/* AI Office - light synergy theme */
:root {
  --paper: #F5F6FB;
  --paper-2: #EAECF4;
  --ink: #0D0D26;
  --muted: #5A5E7A;
  --line: #DCDFEC;
  --card: #FFFFFF;
  --machine: #2134EA;
  --human: #FF0000;
  --font-d: 'Geologica', system-ui, sans-serif;
  --font-b: 'Geologica', system-ui, sans-serif;
  --font-m: 'JetBrains Mono', ui-monospace, monospace;
  --wrap: 1280px;
  --pad: clamp(20px, 5vw, 84px);
  --gap-y: clamp(90px, 14vh, 180px);
  --r-btn: 8px;
  --r-card: 16px;
}
html[data-palette="p2"] { --human: #0D9488; }
html[data-palette="p3"] { --human: #6366F1; }
html[data-fontsys="s2"] { --font-d: 'Onest', system-ui, sans-serif; --font-b: 'Onest', system-ui, sans-serif; }
html[data-fontsys="s3"] { --font-d: 'Unbounded', system-ui, sans-serif; --font-b: 'Geologica', system-ui, sans-serif; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
html, body { overflow-x: clip; }
body {
  font-family: var(--font-b);
  font-weight: 400;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 85% -10%, #EDEFFA 0%, transparent 60%),
    radial-gradient(1000px 800px at -10% 40%, #EEEFF8 0%, transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--machine); color: #fff; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
/* the nucleus rides on its own canvas ABOVE the content - dense, never washed out */
#fieldTop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; }
main, .nav { position: relative; z-index: 2; }

/* fallback backdrop when WebGL is unavailable */
body.no-webgl #field { display: none; }
body.no-webgl::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(700px 500px at 28% 30%, color-mix(in srgb, var(--human) 12%, transparent), transparent 70%),
    radial-gradient(700px 500px at 72% 60%, color-mix(in srgb, var(--machine) 12%, transparent), transparent 70%);
}

/* ---------- typography ---------- */
.mono { font-family: var(--font-m); }
.wrap {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad);
  /* paper halo: keeps type readable while the field flows underneath */
  text-shadow: 0 0 14px var(--paper), 0 0 28px var(--paper), 0 0 42px var(--paper);
}
.card, .btn, .nav, #devpanel { text-shadow: none; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-m);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--machine);
  margin-bottom: 22px;
}
.h1 {
  font-family: var(--font-d);
  font-size: clamp(42px, 6.6vw, 88px);
  line-height: 1.04; letter-spacing: -0.022em; font-weight: 650;
  max-width: 20ch;
}
html[data-fontsys="s3"] .h1 { font-weight: 500; font-size: clamp(32px, 4.9vw, 64px); letter-spacing: -0.01em; }
.h1 .w-hu { color: var(--human); }
.h1 .w-ai { color: var(--machine); }
.h2 {
  font-family: var(--font-d);
  font-size: clamp(38px, 4.6vw, 68px);
  line-height: 1.05; letter-spacing: -0.024em; font-weight: 650;
  max-width: 20ch;
  margin-bottom: 22px;
}
html[data-fontsys="s3"] .h2 { font-weight: 500; font-size: clamp(24px, 3vw, 42px); }
.lead { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.6; color: #4B4F6E; max-width: 680px; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 clamp(16px, 3vw, 40px);
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 15px; height: 17px; display: block; }
.brand span { font-family: var(--font-m); font-size: 13px; font-weight: 700; letter-spacing: 0.22em; }
.nav nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav nav a {
  font-size: 14px; font-weight: 500; color: var(--ink);
  text-decoration: none; opacity: .78; transition: opacity .2s, color .2s;
}
.nav nav a:hover { opacity: 1; color: var(--machine); }
.nav nav a.nav-cta {
  opacity: 1; color: #fff; background: var(--machine);
  padding: 9px 16px; border-radius: var(--r-btn);
  transition: transform .2s, box-shadow .2s;
}
.nav nav a.nav-cta:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--machine) 35%, transparent); }

#scrollbar {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50; pointer-events: none;
}
#scrollbar i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--machine), var(--human));
  transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- sections ---------- */
.s { position: relative; padding: calc(var(--gap-y) * .5) 0 calc(var(--gap-y) * .5); }
.s-hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 96px;
}
/* centered hero: the copy stands exactly where the two clouds meet */
.hero-in { position: relative; text-align: center; }
.hero-in .eyebrow-row { justify-content: center; }
.hero-in .h1 { margin: 0 auto; max-width: 17ch; }
.hero-in .lead { margin-left: auto; margin-right: auto; }
.hero-in .cta-row { justify-content: center; }
.hero-in .stats { justify-content: center; }
.hero-in .stat b::after { margin-left: auto; margin-right: auto; }
.hero-in .stat span { margin-left: auto; margin-right: auto; }
/* soft paper glow behind hero copy: field stays visible, text stays readable */
.hero-in::before {
  content: ''; position: absolute; z-index: -1;
  inset: -10% -6%;
  background: radial-gradient(52% 58% at 50% 46%,
    color-mix(in srgb, var(--paper) 84%, transparent) 0%,
    color-mix(in srgb, var(--paper) 52%, transparent) 56%,
    transparent 80%);
  filter: blur(2px);
  pointer-events: none;
}
.eyebrow-row { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.eyebrow-row .tag { font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.hero-in .lead { margin-top: 26px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-b);
  font-size: 15px; font-weight: 600; text-decoration: none;
  padding: 15px 24px; border-radius: var(--r-btn);
  transition: box-shadow .25s, background .25s, color .25s, border-color .25s;
  will-change: transform;
}
.btn-primary { background: var(--machine); color: #fff; }
.btn-primary:hover { box-shadow: 0 10px 26px color-mix(in srgb, var(--machine) 38%, transparent); }
.btn-ghost {
  color: var(--ink); border: 1px solid var(--line);
  background: color-mix(in srgb, #fff 62%, transparent);
}
.btn-ghost:hover { border-color: var(--machine); color: var(--machine); }

.stats { display: flex; gap: clamp(28px, 5vw, 64px); margin-top: clamp(44px, 7vh, 76px); flex-wrap: wrap; }
.stat b {
  display: block; font-family: var(--font-m); font-weight: 700;
  font-size: clamp(34px, 3.6vw, 52px); line-height: 1; color: var(--ink);
}
.stat b::after { content: ''; display: block; width: 26px; height: 3px; margin-top: 10px;
  background: linear-gradient(90deg, var(--machine), var(--human)); border-radius: 2px; }
.stat span { display: block; margin-top: 10px; font-size: 13.5px; color: var(--muted); max-width: 160px; line-height: 1.45; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .28em; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint i {
  width: 1px; height: 42px; background: linear-gradient(180deg, var(--machine), transparent);
  animation: hint 2.2s ease-in-out infinite;
}
@keyframes hint { 0%,100% { transform: scaleY(.4); opacity:.4 } 50% { transform: scaleY(1); opacity:1 } }

/* ---------- editorial composition (non-standard positioning) ---------- */
.stair .l1, .stair .l2 { display: block; }
.stair .l2 { padding-left: clamp(48px, 13vw, 220px); }
.sec-head.right { margin-left: auto; max-width: 720px; text-align: right; }
.sec-head.right .lead { margin-left: auto; }
.sec-head.right .h2 { margin-left: auto; }

/* inversion lens: monochrome-invert pool drifting after the cursor */
#blend {
  /* between content (2) and the nucleus canvas (12): the core CHANGES what is under it */
  position: fixed; top: 0; left: 0; z-index: 10; pointer-events: none;
  width: 460px; height: 460px;
  margin: -230px 0 0 -230px;
  backdrop-filter: grayscale(1) invert(0.94);
  -webkit-backdrop-filter: grayscale(1) invert(0.94);
  /* nucleus: near-black heart */
  background: radial-gradient(circle at 50% 48%,
    rgba(4, 5, 16, 0.82) 0%, rgba(4, 5, 16, 0.38) 30%, rgba(4, 5, 16, 0.10) 48%, transparent 64%);
  /* the whole core (inversion included) DISSOLVES to transparency - no hard rim */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 32%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 32%, transparent 70%);
  /* organic, never perfectly round */
  border-radius: 58% 42% 55% 45% / 44% 56% 42% 58%;
  animation: blob 9s ease-in-out infinite;
  transform: translate(-400px, -400px);
  opacity: 0; transition: opacity .4s;
}
@keyframes blob {
  0%   { border-radius: 58% 42% 55% 45% / 44% 56% 42% 58%; }
  33%  { border-radius: 45% 55% 48% 52% / 58% 40% 60% 42%; }
  66%  { border-radius: 52% 48% 60% 40% / 46% 58% 44% 56%; }
  100% { border-radius: 58% 42% 55% 45% / 44% 56% 42% 58%; }
}
body.lens-on #blend { opacity: 1; }
body:not(.lens-on) #blend { display: none; }
@media (pointer: coarse) { #blend { display: none; } }

/* list hover focus: the row you read stays, the rest dims */
.ladder-list:hover .lv:not(:hover) { opacity: .38; }
.phases:hover .phase:not(:hover) { opacity: .38; }
.lv, .phase { transition: opacity .25s; }

/* ---------- cards ---------- */
.card {
  position: relative; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(22px, 2.6vw, 32px);
  box-shadow: 0 12px 34px rgba(13, 13, 38, .06);
  transition: box-shadow .3s, border-color .3s;
  will-change: transform;
}
.card:hover { border-color: color-mix(in srgb, var(--machine) 34%, var(--line)); box-shadow: 0 20px 48px rgba(13, 13, 38, .11); }
/* spotlight that follows the nucleus inside the block */
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--machine) 10%, transparent), transparent 70%);
  opacity: 0; transition: opacity .25s;
}
.card:hover::after { opacity: 1; }

/* subtext wave words */
.sw { display: inline-block; transform-origin: 50% 80%; transition: color .18s ease; }
.sw.lit { color: var(--ink); }

/* small mono labels: swell under the nucleus, tracking stretches */
.eyebrow, .card-tag, .card-foot, .phase .ph, .core-caption, .eyebrow-row .tag, .legend > span {
  transition: color .2s ease, letter-spacing .25s ease;
}
.eyebrow { transform-origin: 0 62%; }
.eyebrow.lit { letter-spacing: 0.26em; }
.card-tag { display: inline-block; transform-origin: 0 62%; }
.card-note { margin-top: 14px; font-size: 11.5px; letter-spacing: .05em; color: var(--machine); }
.card-tag.lit, .card-foot.lit { color: var(--machine); letter-spacing: 0.22em; }
.card-foot { transform-origin: 0 62%; }
.phase .ph { display: inline-block; transform-origin: 0 62%; }
.phase .ph.lit { letter-spacing: 0.18em; }
.eyebrow-row .tag { display: inline-block; transform-origin: 0 62%; }
.eyebrow-row .tag.lit, .core-caption.lit { color: var(--ink); }
.legend > span { display: inline-block; transform-origin: 0 62%; }
.legend > span.lit { color: var(--ink); }

/* numbers + labels + buttons answering the nucleus */
.stat b { transform-origin: 50% 82%; transition: color .2s; }
.stat b.lit { color: var(--machine); }
.stat b.lit::after { width: 44px; }
.stat b::after { transition: width .3s ease; }
.gnum { display: inline-block; transform-origin: 0 90%; transition: color .2s; }
.gnum.lit { color: var(--human); }
.btn.lit.btn-primary { box-shadow: 0 12px 34px color-mix(in srgb, var(--machine) 45%, transparent); }
.btn.lit.btn-ghost { border-color: var(--machine); color: var(--machine); }

/* list rows lean toward the reader on hover */
.lv.on:hover { transform: rotateX(0) translateX(6px); }
.phase:hover { transform: translateX(6px); }
.phase { transition: opacity .25s, transform .3s ease; }
.card h3 { font-family: var(--font-d); font-size: clamp(21px, 1.9vw, 28px); font-weight: 650; letter-spacing: -0.016em; margin: 14px 0 11px; }
.card p { font-size: 16.5px; line-height: 1.62; color: var(--muted); }
.card-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card-foot { display: block; margin-top: 20px; font-size: 11px; letter-spacing: .18em; color: var(--muted); opacity: .8; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; }
.duo .accent { margin-top: 56px; }               /* broken grid: the system card sits lower */
.duo .accent { border-color: color-mix(in srgb, var(--machine) 45%, var(--line)); position: relative; overflow: hidden; }
.duo .accent::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--machine), var(--human));
}
.duo .accent .card-tag, .duo .accent .card-foot { color: var(--machine); }

.grid4 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 44px;
  max-width: 980px; align-items: start;      /* cards size to content, no stretch voids */
}
.grid4 article:nth-child(even) { margin-top: 44px; }
.gnum { font-family: var(--font-m); font-size: 13.5px; font-weight: 700; color: var(--machine); letter-spacing: .12em; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.trio article:nth-child(2) { margin-top: 48px; }
.trio article:nth-child(3) { margin-top: 96px; }

/* ---------- ladder ---------- */
.ladder-wrap { display: grid; grid-template-columns: minmax(0, 620px) 1fr; gap: 40px; }
.ladder-list { position: relative; margin-top: 40px; padding-left: 22px; perspective: 1100px; }
.rail { position: absolute; left: 0; top: 26px; bottom: 26px; width: 2px; background: var(--line); border-radius: 2px; }
.rail i {
  position: absolute; inset: 0; display: block;
  background: linear-gradient(180deg, var(--machine), var(--human));
  transform: scaleY(0); transform-origin: 0 0; border-radius: 2px;
}
.lv {
  display: flex; align-items: baseline; gap: 22px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  position: relative;
  transform-origin: 50% 0;
  transform: rotateX(-38deg) translateY(10px);
  opacity: .38;
  transition: transform .65s cubic-bezier(.22, .8, .26, 1), opacity .5s;
}
.lv.on { transform: rotateX(0) translateY(0); opacity: 1; }
.lv:last-child { border-bottom: none; }
/* level numbers styled like the hero counters: big digit + gradient underline */
.lv-num {
  flex: 0 0 118px;
  font-family: var(--font-m); font-size: clamp(38px, 4.6vw, 68px); font-weight: 700; line-height: 1;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  transition: color .4s;
  transform-origin: 30% 70%;
}
#ladderList .lv-num.lit { color: var(--machine); }
.lv-num::after {
  content: ''; display: block; width: 26px; height: 3px; margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--machine), var(--human));
  transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .45s ease;
}
.lv.on .lv-num { color: var(--ink); }
.lv.on .lv-num::after { transform: scaleX(1); }
.lv b { font-family: var(--font-d); font-weight: 650; font-size: clamp(20px, 1.9vw, 27px); letter-spacing: -0.016em; min-width: 210px; }
.lv span:not(.lv-num) { font-size: 16px; color: var(--muted); line-height: 1.55; }
.lv.hl b { color: var(--machine); }
.lv.hl.on .lv-num { color: var(--human); }
.lv.hl.on .lv-num::after { background: linear-gradient(90deg, var(--human), var(--machine)); }

/* ---------- how (core): statement left space, cards right ---------- */
.how-wrap { display: grid; grid-template-columns: 1fr minmax(0, 560px); gap: 40px; align-items: start; }
.how-cards { display: grid; gap: 18px; margin-top: 40px; order: 2; }
.how-cards article:nth-child(2) { margin-left: -64px; }   /* cards step toward the core */
.core-caption {
  order: 1; align-self: end; justify-self: start;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-m); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 10vh;
}
.core-caption i { width: 34px; height: 1px; background: var(--machine); display: block; }

/* ---------- method: cascade along the flow line ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 44px; }
.steps .card { padding: 22px 20px; }
.steps .card h3 { font-size: clamp(17px, 1.35vw, 22px); letter-spacing: -0.012em; overflow-wrap: break-word; }
.steps .card p { font-size: 14.5px; line-height: 1.55; }
.steps .step:nth-child(2) { margin-top: 28px; }
.steps .step:nth-child(3) { margin-top: 56px; }
.steps .step:nth-child(4) { margin-top: 84px; }
.steps .step:nth-child(5) { margin-top: 112px; }
.step { position: relative; }
.step::after {
  content: '»'; position: absolute; right: -14px; top: 42%;
  font-family: var(--font-m); font-weight: 700; color: var(--machine);
  font-size: 18px;
}
.step:last-child::after { content: none; }
.legend { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; font-family: var(--font-m); font-size: 12.5px; color: var(--muted); }
.legend b { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.legend .dot-w { background: #fff; border: 1.5px solid var(--line); }
.legend .dot-y { background: #F5C518; }
.legend .dot-g { background: #12B76A; }

/* ---------- vision ---------- */
.vision-wrap { display: grid; grid-template-columns: minmax(0, 620px) 1fr; gap: 40px; }
.phases { margin-top: 40px; display: grid; gap: 0; }
.phase {
  display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.phase:last-child { border-bottom: none; }
.phase .ph { font-family: var(--font-m); font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--machine); }
.phase p { font-size: clamp(17px, 1.5vw, 20px); color: var(--ink); }
.phase p span { color: var(--muted); }

/* ---------- CTA ---------- */
.s-cta {
  min-height: 92svh; display: flex; flex-direction: column; justify-content: center;
  padding-top: clamp(260px, 36vh, 480px);      /* the down-chevron owns the top, content sits lower */
  padding-bottom: clamp(60px, 8vh, 110px);
}
.cta-card {
  max-width: 640px; margin: 0 auto; text-align: center;
  background: color-mix(in srgb, #fff 74%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid color-mix(in srgb, #fff 70%, var(--line));
  border-radius: 20px;
  padding: clamp(34px, 5vw, 56px);
  box-shadow: 0 24px 70px rgba(13, 13, 38, .10);
}
.cta-card .h2 { margin: 0 auto 26px; max-width: 16ch; }
.cta-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; justify-content: center; }
.cta-form input {
  flex: 1; min-width: 0;
  font-family: var(--font-b); font-size: 15px; color: var(--ink);
  padding: 14px 16px; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: #fff;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.cta-form input:focus { border-color: var(--machine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--machine) 14%, transparent); }
.cta-form .btn { white-space: nowrap; }
.cta-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

footer {
  margin-top: clamp(40px, 6vh, 90px);
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-m); font-size: 12px; color: var(--muted); letter-spacing: .04em;
}
footer a { color: var(--ink); text-decoration: none; }
footer a:hover { color: var(--machine); }

/* ---------- parallax chevrons ---------- */
.chev-bg {
  position: absolute; pointer-events: none; z-index: -1;
  opacity: .055;
}
.chev-bg svg { width: 100%; height: 100%; display: block; }

/* ---------- custom cursor ---------- */
#cursor { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
#cursor .c-dot, #cursor .c-ring { position: fixed; top: 0; left: 0; border-radius: 50%; will-change: transform; }
#cursor .c-dot { width: 6px; height: 6px; background: var(--machine); margin: -3px 0 0 -3px; }
#cursor .c-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in srgb, var(--machine) 55%, transparent);
  transition: width .25s, height .25s, margin .25s, border-color .25s, opacity .25s;
}
#cursor.grow .c-ring {
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-color: color-mix(in srgb, var(--human) 70%, transparent);
}
body.cursor-on, body.cursor-on a, body.cursor-on button, body.cursor-on input { cursor: none; }
@media (pointer: coarse) { #cursor { display: none; } }

/* ---------- nav settings icons + popovers ---------- */
.nav-tools { display: inline-flex; gap: 6px; margin-right: clamp(6px, 1.6vw, 22px); }
.nt-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  transition: all .15s;
}
.nt-btn:hover { color: var(--machine); border-color: var(--machine); }
.nt-btn.on { background: var(--machine); border-color: var(--machine); color: #fff; }

#tools .popover {
  display: none;
  position: fixed; top: 72px; right: 24px; z-index: 80;
  background: color-mix(in srgb, #fff 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 11px; color: var(--muted);
  gap: 8px;
  box-shadow: 0 14px 40px rgba(13,13,38,.14);
  max-height: 80vh; overflow-y: auto; overscroll-behavior: contain;
  width: 320px;
}
#tools .popover.open { display: grid; }
#tools .pop-title {
  font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); padding-bottom: 2px; border-bottom: 1px solid var(--line);
}
#tools .dp-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#tools .dp-row > span:first-child { min-width: 46px; letter-spacing: .1em; text-transform: uppercase; font-size: 9.5px; }
#tools button {
  font-family: var(--font-m); font-size: 10.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; transition: all .15s;
}
#tools button:hover { border-color: var(--machine); color: var(--machine); }
#tools button.on { background: var(--machine); border-color: var(--machine); color: #fff; }
#tools .dp-meta { font-size: 10px; opacity: .8; }
#tools .dp-grid { display: grid; grid-template-columns: 1fr; gap: 2px; }
#tools .dp-grid label {
  display: flex; align-items: center; gap: 8px;
  font-size: 9.5px; color: var(--muted); line-height: 1;
}
#tools .dp-grid label span {
  flex: 0 0 112px; letter-spacing: .03em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
#tools .dp-grid input[type="range"] { flex: 1; min-width: 0; accent-color: var(--machine); height: 15px; margin: 0; }
#tools .dp-grid label b { flex: 0 0 32px; text-align: right; font-weight: 500; color: var(--ink); font-size: 9px; }
#tools .dp-meta span[data-copy] { cursor: pointer; text-decoration: underline dotted; }
#tools .sw {
  width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line);
}
#tools .sw.on { box-shadow: 0 0 0 2px var(--ink); }
#tools input[type="color"] {
  width: 26px; height: 22px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; cursor: pointer;
}

/* ---------- AI core slot: lives in the CTA block, right column ---------- */
#coreSlot { width: 100%; height: clamp(340px, 52vh, 560px); pointer-events: none; }

/* CTA: big statement left, the nucleus right, no card background */
.cta-split {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 48px); align-items: center;
}
.cta-left .h2 {
  font-size: clamp(44px, 5.2vw, 84px);
  line-height: 1.04; letter-spacing: -0.025em;
  max-width: 12ch; margin-bottom: 38px;
}
.cta-left .h2 .accent { color: var(--machine); }
.cta-left .cta-form { margin: 0; justify-content: flex-start; }
.cta-left .cta-note { text-align: left; max-width: 440px; margin-top: 20px; }
@media (max-width: 980px) {
  .cta-split { grid-template-columns: 1fr; }
  #coreSlot { height: 300px; }
}

/* ---------- ghost numbers turn WHITE under the black core (via inversion) ---------- */
.ghost { transition: color .25s, -webkit-text-stroke-color .25s; }
.ghost.under-core {
  /* solid ink -> the inversion renders it FULLY white, no outline look */
  color: rgba(13, 13, 38, 0.97);
  -webkit-text-stroke-color: rgba(13, 13, 38, 0.97);
}

/* ---------- reveal defaults (JS sets initial state) ---------- */
[data-reveal] { will-change: transform, opacity; }

/* ---------- split-text machinery ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; transform-origin: 50% 78%; white-space: nowrap; }
.wi, .ci { display: inline-block; will-change: transform; transform-origin: 50% 72%; }
.ci { min-width: 0.22em; } /* spaces inside words keep width when scaled */
.h2 .w { padding-bottom: 0.06em; margin-bottom: -0.06em; } /* keep descenders */
.h1 .w { padding-bottom: 0.08em; margin-bottom: -0.08em; }
/* after the rise completes the masks open, so loupe-scaled letters are not clipped */
.revealed .w { overflow: visible; }

/* animated gradient texture on the accent words (per-letter, loupe-safe) */
.h1 .w-hu .ci {
  background: linear-gradient(100deg, var(--human), color-mix(in srgb, var(--human) 55%, #FF9EF0), var(--human));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hue-slide 7s linear infinite;
  text-shadow: none;
}
.h1 .w-ai .ci {
  background: linear-gradient(100deg, var(--machine), color-mix(in srgb, var(--machine) 55%, #6FE3FF), var(--machine));
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hue-slide 7s linear infinite;
  text-shadow: none;
}
@keyframes hue-slide { to { background-position: 220% 0; } }

/* ---------- ghost section numbers (depth texture) ---------- */
.ghost {
  position: absolute; top: 4%; z-index: -1;
  font-family: var(--font-d); font-weight: 800;
  font-size: clamp(170px, 24vw, 360px); line-height: 1; letter-spacing: -0.05em;
  color: color-mix(in srgb, var(--machine) 3.5%, transparent);
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--machine) 22%, transparent);
  user-select: none; pointer-events: none;
}
.ghost.g-r { right: -1%; }
.ghost.g-l { left: -1%; }

/* ---------- ticker line ---------- */
.ticker {
  position: relative; z-index: 2;
  overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 13px 0;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
}
.ticker-track {
  display: flex; gap: 0; white-space: nowrap; width: max-content;
  animation: tick 52s linear infinite;
}
.ticker span {
  font-family: var(--font-m); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
  padding-right: 56px;
}
.ticker b { color: var(--machine); font-weight: 700; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- grain texture ---------- */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 55; pointer-events: none;
  opacity: 0.045; 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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .duo, .grid4, .trio { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step::after { content: none; }
  .ladder-wrap, .how-wrap, .vision-wrap { grid-template-columns: 1fr; }
  .core-caption { justify-self: start; padding: 26px 0 0; }
  .lv b { min-width: 132px; }
  .nav nav a:not(.nav-cta) { display: none; }
  /* editorial offsets collapse on small screens */
  .duo .accent, .grid4 article:nth-child(even), .trio article:nth-child(2),
  .trio article:nth-child(3), .steps .step:nth-child(2), .steps .step:nth-child(3),
  .steps .step:nth-child(4), .steps .step:nth-child(5) { margin-top: 0; }
  .grid4 article:nth-child(3) { margin-top: 0; }
  .how-cards { order: 0; }
  .how-cards article:nth-child(2) { margin-left: 0; }
  .core-caption { order: 0; }
  .stair .l2 { padding-left: 0; }
  .sec-head.right { text-align: left; margin-left: 0; }
  .sec-head.right .lead, .sec-head.right .h2 { margin-left: 0; }
}
@media (max-width: 640px) {
  .steps { grid-template-columns: 1fr; }
  .cta-form { flex-direction: column; align-items: flex-start; }
  .phase { grid-template-columns: 1fr; gap: 6px; }
  .stats { gap: 22px; }
  /* ladder rows compact: digit smaller, texts wrap below the role */
  .lv { flex-wrap: wrap; gap: 10px 16px; padding: 18px 0; }
  .lv-num { flex: 0 0 56px; font-size: 34px; }
  .lv b { min-width: 0; font-size: 20px; }
  .lv span:not(.lv-num) { flex: 1 1 100%; font-size: 14.5px; }
  .s-cta { padding-top: 150px; }
  .scroll-hint { display: none; }
  .cta-left .h2 { font-size: clamp(36px, 10.5vw, 48px); }
  .h2 { font-size: clamp(30px, 8.6vw, 40px); }
  .h1 { font-size: clamp(34px, 10vw, 46px); }
  .ghost { font-size: 34vw; opacity: .8; }
}
@media (max-width: 980px) {
  /* no cursor nucleus on touch devices - the empty slot collapses */
  #coreSlot { display: none; }
  .nav-tools { display: none; }
}

/* ---------- reduced motion (driven by body.rm - the JS motion setting,
   not the raw OS flag, so the panel override actually wins) ---------- */
body.rm .scroll-hint i { animation: none; }
body.rm #cursor { display: none; }
body.rm .ticker-track { animation: none; }
body.rm .h1 .ci { animation: none; }
body.rm #blend { display: none; }
