/* =====================================================================
   impair studio — 2026 redesign
   A minimal, editorial, interactive system inspired by vaulk.com:
   warm paper background, near-black ink, hairline rules, large type,
   technical mono labels, generous whitespace, smooth reveals.
   Works on desktop + mobile. Self-contained (no Webflow).
   ===================================================================== */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Major Mono Display";
  src: url("../../fonts/MajorMonoDisplay-Regular.woff2") format("woff2"),
       url("../../fonts/MajorMonoDisplay-Regular.ttf") format("truetype");
  font-display: swap;
  font-weight: 400;
}

/* ---------- Design tokens ---------- */
:root {
  --paper:       #f3f1ec;   /* warm off-white */
  --paper-2:     #eae7e0;   /* slightly darker panel */
  --ink:         #15120f;   /* near-black, warm */
  --ink-2:       #6c655c;   /* muted text */
  --ink-3:       #9a9389;   /* faint text */
  --line:        rgba(21,18,15,0.14);
  --line-soft:   rgba(21,18,15,0.08);
  --invert:      #100e0c;   /* dark sections */
  --invert-ink:  #f1efe9;

  /* The studio's identity is Major Mono Display — used for ALL text.
     We build hierarchy with WEIGHT (400 vs faux-bold 700) and CASE
     (lowercase renders as small-caps; uppercase renders as tall caps). */
  --mono: "Major Mono Display", ui-monospace, "Courier New", monospace;
  --sans: "Major Mono Display", ui-monospace, "Courier New", monospace;

  --pad-x: clamp(1.25rem, 4vw, 4.5rem);
  --maxw: 1600px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.7s;

  --nav-h: 74px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
ul { list-style: none; }
::selection { background: var(--ink); color: var(--paper); }

/* hide content until preloader done to avoid flash, restored by JS */
body.is-loading { overflow: hidden; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-x); }
.section { padding-block: clamp(4.5rem, 11vw, 11rem); }
.section--tight { padding-block: clamp(3rem, 7vw, 6rem); }
.rule { height: 1px; background: var(--line); border: 0; }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 1.6rem; height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* ---------- Typography ----------
   Single typeface (Major Mono Display). Headings are heavy (faux-bold)
   lowercase small-caps; `em` accents flip to tall UPPERCASE at lighter
   weight to create contrast within one font. */
h1, h2, h3 { font-weight: 700; line-height: 1.02; letter-spacing: -0.01em; }
.display {
  font-size: clamp(2.1rem, 6.5vw, 6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.h-xl { font-size: clamp(1.8rem, 4.6vw, 3.6rem); font-weight: 700; }
.h-lg { font-size: clamp(1.4rem, 3.2vw, 2.4rem); font-weight: 700; }
.h-md { font-size: clamp(1.05rem, 2vw, 1.5rem); font-weight: 700; }
em { font-style: normal; text-transform: none; font-weight: 400; }
/* Brand quirk: the whole site is lowercase, but every "a" is shown as a
   capital A (matches the impair wordmark). JS wraps text in .cap-wrap and
   each a/A in .cap-a. These spans are injected everywhere, so they must be
   immune to descendant rules (e.g. ".ticker__row span", ".pj-meta div span")
   that would otherwise give them flex/gaps/::after marks. Hence !important. */
.cap-wrap, .cap-a {
  display: inline !important;
  margin: 0 !important; padding: 0 !important;
  gap: 0 !important; background: none !important; border: 0 !important;
  font: inherit !important; letter-spacing: inherit !important; color: inherit !important;
}
.cap-wrap::before, .cap-wrap::after,
.cap-a::before, .cap-a::after { content: none !important; display: none !important; }
.cap-a { text-transform: uppercase !important; }
.caps { text-transform: none; letter-spacing: 0.01em; }
.lead { font-size: clamp(0.95rem, 1.5vw, 1.2rem); line-height: 1.5; color: var(--ink); font-weight: 400; }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); }
b, strong { font-weight: 700; }

/* ============================================================
   PRELOADER  (numeric 0 -> 100, vaulk-style)
   ============================================================ */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--paper);
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.5rem, 5vw, 4rem);
  transition: transform 0.9s var(--ease), opacity 0.6s ease;
}
#preloader.done { transform: translateY(-100%); pointer-events: none; }
/* Aligned to the navbar so the brand logo sits in the exact same spot as
   .nav__brand — no jump/shift when the preloader slides up to reveal the nav. */
.pl-top {
  position: absolute; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  padding-inline: clamp(1.1rem, 2.4vw, 2.2rem);
  display: flex; justify-content: space-between; align-items: center;
}
.pl-brand { font-family: var(--mono); font-size: 1rem; letter-spacing: 0.04em; display: flex; align-items: center; line-height: 0; }
.pl-tag { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-2); text-align: right; max-width: 14rem; }
.pl-count {
  font-family: var(--mono);
  font-size: clamp(1rem, 5.5vw, 4.5rem);
  line-height: 0.8;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.pl-bar { margin-top: clamp(1rem, 2vw, 1.6rem); height: 1px; background: var(--line); position: relative; }
.pl-bar > span { position: absolute; inset: 0 100% 0 0; background: var(--ink); transition: inset 0.2s linear; }
.pl-foot { display: flex; justify-content: space-between; margin-top: 0.9rem; font-family: var(--mono); font-size: 0.66rem; color: var(--ink-2); }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 800;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: transform 0.5s var(--ease), background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
  mix-blend-mode: normal;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom-color: var(--line);
}
.nav.hide { transform: translateY(-100%); }
/* Full-bleed nav so the brand sits in the actual left corner (not indented
   by the centered content max-width) on wide screens. */
.nav__inner { width: 100%; padding-inline: clamp(1.1rem, 2.4vw, 2.2rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav__brand { font-family: var(--mono); font-size: 1.18rem; letter-spacing: 0.02em; line-height: 1; display:flex; align-items:baseline; gap:.4em; }
.nav__brand b { font-weight: 400; }
.nav__brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); display:inline-block; }
.nav__links { display: flex; align-items: center; gap: clamp(1.2rem, 2.5vw, 2.6rem); }
.nav__link {
  font-family: var(--mono); font-size: 0.78rem; text-transform: lowercase;
  letter-spacing: 0.01em; position: relative; padding-block: 0.3rem;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  font-family: var(--mono); font-size: 0.74rem; text-transform: lowercase;
  border: 1px solid var(--line); border-radius: 100px; padding: 0.55rem 1.15rem;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s;
  white-space: nowrap;
}
.nav__cta:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* mobile menu button */
.nav__burger { display: none; width: 30px; height: 16px; position: relative; }
.nav__burger span { position: absolute; left: 0; right: 0; height: 1.6px; background: var(--ink); transition: transform 0.4s var(--ease), opacity 0.3s; }
.nav__burger span:nth-child(1) { top: 2px; }
.nav__burger span:nth-child(2) { bottom: 2px; }
body.menu-open .nav__burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .nav__burger span:nth-child(2) { transform: translateY(-6px) rotate(-45deg); }

/* full-screen mobile overlay */
.menu {
  position: fixed; inset: 0; z-index: 790;
  background: var(--invert); color: var(--invert-ink);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--pad-x);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.75s var(--ease);
  pointer-events: none;
}
body.menu-open .menu { clip-path: inset(0 0 0 0); pointer-events: auto; }
.menu__list { display: flex; flex-direction: column; gap: 0.2rem; }
.menu__item { overflow: hidden; }
.menu__link {
  font-size: clamp(1.9rem, 8vw, 3.6rem); font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.18; display: inline-block; color: var(--invert-ink);
  transform: translateY(110%); transition: transform 0.7s var(--ease);
}
body.menu-open .menu__link { transform: translateY(0); }
.menu__link .idx { font-family: var(--mono); font-size: 0.8rem; vertical-align: super; opacity: 0.5; margin-right: 0.6rem; }
.menu__foot { margin-top: clamp(2rem, 6vw, 4rem); display: flex; flex-wrap: wrap; gap: 1.5rem 3rem;
  font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.menu__foot a:hover { color: var(--invert-ink); }

/* stagger the overlay links in */
body.menu-open .menu__item:nth-child(1) .menu__link { transition-delay: 0.12s; }
body.menu-open .menu__item:nth-child(2) .menu__link { transition-delay: 0.18s; }
body.menu-open .menu__item:nth-child(3) .menu__link { transition-delay: 0.24s; }
body.menu-open .menu__item:nth-child(4) .menu__link { transition-delay: 0.30s; }
body.menu-open .menu__item:nth-child(5) .menu__link { transition-delay: 0.36s; }

/* ============================================================
   BUTTONS / LINKS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 0.7em;
  font-family: var(--mono); font-size: 0.8rem; text-transform: lowercase;
  border: 1px solid var(--ink); border-radius: 100px;
  padding: 0.85rem 1.5rem; position: relative; overflow: hidden;
  transition: color 0.45s var(--ease);
  isolation: isolate;
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  transform: translateY(101%); transition: transform 0.5s var(--ease); z-index: -1;
}
.btn:hover { color: var(--paper); }
.btn:hover::before { transform: translateY(0); }
.btn .arrow { transition: transform 0.45s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn--invert { border-color: var(--invert-ink); color: var(--invert-ink); }
.btn--invert::before { background: var(--invert-ink); }
.btn--invert:hover { color: var(--invert); }

.link-underline { position: relative; display: inline-block; }
.link-underline::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

/* ============================================================
   SCROLL REVEAL primitives
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.line-mask { overflow: hidden; }
.line-mask > * { display: block; transform: translateY(105%); transition: transform 0.9s var(--ease); }
.line-mask.in > * { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .line-mask > * { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   HERO  (home)
   ============================================================ */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; padding-top: var(--nav-h); }
.hero__inner { flex: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: stretch; gap: 0; }
.hero__left { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem,5vw,4rem) var(--pad-x) clamp(2rem,5vw,3rem); }
.hero__title { font-size: clamp(2rem, 5.8vw, 5rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
/* Keep each masked line on a single line as the window narrows (2 lines total,
   like the wide layout) — the font scales down via the clamp above instead of
   the text re-wrapping into 3–4 lines. */
.hero__title .line-mask > * { white-space: nowrap; }
.hero__title em { font-weight: 400; }
.hero__sub { margin-top: clamp(1.4rem, 3vw, 2.2rem); max-width: 34ch; font-size: clamp(0.98rem,1.4vw,1.18rem); color: var(--ink-2); line-height: 1.45; }
.hero__actions { margin-top: clamp(1.8rem, 4vw, 2.6rem); display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.hero__right { position: relative; overflow: hidden; background: var(--paper-2); }
.hero__media { position: absolute; inset: 0; }
.hero__media img, .hero__media video { width: 100%; height: 100%; object-fit: cover; }
.hero__media img { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s var(--ease); }
.hero__media img.active { opacity: 1; }
.hero__scrollcue {
  display: flex; align-items: center; gap: 0.7rem; padding: 1rem var(--pad-x) clamp(1rem,2vw,1.6rem);
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); border-top: 1px solid var(--line);
}
.hero__scrollcue .dotpulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.32; } }
.hero__meta { margin-left: auto; display: flex; gap: 2rem; }

/* marquee strip under hero / generic */
.ticker { border-block: 1px solid var(--line); overflow: hidden; padding-block: 0.9rem; }
.ticker__row { display: flex; white-space: nowrap; width: max-content; will-change: transform; }
.ticker__row span { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-2); display: inline-flex; gap: 3rem; align-items: center; margin-right: 3rem; }
.ticker__row span::after { content: "✦"; opacity: 0.4; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.shead { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.shead__title { font-size: clamp(1.8rem, 5vw, 4.4rem); font-weight: 700; line-height: 1; letter-spacing: -0.015em; }
.shead__title em { font-weight: 400; }
.shead__aside { max-width: 34ch; color: var(--ink-2); font-size: 0.9rem; }
.section-index { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-3); }

/* intro statement */
.statement { font-size: clamp(1.25rem, 3.2vw, 2.5rem); font-weight: 700; line-height: 1.18; letter-spacing: -0.01em; max-width: 22ch; }
.statement em { font-weight: 400; color: var(--ink-2); }
.statement .word { display: inline-block; }

/* ============================================================
   SERVICES (numbered rows w/ hover preview)
   ============================================================ */
.services { border-top: 1px solid var(--line); }
.srow {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.5rem;
  padding: clamp(1.6rem, 3.6vw, 3rem) 0; border-bottom: 1px solid var(--line);
  position: relative; transition: padding-left 0.5s var(--ease); cursor: pointer;
}
.srow__num { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); width: 3ch; }
.srow__title { font-size: clamp(1.5rem, 3.8vw, 3rem); font-weight: 700; letter-spacing: -0.015em; line-height: 1; text-transform: lowercase; transition: transform 0.5s var(--ease); }
.srow__title em { font-weight: 400; }
.srow__desc { font-size: 0.95rem; color: var(--ink-2); max-width: 38ch; }
.srow__arrow { font-family: var(--mono); transition: transform 0.5s var(--ease); }
.srow:hover { padding-left: clamp(0.6rem, 1.5vw, 1.4rem); }
.srow:hover .srow__arrow { transform: translate(4px, -4px); }
.srow:hover .srow__num { color: var(--ink); }
/* floating preview follows cursor (desktop) */
.srow-preview {
  position: fixed; top: 0; left: 0; width: 26vw; max-width: 380px; aspect-ratio: 4/3;
  pointer-events: none; z-index: 700; overflow: hidden; border-radius: 4px;
  opacity: 0; transform: translate(-50%, -50%) scale(0.85); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}
.srow-preview.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.srow-preview img, .srow-preview video { width: 100%; height: 100%; object-fit: cover; }
.srow-preview img { position:absolute; inset:0; opacity:0; transition:opacity .3s; }
.srow-preview img.active { opacity: 1; }

/* services description grid (services.html) */
/* Services listing: text ABOVE, video full-width below (same footprint as the
   homepage panels). The video reveals with the membrane (clip-path) effect. */
.srv-detail { display: flex; flex-direction: column; gap: clamp(1.2rem, 3vw, 2.4rem); }
.srv-detail .srv-text { display: flex; flex-direction: column; gap: 1rem; max-width: 60ch; }
.srv-detail .srv-media { aspect-ratio: auto; height: clamp(480px, 70vh, 800px); }
.srv-media { position: relative; overflow: hidden; aspect-ratio: 16/10; background: var(--paper-2); }
/* Membrane reveal: a rounded window that opens to full as the element scrolls
   into view (image/video never scales — only the visible area grows). */
[data-membrane] {
  clip-path: inset(var(--mb-iy, 0px) var(--mb-ix, 0px) round var(--mb-r, 0px));
  will-change: clip-path;
}
.srv-media video, .srv-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.srv-card:hover .srv-media video, .srv-card:hover .srv-media img { transform: scale(1.04); }

/* ============================================================
   SOLUTIONS — cinematic expanding panels (pure-CSS, buttery smooth)
   ============================================================ */
.panels { display: flex; width: 100%; height: clamp(520px, 72vh, 820px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--invert); }
.pan {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.12); color: var(--invert-ink);
  transition: flex 0.85s cubic-bezier(0.66, 0, 0.18, 1);
}
.pan:last-child { border-right: 0; }
/* expand the hovered panel, recede the rest */
.panels:hover .pan { flex: 0.7 1 0; }
.panels:hover .pan:hover { flex: 3.6 1 0; }

.pan__media { position: absolute; inset: 0; }
.pan__img, .pan__vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pan__img { filter: grayscale(1) brightness(0.8) contrast(1.05); transform: scale(1.03);
  transition: filter 0.9s var(--ease), transform 1.2s var(--ease); }
.pan:hover .pan__img { filter: grayscale(0) brightness(0.96); transform: scale(1.07); }
.pan__vid { opacity: 0; transition: opacity 0.8s var(--ease); }
.pan.playing .pan__vid { opacity: 1; }
.pan__shade { position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,11,10,0.85), rgba(12,11,10,0.15) 52%, rgba(12,11,10,0.4));
  transition: background 0.8s var(--ease); }
.pan:hover .pan__shade { background: linear-gradient(to top, rgba(12,11,10,0.8), transparent 62%); }

.pan__body { position: absolute; inset: 0; z-index: 2; padding: clamp(1.1rem, 2vw, 1.9rem); pointer-events: none; }
.pan__top { display: flex; justify-content: space-between; align-items: flex-start; font-family: var(--mono); font-size: 0.72rem; color: rgba(241,239,233,0.65); }
.pan__num { font-size: 0.92rem; color: var(--invert-ink); }
.pan__spine {
  position: absolute; left: clamp(1rem, 1.6vw, 1.7rem); bottom: clamp(1.2rem, 2vw, 1.9rem);
  writing-mode: vertical-rl; transform: rotate(180deg); transform-origin: center;
  font-size: clamp(1rem, 1.4vw, 1.45rem); font-weight: 700; letter-spacing: -0.01em;
  white-space: nowrap; color: var(--invert-ink); transition: opacity 0.45s var(--ease); text-shadow: 0 1px 14px rgba(0,0,0,0.4);
}
.pan:hover .pan__spine { opacity: 0; }
.pan__foot { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(1.1rem, 2vw, 1.9rem);
  opacity: 0; transform: translateY(14px); transition: opacity 0.55s var(--ease), transform 0.6s var(--ease); }
.pan:hover .pan__foot { opacity: 1; transform: none; transition-delay: 0.1s; }
.pan__tag { font-family: var(--mono); font-size: 0.72rem; color: rgba(241,239,233,0.7); }
.pan__name { font-size: clamp(1.6rem, 2.5vw, 3.1rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1; margin-top: 0.35rem; text-shadow: 0 1px 18px rgba(0,0,0,0.45); }
.pan__more { display: flex; flex-direction: column; gap: 0.7rem; align-items: flex-start; margin-top: 0.9rem; max-width: 34ch; }
.pan__desc { font-size: 0.95rem; color: rgba(241,239,233,0.82); }
.pan__cta { display: inline-flex; gap: 0.5rem; align-items: center; font-family: var(--mono); font-size: 0.78rem; }
.pan__cta .arrow { transition: transform 0.4s var(--ease); }
.pan:hover .pan__cta .arrow { transform: translate(3px, -3px); }

@media (max-width: 860px) {
  .panels { flex-direction: column; height: auto; }
  .pan { flex: none; height: clamp(230px, 40vh, 320px); border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
  /* Touch fires :hover too — keep panels at full size so a tap/hold doesn't
     collapse them all to zero (the desktop expand effect must not apply here). */
  .panels:hover .pan, .panels:hover .pan:hover { flex: none; }
  .pan__img { filter: grayscale(0) brightness(0.92); transform: none; }
  .pan__shade { background: linear-gradient(to top, rgba(12,11,10,0.8), transparent 60%); }
  .pan__spine { display: none; }
  .pan__foot { opacity: 1; transform: none; }
}

/* ============================================================
   WORK GRID / CARDS
   ============================================================ */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.2rem, 3vw, 3rem) clamp(1.2rem, 3vw, 2.5rem); }
.work-card { display: block; }
.work-card__media { position: relative; overflow: hidden; aspect-ratio: 4/3; background: var(--paper-2); }
.work-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter 0.6s ease; }
.work-card:hover .work-card__media img { transform: scale(1.05); }
.work-card__media::after {
  content: "view project ↗"; position: absolute; left: 1rem; bottom: 1rem;
  font-family: var(--mono); font-size: 0.72rem; color: var(--paper);
  background: rgba(15,14,12,0.85); padding: 0.45rem 0.8rem; border-radius: 100px;
  transform: translateY(140%); transition: transform 0.5s var(--ease);
}
.work-card:hover .work-card__media::after { transform: none; }
.work-card__foot { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-top: 1rem; }
.work-card__title { font-size: clamp(1.05rem, 1.8vw, 1.5rem); font-weight: 600; letter-spacing: -0.02em; }
.work-card__meta { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); text-align: right; white-space: nowrap; }
.work-card__idx { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); }
/* featured first card spans both columns */
.work-card.is-feature { grid-column: 1 / -1; }
.work-card.is-feature .work-card__media { aspect-ratio: 21/9; }

/* ============================================================
   PARTNERS marquee
   ============================================================ */
.partners { overflow: hidden; }
.logo-track { display: flex; width: max-content; align-items: center; will-change: transform; }
.logo-track img { height: clamp(26px, 4vw, 40px); width: auto; object-fit: contain; margin-right: clamp(2.5rem, 6vw, 6rem);
  filter: grayscale(1) brightness(0) invert(0.65) opacity(0.85); transition: filter 0.5s ease; }
.logo-track img:hover { filter: grayscale(0) opacity(1); }

/* ============================================================
   CTA / contact banner
   ============================================================ */
.cta { background: var(--invert); color: var(--invert-ink); position: relative; overflow: hidden; }
.cta__title { font-size: clamp(2rem, 6vw, 5.2rem); font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.cta__title em { font-weight: 400; }
.cta__grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: end; }
.cta__addr { font-family: var(--mono); font-size: 0.82rem; line-height: 1.7; color: var(--ink-3); }
.cta__addr a:hover { color: var(--invert-ink); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--invert); color: var(--invert-ink); padding-block: clamp(3rem, 7vw, 6rem) 2rem; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-bottom: clamp(3rem,6vw,5rem); border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer__brand { font-family: var(--mono); font-size: clamp(1.6rem, 5vw, 3rem); }
.footer__brand .dot { display:inline-block; width:8px; height:8px; border-radius:50%; background: var(--invert-ink); }
.footer__col h5 { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); text-transform: lowercase; margin-bottom: 1.2rem; font-weight: 400; }
.footer__col a, .footer__col p { display: block; font-size: 0.95rem; color: rgba(241,239,233,0.7); padding-block: 0.32rem; }
.footer__col a:hover { color: var(--invert-ink); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 2rem;
  font-family: var(--mono); font-size: 0.68rem; color: var(--ink-3); }
.footer__bottom a:hover { color: var(--invert-ink); }
.footer__admin { opacity: 0.5; transition: opacity 0.3s; }
.footer__admin:hover { opacity: 1; }

/* ============================================================
   CUSTOM CURSOR (desktop pointer only)
   ============================================================ */
.cursor { position: fixed; top: 0; left: 0; z-index: 9000; pointer-events: none; mix-blend-mode: difference; }
.cursor__dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: translate(-50%,-50%); transition: width 0.3s var(--ease), height 0.3s var(--ease); }
.cursor.is-hover .cursor__dot { width: 46px; height: 46px; background: rgba(255,255,255,0.18); border: 1px solid #fff; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ============================================================
   PROJECT DETAIL (work template)
   ============================================================ */
.pj-hero { min-height: 92svh; display: flex; flex-direction: column; justify-content: flex-end; padding-top: var(--nav-h); position: relative; }
.pj-hero__bg { position: absolute; inset: 0; overflow: hidden; }
.pj-hero__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.pj-hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,14,12,0.6), rgba(15,14,12,0.05) 45%, transparent); }
.pj-hero__inner { position: relative; color: var(--invert-ink); padding-bottom: clamp(2rem,5vw,4rem); }
.pj-hero__title { font-size: clamp(1.9rem, 5.2vw, 4.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.pj-meta { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 1.5rem; }
.pj-meta div span { display: block; font-family: var(--mono); font-size: 0.68rem; color: rgba(241,239,233,0.55); margin-bottom: 0.3rem; }
.pj-meta div b { font-weight: 500; font-size: 1rem; }
.pj-gallery { display: flex; flex-direction: column; gap: clamp(0.6rem, 1.5vw, 1.2rem); }
.pj-shot { width: 100%; background: var(--paper-2); overflow: hidden; }
.pj-shot img { width: 100%; height: auto; display: block; }
.pj-next { display: block; position: relative; overflow: hidden; min-height: 60svh; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--invert-ink); }
.pj-next__bg { position: absolute; inset: 0; }
.pj-next__bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); transition: transform 1.2s var(--ease); }
.pj-next:hover .pj-next__bg img { transform: scale(1.12); }
.pj-next__bg::after { content: ""; position: absolute; inset: 0; background: rgba(15,14,12,0.55); }
.pj-next__inner { position: relative; }
.pj-next__label { font-family: var(--mono); font-size: 0.74rem; color: rgba(241,239,233,0.7); }
.pj-next__title { font-size: clamp(1.7rem, 4.6vw, 3.6rem); font-weight: 700; letter-spacing: -0.02em; margin-top: 0.5rem; }

/* ============================================================
   ABOUT — one chic frame: a line, the trio, a button
   ============================================================ */
.ab2 {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: clamp(1.8rem, 4.5vw, 3.5rem);
  padding: calc(var(--nav-h) + clamp(1.5rem,4vw,3rem)) var(--pad-x) clamp(2.5rem,5vw,4rem);
}
.ab2-title { font-size: clamp(1.9rem, 5vw, 4.2rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.ab2-title em { font-weight: 400; }
.ab2-trio {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(1rem, 4vw, 4.5rem); width: 100%; max-width: 1120px;
}
.ab2-person { display: flex; flex-direction: column; align-items: center; flex: 0 1 auto; min-width: 0; transition: opacity 0.55s var(--ease); }
.ab2-fig { height: clamp(200px, 40vh, 480px); display: flex; align-items: flex-end; justify-content: center; }
.ab2-fig .team-svg { height: 100%; width: auto; max-width: 100%; transition: transform 0.6s var(--ease); }
.ab2-cap { margin-top: clamp(1rem, 1.8vw, 1.5rem); }
.ab2-name { display: block; font-size: clamp(1.05rem, 1.7vw, 1.5rem); font-weight: 700; letter-spacing: -0.02em; }
.ab2-role { display: block; font-family: var(--mono); font-size: 0.72rem; color: var(--ink-2); margin-top: 0.3rem; }
.ab2-trio:hover .ab2-person:not(:hover) { opacity: 0.28; }
.ab2-person:hover .team-svg { transform: translateY(-12px); }
@media (max-width: 640px) {
  .ab2-trio { gap: 3vw; }
  .ab2-fig { height: clamp(140px, 24vh, 260px); }
  .ab2-role { font-size: 0.62rem; }
  .ab2-trio:hover .ab2-person:not(:hover) { opacity: 1; }
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.field { position: relative; margin-bottom: 1.6rem; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 0.9rem 0 0.6rem; font-size: 1.05rem; outline: none; transition: border-color 0.4s;
}
.field textarea { resize: vertical; min-height: 5rem; }
.field label {
  position: absolute; left: 0; top: 0.9rem; font-size: 1.05rem; color: var(--ink-3);
  pointer-events: none; transition: transform 0.35s var(--ease), font-size 0.35s var(--ease), color 0.35s;
  font-family: var(--mono); text-transform: lowercase;
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--ink); }
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.5rem); font-size: 0.72rem; color: var(--ink-2);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.type-grid { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.type-btn { font-family: var(--mono); font-size: 0.78rem; text-transform: lowercase; border: 1px solid var(--line);
  border-radius: 100px; padding: 0.5rem 1.1rem; transition: all 0.35s var(--ease); }
.type-btn:hover { border-color: var(--ink); }
.type-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.contact-aside dl { display: grid; grid-template-columns: auto; gap: 1.8rem; }
.contact-aside dt { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3); margin-bottom: 0.4rem; text-transform: lowercase; }
.contact-aside dd { font-size: 1.05rem; line-height: 1.5; }
.form-success { display: none; }
.form-success.show { display: block; }
.form-error { color: #a8321f; font-family: var(--mono); font-size: 0.78rem; margin-top: 1rem; }

/* ============================================================
   PAGE HEADER (interior pages)
   ============================================================ */
.pagehead { padding-top: calc(var(--nav-h) + clamp(3rem,8vw,7rem)); padding-bottom: clamp(2rem,5vw,4rem); }
.pagehead__title { font-size: clamp(2rem, 6.4vw, 5.8rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.pagehead__title em { font-weight: 400; }

/* ============================================================
   BRAND LOGO (replaces the "impair" wordmark text)
   ============================================================ */
.brandmark { height: 38px; width: auto; display: block; }
.nav__brand { display: flex; align-items: center; line-height: 0; }
.brandmark--footer { height: 45px; filter: invert(1); }
.footer__brand { line-height: 0; }
.brandmark--pl { height: 38px; } /* match .brandmark in the navbar exactly */
/* logo flips to white when it sits over the dark mobile-menu overlay */
body.menu-open .nav__brand .brandmark { filter: invert(1); }

/* ---- Magnetic dots: every dot/point repels from the cursor (JS-driven) ---- */
.mdot { will-change: transform; pointer-events: none; }
.mdot--char { display: inline-block; }       /* periods & separators need a box to translate */
.brand-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink); margin-left: 0.42em; vertical-align: middle;
}
.brand-dot--light { background: var(--invert-ink); }
.phase-dot { will-change: transform; }

/* ============================================================
   TEAM CHARACTERS — eyebrow lift on hover + Jalal's glasses
   easing darker over time (carried over from the old site)
   ============================================================ */
.team-character { display: flex; align-items: center; justify-content: center; }
.team-svg { display: block; }
.team-svg path { fill: var(--ink); transition: fill 0.5s ease; }
.team-svg [id*="eyebrow" i] {
  transition: transform 340ms cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-box: fill-box; transform-origin: center;
}
.team-character:hover .team-svg [id*="eyebrow" i] { transform: translateY(-34px); }
@keyframes jalalShadesIn { from { opacity: 0; } to { opacity: 0.9; } }
.team-character[data-name="jalal"] .team-svg #left_black_sunshades,
.team-character[data-name="jalal"] .team-svg #right_black_sunshades {
  opacity: 0; animation: jalalShadesIn 90s linear forwards;
}

/* ============================================================
   VAULK-INSPIRED — technical labels + numbered process timeline
   ============================================================ */
/* small technical captions overlaid on imagery (fig. callouts) */
.tech-label {
  position: absolute; z-index: 3; font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.06em; color: var(--paper); text-transform: lowercase;
  background: rgba(15,14,12,0.45); padding: 0.32rem 0.55rem; border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.tech-label--tl { top: 1rem; left: 1rem; }
.tech-label--br { bottom: 1rem; right: 1rem; }
.tech-corner { position: absolute; z-index: 3; width: 16px; height: 16px; border: 1px solid rgba(255,255,255,0.5); }
.tech-corner--tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.tech-corner--br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

/* numbered process timeline (J0 → J+x style) */
.process { border-top: 1px solid var(--ink); margin-top: 2.5rem; }
.process__rail { display: grid; grid-template-columns: repeat(4, 1fr); }
.phase { position: relative; padding: 1.8rem 1.5rem 2.2rem 0; }
.phase-dot { position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.phase__tag { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-3); }
.phase__title { font-weight: 700; font-size: clamp(1.05rem, 1.6vw, 1.35rem); margin: 0.7rem 0 0.55rem; }
.phase__desc { color: var(--ink-2); font-size: 0.85rem; line-height: 1.5; max-width: 26ch; }

/* ============================================================
   CINEMATIC SCROLL-SCRUB REVEAL  (render → clay flythrough)
   A pinned <canvas> scrubs through the intro frame sequence as you
   scroll. Sub-frame alpha-blending + lerp = buttery. Live HUD.
   ============================================================ */
.reveal-scene { position: relative; height: 360vh; background: var(--paper); }
.reveal-pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  /* "Membrane" reveal on entry: a rounded window that grows to full-bleed
     WITHOUT scaling the image — only the visible area expands (clip-path).
     The image stays at full size; we simply reveal more of it.
     Defaults keep it full-bleed if JS is off / reduced-motion. */
  clip-path: inset(var(--rs-iy, 0px) var(--rs-ix, 0px) round var(--rs-r, 0px));
  will-change: clip-path;
}
.reveal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.reveal-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(130% 100% at 50% 35%, transparent 52%, rgba(0,0,0,0.5) 100%),
    linear-gradient(to top, rgba(0,0,0,0.55), transparent 28%);
}
.reveal-hud { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  color: var(--paper); font-family: var(--mono); }
.reveal-hud .hud { position: absolute; font-size: 0.66rem; letter-spacing: 0.06em; color: rgba(241,239,233,0.72); }
.hud-tl { top: calc(var(--nav-h) + 1.1rem); left: var(--pad-x); }
.hud-tr { top: calc(var(--nav-h) + 1.1rem); right: var(--pad-x); text-align: right; }
.hud-bl { bottom: 1.5rem; left: var(--pad-x); }
.reveal-caps { position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 5.5rem; height: 3.4em; }
.reveal-cap {
  position: absolute; bottom: 0; left: 0; margin: 0;
  font-size: clamp(1.5rem, 3.6vw, 3rem); font-weight: 700; line-height: 1.04;
  color: var(--paper); white-space: nowrap; opacity: 0; transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform;
}
.reveal-cap.on { opacity: 1; transform: none; }
.reveal-bar { position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 3.4rem; height: 1px;
  background: rgba(241,239,233,0.2); }
.reveal-bar > i { position: absolute; top: -2.5px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--paper); transform: translateX(-50%); transition: left 0.08s linear; box-shadow: 0 0 0 4px rgba(241,239,233,0.12); }
.reveal-bar .lab-l, .reveal-bar .lab-r { position: absolute; bottom: 0.55rem; font-size: 0.58rem; color: rgba(241,239,233,0.55); }
.reveal-bar .lab-l { left: 0; } .reveal-bar .lab-r { right: 0; }
.reveal-loader { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: #0b0a09; color: var(--paper); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em;
  transition: opacity 0.7s ease; }
.reveal-loader.hide { opacity: 0; pointer-events: none; }
.reveal-loader b { font-weight: 400; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(2,1fr); gap: 2rem; }
}
@media (max-width: 860px) {
  :root { --nav-h: 64px; }
  .nav__links { display: none; }
  .nav__burger { display: block; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__right { min-height: 52svh; order: -1; }
  .hero { min-height: auto; }
  .hero__left { padding-block: clamp(2rem,8vw,3.5rem); }
  .contact-grid { grid-template-columns: 1fr; }
  .srv-detail { grid-template-columns: 1fr; }
  /* Service videos: a normal aspect on phones/tablets instead of the tall
     desktop height — keeps each card from dominating the screen. */
  .srv-detail .srv-media { height: auto; aspect-ratio: 16/10; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card.is-feature .work-card__media { aspect-ratio: 4/3; }
  .team-grid { grid-template-columns: 1fr; max-width: 22rem; margin-inline: auto; }
  .cta__grid { grid-template-columns: 1fr; }
  .srow { grid-template-columns: auto 1fr auto; }
  .srow__desc { display: none; }
  .srow-preview { display: none; }
  .hero__meta { display: none; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer__top { grid-template-columns: 1fr; gap: 2.5rem; }
  .process__rail { grid-template-columns: 1fr; }
  .phase { padding: 1.6rem 0 1.8rem 1.4rem; border-left: 1px solid var(--line); }
  .phase-dot { left: -5px; top: 0; }
  .reveal-scene { height: 240vh; }
  .reveal-caps { bottom: 4.5rem; }
  .hud-tl { font-size: 0.58rem; max-width: 9rem; }
}
@media (max-width: 520px) {
  .shead { margin-bottom: 2.5rem; }
  .pj-meta { gap: 1.5rem; }
  .pl-tag { display: none; }
}

/* === Échelle TEXTE uniquement (~85%) sur desktop ===
   Réduit de 15% SEULEMENT les tailles de police (jamais les espacements,
   images ou le mobile). Donne le rendu compact « 85% » côté texte tout en
   gardant la mise en page et les marges d'origine. */
@media (min-width: 861px) {
  body { font-size: 12.75px; }
  .eyebrow { font-size: 0.612rem; }
  .display { font-size: clamp(1.785rem, 5.525vw, 5.1rem); }
  .h-xl { font-size: clamp(1.53rem, 3.91vw, 3.06rem); }
  .h-lg { font-size: clamp(1.19rem, 2.72vw, 2.04rem); }
  .h-md { font-size: clamp(0.892rem, 1.7vw, 1.275rem); }
  .lead { font-size: clamp(0.807rem, 1.275vw, 1.02rem); }
  .pl-brand { font-size: 0.85rem; }
  .pl-tag { font-size: 0.578rem; }
  .pl-count { font-size: clamp(1rem, 5.5vw, 4.5rem); }
  .pl-foot { font-size: 0.561rem; }
  .nav__brand { font-size: 1.003rem; }
  .nav__link { font-size: 0.663rem; }
  .nav__cta { font-size: 0.629rem; }
  .menu__link { font-size: clamp(1.615rem, 6.8vw, 3.06rem); }
  .menu__link .idx { font-size: 0.68rem; }
  .menu__foot { font-size: 0.663rem; }
  /* ============================================================
   BUTTONS / LINKS
   ============================================================ */
.btn { font-size: 0.68rem; }
  .hero__title { font-size: clamp(1.7rem, 4.93vw, 4.25rem); }
  .hero__sub { font-size: clamp(0.833rem,1.19vw,1.003rem); }
  .hero__scrollcue { font-size: 0.595rem; }
  .ticker__row span { font-size: 0.697rem; }
  .shead__title { font-size: clamp(1.53rem, 4.25vw, 3.74rem); }
  .shead__aside { font-size: 0.765rem; }
  .section-index { font-size: 0.629rem; }
  /* intro statement */
.statement { font-size: clamp(1.062rem, 2.72vw, 2.125rem); }
  .srow__num { font-size: 0.68rem; }
  .srow__title { font-size: clamp(1.275rem, 3.23vw, 2.55rem); }
  .srow__desc { font-size: 0.807rem; }
  .pan__top { font-size: 0.612rem; }
  .pan__num { font-size: 0.782rem; }
  .pan__spine { font-size: clamp(0.85rem, 1.19vw, 1.232rem); }
  .pan__tag { font-size: 0.612rem; }
  .pan__name { font-size: clamp(1.36rem, 2.125vw, 2.635rem); }
  .pan__desc { font-size: 0.807rem; }
  .pan__cta { font-size: 0.663rem; }
  .work-card__media::after { font-size: 0.612rem; }
  .work-card__title { font-size: clamp(0.892rem, 1.53vw, 1.275rem); }
  .work-card__meta { font-size: 0.612rem; }
  .work-card__idx { font-size: 0.612rem; }
  .cta__title { font-size: clamp(1.7rem, 5.1vw, 4.42rem); }
  .cta__addr { font-size: 0.697rem; }
  .footer__brand { font-size: clamp(1.36rem, 4.25vw, 2.55rem); }
  .footer__col h5 { font-size: 0.612rem; }
  .footer__col a, .footer__col p { font-size: 0.807rem; }
  .footer__bottom { font-size: 0.578rem; }
  .pj-hero__title { font-size: clamp(1.615rem, 4.42vw, 3.74rem); }
  .pj-meta div span { font-size: 0.578rem; }
  .pj-meta div b { font-size: 0.85rem; }
  .pj-next__label { font-size: 0.629rem; }
  .pj-next__title { font-size: clamp(1.445rem, 3.91vw, 3.06rem); }
  .ab2-title { font-size: clamp(1.615rem, 4.25vw, 3.57rem); }
  .ab2-name { font-size: clamp(0.892rem, 1.445vw, 1.275rem); }
  .ab2-role { font-size: 0.612rem; }
  .field input, .field textarea { font-size: 0.892rem; }
  .field label { font-size: 0.892rem; }
  .field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label { font-size: 0.612rem; }
  .type-btn { font-size: 0.663rem; }
  .contact-aside dt { font-size: 0.612rem; }
  .contact-aside dd { font-size: 0.892rem; }
  .form-error { font-size: 0.663rem; }
  .pagehead__title { font-size: clamp(1.7rem, 5.44vw, 4.93rem); }
  /* ============================================================
   VAULK-INSPIRED — technical labels + numbered process timeline
   ============================================================ */
/* small technical captions overlaid on imagery (fig. callouts) */
.tech-label { font-size: 0.51rem; }
  .phase__tag { font-size: 0.595rem; }
  .phase__title { font-size: clamp(0.892rem, 1.36vw, 1.147rem); }
  .phase__desc { font-size: 0.722rem; }
  .reveal-hud .hud { font-size: 0.561rem; }
  .reveal-cap { font-size: clamp(1.275rem, 3.06vw, 2.55rem); }
  .reveal-bar .lab-l, .reveal-bar .lab-r { font-size: 0.493rem; }
  .reveal-loader { font-size: 0.68rem; }
}

/* === Word-spacing: tighter for body copy, normal for titles =============== */
body { word-spacing: -0.1em; }
h1, h2, h3, h4, .display, .h-xl, .h-lg, .h-md,
.hero__title, .pagehead__title, .shead__title, .statement, .cta__title,
.reveal-cap, .ab2-title, .phase__title, .pj-hero__title, .pj-next__title,
.work-card__title, .pan__name, .srow__title { word-spacing: normal; }

/* ============================================================
   DARK MODE  (toggle via html.dark, persisted in localStorage)
   ============================================================ */
html.dark {
  color-scheme: dark;
  --paper:     #16130f;   /* dark warm background */
  --paper-2:   #211c17;
  --ink:       #f3f1ec;   /* light text */
  --ink-2:     #a89f95;   /* muted light */
  --ink-3:     #6f685e;   /* faint light */
  --line:      rgba(243,241,236,0.16);
  --line-soft: rgba(243,241,236,0.08);
  /* --invert / --invert-ink kept as-is: dark accent sections (cta, footer,
     panels) stay dark with light text in both modes. */
}
/* Keep overlay text that sits on always-dark media light in dark mode. */
html.dark .reveal-hud, html.dark .reveal-cap, html.dark .reveal-loader,
html.dark .work-card__media::after { color: var(--invert-ink); }
/* Light up the dark "impair" wordmark in dark mode (navbar + preloader). */
html.dark .nav__brand .brandmark,
html.dark .brandmark--pl { filter: invert(1); }
/* Smooth theme transition. */
body { transition: background-color .35s ease, color .35s ease; }

/* Theme toggle — text button (darkmode / lightmode) */
.nav__theme {
  font-family: var(--mono); font-size: 0.72rem; text-transform: lowercase;
  letter-spacing: 0.03em; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 100px;
  padding: 0.42rem 0.9rem; margin-left: 0.45rem; flex: none; line-height: 1;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.nav__theme:hover { color: var(--ink); border-color: var(--ink); }
.nav__theme .th-light { display: none; }
html.dark .nav__theme .th-dark { display: none; }
html.dark .nav__theme .th-light { display: inline; }
