/* ════════════════════════════════════════════════════════════
   Rudhra Rekapally — Portfolio 2026 · "Field Notes" edition
   Paper + topographic contours · Bodoni Moda × Inter × JB Mono
   Light editorial canvas, night bookends (loader · contact)
   ════════════════════════════════════════════════════════════ */

:root {
  /* paper (day) */
  --paper: #e9e5da;
  --paper-2: #e0dcd0;
  --paper-3: #d6d2c4;
  --ink: #161410;
  --ink-dim: #4f4b42;
  --ink-faint: #6a655a;   /* WCAG AA 4.6:1 on paper (was #8a8478 ≈ 2.95:1) */
  --line: rgba(22, 20, 16, 0.14);
  --line-strong: rgba(22, 20, 16, 0.30);

  /* night */
  --night: #14120e;
  --night-2: #1b1813;
  --cream: #f0ece1;
  --cream-dim: #b5afa1;
  --cream-faint: #857f6e;   /* WCAG AA 4.7:1 on night (was #777163 ≈ 3.85:1) */
  --nline: rgba(240, 236, 225, 0.12);
  --nline-strong: rgba(240, 236, 225, 0.24);

  --accent: #eb4d0e;
  --accent-deep: #c93e07;
  --accent-ink: #1d0d04;
  --green: #2e7d4f;

  --display: "Archivo", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(20px, 5vw, 72px);
  --nav-h: 72px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snap: cubic-bezier(0.6, 0.05, 0.1, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--sans);
  font-weight: 350;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.002em;
}

::selection { background: var(--accent); color: var(--paper); }

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; }

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

/* ── Grain ───────────────────────────────────────── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 200;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ── Preloader — night, giant counter ────────────── */
.loader {
  position: fixed; inset: 0; z-index: 500;
  background: var(--night);
  color: var(--cream);
  overflow: hidden;
}
.loader-brand {
  position: absolute; left: clamp(20px, 4vw, 56px); bottom: clamp(24px, 5vh, 52px);
  font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -0.02em;
}
.loader-brand .dot { color: var(--accent); font-style: normal; }
.loader-count {
  position: absolute; left: 50%; bottom: -0.12em;
  transform: translateX(-50%);
  font-family: var(--display); font-weight: 800;
  font-size: clamp(140px, 22vw, 320px);
  line-height: 1; white-space: nowrap;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.loader-count .pct {
  font-size: 0.16em; color: var(--accent);
  font-weight: 700; margin-left: 0.16em;
  letter-spacing: 0;
}
.loader-side {
  position: absolute; right: clamp(14px, 2.4vw, 30px); top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--cream-faint);
}

/* ── Custom cursor ───────────────────────────────── */
.cursor { position: fixed; inset: 0; pointer-events: none; z-index: 400; }
.cursor-dot, .cursor-ring {
  position: absolute; top: 0; left: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor-dot {
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  background: var(--accent);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
              margin 0.25s var(--ease-out);
}
/* the ring is invisible by default — the cursor is just the orange dot.
   It only materialises as the orange label bubble in the view state. */
.cursor-ring {
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border: 1px solid transparent;
  display: grid; place-items: center;
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out),
              margin 0.3s var(--ease-out), background 0.3s, border-color 0.3s;
}
.cursor-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--paper);
  text-align: center; line-height: 1.35; max-width: 60px;   /* long labels wrap centered inside the ring */
  opacity: 0; transition: opacity 0.2s;
}
.cursor.is-hover .cursor-dot {
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
}
.cursor.is-view .cursor-ring {
  width: 74px; height: 74px; margin: -37px 0 0 -37px;
  background: var(--accent); border-color: var(--accent);
}
.cursor.is-view .cursor-label { opacity: 1; }
.cursor.is-view .cursor-dot { opacity: 0; }
@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
}

/* ── Nav ─────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; /* links dead-centre */
  align-items: center;
  padding: 0 clamp(16px, 3vw, 44px);
  transition: transform 0.5s var(--ease-out), background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav-brand { justify-self: start; }
.nav-links { justify-self: center; }
.nav-right { justify-self: end; }
.nav.is-scrolled {
  background: rgba(233, 229, 218, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }

.nav-brand {
  display: inline-flex; align-items: baseline;
  text-decoration: none;
}
.brand-mark {
  font-family: var(--display); font-weight: 700;
  font-size: 22px; letter-spacing: -0.025em;
}
.brand-mark .dot { color: var(--accent); }

.nav-links { display: flex; gap: clamp(10px, 2vw, 26px); }
.nav-links a {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-dim); text-decoration: none;
  padding: 8px 2px;
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 4px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease-snap);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.is-current { color: var(--accent-deep); }
.nav-links a.is-current::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-time {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faint);
}
.nav-time b { font-weight: 500; color: var(--accent); }
.nav-ai {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none;
  padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.nav-ai:hover { background: var(--accent); color: var(--paper); transform: translateY(-1px); }

.nav-burger {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); border-radius: 50%;
}
.nav-burger span {
  width: 16px; height: 1.5px; background: var(--ink);
  transition: transform 0.35s var(--ease-out);
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }

/* ── Mobile menu ─────────────────────────────────── */
.mmenu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(233, 229, 218, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--nav-h) var(--pad) 40px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s var(--ease-out);
}
.mmenu.is-open { opacity: 1; pointer-events: auto; }
.mmenu-links { display: flex; flex-direction: column; gap: 2px; }
.mmenu-links a {
  font-family: var(--display); font-weight: 680;
  letter-spacing: -0.02em;
  font-size: clamp(30px, 8vw, 46px);
  text-decoration: none; padding: 9px 0;
  display: flex; align-items: baseline; gap: 16px;
  border-bottom: 1px solid var(--line);
  transform: translateY(24px); opacity: 0;
  transition: transform 0.55s var(--ease-out), opacity 0.55s;
}
.mmenu.is-open .mmenu-links a { transform: none; opacity: 1; }
.mmenu-links a:nth-child(1) { transition-delay: 0.06s; }
.mmenu-links a:nth-child(2) { transition-delay: 0.11s; }
.mmenu-links a:nth-child(3) { transition-delay: 0.16s; }
.mmenu-links a:nth-child(4) { transition-delay: 0.21s; }
.mmenu-links a:nth-child(5) { transition-delay: 0.26s; }
.mmenu-links a:nth-child(6) { transition-delay: 0.31s; }
.mmenu-links a:nth-child(7) { transition-delay: 0.36s; }
.mmenu-links .mi { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.mmenu-foot {
  margin-top: auto; display: flex; flex-direction: column; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  letter-spacing: 0.06em;
}
.mmenu-foot a { color: var(--ink-dim); text-decoration: none; }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none;
  transition: transform 0.35s var(--ease-out), background 0.35s, color 0.35s, border-color 0.35s;
  will-change: transform;
}
.btn-solid { background: var(--accent); color: var(--paper); }
.btn-solid:hover { background: var(--ink); color: var(--paper); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.night .btn-ghost, .nightband .btn-ghost { border-color: var(--nline-strong); color: var(--cream); }
.night .btn-ghost:hover, .nightband .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.night .btn-solid:hover, .nightband .btn-solid:hover { background: var(--cream); color: var(--night); }

/* ── Sections shared ─────────────────────────────── */
.section { position: relative; padding: clamp(90px, 12vh, 150px) var(--pad); max-width: 1480px; margin: 0 auto; }
.section-head { margin-bottom: clamp(40px, 6vh, 72px); }
.section-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent-deep);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px;
}
.section-tag::before { content: ""; width: 34px; height: 1px; background: var(--accent); opacity: 0.7; }
.section-title {
  font-family: var(--display); font-weight: 680;
  font-size: clamp(30px, 4.4vw, 60px);
  line-height: 1.06; letter-spacing: -0.022em;
  max-width: 24ch; text-wrap: balance;
}
.section-title em { font-style: italic; color: var(--accent-deep); font-weight: 650; }
.section-note { margin-top: 18px; color: var(--ink-faint); font-size: 14px; max-width: 58ch; line-height: 1.6; }

.split-reveal .sr-line { display: block; overflow: hidden; }
.split-reveal .sr-inner { display: block; transform: translateY(110%); }
.no-js .split-reveal .sr-inner, html.reduce-motion .split-reveal .sr-inner { transform: none; }

/* ── Hero — circuit traces on paper ──────────────── */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 16px) clamp(20px, 4vw, 56px) 86px;
  overflow: hidden;
}
#fxCanvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  /* keep the centre calm so the type and chat card lead */
  -webkit-mask-image: radial-gradient(85% 75% at 50% 46%, rgba(0, 0, 0, 0.22) 12%, rgba(0, 0, 0, 1) 70%);
  mask-image: radial-gradient(85% 75% at 50% 46%, rgba(0, 0, 0, 0.22) 12%, rgba(0, 0, 0, 1) 70%);
}

.hero-stage {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  width: 100%; max-width: 880px;
}
.hero-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-dim);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(233, 229, 218, 0.6);
  margin-bottom: clamp(20px, 4vh, 34px);
}
.hero-eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: pingPulse 2.2s ease-in-out infinite;
}
.hero-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(38px, 6.4vw, 86px);
  line-height: 1.02; letter-spacing: -0.028em;
  margin-bottom: clamp(18px, 3vh, 26px);
  text-wrap: balance;
}
.hero-title em { font-style: normal; color: var(--accent); }
.ht-line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.04em; }
.ht-inner { display: inline-block; will-change: transform; }
.hero-lede {
  font-size: clamp(14.5px, 1.4vw, 17px); line-height: 1.65;
  color: var(--ink-dim); font-weight: 400;
  max-width: 52ch;
  margin-bottom: clamp(26px, 4.5vh, 38px);
  text-wrap: pretty;
}
.hero-lede strong { color: var(--ink); font-weight: 550; }

/* ── ask-the-AI — the hero's highlight card ── */
.hero-ask {
  position: relative;
  width: min(520px, 100%);
  text-align: left;
  background: rgba(27, 24, 19, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--cream);
  border: 1px solid rgba(240, 236, 225, 0.14);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 70px -24px rgba(22, 20, 16, 0.55),
    0 0 0 6px rgba(235, 77, 14, 0.06);
  transition: box-shadow 0.4s, transform 0.4s var(--ease-out);
}
.hero-ask:focus-within, .hero-ask:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 34px 80px -24px rgba(22, 20, 16, 0.65),
    0 0 0 6px rgba(235, 77, 14, 0.14);
}
.ha-badge {
  position: absolute; top: -11px; right: 18px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--accent); color: var(--paper);
  padding: 5px 11px; border-radius: 999px;
}
.ha-label {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cream-dim);
  margin-bottom: 14px;
}
.ha-label::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(235, 77, 14, 0.5);
  animation: askPing 2.2s ease-out infinite;
}
@keyframes askPing {
  0% { box-shadow: 0 0 0 0 rgba(235, 77, 14, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(235, 77, 14, 0); }
  100% { box-shadow: 0 0 0 0 rgba(235, 77, 14, 0); }
}
.ha-row {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--nline-strong);
  padding-bottom: 12px;
  transition: border-color 0.3s;
}
.ha-row:focus-within { border-color: var(--accent); }
.ha-row input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  font-family: var(--sans); font-size: 16px; color: var(--cream);
  padding: 6px 0;
  transition: opacity 0.28s ease;
}
.ha-row input::placeholder { color: var(--cream-faint); }
.ha-row button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--paper);
  background: var(--accent);
  padding: 11px 18px; border-radius: 999px;
  white-space: nowrap;
  transition: background 0.3s, transform 0.3s var(--ease-out);
}
.ha-row button:hover { background: var(--cream); color: var(--night); transform: translateY(-1px); }
.ha-hint {
  display: block; margin-top: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--cream-faint);
}

.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 44px); height: 58px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-faint);
}
.hf-item { display: inline-flex; align-items: center; gap: 9px; }
.hf-item .ping {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block; flex-shrink: 0;
  animation: pingPulse 2.2s ease-in-out infinite;
}
@keyframes pingPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.hf-arrow { display: inline-block; animation: bobble 1.8s ease-in-out infinite; }
@keyframes bobble { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ── Marquee ─────────────────────────────────────── */
.marquee {
  overflow: hidden; white-space: nowrap;
  border-block: 1px solid var(--line);
  padding: 20px 0;
  background: var(--paper-2);
}
.marquee-track {
  display: inline-flex; align-items: center; gap: 36px;
  will-change: transform;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(17px, 2.2vw, 27px);
  letter-spacing: -0.01em;
  color: var(--ink-dim);
}
.marquee-track i { font-style: normal; color: var(--accent); font-size: 0.6em; }

/* ── About ───────────────────────────────────────── */
.about-grid {
  display: grid; grid-template-columns: 1.5fr 1fr;
  gap: clamp(36px, 6vw, 90px); align-items: start;
}
.about-lede {
  font-family: var(--display); font-weight: 560;
  font-size: clamp(18px, 2vw, 25px); line-height: 1.42;
  letter-spacing: -0.012em;
  margin-bottom: 26px;
}
.about-body { color: var(--ink-dim); font-size: 16px; line-height: 1.75; max-width: 62ch; }
.about-body strong { color: var(--accent-deep); font-weight: 550; }
.about-chips { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--ink-dim);
  padding: 9px 15px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(22, 20, 16, 0.025);
  transition: border-color 0.3s, color 0.3s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; }
.stat {
  padding: clamp(20px, 2.6vw, 34px) clamp(16px, 2vw, 28px);
  border: 1px solid var(--nline);
  margin: 0 -1px -1px 0;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--night);
  color: var(--cream);
  transition: background 0.4s;
}
.stat:hover { background: var(--night-2); }
.stat-num {
  font-family: var(--display); font-weight: 720;
  font-size: clamp(40px, 4.6vw, 60px); line-height: 1;
  letter-spacing: -0.03em;
}
.stat-num b { color: var(--accent); font-weight: 700; }
.stat-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-faint); }

/* ── Work ────────────────────────────────────────── */
.work-index { border-top: 1px solid var(--line); }
.work-row {
  display: grid;
  grid-template-columns: 56px 1fr auto 90px;
  align-items: center; gap: clamp(14px, 2.5vw, 36px);
  padding: clamp(22px, 3vw, 34px) 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  position: relative;
  transition: padding 0.4s var(--ease-out), background 0.4s;
}
.work-row::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 100%; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.55s var(--ease-snap);
}
.work-row:hover::after { transform: scaleX(1); }
.work-row:hover { background: rgba(22, 20, 16, 0.03); padding-left: 18px; }
.wr-num { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
/* static per-row thumbnail — only shown ≤960px, where the hover preview doesn't exist */
.wr-thumb { display: none; }
.work-row:hover .wr-num { color: var(--accent-deep); }
.wr-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.wr-title {
  font-family: var(--display); font-weight: 680;
  font-size: clamp(22px, 3vw, 40px); line-height: 1.02;
  letter-spacing: -0.02em;
  transition: color 0.3s, transform 0.45s var(--ease-out);
  transform-origin: left center;
}
.work-row:hover .wr-title { color: var(--accent-deep); transform: translateX(4px); }
.wr-desc { font-size: 13.5px; color: var(--ink-faint); line-height: 1.55; max-width: 60ch; }
.wr-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wr-tags span {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-dim);
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px;
  white-space: nowrap;
}
.wr-year { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); text-align: right; }

.work-preview {
  position: fixed; top: 0; left: 0; z-index: 80;
  width: 360px; height: 240px;
  border-radius: 6px; overflow: hidden;
  pointer-events: none;
  opacity: 0; transform: scale(0.96);
  transition: opacity 0.14s ease-out;
  box-shadow: 0 30px 70px -18px rgba(22, 20, 16, 0.45);
  border: 1px solid var(--line-strong);
  background: var(--paper-3);
  will-change: transform;
}
.work-preview.is-active { opacity: 1; }
.work-preview img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.16s ease-out;
}
.work-preview img.is-show { opacity: 1; }

/* ── Process ─────────────────────────────────────── */
.process-rail {
  list-style: none;
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.p-step {
  padding: clamp(24px, 2.6vw, 38px) clamp(18px, 2vw, 28px) clamp(28px, 3vw, 42px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  transition: background 0.4s;
}
.p-step:last-child { border-right: 0; }
.p-step:hover { background: var(--paper); }
.ps-num { font-family: var(--display); font-style: italic; font-size: 30px; color: var(--accent); line-height: 1; }
.ps-name { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.ps-body { font-size: 13.5px; line-height: 1.65; color: var(--ink-dim); }
.ps-ai {
  margin-top: auto; font-family: var(--mono); font-size: 10.5px;
  line-height: 1.6; letter-spacing: 0.02em; color: var(--accent-deep);
  padding-top: 14px; border-top: 1px dashed var(--line-strong);
}

/* ── Lexicon ─────────────────────────────────────── */
.lexicon { background: var(--paper-2); max-width: none; }
.lexicon > * { max-width: 1480px; margin-left: auto; margin-right: auto; }
.lexicon .section-head { margin-bottom: clamp(36px, 5vh, 60px); }

.lex-shell {
  display: grid; grid-template-columns: minmax(200px, 0.8fr) 2fr;
  gap: clamp(28px, 4vw, 70px);
  align-items: start;
}
.lex-terms {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  max-height: clamp(260px, 34vh, 340px);
  overflow-y: auto;
  padding-right: 8px;
  scroll-snap-type: y mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 34px, #000 calc(100% - 34px), transparent 100%);
}
.lex-terms::-webkit-scrollbar { width: 6px; }
.lex-terms::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.lex-terms::-webkit-scrollbar-track { background: transparent; }
.lex-term {
  scroll-snap-align: center;
  font-family: var(--display); font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.2;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: color 0.3s, padding-left 0.4s var(--ease-out), background 0.3s;
}
.lex-term:last-child { border-bottom: 0; }
.lex-term .li {
  font-family: var(--mono); font-weight: 400; font-size: 11px;
  letter-spacing: 0.12em; color: var(--ink-faint);
  transition: color 0.3s;
}
.lex-term .la {
  margin-left: auto;
  font-family: var(--mono); font-weight: 400; font-size: 14px;
  color: var(--accent);
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.lex-term:hover { color: var(--ink); padding-left: 10px; background: rgba(22, 20, 16, 0.025); }
.lex-term:hover .la { opacity: 0.6; transform: none; }
.lex-term.is-active { color: var(--accent); font-style: italic; padding-left: 10px; }
.lex-term.is-active .li { color: var(--accent-deep); }
.lex-term.is-active .la { opacity: 1; transform: none; }

.lex-stage { position: relative; }
.lex-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.lex-counter {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  letter-spacing: 0.15em;
}
.lex-counter i { font-style: normal; color: var(--accent-deep); padding: 0 4px; }
.lex-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  perspective: 1200px;
}
.lex-card {
  border-radius: 6px;
  padding: clamp(24px, 2.6vw, 38px);
  min-height: clamp(260px, 30vw, 330px);
  display: flex; flex-direction: column;
  will-change: transform, opacity;
}
.lex-card header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 22px;
}
.lc-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase;
}
.lc-cite { font-family: var(--mono); font-size: 10px; color: inherit; opacity: 0.55; }
.lex-card--book {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-dim);
}
.lex-card--book .lc-tag { color: var(--ink-faint); }
.lex-card--book .lc-body {
  font-family: var(--mono); font-size: clamp(13.5px, 1.3vw, 15.5px);
  line-height: 1.8;
}
.lex-card--mine {
  background: linear-gradient(160deg, #f0560f, #c93e07);
  color: #fdf4ea;
  box-shadow: 0 24px 60px -22px rgba(201, 62, 7, 0.55);
}
.lex-card--mine .lc-tag { color: rgba(253, 244, 234, 0.8); }
.lex-card--mine .lc-body {
  font-family: var(--display); font-weight: 520;
  font-size: clamp(17px, 1.7vw, 21px); line-height: 1.45;
  letter-spacing: -0.008em;
}
.lex-card--mine .lc-body strong { font-style: italic; font-weight: 700; }
.lc-sign {
  margin-top: auto; padding-top: 18px;
  font-family: var(--display); font-style: italic; font-size: 16px;
  color: rgba(253, 244, 234, 0.75);
}
.lex-nav { display: flex; gap: 10px; }
.lex-arrow {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 18px; color: var(--ink);
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.lex-arrow:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); transform: translateY(-2px); }

.lex-origin {
  margin-top: clamp(48px, 7vh, 80px);
  padding: clamp(24px, 3vw, 40px);
  border: 1px dashed var(--line-strong); border-radius: 6px;
  color: var(--ink-dim); font-size: 15px; line-height: 1.75;
  max-width: 1480px;
}
.lo-tag {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 12px;
}

/* ── Beyond teaser (index) ───────────────────────── */
.beyond-teaser { padding-top: clamp(70px, 9vh, 110px); padding-bottom: clamp(70px, 9vh, 110px); }
.bt-card {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: clamp(34px, 5vw, 64px);
  display: grid; grid-template-columns: 1fr auto;
  gap: clamp(24px, 4vw, 60px); align-items: center;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(235, 77, 14, 0.07), transparent 55%),
    var(--paper-2);
  text-decoration: none;
  transition: border-color 0.35s, transform 0.45s var(--ease-out);
}
.bt-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.bt-quote {
  font-family: var(--display); font-weight: 560;
  font-size: clamp(20px, 2.5vw, 31px); line-height: 1.35;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.bt-quote em { font-style: italic; color: var(--accent-deep); }
.bt-meta {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
  text-align: right;
}
.bt-meta .section-tag { margin-bottom: 0; }
.bt-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 5px;
  transition: color 0.3s, border-color 0.3s;
}
.bt-card:hover .bt-link { color: var(--accent-deep); border-color: var(--accent); }

/* ── Night bookend (dark background behind the sleek footer) ── */
.nightband {
  background: var(--night);
  color: var(--cream);
}

/* ── sleek footer — shared CTA bookend (index · beyond · case) ── */
.sfoot {
  max-width: 1480px; margin: 0 auto;
  padding: clamp(64px, 11vh, 140px) clamp(16px, 3vw, 40px) 0;
}
.sfoot-brief { padding-bottom: clamp(34px, 5vh, 58px); }
.sfoot-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 22px;
}
.sfoot-head {
  font-family: var(--display); font-weight: 760;
  font-size: clamp(38px, 6.6vw, 96px);
  line-height: 0.97; letter-spacing: -0.03em; margin: 0;
}
.sfoot-head em { font-style: italic; color: var(--accent); }
/* the CTA ledger — contact as a spec sheet, not a button stack */
.sfoot-ledger { border-top: 1px solid var(--nline); margin-bottom: clamp(44px, 7vh, 78px); }
.sl-row {
  display: grid; grid-template-columns: minmax(130px, 220px) 1fr auto;
  align-items: baseline; gap: clamp(14px, 3vw, 40px);
  padding: clamp(18px, 2.6vw, 26px) 6px;
  border-bottom: 1px solid var(--nline);
  text-decoration: none;
  transition: padding-left 0.35s var(--ease-out);
}
.sl-k {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cream-faint); transition: color 0.3s;
}
.sl-v {
  font-family: var(--display); font-weight: 640;
  font-size: clamp(17px, 2.4vw, 28px); letter-spacing: -0.015em;
  color: var(--cream); overflow-wrap: anywhere; transition: color 0.3s;
}
.sl-a { color: var(--cream-faint); transition: color 0.3s, transform 0.35s var(--ease-out); }
.sl-row:hover { padding-left: 16px; }
.sl-row:hover .sl-k { color: var(--cream-dim); }
.sl-row:hover .sl-v { color: var(--accent); }
.sl-row:hover .sl-a { color: var(--accent); transform: translate(3px, -3px); }
.sfoot-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 22px 0 30px; border-top: 1px solid var(--nline);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--cream-faint);
}
.sfoot-brand {
  font-family: var(--display); font-weight: 800; font-size: 21px;
  letter-spacing: -0.02em; color: var(--cream); text-decoration: none;
  text-transform: none;
}
.sfoot-brand .dot { color: var(--accent); }
.sfoot-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.sfoot-nav a { color: var(--cream-dim); text-decoration: none; transition: color 0.3s; }
.sfoot-nav a:hover { color: var(--accent); }
.sfoot-fine { color: var(--cream-faint); }
@media (max-width: 760px) {
  .sl-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .sl-k { grid-column: 1 / -1; }
  .sfoot-meta { justify-content: center; text-align: center; gap: 14px; }
}

/* ── contact CTA after every chat reply — matches the followup pills, accent-tinted ── */
.cp-followups .fu-cta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent-deep);
  background: rgba(235, 77, 14, 0.06);
  text-decoration: none; transition: all 0.25s;
}
.cp-followups .fu-cta:hover { background: var(--accent); color: var(--paper); }

/* ════════════════════════════════════════════════
   CHAT PAGE
   ════════════════════════════════════════════════ */
.chatpage {
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding: calc(var(--nav-h) + 30px) var(--pad) 130px;
  max-width: 880px; margin: 0 auto;
}
.cpg-welcome { margin-bottom: clamp(30px, 5vh, 56px); }
.cpg-title {
  font-family: var(--display); font-weight: 720;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 1; letter-spacing: -0.025em;
  margin: 14px 0 18px;
}
.cpg-title em { font-style: italic; color: var(--accent); }
.cpg-sub { color: var(--ink-dim); font-size: 15px; line-height: 1.65; max-width: 52ch; margin-bottom: 26px; }
.cpg-chips { display: flex; flex-wrap: wrap; gap: 9px; }

/* grouped starter prompts */
.cpg-sugg {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2.2vw, 24px);
}
@media (max-width: 1040px) { .cpg-sugg { grid-template-columns: repeat(2, 1fr); } }
.sg-col { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.sg-k {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-deep);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 9px;
}
.sg-k::before { content: ""; width: 18px; height: 1px; background: var(--accent); opacity: 0.7; }
.sg-col button, .sg-col .sg-link {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.45;
  text-align: left; text-decoration: none;
  padding: 10px 14px; min-height: 44px;   /* touch target */
  display: flex; align-items: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--ink-dim);
  transition: border-color 0.25s, color 0.25s, background 0.25s, transform 0.3s var(--ease-out);
}
.sg-col button:hover, .sg-col .sg-link:hover {
  border-color: var(--accent); color: var(--accent-deep);
  background: rgba(235, 77, 14, 0.06);
  transform: translateX(3px);
}
/* the contact column reads as the action group */
.sg-col--cta .sg-link { justify-content: space-between; gap: 10px; border-color: var(--accent); color: var(--accent-deep); }
.sg-col--cta .sg-k { color: var(--accent); }
.cpg-chips button, .cp-followups button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.03em;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-dim);
  transition: all 0.25s;
}
.cpg-chips button:hover, .cp-followups button:hover {
  border-color: var(--accent); color: var(--accent-deep);
  background: rgba(235, 77, 14, 0.07);
}

.cpg-stream { display: flex; flex-direction: column; gap: clamp(34px, 5vh, 54px); }
.cpg-entry { animation: entryIn 0.5s var(--ease-out); }
@keyframes entryIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.entry-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px;
}
.entry-label .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
.entry-q {
  font-family: var(--display); font-weight: 680;
  font-size: clamp(23px, 3.4vw, 38px); line-height: 1.08;
  letter-spacing: -0.02em;
}
.entry-body { max-width: 64ch; }
.entry-body .lead {
  font-family: var(--display); font-weight: 560;
  font-size: clamp(17px, 1.9vw, 21px); line-height: 1.45;
  letter-spacing: -0.008em;
  margin-bottom: 14px;
}
.entry-body p { color: var(--ink-dim); font-size: 15px; line-height: 1.75; margin-bottom: 12px; }
.entry-body strong { color: var(--accent-deep); font-weight: 550; }
.entry-body a { color: var(--accent-deep); }
.cp-followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.fu-label {
  width: 100%; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
}
.cpg-thinking {
  display: inline-flex; gap: 6px; align-items: center;
  font-family: var(--display); font-style: italic; font-size: 18px;
  color: var(--ink-faint);
}
.cpg-thinking i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); display: block;
  animation: typeDot 1.2s ease-in-out infinite;
}
.cpg-thinking i:nth-child(3) { animation-delay: 0.15s; }
.cpg-thinking i:nth-child(4) { animation-delay: 0.3s; }
@keyframes typeDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.cpg-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  padding: 16px var(--pad) 22px;
  background: linear-gradient(to top, var(--paper) 65%, transparent);
}
.cpg-bar-inner {
  max-width: 760px; margin: 0 auto;
  display: flex; gap: 10px; align-items: center;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 8px 8px 22px;
  box-shadow: 0 18px 50px -18px rgba(22, 20, 16, 0.35);
  transition: border-color 0.3s;
}
.cpg-bar-inner:focus-within { border-color: var(--accent); }
.cpg-bar input {
  flex: 1; min-width: 0;
  background: transparent; border: 0; outline: none;
  font-size: 15px; color: var(--ink); height: 44px;
}
.cpg-bar input::placeholder { color: var(--ink-faint); }
.cpg-bar button {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: var(--paper);
  font-size: 18px;
  transition: opacity 0.25s, background 0.3s, transform 0.3s var(--ease-out);
}
.cpg-bar button:disabled { opacity: 0.35; cursor: default; }
.cpg-bar button:not(:disabled):hover { background: var(--ink); transform: translateY(-2px); }
/* while a reply is in flight the send button becomes a stop button */
.cpg-bar button.is-stop { background: var(--ink); font-size: 13px; }
.cpg-bar button.is-stop:not(:disabled):hover { background: var(--accent-deep); transform: none; }

/* per-question edit affordance — refill the input with a sent prompt */
.q-edit {
  margin-left: 10px; padding: 2px 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); border: 1px solid var(--line); border-radius: 999px;
  transition: color 0.25s, border-color 0.25s;
}
.q-edit:hover { color: var(--accent-deep); border-color: var(--accent); }

/* ════════════════════════════════════════════════
   BEYOND PAGE — day half · night half
   ════════════════════════════════════════════════ */
.bp-hero {
  position: relative;
  padding: calc(var(--nav-h) + clamp(40px, 9vh, 90px)) var(--pad) clamp(40px, 7vh, 70px);
  max-width: 1480px; margin: 0 auto;
}
/* stacking context so the gamer can emerge from BEHIND the name, then rise above */
.bp-intro { position: relative; z-index: 6; }
.bp-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(38px, 6.4vw, 88px);
  line-height: 1.02; letter-spacing: -0.028em;
}
.bp-title em { font-style: normal; color: var(--accent); }
/* secondary title — reads as line 2 of the headline: same display font, weight,
   tracking and rhythm as .bp-title, just a step smaller. Swaps pro/personal with
   the switch. No color set: inherits .bp-hero ink (paper) / cream (night). */
.bp-tagline {
  margin-top: 16px;
  font-family: var(--display); font-weight: 400; font-style: normal;
  font-size: clamp(38px, 6.4vw, 88px);   /* same size as .bp-title — reads as line 2 */
  line-height: 1.02; letter-spacing: -0.028em;
  max-width: 24ch;
}
.bp-tagline em { font-style: normal; color: var(--accent); }
.bp-sub { margin-top: 34px; color: var(--ink-dim); font-size: 15.5px; line-height: 1.7; max-width: 54ch; }
@media (min-width: 761px) {
  .bp-sub { margin-top: 48px; }   /* desktop: more air under the title block */
}

/* inner box mirrors .bp-hero (max-width includes --pad) so headings align */
.bhalf { padding: clamp(70px, 10vh, 120px) 0; }
.bhalf > .bh-inner { max-width: 1480px; margin: 0 auto; padding: 0 var(--pad); }
.bhalf--night { background: var(--night); color: var(--cream); }
.bh-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent-deep);
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.bhalf--night .bh-kicker { color: var(--accent); }
.bh-kicker::before { content: ""; width: 34px; height: 1px; background: var(--accent); opacity: 0.7; }
.bh-title {
  font-family: var(--display); font-weight: 680;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1.06; letter-spacing: -0.02em;
  max-width: 24ch; margin-bottom: 14px;
}
.bh-title em { font-style: italic; color: var(--accent-deep); }
.bhalf--night .bh-title em { color: var(--accent); }
.bh-lede { color: var(--ink-dim); font-size: 15px; line-height: 1.7; max-width: 58ch; margin-bottom: clamp(34px, 5vh, 54px); }
.bhalf--night .bh-lede { color: var(--cream-dim); }

.bh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bh-card {
  border: 1px solid var(--line); border-radius: 6px;
  padding: clamp(22px, 2.6vw, 36px);
  background: var(--paper-2);
  transition: border-color 0.35s, transform 0.45s var(--ease-out);
}
.bh-card:hover { border-color: var(--line-strong); transform: translateY(-4px); }
.bhalf--night .bh-card { border-color: var(--nline); background: var(--night-2); }
.bhalf--night .bh-card:hover { border-color: var(--nline-strong); }
.bh-card-kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent-deep);
  display: block; margin-bottom: 14px;
}
.bhalf--night .bh-card-kicker { color: var(--accent); }
.bh-card h3 { font-family: var(--display); font-weight: 640; letter-spacing: -0.015em; font-size: clamp(20px, 2.1vw, 26px); margin-bottom: 12px; }
.bh-card p { font-size: 14px; line-height: 1.65; color: var(--ink-dim); }
.bhalf--night .bh-card p { color: var(--cream-dim); }

.bh-list { list-style: none; margin-top: 16px; }
.bh-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px; color: var(--ink-dim);
}
.bhalf--night .bh-list li { border-color: var(--nline); color: var(--cream-dim); }
.bh-list li:last-child { border-bottom: 0; }
.bh-list .li-name { color: var(--ink); font-weight: 500; }
.bhalf--night .bh-list .li-name { color: var(--cream); }
.bh-list .li-meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-faint); white-space: nowrap; }
.bhalf--night .bh-list .li-meta { color: var(--cream-faint); }

.bh-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.bhalf--night .chip { border-color: var(--nline); color: var(--cream-dim); background: rgba(240, 236, 225, 0.03); }
.bhalf--night .chip:hover { border-color: var(--accent); color: var(--cream); }

.bh-quote {
  grid-column: 1 / -1;
  font-family: var(--display); font-weight: 560;
  letter-spacing: -0.012em;
  font-size: clamp(20px, 2.6vw, 31px); line-height: 1.38;
  text-align: center; text-wrap: balance;
  padding: clamp(28px, 5vh, 50px) clamp(20px, 6vw, 80px) 4px;
}
.bh-quote em { font-style: italic; color: var(--accent-deep); }
.bhalf--night .bh-quote em { color: var(--accent); }

/* ── Beyond easter-egg · the gamer who fights the switch ── */
.gamer {
  position: absolute; z-index: 5;            /* sits behind the name while emerging */
  width: 34px; height: 42px;
  left: 0; top: 0;
  display: none; opacity: 0;
  pointer-events: none;
  image-rendering: pixelated;
  will-change: left, top, opacity;
}
/* a glasses-wearing dev in a denim jacket — echoes the sprite sheet */
.gamer .g-head {            /* face */
  position: absolute; left: 9px; top: 5px;
  width: 16px; height: 14px; border-radius: 6px;
  background: #f1d2bb;
}
.gamer .g-head::before {    /* messy dark hair */
  content: ""; position: absolute; left: -2px; top: -3px;
  width: 20px; height: 10px;
  background: #3a2a22; border-radius: 8px 9px 4px 4px;
  box-shadow: 2px -2px 0 #3a2a22, -2px -1px 0 #3a2a22;
}
.gamer .g-head::after {     /* glasses */
  content: ""; position: absolute; left: 1px; top: 7px;
  width: 14px; height: 3px;
  border: 1.4px solid #211a14; border-radius: 2px;
  background: rgba(178,216,226,0.55);
}
.gamer .g-scarf {           /* teal scarf */
  position: absolute; left: 8px; top: 17px;
  width: 18px; height: 4px; border-radius: 2px;
  background: #2f9e8f;
}
.gamer .g-body {            /* denim jacket */
  position: absolute; left: 7px; top: 19px;
  width: 20px; height: 15px; border-radius: 5px 5px 4px 4px;
  background: #3f5d86;
}
.gamer .g-arm {
  position: absolute; left: 23px; top: 21px;
  width: 9px; height: 4px; border-radius: 3px;
  background: #34507a; transform-origin: left center;
}
.gamer .g-controller {      /* controller in hand */
  position: absolute; left: 24px; top: 25px;
  width: 11px; height: 6px; border-radius: 2px; background: var(--ink);
}
.gamer .g-controller::after {
  content: ""; position: absolute; right: 1.5px; top: 1.5px;
  width: 2px; height: 2px; border-radius: 50%; background: var(--accent);
}
.gamer .g-leg {
  position: absolute; top: 33px; width: 5px; height: 8px;
  border-radius: 2px 2px 0 0; background: #2b2f3a;   /* jeans */
  transform-origin: top center;
}
.gamer .g-leg::after {      /* red-soled shoe */
  content: ""; position: absolute; left: -1px; bottom: -2px;
  width: 7px; height: 3px; border-radius: 2px; background: #d8442a;
}
.gamer .g-leg.l { left: 10px; }
.gamer .g-leg.r { left: 18px; }

.gamer.is-run { animation: gBob 0.26s linear infinite; }
.gamer.is-run .g-leg.l { animation: gLegA 0.26s linear infinite; }
.gamer.is-run .g-leg.r { animation: gLegB 0.26s linear infinite; }
@keyframes gLegA { 0%,100% { transform: rotate(26deg); } 50% { transform: rotate(-26deg); } }
@keyframes gLegB { 0%,100% { transform: rotate(-26deg); } 50% { transform: rotate(26deg); } }
@keyframes gBob { 0%,100% { margin-top: 0; } 50% { margin-top: -2px; } }

/* clambering up out of the letters — arms reaching, legs braced */
.gamer.is-climb .g-arm { transform: rotate(-94deg); }
.gamer.is-climb .g-leg.l { transform: rotate(22deg); }
.gamer.is-climb .g-leg.r { transform: rotate(-16deg); }

/* mid-air tuck — leaping onto the switch */
.gamer.is-jump .g-leg.l { transform: rotate(40deg); }
.gamer.is-jump .g-leg.r { transform: rotate(-32deg); }
.gamer.is-jump .g-arm { transform: rotate(-42deg); }

/* lying down on the switch, out cold */
.gamer.is-lie { transform: rotate(90deg); }
.gamer.is-lie .g-head::after { background: transparent; }

.gamer .g-spark {
  position: absolute; left: 27px; top: 2px;
  font-family: var(--mono); font-size: 9px; color: var(--accent);
  opacity: 0; white-space: nowrap;
}
.lightswitch.is-shoved { animation: lsShove 0.3s ease-in-out infinite; }
@keyframes lsShove { 0%,100% { transform: translateY(0); } 50% { transform: translateY(2px); } }

/* ── Page veil — seamless page transitions ───────── */
/* html.veiling is set by an inline <head> script when arriving mid-transition,
   so the veil covers from the very first paint (no content flash) */
html.veiling .page-veil { transform: translateY(0); }
html.veiling .page-veil .pv-mark { opacity: 1; }
html.veiling .loader, html.no-loader .loader { display: none; }
.page-veil {
  position: fixed; inset: 0; z-index: 460;
  background: var(--night);
  display: grid; place-items: center;
  transform: translateY(101%);
  pointer-events: none;
  will-change: transform;
}
.page-veil .pv-mark {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(26px, 3.2vw, 44px); letter-spacing: -0.025em;
  color: var(--cream);
  opacity: 0;
}
.page-veil .pv-mark .dot { color: var(--accent); }

/* ── Beyond — light switch + day/night modes ─────── */
.bp-hero {
  position: relative;                       /* origin for the absolutely-positioned gamer */
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: clamp(24px, 5vw, 80px);
  transition: color 0.5s;
}
/* the name block sits above the gamer so it can climb out from BEHIND the letters */
.bp-intro { position: relative; z-index: 2; }
.bswitch {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  justify-self: end;
}
.ls-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
  transition: color 0.35s;
}
.ls-label.is-active { color: var(--accent-deep); }
.lightswitch {
  position: relative;
  width: 74px; height: 128px;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  box-shadow:
    inset 0 2px 6px rgba(22, 20, 16, 0.12),
    0 14px 34px -14px rgba(22, 20, 16, 0.35);
  transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}
.lightswitch::before, .lightswitch::after {
  /* faceplate screws */
  content: ""; position: absolute; left: 50%;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-strong);
  transform: translateX(-50%);
  transition: background 0.5s;
}
.lightswitch::before { top: 7px; }
.lightswitch::after { bottom: 7px; }
.ls-knob {
  position: absolute; left: 9px; right: 9px; top: 16px;
  height: 44px; border-radius: 11px;
  background: linear-gradient(180deg, #fbf8f0, #d9d4c6);
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 12px -4px rgba(22, 20, 16, 0.4), inset 0 -3px 0 rgba(22, 20, 16, 0.14);
  transition: transform 0.45s var(--ease-snap), background 0.5s, box-shadow 0.5s;
}
.ls-knob::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 22px; height: 3px; border-radius: 99px;
  background: rgba(22, 20, 16, 0.25);
  transform: translate(-50%, -50%);
  transition: background 0.5s;
}
.lightswitch[aria-checked="false"] .ls-knob { transform: translateY(52px); }
.ls-hint {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--ink-faint); text-transform: uppercase;
  transition: color 0.5s;
}

/* night mode — lights out */
body.is-night { background: var(--night); }
body.is-night .bp-hero { color: var(--cream); }
body.is-night .bp-title,
body.is-night .bp-tagline { color: var(--cream); }   /* night title + secondary title go white */
body.is-night .bp-sub { color: var(--cream-dim); }
body.is-night .bp-title em,
body.is-night .bp-tagline em { color: var(--accent); }
body.is-night .nav.is-scrolled { background: rgba(20, 18, 14, 0.82); border-bottom-color: var(--nline); }
body.is-night .nav-links a { color: var(--cream-dim); }
body.is-night .nav-links a:hover { color: var(--cream); }
body.is-night .brand-mark { color: var(--cream); }
body.is-night .nav-time { color: var(--cream-faint); }
body.is-night .nav-burger { border-color: var(--nline-strong); }
body.is-night .nav-burger span { background: var(--cream); }
/* personal (night) side: invert the Get-in-touch pill so it reads as switched, not blended into the dark nav */
body.is-night .nav-ai { background: var(--cream); color: var(--night); }
body.is-night .nav-ai:hover { background: var(--accent); color: var(--paper); }
body.is-night .ls-label { color: var(--cream-faint); }
body.is-night .ls-label.is-active { color: var(--accent); }
body.is-night .ls-hint { color: var(--cream-faint); }
body.is-night .lightswitch {
  background: var(--night-2);
  border-color: var(--nline-strong);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 28px -6px rgba(235, 77, 14, 0.35);
}
body.is-night .lightswitch::before, body.is-night .lightswitch::after { background: var(--nline-strong); }
body.is-night .ls-knob {
  background: linear-gradient(180deg, #f0560f, #c93e07);
  border-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.6), 0 0 18px -2px rgba(235, 77, 14, 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
body.is-night .ls-knob::after { background: rgba(253, 244, 234, 0.55); }

/* mode visibility — JS crossfades, CSS hides the inactive half */
.bhalf { transition: opacity 0.35s ease; }
body:not(.is-night) .bhalf--night { display: none; }
body.is-night .bhalf--day { display: none; }

/* ── Beyond · player profile — XP bars ───────────── */
.xp { margin-top: 18px; }
.xp-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 5px 12px; align-items: baseline;
  padding: 10px 0 12px;
  border-bottom: 1px dashed var(--nline);
}
.xp-row:last-child { border-bottom: 0; }
.xp-name { font-size: 13.5px; font-weight: 500; color: var(--cream); }
.xp-val { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--cream-faint); white-space: nowrap; }
.xp-bar {
  grid-column: 1 / -1;
  height: 6px; border-radius: 99px;
  background: rgba(240, 236, 225, 0.08);
  overflow: hidden;
}
.xp-fill {
  display: block; height: 100%; width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, #c93e07, #f0560f 60%, #ffb36b);
  box-shadow: 0 0 10px -2px rgba(235, 77, 14, 0.6);
}

/* achievements */
.ach-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ach {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em;
  color: var(--cream-dim);
  padding: 10px 16px;
  border: 1px dashed rgba(235, 77, 14, 0.45);
  border-radius: 10px;
  background: rgba(235, 77, 14, 0.07);
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease-out);
}
.ach:hover { border-color: var(--accent); color: var(--cream); transform: translateY(-2px); }

/* achievement toast */
.ach-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translateX(-50%) translateY(90px);
  opacity: 0;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  color: var(--cream);
  background: var(--night-2);
  border: 1px solid rgba(235, 77, 14, 0.55);
  border-radius: 999px;
  padding: 13px 22px;
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, 0.7), 0 0 24px -6px rgba(235, 77, 14, 0.5);
  pointer-events: none;
  white-space: nowrap;
}

/* ── Case study template ─────────────────────────── */
.case {
  max-width: 1100px; margin: 0 auto;
  padding: calc(var(--nav-h) + clamp(36px, 7vh, 70px)) var(--pad) clamp(70px, 10vh, 110px);
}
.case-title {
  font-family: var(--display); font-weight: 720;
  font-size: clamp(34px, 5.6vw, 72px);
  line-height: 1; letter-spacing: -0.025em;
  margin: 14px 0 16px;
}
.case-sub { color: var(--ink-dim); font-size: 16px; line-height: 1.7; max-width: 62ch; }
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-block: 1px solid var(--line);
  margin-top: clamp(26px, 4vh, 40px);
}
.cm-item { padding: 16px 18px 16px 0; }
.cm-item + .cm-item { padding-left: 18px; border-left: 1px solid var(--line); }
.cm-k {
  display: block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 6px;
}
.cm-v { font-size: 13.5px; font-weight: 550; color: var(--ink); }

.case-cover {
  margin: clamp(28px, 5vh, 48px) 0 clamp(36px, 6vh, 60px);
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
}
/* section sub-pages drop the cover — restore the same gap the cover normally
   provides between the meta bar and the first content block */
.case.is-section #csBlocks { padding-top: clamp(36px, 6vh, 60px); }
.case-cover img { width: 100%; display: block; }

.cb-block {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 16px 48px;
  margin-bottom: clamp(34px, 6vh, 56px);
}
.cb-block > h2 {
  font-family: var(--mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-deep); padding-top: 5px;
}
.cb-body p { font-size: 15.5px; line-height: 1.75; color: var(--ink-dim); margin-bottom: 12px; }
.cb-body p:last-child { margin-bottom: 0; }
.cb-body strong { color: var(--accent-deep); font-weight: 550; }
.cb-did { list-style: none; }
.cb-did li {
  padding: 11px 0; font-size: 14.5px; color: var(--ink-dim);
  border-bottom: 1px dashed var(--line);
  display: flex; gap: 12px; align-items: baseline;
}
.cb-did li::before { content: "→"; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.cb-did li:last-child { border-bottom: 0; }

.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.case-stats .stat { background: var(--night); }

.case-note {
  border: 1px dashed var(--line-strong); border-radius: 6px;
  padding: clamp(22px, 3vw, 34px);
  font-family: var(--display); font-weight: 560;
  font-size: clamp(17px, 2vw, 23px); line-height: 1.45;
  letter-spacing: -0.008em;
  margin-bottom: clamp(40px, 7vh, 64px);
}
.case-note em { font-style: normal; color: var(--accent-deep); }
.cn-tag {
  display: block; font-family: var(--mono); font-weight: 400; font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 12px;
}

.case-next {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border-top: 1px solid var(--line-strong);
  padding-top: 28px;
  text-decoration: none;
  transition: transform 0.4s var(--ease-out);
}
.case-next:hover { transform: translateX(6px); }
.cnx-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }
.cnx-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 3.2vw, 42px); letter-spacing: -0.02em;
  transition: color 0.3s;
}
.case-next:hover .cnx-title { color: var(--accent-deep); }
.cnx-arrow { font-size: clamp(22px, 3vw, 36px); color: var(--accent); }

/* section sub-page footer: ← back to the study / next section → */
.cs-secnav { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 32px); }
.cs-secnav.is-single { grid-template-columns: 1fr; }
.cs-secnav .cnx-title { font-size: clamp(20px, 2.6vw, 34px); }
.csn-back { justify-content: flex-start; }
.csn-back:hover { transform: translateX(-6px); }   /* backward slide — mirrors the ← */
@media (max-width: 760px) {
  .cs-secnav { grid-template-columns: 1fr; }
}

/* ── Case study · modular blocks ─────────────────── */
.cb-body .cb-h {
  font-family: var(--display); font-weight: 640;
  font-size: clamp(18px, 2vw, 23px); letter-spacing: -0.015em;
  color: var(--ink); margin-bottom: 12px;
}
.cb-body .cb-intro { font-size: 15.5px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 16px; }
/* the same intro under wide blocks (swot / compare / palette / galleries) — consistent gap
   between the block title, its description, and the content below */
.cb-wide .cb-intro { font-size: 15.5px; line-height: 1.7; color: var(--ink-dim); margin: -6px 0 24px; max-width: 62ch; }

/* cards — personas, research methods, principles */
.cb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.cb-card {
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper-2); padding: 18px 18px 20px;
}
.cb-card-tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-deep);
  margin-bottom: 10px;
}
.cb-card h4 { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; margin-bottom: 7px; color: var(--ink); }
.cb-card p { font-size: 13.5px; line-height: 1.6; color: var(--ink-dim); }

/* numbered steps */
.cb-steps { list-style: none; counter-reset: cbstep; display: grid; gap: 2px; }
.cb-steps li {
  counter-increment: cbstep;
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 16px;
  padding: 14px 0; border-bottom: 1px dashed var(--line);
}
.cb-steps li:last-child { border-bottom: 0; }
.cb-steps li::before {
  content: counter(cbstep, decimal-leading-zero);
  grid-row: 1 / span 2; align-self: start;
  font-family: var(--mono); font-size: 12px; color: var(--accent);
}
.cb-step-t { font-weight: 560; font-size: 15px; color: var(--ink); }
.cb-step-b { font-size: 13.5px; line-height: 1.6; color: var(--ink-dim); }

/* wide blocks (gallery / figure / split) break the label gutter and run full width */
.cb-wide, .cb-figure, .cb-split { margin-bottom: clamp(34px, 6vh, 56px); }
.cb-eyebrow {
  display: block; font-family: var(--mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-deep); margin-bottom: 10px;
}
.cb-wide-h {
  font-family: var(--display); font-weight: 640;
  font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.02em;
  color: var(--ink); margin-bottom: 20px;
}
.cb-split .cb-wide-h { margin-bottom: 14px; }

/* image figures + galleries */
.cb-figure, .cb-gallery figure, .cb-split-media {
  margin: 0; border: 1px solid var(--line-strong); border-radius: 8px;
  overflow: hidden; background: var(--paper-2);
}
/* standalone figures keep the block rhythm (the reset above zeroed it) */
figure.cb-figure { margin: 0 0 clamp(34px, 6vh, 56px); }
/* "plate" figures: diagram crops presented centered on a padded white plate,
   at natural size — never stretched full-bleed, never clipped */
.cb-figure.is-plate, .cb-gallery.is-plates figure { background: #fff; }
.cb-figure.is-plate img {
  width: auto; max-width: 100%; max-height: 720px;
  margin: 0 auto; padding: clamp(18px, 3vw, 36px);
}
.cb-gallery.is-plates img {
  width: auto; max-width: 100%;
  margin: 0 auto; padding: clamp(14px, 2.2vw, 26px);
}
.cb-figure img, .cb-gallery img, .cb-split-media img { width: 100%; display: block; }
.cb-figure figcaption, .cb-gallery figcaption, .cb-split-media figcaption {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--ink-faint); padding: 10px 14px; border-top: 1px solid var(--line);
}
.cb-gallery { display: grid; gap: 14px; }
.cb-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cb-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── SWOT board — native 2×2 quadrants ── */
.cb-swot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swot-q { border: 1px solid var(--line-strong); border-radius: 12px; padding: 20px 22px; background: var(--paper-2); }
.swot-q h4 {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 14px;
}
.swot-q h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.swot-q--s h4, .swot-q--o h4 { color: var(--accent-deep); }
.swot-q--s h4::before, .swot-q--o h4::before { background: var(--accent); }
.swot-q--w h4, .swot-q--t h4 { color: var(--ink-faint); }
.swot-q--w h4::before, .swot-q--t h4::before { background: var(--ink-faint); }
.swot-q ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.swot-q li { font-size: 13.5px; line-height: 1.55; color: var(--ink-dim); padding-left: 14px; position: relative; }
.swot-q li::before { content: "·"; position: absolute; left: 2px; color: var(--ink-faint); }

/* ── feature-comparison table ── */
.cb-tablewrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper-2); }
.cb-compare { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13px; }
.cb-compare th, .cb-compare td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: center; }
.cb-compare thead th {
  font-family: var(--mono); font-weight: 500; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint);
  border-bottom: 1px solid var(--line-strong);
}
.cb-compare th:first-child, .cb-compare td:first-child { text-align: left; }
.cb-compare td:first-child { font-weight: 550; color: var(--ink); }
.cb-compare tbody tr:last-child td { border-bottom: 0; }
.cmp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-dim); }
.cmp-dot--part { background: transparent; border: 1.5px solid var(--ink-dim); }
.cb-compare .is-hero { background: rgba(235, 77, 14, 0.06); }
.cb-compare thead th.is-hero { color: var(--accent-deep); }
.cb-compare .is-hero .cmp-dot { background: var(--accent); }
.cmp-note { margin-top: 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-faint); }
.cmp-note i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-dim); margin-right: 7px; }

/* ── colour palette chips ── */
.cb-palette { display: grid; gap: 28px; }
.pal-group h4 {
  font-family: var(--mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px;
}
.pal-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.pal-chip { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.pal-chip i { display: block; height: 56px; border-bottom: 1px solid var(--line); }
.pal-chip .pal-n { display: block; padding: 9px 11px 2px; font-size: 12px; font-weight: 550; color: var(--ink); }
.pal-chip .pal-h { display: block; padding: 0 11px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; color: var(--ink-faint); }

/* ── scrollable full-page website render ── */
.cb-scrollframe {
  border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden;
  background: #0a0908;
}
.cb-scrollframe .sf-viewport {
  max-height: 640px; overflow-y: auto; overscroll-behavior: contain;
}
.cb-scrollframe img { width: 100%; display: block; }
.cb-scrollframe .sf-bar {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--ink-faint);
  border-top: 1px solid var(--line); background: var(--paper-2);
}

/* ── visual-design showcases (native, no PDF renders) ── */
.vd-plate {
  background: var(--paper-2); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: clamp(22px, 4vw, 40px);
}
.vd-specimen { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.sp-aa { font-family: 'Montserrat', Inter, system-ui, sans-serif; font-weight: 600; font-size: clamp(72px, 9vw, 124px); line-height: 1; color: var(--ink); }
.sp-name { font-size: 15px; line-height: 1.65; color: var(--ink-dim); margin-bottom: 16px; max-width: 46ch; }
.sp-weights { display: flex; gap: clamp(14px, 2.5vw, 28px); flex-wrap: wrap; font-family: 'Montserrat', Inter, system-ui, sans-serif; font-size: 19px; color: var(--ink); }
.sp-weights small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.vd-scale { display: flex; align-items: flex-end; gap: clamp(12px, 2.4vw, 28px); flex-wrap: wrap; }
.sc-step { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sc-box { background: var(--ink); border-radius: 3px; }
.sc-l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-faint); white-space: nowrap; }
.vd-grids { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gd { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--paper-2); }
.gd-box { height: 96px; display: grid; gap: 6px; margin-bottom: 10px; }
.gd-box i { background: rgba(235, 77, 14, 0.13); border-radius: 2px; }
.gd--cols .gd-box { grid-template-columns: repeat(4, 1fr); }
.gd--rows .gd-box { grid-template-rows: repeat(4, 1fr); }
.gd--grid .gd-box {
  background-image:
    repeating-linear-gradient(to right, rgba(235, 77, 14, 0.16) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(to bottom, rgba(235, 77, 14, 0.16) 0 1px, transparent 1px 12px);
  border-radius: 4px;
}
.gd-l { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); text-align: center; display: block; }
.vd-effects { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: clamp(14px, 2.4vw, 24px); }
.fx-chip {
  background: #fff; border-radius: 12px; height: 92px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim);
}
.fx-chip--none { border: 1px solid var(--line); }
.fx-chip--light { box-shadow: 0 6px 18px rgba(22, 20, 16, 0.10); }
.fx-chip--heavy { box-shadow: 0 16px 38px rgba(22, 20, 16, 0.18); }
.fx-chip--stroke { border: 2px solid var(--ink); }
@media (max-width: 760px) {
  .vd-specimen { grid-template-columns: 1fr; }
  .vd-grids { grid-template-columns: 1fr; }
}

/* split — text beside media */
.cb-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.cb-split.is-flip .cb-split-text { order: 2; }
.cb-split-text p { font-size: 15px; line-height: 1.7; color: var(--ink-dim); margin-bottom: 12px; }
.cb-split-text p:last-child { margin-bottom: 0; }
.cb-split-text strong { color: var(--accent-deep); font-weight: 550; }

/* resource links */
.cb-links { display: flex; flex-wrap: wrap; gap: 10px; }
.cb-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 16px; transition: border-color 0.25s, color 0.25s, transform 0.25s var(--ease-out);
}
.cb-link span { color: var(--accent); }
.cb-link:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-2px); }

/* "to be added later" placeholder slot */
.cb-todo {
  border: 1px dashed var(--line-strong); border-radius: 8px;
  padding: 20px 22px; background: var(--paper-2);
}
.cb-todo-tag {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint);
  padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 12px;
}
.cb-todo p { font-size: 14px; line-height: 1.6; color: var(--ink-dim); }

.cn-cite { display: block; margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-faint); font-style: normal; }

/* ── case section index — doorways to the section sub-pages ── */
.cb-toc { margin: clamp(34px, 6vh, 64px) 0; }
.cb-toc .cb-eyebrow { display: block; margin-bottom: 12px; }
.cb-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toc-li { border-bottom: 1px solid var(--line); }
.toc-item {
  display: flex; align-items: flex-start; gap: clamp(16px, 3vw, 34px);
  width: 100%;
  padding: clamp(24px, 3.4vw, 40px) 6px;
  text-decoration: none; color: var(--ink);
  background: none; border: 0; text-align: left; font: inherit; cursor: pointer;
  transition: padding-left 0.35s var(--ease-out), color 0.3s, background 0.3s;
}
.toc-num { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); padding-top: 10px; }
.toc-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.toc-t {
  font-family: var(--display); font-weight: 680;
  font-size: clamp(26px, 3.8vw, 48px); line-height: 1.02; letter-spacing: -0.022em;
}
.toc-d { font-size: 14.5px; line-height: 1.6; color: var(--ink-dim); max-width: 56ch; }
.toc-go {
  margin-left: auto; padding-top: 8px;
  font-size: clamp(18px, 2vw, 24px); color: var(--ink-faint);
  transition: color 0.3s, transform 0.35s var(--ease-out);
}
a.toc-item:hover { padding-left: 18px; }
a.toc-item:hover .toc-t { color: var(--accent-deep); }
a.toc-item:hover .toc-go { color: var(--accent); transform: translateX(5px); }
.toc-li.is-locked .toc-t { color: var(--ink-faint); }
.toc-lock {
  margin-left: auto; flex-shrink: 0; padding-top: 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint);
  transition: color 0.3s;
}
.toc-lockbtn:hover .toc-lock { color: var(--accent-deep); }
/* the "unlocked this session" state — the lock mark stays visible after unlocking */
.toc-lock.is-open { color: var(--accent-deep); }
a.toc-item .toc-lock.is-open + .toc-go { margin-left: 16px; }
/* the unlock drop-down */
.toc-panel { padding: 0 6px clamp(24px, 3vw, 34px) clamp(34px, 5vw, 62px); }
.toc-panel-note { font-size: 14px; color: var(--ink-dim); margin: 0 0 14px; }
.toc-unlock { display: flex; gap: 10px; flex-wrap: wrap; }
.toc-unlock input {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em;
  padding: 12px 16px; width: min(240px, 100%);
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color 0.3s;
}
.toc-unlock input:focus { outline: none; border-color: var(--accent); }
.toc-unlock button {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper);
  transition: background 0.3s, transform 0.3s var(--ease-out);
}
.toc-unlock button:hover { background: var(--accent); }
.toc-unlock.is-wrong { animation: tocShake 0.4s var(--ease-out); }
@keyframes tocShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  55% { transform: translateX(5px); }
  80% { transform: translateX(-3px); }
}
.toc-err { display: block; margin-top: 12px; font-size: 13px; color: var(--accent-deep); }
.toc-err a { color: inherit; }
@media (max-width: 760px) {
  .toc-item { flex-wrap: wrap; row-gap: 8px; }
  .toc-lock, .toc-go { margin-left: 0; width: 100%; padding: 0 0 0 30px; }
  .toc-panel { padding-left: 6px; }
}

/* ── Reveal helpers ──────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(36px); }
html.reduce-motion .fade-up { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1100px) {
  .process-rail { grid-template-columns: 1fr 1fr; }
  .p-step { border-bottom: 1px solid var(--line); }
  .p-step:nth-child(even) { border-right: 0; }
  .p-step:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .p-step:nth-child(4) { border-bottom: 0; }
  .nav-time { display: none; }
}

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  /* phones/tablets never get the hover preview — show a static thumbnail per row */
  .wr-thumb {
    display: block; grid-column: 2 / -1;
    width: 100%; max-width: 440px;
    aspect-ratio: 16 / 9; object-fit: cover;
    border-radius: 12px; border: 1px solid var(--line);
    margin-top: 6px;
  }
  .about-grid { grid-template-columns: 1fr; }
  .lex-shell { grid-template-columns: 1fr; }
  .lex-terms {
    flex-direction: row; flex-wrap: nowrap; gap: 18px;
    overflow-x: auto; padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .lex-terms::-webkit-scrollbar { display: none; }
  .lex-term {
    font-size: 22px; white-space: nowrap;
    border-bottom: 0; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 999px;
    margin-right: 8px; flex-shrink: 0;
  }
  .lex-term:last-child { border: 1px solid var(--line); }
  .lex-term.is-active { border-color: var(--accent); }
  .lex-term.is-active, .lex-term:hover { padding-left: 12px; background: none; }
  .lex-term .la { display: none; }
  .work-preview { display: none; }
  .bt-card { grid-template-columns: 1fr; }
  .bt-meta { align-items: flex-start; text-align: left; }
  .cb-gallery.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root { --nav-h: 64px; }
  .nav-ai { display: none; }

  .hero { padding-bottom: 86px; }
  .hero-title { font-size: clamp(31px, 9.4vw, 44px); }
  .hero-eyebrow { font-size: 9.5px; padding: 8px 13px; }
  .hero-ask { width: 100%; }
  .bp-hero { grid-template-columns: 1fr; }
  .bswitch { justify-self: start; flex-direction: row; gap: 18px; }
  .ls-hint { display: none; }   /* "press F" — no keyboard on phones */
  .lightswitch { width: 64px; height: 110px; }
  .lightswitch[aria-checked="false"] .ls-knob { transform: translateY(44px); }
  .ls-knob { top: 13px; height: 40px; }
  .hero-foot { height: 52px; }
  .hero-foot .hf-mid { display: none; }

  .work-row { grid-template-columns: 34px 1fr; row-gap: 12px; }
  .wr-tags { grid-column: 2; justify-content: flex-start; }
  .wr-year { display: none; }
  .work-row:hover { padding-left: 8px; }
  .lex-cards { grid-template-columns: 1fr; }
  .lex-card { min-height: 0; }
  .process-rail { grid-template-columns: 1fr; }
  .p-step { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .p-step:nth-child(4) { border-bottom: 1px solid var(--line); }
  .p-step:last-child { border-bottom: 0; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .bh-grid { grid-template-columns: 1fr; }
  .cb-block { grid-template-columns: 1fr; gap: 12px; }
  .case-stats { grid-template-columns: 1fr; }
  .cb-split { grid-template-columns: 1fr; }
  .cb-split.is-flip .cb-split-text { order: 0; }
  .cb-gallery.cols-2, .cb-gallery.cols-3 { grid-template-columns: 1fr; }
  .cb-cards { grid-template-columns: 1fr; }
  .cpg-sugg { grid-template-columns: 1fr; }
  .loader-count { font-size: clamp(110px, 30vw, 200px); }
  .chatpage { padding-bottom: 120px; }
  .cpg-bar { padding-left: 12px; padding-right: 12px; }
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .grain { animation: none; }
  html { scroll-behavior: auto; }
}
