/* ============================================================
   PASODOBLE, CINEMATIC SYSTEM  v2
   One CSS file. Tokens at the top, scenes below.
   ============================================================ */

:root {
  --bg: #0d0d0d;
  --bg-deep: #080808;
  --fg: #ffffff;
  --surface: #161616;
  --muted: #1b1b1b;
  --muted-fg: #a4a4a4;
  --dim-fg: #6f6f6f;
  --primary: #f9752f;
  --primary-glow: #ff9858;
  --primary-fg: #030303;
  --primary-dim: rgba(249, 117, 47, 0.14);
  --border: #262626;
  --border-strong: #3d3d3d;
  --radius: 0.375rem;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 80rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-swift: cubic-bezier(0.7, 0, 0.2, 1);
  --header-h: 4rem;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: clip; }
html.rm { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100vh;
  /* No overflow here: any overflow value on body computes the cross axis to
     `auto`, making body a scroll container and silently killing position:sticky
     for every pinned scene. Horizontal clipping lives on html (clip, not
     hidden, clip creates no scroll container). */
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }
::selection { background: var(--primary); color: var(--primary-fg); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 300;
  background: var(--primary); color: var(--primary-fg);
  padding: 0.6rem 1rem; font-size: 0.8rem; font-weight: 600; border-radius: var(--radius);
  transition: top 0.2s;
}
.skip-link:focus-visible { top: 1rem; }

/* film-grain + dot-grid texture, barely perceptible */
.texture {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
  opacity: 0.6;
}
.texture::after {
  content: ""; position: absolute; inset: -80px;
  background-image: url("../assets/tex/grain.webp");
  background-size: 128px 128px;
  opacity: 0.022;
  animation: grain 9s steps(6) infinite;
}
/* px drift inside the tile, so the layer stays viewport-sized instead of 9x */
@keyframes grain {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-24px, 16px, 0); }
  40% { transform: translate3d(18px, -28px, 0); }
  60% { transform: translate3d(-12px, -18px, 0); }
  80% { transform: translate3d(26px, 22px, 0); }
}
/* atmospheric motion is the first thing to go when the device is modest */
:root[data-perf="low"] .texture::after { animation: none; }

/* ---------- typography ---------- */

.display {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
}
.d-xl { font-size: clamp(2.7rem, 9.5vw, 8.5rem); }
.d-lg { font-size: clamp(2.2rem, 6.5vw, 5.5rem); }
.d-md { font-size: clamp(2rem, 4.5vw, 3.75rem); }
.d-sm { font-size: clamp(1.5rem, 3vw, 2.25rem); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-fg);
}
.mono .idx { color: var(--primary); }

.lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted-fg); max-width: 34em; }
.small { font-size: 0.875rem; color: var(--muted-fg); }
.orange { color: var(--primary); }

/* section label: ── 01 / LABEL */
.slabel {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.6875rem;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted-fg);
}
.slabel::before { content: ""; width: 2rem; height: 1px; background: var(--primary); }
.slabel b { color: var(--primary); font-weight: 400; }

/* ---------- layout ---------- */

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem; }
main { position: relative; z-index: 2; }
section { position: relative; }
.section-pad { padding-block: clamp(5rem, 12vh, 9rem); }

/* ---------- staircase block motif ---------- */
/* [data-stair] gets 16 cells injected by JS; pattern indices 3,6,7,9,10,12,13 */

.stair { display: grid; grid-template-columns: repeat(4, var(--cell, 12px)); gap: 2px; }
.stair i { width: var(--cell, 12px); height: var(--cell, 12px); }
.stair i.on { background: var(--primary); }
.stair.ghost i.on { background: var(--border-strong); }

.float-slow { animation: float-slow 9s ease-in-out infinite; }
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex: none;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font-size: 0.875rem; font-weight: 600; letter-spacing: 0.01em;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.3s, transform 0.3s var(--ease-out);
  position: relative; white-space: nowrap;
}
.btn .arr { transition: transform 0.25s var(--ease-out); display: inline-block; }
.btn:hover .arr { transform: translateX(4px); }

.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover {
  background: var(--primary-glow);
  box-shadow: 0 0 34px -6px var(--primary);
}
.btn-ghost { border: 1px solid var(--border-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-quiet { color: var(--muted-fg); padding-inline: 0.5rem; }
.btn-quiet:hover { color: var(--fg); }

.link-more {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--primary); font-size: 0.875rem; font-weight: 500;
}
.link-more .arr { transition: transform 0.25s var(--ease-out); }
.link-more:hover .arr { transform: translateX(4px); }

/* ---------- cursor ---------- */

.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; border-radius: 50%;
  /* parked off-screen until the first pointer move: the loop is idle-stopped,
     so nothing would otherwise place them and they would sit at 0,0 */
  transform: translate(-200px, -200px);
}
.cursor-dot {
  width: 8px; height: 8px; background: var(--primary);
  mix-blend-mode: screen; z-index: 9999;
}
.cursor-ring {
  width: 34px; height: 34px; border: 1px solid rgba(249, 117, 47, 0.55);
  z-index: 9998;
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
              border-color 0.25s, background 0.25s, opacity 0.3s;
}
body.cursor-on { cursor: none; }
body.cursor-on a, body.cursor-on button, body.cursor-on label { cursor: none; }
.cursor-hover .cursor-ring {
  width: 52px; height: 52px;
  border-color: var(--primary);
  background: rgba(249, 117, 47, 0.08);
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }
html.rm .cursor-dot, html.rm .cursor-ring { display: none; }
html.rm body.cursor-on, html.rm body.cursor-on a, html.rm body.cursor-on button { cursor: auto; }

/* ---------- HUD ---------- */

.hud { position: fixed; z-index: 60; pointer-events: none; font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.18em; color: var(--dim-fg); text-transform: uppercase; opacity: 0; transition: opacity 1s ease 0.4s; }
body.booted .hud { opacity: 0.85; }
.hud-bl { left: 1.25rem; bottom: 1rem; }
.hud-br { right: 1.25rem; bottom: 1rem; text-align: right; }
.hud b { color: var(--primary); font-weight: 400; }
@media (max-width: 767px) { .hud { display: none; } }

/* scroll progress hairline */
.progress-line {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: var(--primary); z-index: 90; pointer-events: none;
  opacity: 0.9;
}

/* ---------- header ---------- */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background 0.35s, border-color 0.35s, opacity 0.8s ease, transform 0.8s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(13, 13, 13, 0.82);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
/* same translucent language, no per-frame blur cost */
:root[data-perf="low"] .site-header.scrolled {
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: none;
}
body:not(.booted) .site-header { opacity: 0; transform: translateY(-8px); pointer-events: none; }

.header-in {
  max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em; }
/* the real Pasodoble mark (favicon artwork), square, never stretched */
.brand-mark { width: 22px; height: 22px; object-fit: contain; flex: none; }
.brand .stair { --cell: 5px; }
.brand span em { font-style: normal; font-weight: 400; color: var(--muted-fg); }

.nav-desktop { display: none; align-items: center; gap: 0.25rem; }
@media (min-width: 768px) { .nav-desktop { display: flex; } }
.nav-desktop a {
  padding: 0.4rem 0.75rem; font-size: 0.8125rem; color: var(--muted-fg);
  border-radius: var(--radius); transition: color 0.2s; position: relative;
}
.nav-desktop a:hover { color: var(--fg); }
.nav-desktop a[aria-current="page"] { color: var(--fg); }
.nav-desktop a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.1rem;
  height: 2px; background: var(--primary);
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.lang-switch {
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.14em;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.3rem 0.55rem; color: var(--muted-fg);
  transition: color 0.2s, border-color 0.2s;
}
.lang-switch:hover { color: var(--fg); border-color: var(--border-strong); }
.header-cta { display: none; }
@media (min-width: 640px) { .header-cta { display: inline-flex; padding: 0.55rem 1rem; font-size: 0.8125rem; } }

.menu-btn { display: inline-flex; flex-direction: column; gap: 6px; padding: 0.5rem; }
.menu-btn span { display: block; width: 24px; height: 1px; background: currentColor; transition: transform 0.3s var(--ease-out), opacity 0.3s; }
@media (min-width: 768px) { .menu-btn { display: none; } }
body.menu-open .menu-btn span:first-child { transform: translateY(3.5px) rotate(45deg); }
body.menu-open .menu-btn span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* mobile menu overlay */
.mobile-menu {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(8, 8, 8, 0.97);
  display: flex; flex-direction: column; justify-content: center;
  padding: 6rem 2rem 3rem;
  opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s;
}
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }
.mobile-menu a.mm-link {
  font-size: clamp(2rem, 9vw, 3rem); font-weight: 800; letter-spacing: -0.04em;
  padding: 0.4rem 0; color: var(--fg); display: flex; align-items: baseline; gap: 1rem;
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), color 0.2s;
}
.mobile-menu a.mm-link .mono { font-size: 0.625rem; }
body.menu-open .mobile-menu a.mm-link { opacity: 1; transform: none; }
body.menu-open .mobile-menu a.mm-link:nth-child(2) { transition-delay: 0.05s; }
body.menu-open .mobile-menu a.mm-link:nth-child(3) { transition-delay: 0.1s; }
body.menu-open .mobile-menu a.mm-link:nth-child(4) { transition-delay: 0.15s; }
body.menu-open .mobile-menu a.mm-link:nth-child(5) { transition-delay: 0.2s; }
.mobile-menu a.mm-link[aria-current="page"] { color: var(--primary); }
.mobile-menu .mm-foot { margin-top: 3rem; display: flex; gap: 1rem; }

/* ---------- boot sequence ---------- */

.boot {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.7s ease, visibility 0.7s;
}
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-meta {
  position: absolute; top: 1.25rem; left: 1.5rem;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dim-fg);
  opacity: 0; animation: boot-fade 0.6s ease 0.2s forwards;
}
.boot-meta b { color: var(--primary); font-weight: 400; }
.boot-skip {
  position: absolute; bottom: 1.5rem; right: 1.5rem;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--dim-fg);
  padding: 0.5rem 0.75rem; border: 1px solid var(--border);border-radius: var(--radius);
  opacity: 0; animation: boot-fade 0.6s ease 1.2s forwards;
  transition: color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.boot-skip:hover { color: var(--fg); border-color: var(--border-strong); }

.boot-stage { position: relative; text-align: center; }
.boot-stair { --cell: clamp(18px, 4vw, 30px); margin-inline: auto; }
.boot-stair i.on { background: var(--primary); opacity: 0; transform: scale(0.4); }
.boot.play .boot-stair i.on { animation: block-in 0.45s var(--ease-out) forwards; }
.boot.play .boot-stair i.on:nth-child(4)  { animation-delay: 0.45s; }
.boot.play .boot-stair i.on:nth-child(7)  { animation-delay: 0.58s; }
.boot.play .boot-stair i.on:nth-child(8)  { animation-delay: 0.71s; }
.boot.play .boot-stair i.on:nth-child(10) { animation-delay: 0.84s; }
.boot.play .boot-stair i.on:nth-child(11) { animation-delay: 0.97s; }
.boot.play .boot-stair i.on:nth-child(13) { animation-delay: 1.10s; }
.boot.play .boot-stair i.on:nth-child(14) { animation-delay: 1.23s; }
@keyframes block-in {
  from { opacity: 0; transform: scale(0.4); }
  60% { opacity: 1; transform: scale(1.12); }
  to { opacity: 1; transform: scale(1); }
}

.boot-pulse {
  position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  margin: -4px; border-radius: 50%; background: var(--primary);
  opacity: 0;
}
.boot.play .boot-pulse { animation: boot-pulse 1.1s var(--ease-out) 0.05s; }
@keyframes boot-pulse {
  0% { opacity: 0; transform: scale(0.4); box-shadow: 0 0 0 0 rgba(249, 117, 47, 0.5); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); box-shadow: 0 0 0 80px rgba(249, 117, 47, 0); }
}

.boot-line { margin-top: 2.2rem; min-height: 4.6em; }
.boot-line .bl {
  display: block; font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  opacity: 0;
}
.boot-line .bl-pre { font-size: clamp(1rem, 2.6vw, 1.6rem); color: var(--muted-fg); letter-spacing: 0.28em; font-weight: 500; }
.boot-line .bl-word { font-size: clamp(2.6rem, 7.5vw, 5.2rem); margin-top: 0.35rem; }
.boot-line .bl-word.f2 { color: var(--primary); }
.boot.play .bl-pre.p1 { animation: word-in 0.5s var(--ease-out) 1.6s forwards; }
.boot.play .bl-word.w1 { animation: word-lock 0.55s var(--ease-swift) 2.05s forwards; }
.boot.play .bl-pre.p2 { animation: word-in 0.5s var(--ease-out) 3.0s forwards; }
.boot.play .bl-word.w2 { animation: word-lock 0.55s var(--ease-swift) 3.45s forwards; }
@keyframes word-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes word-lock {
  0% { opacity: 0; transform: scale(1.25); letter-spacing: 0.12em; filter: blur(6px); }
  100% { opacity: 1; transform: scale(1); letter-spacing: -0.04em; filter: blur(0); }
}
@keyframes boot-fade { to { opacity: 1; } }

.boot-scan {
  position: absolute; left: -20vw; right: -20vw; top: 50%; height: 1px;
  background: linear-gradient(to right, transparent, rgba(249, 117, 47, 0.6), transparent);
  opacity: 0;
}
.boot.play .boot-scan { animation: scan 1s var(--ease-swift) 4.15s; }
@keyframes scan {
  0% { opacity: 0; transform: translateY(-38vh); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(38vh); }
}

/* ---------- hero ---------- */

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero-status {
  display: inline-flex; align-items: center; gap: 0.6rem;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.35rem 0.9rem; margin-bottom: 2.5rem;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted-fg);
}
.hero h1 { max-width: 11em; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; }
.hero-sub { margin-top: 2.5rem; }
.hero-ctas { margin-top: 2.75rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* staggered mask reveal after boot */
.booted .hero h1 .line > span { animation: rise-in 0.9s var(--ease-out) both; }
.booted .hero h1 .line:nth-child(2) > span { animation-delay: 0.08s; }
.booted .hero h1 .line:nth-child(3) > span { animation-delay: 0.16s; }
@keyframes rise-in {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
.booted .hero-status, .booted .hero-sub, .booted .hero-ctas { animation: fade-up 0.8s var(--ease-out) 0.45s both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* drifting block constellation behind hero */
.hero-field { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.hero-field .stair { position: absolute; opacity: 0.28; transition: transform 0.6s var(--ease-out); will-change: transform; }
.hero-field .f1 { top: 12%; right: 6%; --cell: 44px; }
.hero-field .f2 { bottom: 18%; right: 24%; --cell: 14px; opacity: 0.18; }
.hero-field .f3 { top: 30%; left: -2%; --cell: 22px; opacity: 0.12; }
@media (max-width: 767px) {
  .hero-field .f1 { --cell: 26px; right: -6%; }
  .hero-field .f2, .hero-field .f3 { display: none; }
}

.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--dim-fg);
}
.hero-scroll i {
  width: 1px; height: 42px; background: var(--border-strong); position: relative; overflow: hidden;
}
.hero-scroll i::after {
  content: ""; position: absolute; left: 0; top: -50%; width: 100%; height: 50%;
  background: var(--primary);
  animation: scroll-hint 2s var(--ease-swift) infinite;
}
@keyframes scroll-hint {
  0% { top: -50%; } 60% { top: 100%; } 100% { top: 100%; }
}

/* ---------- reveal utility ---------- */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: var(--rd, 0s); }
.reveal.in { opacity: 1; transform: none; }
.reveal-mask { overflow: hidden; }
.reveal-mask > * { display: block; transform: translateY(105%); transition: transform 0.9s var(--ease-out); transition-delay: var(--rd, 0s); }
.reveal-mask.in > * { transform: none; }

/* ---------- ACT I : belief ---------- */

.belief { min-height: 88svh; display: flex; align-items: center; }
.belief p.belief-line {
  font-size: clamp(1.9rem, 4.6vw, 3.9rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.12;
  max-width: 22em;
}
.belief .b-dim { color: var(--dim-fg); transition: color 0.6s ease; }
.belief .b-hot { color: var(--fg); }
.belief .b-orange { color: var(--primary); }
.belief-meta { margin-top: 3rem; display: flex; gap: 2.5rem; flex-wrap: wrap; }

/* ---------- DUALITY scene ---------- */

.duality { height: 420vh; }
.duality-pin {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.duality-hud {
  position: absolute; top: calc(var(--header-h) + 1.2rem); left: 0; right: 0;
  display: flex; justify-content: space-between; padding-inline: clamp(1.5rem, 5vw, 4rem);
}
.duality-hud .dh {
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--dim-fg); transition: color 0.5s;
  display: flex; align-items: center; gap: 0.6rem;
}
.duality-hud .dh i { width: 8px; height: 8px; background: var(--border-strong); transition: background 0.5s; }
.duality[data-phase="1"] .dh-studio { color: var(--primary); }
.duality[data-phase="1"] .dh-studio i { background: var(--primary); }
.duality[data-phase="2"] .dh-labs { color: var(--primary); }
.duality[data-phase="2"] .dh-labs i { background: var(--primary); }

/* progress ticks */
.duality-ticks { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.duality-ticks i { width: 22px; height: 2px; background: var(--border-strong); transition: background 0.4s; }
.duality[data-phase="0"] .duality-ticks i:nth-child(1),
.duality[data-phase="1"] .duality-ticks i:nth-child(2),
.duality[data-phase="2"] .duality-ticks i:nth-child(3),
.duality[data-phase="3"] .duality-ticks i:nth-child(4) { background: var(--primary); }

/* the morphing block cluster, drifts continuously with scroll so the pinned
   scene never feels frozen between phase changes */
.cluster { position: absolute; inset: 0; pointer-events: none;
  transform: translateY(calc(var(--p, 0) * -4vh)); }
.cluster .blk {
  position: absolute; left: 50%; top: 50%;
  width: var(--w, 64px); height: var(--h, 64px);
  background: var(--primary);
  transform: translate(-50%, -50%) translate(var(--x, 0), var(--y, 0));
  transition: transform 1s var(--ease-swift), width 1s var(--ease-swift),
              height 1s var(--ease-swift), opacity 0.8s ease, background 0.8s ease;
}
.scene-active .blk { will-change: transform; }

/* phase 0, assembled staircase (7 blocks, 64px cells).
   Columns sit at -99/-33/33/99 so the mark is optically centred. */
.duality[data-phase="0"] .b1 { --x: 99px;  --y: -99px; }
.duality[data-phase="0"] .b2 { --x: 33px;  --y: -33px; }
.duality[data-phase="0"] .b3 { --x: 99px;  --y: -33px; }
.duality[data-phase="0"] .b4 { --x: -33px; --y: 33px; }
.duality[data-phase="0"] .b5 { --x: 33px;  --y: 33px; }
.duality[data-phase="0"] .b6 { --x: -99px; --y: 99px; }
.duality[data-phase="0"] .b7 { --x: -33px; --y: 99px; }
.duality .blk { --w: 64px; --h: 64px; }
@media (max-width: 767px) {
  .duality .blk { --w: 40px; --h: 40px; }
  .duality[data-phase="0"] .b1 { --x: 63px;  --y: -63px; }
  .duality[data-phase="0"] .b2 { --x: 21px;  --y: -21px; }
  .duality[data-phase="0"] .b3 { --x: 63px;  --y: -21px; }
  .duality[data-phase="0"] .b4 { --x: -21px; --y: 21px; }
  .duality[data-phase="0"] .b5 { --x: 21px;  --y: 21px; }
  .duality[data-phase="0"] .b6 { --x: -63px; --y: 63px; }
  .duality[data-phase="0"] .b7 { --x: -21px; --y: 63px; }
}

/* phase 1, STUDIO: blocks become editorial layout bars/frames */
.duality[data-phase="1"] .b1 { --x: -30vw; --y: -21vh; --w: 21vw; --h: 10px; }
.duality[data-phase="1"] .b2 { --x: -32vw; --y: -14vh; --w: 12vw; --h: 10px; }
.duality[data-phase="1"] .b3 { --x: 30vw;  --y: 22vh;  --w: 128px; --h: 128px; }
.duality[data-phase="1"] .b4 { --x: 34vw;  --y: -20vh; --w: 56px; --h: 56px; }
.duality[data-phase="1"] .b5 { --x: -30vw; --y: 24vh;  --w: 17vw; --h: 4px; }
.duality[data-phase="1"] .b6 { --x: 37vw;  --y: -13vh; --w: 24px; --h: 24px; }
.duality[data-phase="1"] .b7 { --x: 24vw;  --y: 12vh;  --w: 4px;  --h: 15vh; }

/* phase 2, LABS: blocks contract into nodes */
.duality[data-phase="2"] .blk { --w: 12px; --h: 12px; }
.duality[data-phase="2"] .b1 { --x: -26vw; --y: -16vh; }
.duality[data-phase="2"] .b2 { --x: -10vw; --y: 12vh; }
.duality[data-phase="2"] .b3 { --x: 0vw;   --y: -22vh; }
.duality[data-phase="2"] .b4 { --x: 12vw;  --y: 6vh; }
.duality[data-phase="2"] .b5 { --x: 27vw;  --y: -10vh; }
.duality[data-phase="2"] .b6 { --x: -30vw; --y: 20vh; }
.duality[data-phase="2"] .b7 { --x: 31vw;  --y: 18vh; }
.duality[data-phase="2"] .blk { box-shadow: 0 0 18px -2px var(--primary); }

/* phase 3, resolution: two compact staircases flanking */
.duality[data-phase="3"] .blk { --w: 16px; --h: 16px; }
.duality[data-phase="3"] .b1 { --x: calc(-1 * min(34vw, 320px) + 18px); --y: -44px; }
.duality[data-phase="3"] .b2 { --x: calc(-1 * min(34vw, 320px));        --y: -26px; }
.duality[data-phase="3"] .b3 { --x: calc(-1 * min(34vw, 320px) + 18px); --y: -26px; }
.duality[data-phase="3"] .b4 { --x: calc(-1 * min(34vw, 320px) - 18px); --y: -8px; }
.duality[data-phase="3"] .b5 { --x: min(34vw, 320px);                   --y: -26px; }
.duality[data-phase="3"] .b6 { --x: calc(min(34vw, 320px) - 18px);      --y: -8px; }
.duality[data-phase="3"] .b7 { --x: calc(min(34vw, 320px) + 18px);      --y: -44px; }

/* node connection lines (phase 2) */
.cluster-net { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease 0.35s; }
.duality[data-phase="2"] .cluster-net { opacity: 1; }
.cluster-net line {
  stroke: rgba(249, 117, 47, 0.35); stroke-width: 1;
  stroke-dasharray: 1.4 1.1;
  animation: net-flow 2.4s linear infinite;
}
@keyframes net-flow { to { stroke-dashoffset: -25; } }

/* center copy per phase */
.duality-copy {
  position: relative; text-align: center; max-width: 46rem; padding-inline: 1.5rem; z-index: 3;
}
.duality-copy .dc {
  position: absolute; inset: auto 0 auto 0; top: 50%;
  transform: translateY(calc(-50% + var(--dcY, 0px) + 26px));
  opacity: 0; transition: opacity 0.7s ease, transform 0.7s var(--ease-out);
  pointer-events: none;
}
.duality-copy { min-height: 60vh; display: flex; align-items: center; justify-content: center; width: 100%; }
.duality[data-phase="0"] .dc-0,
.duality[data-phase="1"] .dc-1,
.duality[data-phase="2"] .dc-2,
.duality[data-phase="3"] .dc-3 {
  opacity: 1; transform: translateY(calc(-50% + var(--dcY, 0px))); pointer-events: auto;
}
/* phase-0 label clears the assembled mark (mark half-height ~132px at 64px cells) */
.duality .dc-0 { --dcY: 205px; }
@media (max-width: 767px) { .duality .dc-0 { --dcY: 140px; } }
.duality .dc-0 .mono { font-size: 0.8125rem; letter-spacing: 0.3em; }
.duality .dc .mono { display: block; margin-bottom: 1.2rem; }
.duality .dc p { color: var(--muted-fg); margin-top: 1.4rem; max-width: 30em; margin-inline: auto; }
.duality .dc .dc-links { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- panels : studio / labs previews ---------- */

.panel { border-top: 1px solid var(--border); }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 3.5rem; }

/* AYCA presentation */
.ayca {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 0.75rem;
  background: linear-gradient(160deg, var(--surface), var(--bg));
  padding: clamp(2.5rem, 6vw, 5rem);
}
.ayca-mark { position: absolute; top: -3rem; right: -3rem; opacity: 0.35; }
.ayca .ayca-tm { font-size: 0.45em; vertical-align: super; letter-spacing: 0; }
.ayca-price { display: flex; align-items: baseline; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.ayca-price .num { font-size: clamp(2.6rem, 6vw, 4.5rem); font-weight: 800; letter-spacing: -0.04em; color: var(--primary); }
.ayca-list { margin-top: 2.5rem; display: grid; gap: 0.4rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.ayca-list li { display: flex; gap: 0.75rem; align-items: baseline; font-size: 0.9375rem; color: var(--muted-fg); padding-block: 0.35rem; }
.ayca-list li::before { content: ""; width: 7px; height: 7px; background: var(--primary); flex: none; transform: translateY(-1px); }

/* labs modules grid */
.mod-grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.mod {
  background: var(--bg); padding: 1.75rem;
  position: relative; transition: background 0.3s;
  min-height: 10.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
}
.mod:hover { background: var(--surface); }
.mod .mod-id { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.2em; color: var(--dim-fg); display: flex; justify-content: space-between; }
.mod .mod-id i { width: 8px; height: 8px; background: var(--border-strong); transition: background 0.3s, box-shadow 0.3s; }
.mod:hover .mod-id i { background: var(--primary); box-shadow: 0 0 12px -2px var(--primary); }
.mod h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; }
.mod p { font-size: 0.875rem; color: var(--muted-fg); margin-top: 0.35rem; }

/* ---------- montage (home teaser + work page) ---------- */

.montage { height: 320vh; }
.montage-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.montage-track {
  display: flex; gap: clamp(1.5rem, 4vw, 3rem); padding-inline: 6vw;
  transform: translateX(calc(var(--p, 0) * var(--track-shift, -60%)));
}
/* promoted only while the scene is on screen, then released */
.scene-active .montage-track { will-change: transform; }
/* --track-shift is set precisely in px by JS (scrollWidth - viewport). The
   percentage in the markup is only a pre-JS fallback. */
.mcard {
  flex: none; width: clamp(19rem, 42vw, 34rem);
  border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden;
  background: var(--surface);
  transition: border-color 0.3s;
}
.mcard:hover { border-color: var(--border-strong); }
.mcard .mviz { aspect-ratio: 16 / 10; position: relative; overflow: hidden; background: linear-gradient(150deg, #141414, #0a0a0a); }
.mcard .mviz .stair { position: absolute; bottom: 1.5rem; left: 1.5rem; opacity: 0.8; transition: transform 0.4s var(--ease-out); }
.mcard:hover .mviz .stair { transform: translate(4px, -4px); }
/* scoped: bare `.field` also names the brief form's form-row, whose grid +
   margin would otherwise pin this content to the card's top-left */
.mcard .mviz .field { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; }
.mcard .mviz .proj-num {
  position: absolute; top: 1rem; right: 1.25rem;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.24em; color: var(--dim-fg);
}
.mcard .mmeta { padding: 1.25rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border); }
.mcard .mmeta h3 { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.02em; }
.mcard .mmeta .small { margin-top: 0.15rem; font-size: 0.75rem; }
.tag {
  font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.22em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 3px; padding: 0.3rem 0.5rem; color: var(--muted-fg); flex: none;
}
.tag.hot { border-color: rgba(249, 117, 47, 0.5); color: var(--primary); }

/* ---------- WORK page : film scenes ---------- */

.work-hud {
  position: fixed; left: 1.5rem; bottom: 1.5rem; z-index: 50; pointer-events: none;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted-fg); display: grid; gap: 0.3rem;
  opacity: 0; transition: opacity 0.5s;
}
.work-hud.on { opacity: 1; }
.work-hud b { color: var(--primary); font-weight: 400; }
@media (max-width: 767px) { .work-hud { display: none; } }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filters button {
  font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 0.5rem 1rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted-fg);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filters button:hover { color: var(--fg); border-color: var(--border-strong); }
.filters button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }

.scene-proj {
  min-height: 92svh; display: flex; align-items: center;
  border-top: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.scene-proj.hidden-by-filter { display: none; }
.sp-grid { display: grid; gap: 3rem; align-items: center; width: 100%; }
@media (min-width: 900px) { .sp-grid { grid-template-columns: 1.1fr 1fr; } }
.sp-meta .mono { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.sp-title { margin: 0.5rem 0 1.5rem; }
.sp-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.sp-viz {
  aspect-ratio: 4 / 3; position: relative; border: 1px solid var(--border); border-radius: 0.75rem;
  overflow: hidden; background: linear-gradient(150deg, #131313, #0a0a0a);
}
.sp-viz .clip-reveal { position: absolute; inset: 0; }
.sp-viz .field { position: absolute; inset: 0; display: grid; place-content: center; }
.sp-viz .bignum {
  position: absolute; right: 1.5rem; bottom: 0.5rem;
  font-size: clamp(4rem, 9vw, 7rem); font-weight: 800; letter-spacing: -0.05em;
  color: transparent; -webkit-text-stroke: 1px var(--border-strong);
}
.sp-viz .corner { position: absolute; width: 14px; height: 14px; border: 1px solid rgba(249, 117, 47, 0.5); }
.sp-viz .corner.tl { top: 0.9rem; left: 0.9rem; border-width: 1px 0 0 1px; }
.sp-viz .corner.tr { top: 0.9rem; right: 0.9rem; border-width: 1px 1px 0 0; }
.sp-viz .corner.bl { bottom: 0.9rem; left: 0.9rem; border-width: 0 0 1px 1px; }
.sp-viz .corner.br { bottom: 0.9rem; right: 0.9rem; border-width: 0 1px 1px 0; }
.sp-viz .seedfield { display: grid; grid-template-columns: repeat(8, 16px); gap: 3px; }
.sp-viz .seedfield i { width: 16px; height: 16px; }
.sp-viz .seedfield i.on { background: var(--primary); }
.sp-viz .seedfield i.dim { background: var(--muted); }
.sp-viz .asset-note {
  position: absolute; left: 1.5rem; top: 1.25rem;
  font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim-fg);
}

/* clip-path entrance for scene visuals */
.clip-in { clip-path: inset(0 100% 0 0); transition: clip-path 1s var(--ease-swift); }
.clip-in.in { clip-path: inset(0 0 0 0); }

/* ---------- proof wall ---------- */

.proof-wall { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .proof-wall { grid-template-columns: repeat(3, 1fr); } }
.proof-cell {
  background: var(--bg); aspect-ratio: 16 / 9;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: background 0.35s;
}
.proof-cell:hover { background: var(--surface); }
.proof-cell .pc-name { font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 700; letter-spacing: -0.02em; color: var(--muted-fg); transition: color 0.35s, transform 0.35s var(--ease-out); }
.proof-cell:hover .pc-name { color: var(--fg); transform: scale(1.06); }
.proof-cell .pc-id { position: absolute; top: 0.75rem; left: 1rem; font-family: var(--font-mono); font-size: 0.5625rem; letter-spacing: 0.2em; color: var(--dim-fg); }
.proof-cell .pc-sq { position: absolute; bottom: 0.85rem; right: 1rem; width: 7px; height: 7px; background: var(--border-strong); transition: background 0.35s; }
.proof-cell:hover .pc-sq { background: var(--primary); }

/* ---------- process rail ---------- */

.process { height: 340vh; }
.process-pin { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.rail { position: relative; height: 1px; background: var(--border-strong); margin-block: 4.5rem 2.5rem; }
.rail .rail-fill { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--primary); }
.rail .rail-block {
  position: absolute; top: 50%; left: calc(var(--p, 0) * 100%);
  width: 18px; height: 18px; background: var(--primary);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 24px -4px var(--primary);
}
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.step { opacity: 0.28; transition: opacity 0.45s ease; }
.step .mono { display: block; margin-bottom: 0.6rem; }
.step h3 { font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 800; letter-spacing: -0.03em; }
.step p { font-size: 0.8125rem; color: var(--muted-fg); margin-top: 0.5rem; max-width: 15em; }
.process-pin[data-step="0"] .step:nth-child(1),
.process-pin[data-step="1"] .step:nth-child(-n+2),
.process-pin[data-step="2"] .step:nth-child(-n+3),
.process-pin[data-step="3"] .step:nth-child(-n+4),
.process-pin[data-step="4"] .step { opacity: 1; }
.process-pin .step.now h3 { color: var(--primary); }
@media (max-width: 767px) {
  .steps { grid-template-columns: 1fr; gap: 1.25rem; }
  .step p { max-width: none; }
  .process { height: 300vh; }
}

/* ---------- audit timeline (labs) ---------- */

.timeline { position: relative; padding-left: 2rem; display: grid; gap: 2.5rem; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border-strong); }
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -2rem; top: 6px; width: 9px; height: 9px;
  background: var(--border-strong); transition: background 0.4s, box-shadow 0.4s;
}
.tl-item.in::before { background: var(--primary); box-shadow: 0 0 14px -2px var(--primary); }
.tl-item h3 { font-weight: 700; letter-spacing: -0.02em; }
.tl-item p { color: var(--muted-fg); font-size: 0.9375rem; margin-top: 0.3rem; max-width: 34em; }

/* ---------- offering index (studio) ---------- */

.offer-list { border-top: 1px solid var(--border); }
.offer-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: baseline;
  padding-block: 1.6rem; border-bottom: 1px solid var(--border);
  transition: padding-left 0.35s var(--ease-out), background 0.3s;
  position: relative;
}
.offer-item:hover { padding-left: 1rem; }
.offer-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--primary); transform: scaleY(0); transition: transform 0.35s var(--ease-out);
  transform-origin: top;
}
.offer-item:hover::before { transform: scaleY(1); }
.offer-item h3 { font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.03em; }
.offer-item .oi-desc { color: var(--muted-fg); font-size: 0.9375rem; margin-top: 0.3rem; max-width: 34em; }
.offer-item .oi-spec { text-align: right; }
@media (max-width: 640px) {
  .offer-item { grid-template-columns: auto 1fr; }
  .offer-item .oi-spec { grid-column: 2; text-align: left; margin-top: 0.4rem; }
}

/* request examples, the queue */
.queue { display: grid; gap: 1rem; }
@media (min-width: 900px) { .queue { grid-template-columns: repeat(3, 1fr); } }
.q-item {
  border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface);
  padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.q-item .q-head { display: flex; justify-content: space-between; align-items: center; }
.q-item blockquote { font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.45; }
.q-item .q-eta { margin-top: auto; display: flex; align-items: center; gap: 0.6rem; }
.q-item .q-eta .bar { flex: 1; height: 2px; background: var(--muted); position: relative; overflow: hidden; }
.q-item .q-eta .bar::after {
  content: ""; position: absolute; inset: 0; background: var(--primary);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.4s var(--ease-swift) 0.3s;
}
.q-item.in .q-eta .bar::after { transform: scaleX(var(--fill, 0.7)); }

/* ---------- accordion ---------- */

.faq { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item button {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-block: 1.5rem; text-align: left;
}
.faq-item button .fq { font-size: clamp(1.05rem, 2vw, 1.25rem); font-weight: 600; letter-spacing: -0.02em; transition: color 0.2s; }
.faq-item button:hover .fq { color: var(--primary); }
.faq-item .fx { color: var(--primary); font-size: 1.4rem; font-weight: 300; transition: transform 0.3s var(--ease-out); flex: none; }
.faq-item button[aria-expanded="true"] .fx { transform: rotate(45deg); }
.faq-body { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.35s var(--ease-out), opacity 0.35s; }
.faq-item button[aria-expanded="true"] + .faq-body { grid-template-rows: 1fr; opacity: 1; }
.faq-body > div { overflow: hidden; }
.faq-body p { color: var(--muted-fg); max-width: 42em; padding-bottom: 1.5rem; }

/* ---------- finale CTA ---------- */

.finale {
  min-height: 92svh; display: flex; align-items: center; text-align: center;
  position: relative; overflow: hidden;
}
.finale .wrap { position: relative; z-index: 2; width: 100%; }
.finale-field { position: absolute; inset: 0; pointer-events: none; }
.finale-field i {
  position: absolute; width: 10px; height: 10px; background: var(--primary);
  opacity: 0.16; transition: transform 1.2s var(--ease-out), opacity 0.6s;
}
.finale:hover .finale-field i { opacity: 0.35; }
.finale .btn-primary { padding: 1.1rem 2.2rem; font-size: 1rem; }
.finale .mono { display: block; margin-bottom: 1.6rem; }
.finale p.lede { margin: 1.8rem auto 0; }
.finale .finale-actions { margin-top: 3rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--border); position: relative; z-index: 2; background: var(--bg); }
.footer-grid { display: grid; gap: 3rem; padding-block: 4.5rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid .f-col p.small { max-width: 22rem; margin-top: 1rem; }
.footer-grid .f-head { margin-bottom: 1.2rem; }
.footer-grid ul { display: grid; gap: 0.6rem; font-size: 0.875rem; }
.footer-grid ul a { color: var(--muted-fg); transition: color 0.2s; }
.footer-grid ul a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
  font-size: 0.75rem; color: var(--dim-fg);
}
.footer-bottom .mono { font-size: 0.5625rem; }

/* ---------- BRIEF / project request ---------- */

.brief-page { min-height: 100svh; display: flex; flex-direction: column; }
.brief-shell {
  flex: 1; display: grid; gap: 2rem; align-items: stretch;
  padding-top: calc(var(--header-h) + 2.5rem); padding-bottom: 3rem;
  width: 100%;
}
@media (min-width: 960px) { .brief-shell { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 4rem; } }

.brief-flow { display: flex; flex-direction: column; }
.brief-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2.5rem; }
.brief-progress { display: flex; gap: 6px; }
.brief-progress i { width: 26px; height: 3px; background: var(--muted); transition: background 0.3s; }
.brief-progress i.done { background: var(--primary); }

.brief-step { display: none; animation: fade-up 0.45s var(--ease-out); }
.brief-step.active { display: block; }
.brief-step .bs-q { margin-bottom: 0.75rem; }
.brief-step .bs-hint { color: var(--muted-fg); font-size: 0.9375rem; margin-bottom: 2rem; max-width: 34em; }

.opt-grid { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .opt-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.opt {
  border: 1px solid var(--border); border-radius: 0.5rem; background: var(--surface);
  padding: 1.25rem 1.4rem; text-align: left; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease-out);
}
.opt:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.opt .opt-label { font-weight: 600; letter-spacing: -0.01em; }
.opt .opt-sub { display: block; font-size: 0.8125rem; color: var(--muted-fg); font-weight: 400; margin-top: 0.2rem; }
.opt .opt-sq { width: 12px; height: 12px; border: 1px solid var(--border-strong); flex: none; transition: background 0.2s, border-color 0.2s; }
.opt[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-dim); }
.opt[aria-pressed="true"] .opt-sq { background: var(--primary); border-color: var(--primary); }

.field { display: grid; gap: 0.5rem; margin-bottom: 1.25rem; }
.field label { font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted-fg); }
.field input, .field textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1rem; transition: border-color 0.2s; width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); outline: none; }
.field textarea { resize: vertical; min-height: 7rem; }
.field .err { font-size: 0.75rem; color: var(--primary); display: none; }
.field.invalid .err { display: block; }
.field.invalid input { border-color: var(--primary); }

.brief-nav { margin-top: 2.5rem; display: flex; align-items: center; gap: 1rem; }
.brief-nav .spacer { flex: 1; }

/* schematic panel */
.schematic {
  border: 1px solid var(--border); border-radius: 0.75rem;
  background: linear-gradient(165deg, #121212, #0a0a0a);
  position: relative; overflow: hidden;
  min-height: 26rem;
  display: flex; flex-direction: column;
}
.schematic .sch-head {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.schematic .sch-body { flex: 1; position: relative; padding: 2rem 1.5rem; }
.sch-rows { display: grid; gap: 0.9rem; position: relative; z-index: 2; }
.sch-row {
  display: flex; align-items: center; gap: 1rem;
  opacity: 0.25; transition: opacity 0.5s ease;
  font-family: var(--font-mono); font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-fg);
}
.sch-row .sch-sq { width: 14px; height: 14px; border: 1px solid var(--border-strong); flex: none; transition: background 0.4s, border-color 0.4s, box-shadow 0.4s; }
.sch-row .sch-val { color: var(--fg); letter-spacing: 0.08em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.sch-row.filled { opacity: 1; }
.sch-row.filled .sch-sq { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 12px -2px var(--primary); }
.schematic .sch-stair { position: absolute; bottom: 1.5rem; right: 1.5rem; opacity: 0.3; }
.schematic .sch-grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 36px 36px; opacity: 0.25;
}
.schematic .sch-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
@media (max-width: 959px) { .schematic { min-height: 0; } .schematic .sch-body { padding: 1.5rem; } }

/* brief ready / transmitted */
.brief-final .sum {
  border: 1px solid var(--border); border-radius: 0.75rem; background: var(--surface);
  padding: 2rem; margin-block: 2rem;
}
.brief-final .sum .mono { display: block; margin-bottom: 0.8rem; }
.brief-final .sum .sum-line { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.55rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.brief-final .sum .sum-line:last-child { border-bottom: 0; }
.brief-final .sum .sum-line span:first-child { color: var(--muted-fg); }
.brief-final .sum .sum-line span:last-child { text-align: right; }
.price-lock { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; margin-top: 1rem; }
.price-lock .num { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.04em; color: var(--primary); }

.transmitted { text-align: center; padding-block: 4rem; }
.transmitted .tx-mark { margin: 0 auto 2.5rem; width: max-content; position: relative; }
.transmitted .tx-mark .stair { --cell: 22px; }
.transmitted .tx-mark::after {
  content: ""; position: absolute; inset: -20px; border: 1px solid rgba(249, 117, 47, 0.4);
  animation: tx-ring 2.4s var(--ease-out) infinite;
}
@keyframes tx-ring {
  0% { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ---------- page hero (interior pages) ---------- */

.page-hero { padding-top: calc(var(--header-h) + clamp(4rem, 12vh, 8rem)); padding-bottom: clamp(3rem, 8vh, 6rem); position: relative; overflow: hidden; }
.page-hero .slabel { margin-bottom: 2rem; }
.page-hero .lede { margin-top: 2rem; }
.page-hero .hero-actions { margin-top: 2.5rem; display: flex; gap: 0.9rem; flex-wrap: wrap; }
.page-hero .ph-mark { position: absolute; top: 18%; right: -2rem; opacity: 0.2; pointer-events: none; }

/* divider stair between sections */
.divider-stair { display: flex; justify-content: center; padding-block: 3rem; }

/* ---------- reduced motion ---------- */

html.rm *, html.rm *::before, html.rm *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
}
html.rm .reveal, html.rm .reveal-mask > * { opacity: 1; transform: none; }
html.rm .boot { display: none; }
html.rm .texture::after { display: none; }
html.rm .duality { height: auto; }
html.rm .duality-pin { position: static; height: auto; padding-block: 4rem; }
html.rm .cluster, html.rm .duality-ticks { display: none; }
html.rm .duality-copy .dc { position: static; opacity: 1; transform: none; pointer-events: auto; margin-block: 3rem; }
html.rm .duality-copy { min-height: 0; display: block; }
html.rm .montage { height: auto; }
html.rm .montage-pin { position: static; height: auto; padding-block: 4rem; }
html.rm .montage-track { flex-wrap: wrap; transform: none; padding-inline: 1.5rem; justify-content: center; }
html.rm .process { height: auto; }
html.rm .process-pin { position: static; height: auto; padding-block: 4rem; }
html.rm .step { opacity: 1; }
html.rm .clip-in { clip-path: none; }
html.rm .hero-scroll i::after { display: none; }


/* ============================================================
   OFFSCREEN MOTION
   Decorative loops (Level 3) are paused whenever they are not on
   screen, and while the tab is hidden. Nothing visible changes.
   ============================================================ */
.anim-off, .anim-off::after, .anim-off::before { animation-play-state: paused !important; }
.anim-off .pulse-dot, .anim-off .stair { animation-play-state: paused !important; }

/* modest devices: fewer concurrent atmospheric effects, same composition */
:root[data-perf="low"] .float-slow { animation: none; }
:root[data-perf="low"] .hero-scroll i::after { animation-duration: 3.4s; }
:root[data-perf="low"] .cluster-net line { animation: none; }
:root[data-perf="low"] .btn-primary:hover { box-shadow: none; }

@media (max-width: 640px) { .brand-mark { width: 20px; height: 20px; } }

/* ============================================================
   BRIEF SUBMISSION STATES
   Sending, delivered and interrupted, in the existing language.
   ============================================================ */

/* honeypot: off-screen, out of tab order, invisible to people and AT */
.hp-field {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
  opacity: 0; pointer-events: none;
}

/* transmitting: the button holds a small pulse rather than a spinner */
.tx-sending [data-transmit] { opacity: 0.9; cursor: progress; }
.tx-sending .brief-step .opt,
.tx-sending [data-back] { pointer-events: none; opacity: 0.5; }
.tx-dots { display: inline-flex; gap: 3px; margin-left: 0.15rem; }
.tx-dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; opacity: 0.35;
  animation: tx-dot 1s ease-in-out infinite;
}
.tx-dots i:nth-child(2) { animation-delay: 0.15s; }
.tx-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tx-dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* the server-issued reference on the confirmation screen */
.tx-ref {
  display: flex; align-items: baseline; justify-content: center;
  gap: 0.8rem; flex-wrap: wrap; margin-top: 1.4rem;
}
.tx-ref .mono { font-size: 0.5625rem; }
.tx-id {
  font-family: var(--font-mono); font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  letter-spacing: 0.14em; color: var(--primary);
}

/* interrupted: restrained, and the answers are still behind it */
.tx-error { padding-block: 2rem; }
.tx-error .mono .idx { color: var(--primary); }

@media (prefers-reduced-motion: reduce) { .tx-dots i { animation: none; } }
