/* ============================================================
   The End of the Organisation as You Know It · Kami Labs
   Editorial-first: content in normal flow, canvas as the stage.
   Dark cyberdeck language (SYS_BRIEF family): Syne display,
   DM Sans body, Fira Code labels; indigo/cyan on near-black.
   Engine skeleton forked from drfirdosh-v2 - the structural
   class names (rv, lm, rail, bands, static) are load-bearing.
   ============================================================ */

:root {
  --bg: #07070f;
  --surface: #0d0d1a;
  --surface-2: #121224;
  --border: #1a1a35;
  --border-bright: #2a2a50;
  --indigo: #4f46e5;
  --indigo-bright: #6366f1;
  --cyan: #06b6d4;
  --cyan-bright: #22d3ee;
  --green: #10b981;
  --amber: #f59e0b;

  --fg: #e2e8f0;
  --fg-soft: #94a3b8;
  --fg-muted: #64748b;
  --white: #f8fafc;
  --ground: 7, 7, 15;               /* rgb triplet of the world */
  --rule: rgba(226, 232, 240, 0.12);
  --header-bg: rgba(7, 7, 15, 0.55);

  --display: "Syne", system-ui, sans-serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "Fira Code", ui-monospace, monospace;
  --grad: linear-gradient(100deg, var(--indigo-bright), var(--cyan-bright));

  /* one shape language: technical rectangles, 6px everywhere,
     4px for small chips. No pills - the cyberdeck is square. */
  --r: 6px;
  --r-chip: 4px;

  --t-hero: clamp(2.05rem, 5.6vw, 4.15rem);
  --t-thesis: clamp(1.7rem, 4.2vw, 3.2rem);
  --t-claim: clamp(1.7rem, 3.8vw, 2.9rem);
  --t-section: clamp(1.8rem, 3.8vw, 2.9rem);
  --t-body: clamp(0.98rem, 1.3vw, 1.08rem);
}

/* single dark world; the attribute stays for the engine's theme hook */
[data-theme="dark"] { --ground: 7, 7, 15; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overscroll-behavior-y: none; overflow-x: clip; }

:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 3px; border-radius: 4px; }
.skip {
  position: fixed; top: -4rem; left: 1rem; z-index: 300;
  background: var(--indigo); color: #fff; padding: 0.6rem 1.1rem; border-radius: var(--r);
  text-decoration: none; font-size: 0.9rem; transition: top 0.3s ease;
}
.skip:focus-visible { top: 1rem; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: color 0.8s ease;
}

::selection { background: var(--indigo); color: #fff; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

.mono { font-family: var(--mono); }
.dim { color: var(--fg-muted); }

/* ---------- canvas ---------- */
#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ---------- the grid: the cyberdeck floor ---------- */
.grid-bg {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ---------- grain ---------- */
.grain {
  position: fixed; inset: -50%;
  z-index: 3; pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  animation: grain-shift 1.4s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

/* ---------- progress hairline ---------- */
.progress-hair {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  background: var(--grad); z-index: 40;
  transform: scaleX(0); transform-origin: left;
}

/* ---------- preloader: the run command ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: grid; place-items: center;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.pre-inner { text-align: center; padding: 0 1.4rem; }
.pre-cmd {
  font-family: var(--mono); font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  color: var(--fg);
  letter-spacing: 0.02em;
}
.pre-sym { color: var(--green); margin-right: 0.4ch; }
.pre-cursor {
  display: inline-block; width: 0.55em; height: 1.05em;
  background: var(--indigo-bright); margin-left: 0.35ch;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
/* the command types itself (mono: width in ch is exact) */
.pre-type {
  display: inline-block; overflow: hidden; white-space: nowrap;
  vertical-align: bottom;
  width: 0;
  animation: pre-typing 1.05s steps(32, end) 0.35s forwards;
}
@keyframes pre-typing { to { width: 32ch; } }
.pre-logs { margin-top: 0.8rem; text-align: left; display: inline-block; }
.pre-log {
  font-family: var(--mono); font-size: 0.72rem; color: var(--fg-muted);
  letter-spacing: 0.04em; line-height: 1.9;
  opacity: 0; transform: translateY(4px);
  animation: pre-log-in 0.3s ease forwards;
}
.pre-log-1 { animation-delay: 1.5s; }
.pre-log-2 { animation-delay: 1.75s; }
.pre-log-3 { animation-delay: 2.0s; }
.pre-ok { color: var(--green); }
@keyframes pre-log-in { to { opacity: 1; transform: none; } }
.pre-sub {
  margin-top: 0.9rem;
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* ---------- morph scanline: visible only while the substance morphs ---------- */
.morphline {
  position: fixed; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(to right, transparent 5%, rgba(34, 211, 238, 0.55) 50%, transparent 95%);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
  opacity: 0; z-index: 4; pointer-events: none;
  will-change: transform, opacity;
}

/* ---------- state HUD (desktop, inside the story) ---------- */
.hud {
  position: fixed; right: 1.6rem; bottom: 1.4rem; z-index: 20;
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  background: rgba(7, 7, 15, 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}
.hud.visible { opacity: 1; transform: none; }
.hud b { color: var(--cyan-bright); font-weight: 500; }
@media (max-width: 1100px) { .hud { display: none; } }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  transform: translateY(0);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), background 0.8s ease;
  padding: max(0.9rem, env(safe-area-inset-top))
           max(clamp(1.2rem, 4vw, 3rem), env(safe-area-inset-right))
           0.9rem
           max(clamp(1.2rem, 4vw, 3rem), env(safe-area-inset-left));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(26, 26, 53, 0.6);
}
.site-header.tucked { transform: translateY(-110%); }
.site-header:focus-within { transform: translateY(0); }
.brand {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 500;
  color: var(--indigo-bright); letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none; display: flex; align-items: center;
}
.brand-cursor {
  display: inline-block; width: 7px; height: 13px;
  background: var(--indigo-bright); margin-left: 6px;
  animation: blink 1s step-end infinite;
}
.site-nav { display: flex; gap: 1.5rem; margin-left: auto; }
.site-nav a {
  color: var(--fg-soft); text-decoration: none; font-size: 0.86rem; font-weight: 500;
  transition: color 0.3s;
  position: relative; padding-bottom: 3px;
}
.site-nav a:hover { color: var(--fg); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.site-nav a.active::after, .site-nav a:hover::after { transform: scaleX(1); }
.site-nav a.active { color: var(--fg); }
.btn-pill {
  font-family: var(--display); font-size: 0.83rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  color: #fff; background: var(--grad);
  padding: 0.55rem 1.2rem; border-radius: var(--r);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.btn-pill:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35); }

/* ---------- menu pill (mobile) ---------- */
.menu-btn {
  display: none; align-items: center; justify-content: center; flex: 0 0 auto;
  border: none; cursor: pointer; z-index: 70;
  width: 42px; height: 42px; padding: 0; border-radius: var(--r);
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.3);
}
.mb-lines { position: relative; width: 17px; height: 11px; flex: 0 0 auto; }
.mb-lines i {
  position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px;
  background: #fff;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), top 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), bottom 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mb-lines i:first-child { top: 0; }
.mb-lines i:last-child { bottom: 0; }
body.menu-open .mb-lines i:first-child { top: 4.5px; transform: rotate(45deg); }
body.menu-open .mb-lines i:last-child { bottom: 4.5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 25;
  background: #0a0a16; color: var(--fg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(76px + env(safe-area-inset-top)) clamp(1.4rem, 7vw, 3rem) calc(1.8rem + env(safe-area-inset-bottom));
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
  overscroll-behavior: contain;
}
body.menu-open .menu { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transform: none; border-bottom-color: transparent; }
body.menu-open .site-nav { display: none; }

.menu-nav { overflow-y: auto; }
.menu-nav > *, .menu-foot > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.menu-open .menu-nav > *, body.menu-open .menu-foot > * { opacity: 1; transform: none; }

.menu-tag {
  font-family: var(--mono);
  font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-muted); margin: 1.1rem 0 0.5rem;
}
.menu-tag:first-child { margin-top: 0; }
.menu a { color: var(--fg); text-decoration: none; }
.menu-ch {
  display: flex; align-items: baseline; gap: 0.85rem;
  font-family: var(--display); font-weight: 700; font-size: clamp(1.25rem, 5.4vw, 1.7rem);
  line-height: 1.15; padding: 0.32rem 0;
}
.menu-ch i {
  font-style: normal; font-family: var(--mono); font-size: 0.8rem; flex: 0 0 1.7rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.menu-ch:active, .menu-link:active { opacity: 0.7; }
.menu-link {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: clamp(1.05rem, 4.4vw, 1.3rem); padding: 0.26rem 0;
}
.menu-foot { padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.menu-mail { font-family: var(--mono); font-size: 0.85rem; color: var(--fg-soft); margin-bottom: 0.3rem; }
.menu-clocks { font-family: var(--mono); font-size: 0.78rem; color: var(--fg-muted); }

/* ---------- chapter rail ---------- */
.rail {
  position: fixed; left: 1.4rem; top: 50%; transform: translateY(-50%);
  z-index: 20; display: flex; flex-direction: column; gap: 1.05rem;
  opacity: 0; pointer-events: none; transition: opacity 0.6s ease;
}
.rail.visible { opacity: 1; pointer-events: auto; }
.rail a {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--fg-soft);
}
.rail-tick {
  width: 16px; height: 2px; border-radius: 2px;
  background: var(--fg-soft); opacity: 0.45;
  transition: width 0.35s ease, opacity 0.35s ease, background 0.35s ease;
}
.rail-label {
  font-family: var(--mono);
  font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.rail a:hover .rail-label { opacity: 0.85; transform: none; }
.rail a.active .rail-tick { width: 30px; opacity: 1; background: var(--grad); }
.rail a.active .rail-label { opacity: 1; transform: none; color: var(--fg); }

/* ============================================================
   THE STORY FLOW - normal scroll, canvas behind
   ============================================================ */

/* Deterministic legibility: every text block sits on an editorial
   gradient band of the world colour. Contrast never depends on
   where a particle happens to be. */
.hero-copy, .chapter-copy, .thesis-line {
  position: relative; z-index: 2;
}
.chapter-copy::before, .hero-copy::before {
  content: "";
  position: absolute; inset: -3.5rem -4.5rem -3.5rem -6vw; z-index: -1;
  background: linear-gradient(90deg,
    rgba(var(--ground), 0.94) 0%,
    rgba(var(--ground), 0.82) 62%,
    rgba(var(--ground), 0) 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
  transition: background 0.8s ease;
}
.thesis-line::before {
  content: "";
  position: absolute; inset: -3.5rem -5rem; z-index: -1;
  border-radius: 4rem;
  background: radial-gradient(ellipse at 50% 50%,
    rgba(var(--ground), 0.9) 0%,
    rgba(var(--ground), 0.55) 60%,
    rgba(var(--ground), 0) 100%);
  transition: background 0.8s ease;
}

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 2;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem clamp(1.4rem, 6vw, 6rem) 4rem;
}
.hero-copy { max-width: 44rem; }
.eyebrow {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--cyan-bright); margin-bottom: 1.2rem;
}
.eyebrow .mono { font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grad); display: inline-block; flex: 0 0 auto; }
.hero-headline {
  font-family: var(--display); font-weight: 800;
  font-size: var(--t-hero);
  line-height: 1.02; letter-spacing: -0.015em;
  color: var(--white);
  margin-bottom: 1.4rem;
}
.hero-meta { font-size: 0.74rem; color: var(--fg-muted); letter-spacing: 0.1em; margin-top: 2rem; }
.hero-meta .sep { opacity: 0.45; padding: 0 0.5ch; }

/* ---------- line-mask reveals ---------- */
.lm { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.lmi { display: inline-block; transform: translateY(118%); transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.1, 1); }
.lm:nth-child(2) .lmi { transition-delay: 0.1s; }
.lm:nth-child(3) .lmi { transition-delay: 0.2s; }
.lm-host { opacity: 1 !important; transform: none !important; }
.lm-host.in .lmi { transform: none; }

/* ---------- word cascade (chapter claims, JS-split) ---------- */
.w { display: inline-block; opacity: 0; transform: translateY(0.55em); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
.rv.in .w { opacity: 1; transform: none; }

.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: var(--t-body); color: var(--fg-soft); max-width: 33rem; margin-bottom: 1.8rem; font-weight: 300; }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  font-family: var(--display);
  text-decoration: none; font-weight: 600; font-size: 0.93rem;
  padding: 0.8rem 1.6rem; border-radius: var(--r);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn-primary { color: #fff; background: var(--grad); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4); }
.btn-ghost { color: var(--fg); border: 1px solid var(--border-bright); }
.btn-ghost:hover { background: rgba(99, 102, 241, 0.08); }
.scroll-cue {
  position: absolute; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.64rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg-muted);
}
.scroll-cue-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, var(--indigo-bright), transparent);
  animation: cue 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue { 0%, 100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- thesis line ---------- */
.thesis {
  position: relative; z-index: 2;
  min-height: 84vh;
  display: grid; place-items: center;
  padding: 4rem clamp(1.4rem, 6vw, 6rem);
  text-align: center;
}
.thesis-line {
  font-family: var(--display); font-weight: 700;
  font-size: var(--t-thesis); line-height: 1.18;
  color: var(--white);
}

/* ---------- chapters ---------- */
.chapter {
  position: relative; z-index: 2;
  min-height: 140vh;
  display: flex; align-items: center;
  padding: 10vh clamp(1.4rem, 6vw, 6rem);
}
.chapter-copy { max-width: 36rem; }
.chapter-copy--wide { max-width: 52rem; }
.chapter--wide .chapter-copy::before { inset: -3.5rem -4.5rem -3.5rem -8vw; }
.chapter-ghost {
  position: absolute; top: 50%; right: clamp(3rem, 9vw, 9rem);
  transform: translateY(-54%);
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(9rem, 20vw, 17rem); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(99, 102, 241, 0.22);
  z-index: 1; pointer-events: none; user-select: none;
}
.chapter-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-bright); margin-bottom: 1rem;
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
}
.chapter-claim {
  font-family: var(--display); font-weight: 700;
  font-size: var(--t-claim); line-height: 1.12;
  color: var(--white);
  margin-bottom: 1.1rem;
  text-wrap: balance;
}
.chapter-body { color: var(--fg-soft); font-size: var(--t-body); max-width: 34rem; text-wrap: pretty; font-weight: 300; }
.section-title { text-wrap: balance; }
.lede, .section-lede { text-wrap: pretty; }

/* the night-shift clock */
.sim-clock {
  font-size: 1.05rem; font-weight: 500; letter-spacing: 0.14em;
  color: var(--cyan-bright);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.5);
}

/* ---------- reveal (once) ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rv.in { opacity: 1; transform: none; }

/* ============================================================
   CARDS - one expandable pattern for shifts / problems /
   products / steps. [data-xc] holds, [data-x] toggles.
   ============================================================ */
.cards { display: grid; gap: 0.8rem; margin-top: 1.6rem; }
.cards--grid { grid-template-columns: repeat(3, 1fr); }
.card {
  background: rgba(13, 13, 26, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease;
  position: relative;
}
.card::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s ease;
}
.card:hover, .card.open { border-color: var(--border-bright); background: rgba(18, 18, 36, 0.88); }
.card:hover::after, .card.open::after { transform: scaleX(1); }
.card--hot { border-color: rgba(245, 158, 11, 0.4); }
.card--hot .card-num { color: var(--amber); }
.card--hot::after { background: linear-gradient(100deg, var(--amber), var(--cyan-bright)); }

.card-head {
  width: 100%; text-align: left;
  display: flex; align-items: baseline; gap: 0.7rem;
  background: none; border: none; cursor: pointer;
  font-family: inherit; color: inherit;
  padding: 1.05rem 1.15rem;
}
.card-num { font-size: 0.68rem; color: var(--indigo-bright); letter-spacing: 0.08em; flex: 0 0 auto; }
.card-title {
  font-family: var(--display); font-weight: 600; font-size: 0.94rem;
  color: var(--white); line-height: 1.35; flex: 1;
}
.chev {
  font-size: 0.7rem; color: var(--fg-muted); flex: 0 0 auto;
  transition: transform 0.3s ease;
}
.open > .card-head .chev, .open .tl-head .chev { transform: rotate(180deg); }

[data-xc] .card-body {
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease;
}
[data-xc].open .card-body { max-height: 70rem; opacity: 1; }
.card > .card-body { padding: 0 1.15rem; }
.card.open > .card-body { padding: 0 1.15rem 1.15rem; }
.card-body p, .card-body li {
  font-size: 0.9rem; color: var(--fg-soft); line-height: 1.75; font-weight: 300;
}
.card-body p + p { margin-top: 0.8rem; }

/* product cards */
.card--product .card-head { flex-wrap: wrap; }
.product-badge {
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.22rem 0.6rem; border-radius: var(--r-chip);
  background: rgba(99, 102, 241, 0.12); color: var(--indigo-bright);
  border: 1px solid rgba(99, 102, 241, 0.4);
  flex: 0 0 auto;
}
.product-badge--cyan { background: rgba(6, 182, 212, 0.1); color: var(--cyan-bright); border-color: rgba(6, 182, 212, 0.4); }
.product-badge--green { background: rgba(16, 185, 129, 0.1); color: var(--green); border-color: rgba(16, 185, 129, 0.4); }
.card-title--product { font-size: 1.25rem; display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; width: 100%; }
.product-tag { font-family: var(--sans); font-style: italic; font-weight: 300; font-size: 0.78rem; color: var(--fg-muted); }
.product-vision {
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-style: italic;
}
.pv-label { display: block; font-style: normal; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 0.4rem; }

/* the read-more link (terminal) */
.expand-link {
  background: none; border: none; cursor: pointer;
  font-size: 0.68rem; color: var(--cyan-bright);
  letter-spacing: 0.12em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0; margin-top: 1rem;
}
.expand-link:hover { opacity: 0.75; }
.expand-link .less { display: none; }
[data-xc].open .expand-link .more { display: none; }
[data-xc].open .expand-link .less { display: inline; }

/* ---------- terminal window ---------- */
.terminal {
  margin-top: 1.6rem;
  background: rgba(13, 13, 26, 0.88);
  border: 1px solid var(--border-bright);
  border-radius: var(--r);
  overflow: hidden;
}
.terminal-bar {
  background: rgba(18, 18, 36, 0.9);
  padding: 0.6rem 1rem;
  display: flex; align-items: center; gap: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.tdot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.tdot-r { background: #ff5f57; }
.tdot-y { background: #febc2e; }
.tdot-g { background: #28c840; }
.terminal-title {
  font-size: 0.66rem; color: var(--fg-muted); margin-left: 0.5rem;
  letter-spacing: 0.08em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.terminal-content { padding: 1.3rem 1.5rem; }
.terminal-prompt { font-size: 0.74rem; color: var(--fg-muted); margin-bottom: 1rem; }
.tp-sym { color: var(--green); }
.tp-cmd { color: var(--cyan-bright); }
.tp-cursor {
  display: inline-block; width: 0.5em; height: 1em;
  background: var(--fg-muted); margin-left: 0.35ch;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
.moment p { font-size: 0.92rem; color: var(--fg-soft); line-height: 1.8; font-style: italic; font-weight: 300; }
.moment .card-body p + p, .moment p + .card-body { margin-top: 0.9rem; }

/* ---------- vision split ---------- */
.vision-split {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  margin-top: 1.6rem;
  background: rgba(13, 13, 26, 0.82);
}
.vision-col { padding: 1.8rem; }
.vision-col:first-child { border-right: 1px solid var(--border); }
.vision-label {
  font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--indigo-bright); margin-bottom: 1rem;
}
.vision-col ul { list-style: none; }
.vision-col li {
  position: relative; padding-left: 1.1rem; margin-bottom: 0.9rem;
  font-size: 0.88rem; color: var(--fg-soft); line-height: 1.7; font-weight: 300;
}
.vision-col li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad);
}

/* ---------- callout ---------- */
.callout {
  margin-top: 1.6rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-left: 4px solid var(--indigo-bright);
  border-radius: var(--r);
  padding: 1.4rem 1.6rem;
  font-size: 1rem; font-style: italic; font-weight: 300;
  color: var(--fg); line-height: 1.75;
}

/* ============================================================
   PAPER SECTIONS - solid ground past the story
   ============================================================ */
.paper-section {
  position: relative; z-index: 5;
  background: var(--bg);
  padding: clamp(5rem, 12vh, 8rem) clamp(1.4rem, 6vw, 6rem);
  border-top: 1px solid var(--border);
}
.section-tag {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-bright); margin-bottom: 1rem;
}
.section-title {
  font-family: var(--display); font-weight: 700;
  font-size: var(--t-section); line-height: 1.12;
  color: var(--white); margin-bottom: 1.3rem;
}
.section-lede { color: var(--fg-soft); max-width: 40rem; font-weight: 300; }
.section-head { margin-bottom: 3rem; max-width: 46rem; }

/* timeline */
.timeline {
  position: relative; max-width: 52rem;
  padding-left: 2.6rem;
}
.timeline::before {
  content: ""; position: absolute; left: 0.55rem; top: 1.4rem; bottom: 1.4rem; width: 1px;
  background: linear-gradient(to bottom, var(--indigo-bright), var(--border));
}
.tl-item { position: relative; margin-bottom: 0.8rem; }
.tl-item::before {
  content: ""; position: absolute; left: -2.5rem; top: 1.15rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--indigo-bright);
  transition: background 0.25s ease;
  z-index: 2;
}
.tl-item:hover::before, .tl-item.open::before { background: var(--indigo-bright); }
.tl-head {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 0.9rem;
  background: rgba(13, 13, 26, 0.82); border: 1px solid var(--border); border-radius: var(--r);
  cursor: pointer; font-family: inherit; color: inherit;
  padding: 1.05rem 1.3rem;
  transition: border-color 0.25s ease;
}
.tl-item:hover .tl-head, .tl-item.open .tl-head { border-color: var(--border-bright); }
.tl-num { font-size: 0.66rem; color: var(--indigo-bright); letter-spacing: 0.12em; flex: 0 0 auto; }
.tl-title { font-family: var(--display); font-weight: 600; font-size: 0.98rem; color: var(--white); flex: 1; line-height: 1.3; }
.tl-body { padding: 0 1.3rem; background: rgba(18, 18, 36, 0.55); border-radius: 0 0 var(--r) var(--r); }
.tl-item.open .tl-body { padding: 1.2rem 1.3rem 1.3rem; border: 1px solid var(--border); border-top: none; }
.tl-sub {
  font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-bright); margin: 1.1rem 0 0.5rem;
}
.tl-body ul { list-style: none; }
.tl-body li {
  position: relative; padding-left: 1rem; margin-bottom: 0.4rem;
  font-size: 0.86rem; color: var(--fg-soft); font-weight: 300;
}
.tl-body li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--indigo-bright);
}

/* action cards */
.actions {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
  max-width: 60rem;
}
.action {
  background: rgba(13, 13, 26, 0.82);
  border: 1px solid var(--border); border-left: 3px solid var(--indigo-bright);
  border-radius: var(--r); padding: 1.4rem 1.5rem;
  transition: border-color 0.25s ease;
}
.action:hover { border-color: var(--border-bright); border-left-color: var(--cyan-bright); }
.action .card-num { display: block; margin-bottom: 0.5rem; }
.action h3 {
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  color: var(--white); line-height: 1.35; margin-bottom: 0.6rem;
}
.action p { font-size: 0.86rem; color: var(--fg-soft); font-weight: 300; line-height: 1.7; }
.action .owner { display: block; margin-top: 0.5rem; font-size: 0.68rem; color: var(--fg-muted); letter-spacing: 0.06em; }

/* contact */
.contact { text-align: center; overflow: hidden; position: relative; }
.contact::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(to right, transparent, rgba(99, 102, 241, 0.4), transparent);
  animation: scanline 5s linear infinite;
  pointer-events: none;
}
@keyframes scanline { 0% { top: 0%; } 100% { top: 100%; } }
.contact-inner { max-width: 44rem; margin: 0 auto; position: relative; z-index: 1; }
.contact .section-tag { display: flex; justify-content: center; }
.contact .section-lede { margin: 0 auto 2.6rem; }
.wa-button {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 1.05rem 2.2rem;
  background: #25D366; color: #fff; text-decoration: none;
  border-radius: var(--r);
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulse-green 3s ease infinite;
}
.wa-button:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(37, 211, 102, 0.3); }
.wa-icon { width: 22px; height: 22px; flex: 0 0 auto; }
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
}
.cta-note { margin-top: 1.4rem; font-size: 0.74rem; color: var(--fg-muted); letter-spacing: 0.08em; }

/* ---------- custom cursor (fine pointers only) ---------- */
@media (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
}
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 200; pointer-events: none;
  border-radius: 50%; opacity: 0; transition: opacity 0.3s ease;
}
body.has-cursor .cursor-dot, body.has-cursor .cursor-ring { opacity: 1; }
.cursor-dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--grad); }
.cursor-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  transition: opacity 0.3s ease, border-color 0.3s ease, width 0.25s ease, height 0.25s ease, margin 0.25s ease;
}
.cursor-ring.on { width: 52px; height: 52px; margin: -26px 0 0 -26px; border-color: var(--cyan-bright); }

/* ---------- footer ---------- */
.site-footer {
  position: relative; z-index: 5; background: #05050c; color: var(--fg-soft);
  padding: 3rem clamp(1.4rem, 6vw, 6rem);
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  will-change: transform;
}
.footer-status { display: flex; align-items: center; gap: 0.7rem; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex: 0 0 auto;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.footer-name { font-size: 0.8rem; color: var(--indigo-bright); letter-spacing: 0.1em; text-transform: uppercase; }
.footer-meta p { font-size: 0.74rem; letter-spacing: 0.06em; }
.footer-meta a { color: var(--fg); text-decoration: none; }
.footer-meta a:hover { color: var(--cyan-bright); }
.footer-end { font-size: 0.85rem; }
.footer-colophon { font-style: italic; opacity: 0.75; font-weight: 300; }
.toTop {
  display: inline-block; margin-top: 0.7rem; color: var(--fg-soft); text-decoration: none; font-size: 0.82rem;
  border-bottom: 1px solid var(--border-bright); padding-bottom: 2px;
  transition: color 0.3s, border-color 0.3s;
}
.toTop:hover { color: #fff; border-color: var(--cyan-bright); }

/* ---------- static / reduced-motion fallback ---------- */
body.static #stage, body.static .preloader, body.static .rail,
body.static .scroll-cue, body.static .progress-hair,
body.static .morphline, body.static .hud { display: none; }
body.static .rv { opacity: 1; transform: none; transition: none; }
body.static .lmi, body.static .w { opacity: 1; transform: none; transition: none; }
body.static .hero, body.static .chapter { min-height: 0; padding-top: 12vh; padding-bottom: 12vh; }
body.static .thesis { min-height: 0; padding: 10vh clamp(1.4rem, 6vw, 6rem); }
body.static .sim-clock { display: none; }

/* ---------- responsive ---------- */
@media (min-width: 1101px) {
  .chapter { padding-left: clamp(14rem, 15vw, 16rem); }
}
@media (min-width: 1700px) {
  .hero, .thesis { padding-left: 12vw; padding-right: 12vw; }
  .chapter { padding-left: 19vw; }
  .paper-section { padding-left: 14vw; padding-right: 14vw; }
}
@media (max-width: 1100px) {
  .rail { display: none; }
  .cards--grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .site-nav { display: none; }
  .btn-pill { display: none; }
  .menu-btn { display: inline-flex; }
  .site-header {
    gap: 0.7rem;
    background: transparent; border-bottom: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    padding-top: max(0.7rem, env(safe-area-inset-top));
    padding-bottom: 0.7rem;
  }
  .brand {
    background: rgba(var(--ground), 0.72);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 0.5rem 0.9rem; border-radius: var(--r);
    border: 1px solid var(--border);
  }
  body.menu-open .brand { background: rgba(255, 255, 255, 0.06); }
}
@media (max-width: 640px) {
  /* hero: text owns the top, the chart settles low */
  .hero { padding-top: 5.6rem; justify-content: flex-start; }
  .hero-copy { margin-top: 1.2rem; }
  .hero-ctas .btn-ghost { display: none; }
  .hero-ctas .btn-primary { padding: 0.85rem 1.9rem; }

  /* chapters: substance on top, copy anchored to the bottom band */
  .chapter { min-height: 118vh; align-items: flex-end; padding-bottom: 13vh; }
  .chapter-copy::before, .hero-copy::before {
    inset: -2.2rem -1.5rem;
    background: linear-gradient(180deg,
      rgba(var(--ground), 0) 0%,
      rgba(var(--ground), 0.9) 14%,
      rgba(var(--ground), 0.96) 100%);
    border-radius: 0.75rem;
    -webkit-mask-image: none; mask-image: none;
  }
  .hero-copy::before {
    background: linear-gradient(0deg,
      rgba(var(--ground), 0) 0%,
      rgba(var(--ground), 0.9) 14%,
      rgba(var(--ground), 0.96) 100%);
  }
  .chapter-ghost { font-size: 6.5rem; top: 18%; left: auto; right: 1.1rem; }

  /* wide chapters (cards / vision) are taller than the viewport on
     phones: the copy block needs near-full ground, not a bottom band */
  .chapter--wide .chapter-copy::before {
    background: linear-gradient(180deg,
      rgba(var(--ground), 0) 0%,
      rgba(var(--ground), 0.92) 4%,
      rgba(var(--ground), 0.96) 100%);
  }

  .thesis { min-height: 72vh; }
  .cursor-dot, .cursor-ring { display: none; }

  .cards--grid { grid-template-columns: 1fr; }
  /* product heads: badge row, then a tight title + tagline stack */
  .card-title--product { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
  .card-title--product .product-tag { font-size: 0.74rem; }
  .vision-split { grid-template-columns: 1fr; }
  .vision-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .actions { grid-template-columns: 1fr; }
  .timeline { padding-left: 1.9rem; }
  .tl-item::before { left: -1.75rem; width: 11px; height: 11px; }
  .tl-title { font-size: 0.88rem; }
  .terminal-content { padding: 1rem 1.1rem; }
  .terminal-title { max-width: 170px; }
  .paper-section { padding: 4.5rem 1.3rem; }
  .wa-button { width: 100%; justify-content: center; padding: 0.95rem 1.4rem; font-size: 0.92rem; }
  .grain { opacity: 0.08; }
  .grid-bg { background-size: 44px 44px; }
}
@media (max-width: 380px) {
  .hero-headline { font-size: 2.3rem; }
  .terminal-title { max-width: 120px; }
}
