/* Landing page. Shared tokens, type and buttons come from base.css. */
:root { --paper: #fbf8ef; --paper-line: rgba(13, 16, 18, .12); --edge: #252829; }

.lwrap { max-width: 1360px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 72px); }
.skip:focus { position: fixed; left: 12px; top: 12px; z-index: 99; width: auto; height: auto; clip: auto;
  background: var(--cream); color: var(--cream-ink); padding: 8px 12px; border-radius: 6px; }
.nav { margin-bottom: calc(-1 * var(--nav-h)); }
.nav .lwrap { position: relative; height: 100%; display: flex; align-items: center; gap: 28px; }
.nav .links { margin-left: auto; }
.h2.big { font-size: clamp(34px, 3.5vw, 50px); line-height: 1.05; }
.center { text-align: center; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: max(640px, 100svh); display: grid; place-items: center;
  overflow: hidden; isolation: isolate;
}
.mosaic { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: -2; }
.hero::after, .cta::after { /* the 1px grid between mosaic cells */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--bg) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--bg) 1px, transparent 1px);
  background-size: 6px 6px; opacity: .55;
}
.hero::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%; z-index: -1;
  background: linear-gradient(to top, var(--bg) 0%, rgba(13, 16, 18, .7) 50%, rgba(13, 16, 18, 0) 100%);
}
.hero-in { text-align: center; display: grid; justify-items: center; gap: 28px; padding: 120px var(--gutter) 160px; max-width: 1080px; }
.hero .display { font-size: clamp(54px, 7.8125vw, 80px); line-height: 1.02; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-ctas .btn.ghost { background: rgba(13, 16, 18, .35); }
.hero-sub { margin: 0; max-width: 620px; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.6; color: var(--cream); opacity: .8; text-wrap: pretty; }
.hero-strip {
  position: absolute; left: 0; right: 0; bottom: 34px; margin: 0; padding: 0 var(--gutter); text-align: center;
  font-size: 14px; color: var(--cream); opacity: .62;
}

/* ---------- how it works (scroll-driven, sticky) ---------- */
.hiw { position: relative; height: 400vh; }
.hiw-sticky { position: sticky; top: 0; min-height: 100svh; padding: calc(var(--nav-h) + 72px) 0 56px; display: flex; flex-direction: column; justify-content: center; }
.hiw-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-bottom: 48px; }
.hiw-intro { margin: 0; max-width: 420px; color: var(--cream); opacity: .8; font-size: 16px; line-height: 1.65; }
.hiw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--edge); }
.step { position: relative; border-bottom: 1px solid var(--edge); }
.step button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; gap: 16px; align-items: baseline;
  padding: 22px 4px; color: var(--cream); opacity: .66; transition: opacity .3s;
}
.step button:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.step .n { font: 400 13px/1 var(--mono); color: var(--cream); min-width: 22px; }
.step .t { font: 300 clamp(20px, 1.7vw, 25px)/1.15 var(--serif); letter-spacing: -0.01em; }
.step .body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.step .body > p { overflow: hidden; margin: 0; padding: 0 4px 0 42px; color: var(--cream); opacity: .72; font-size: 16px; line-height: 1.6; max-width: 520px; }
.step.on button { opacity: 1; }
.step.on .body { grid-template-rows: 1fr; }
.step.on .body > p { padding-bottom: 24px; }
.step .bar { position: absolute; left: 0; bottom: -1px; height: 1px; width: calc(var(--p, 0) * 100%); background: var(--grad); opacity: 0; }
.step.on .bar { opacity: 1; }
.stage { position: relative; margin: 0; aspect-ratio: 1.25; border: 1px solid var(--edge); background:
  radial-gradient(120% 90% at 50% 40%, #12181b 0%, var(--bg) 70%); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-cap {
  position: absolute; left: 20px; bottom: 16px; right: 20px; display: flex; justify-content: space-between; gap: 12px;
  font: 400 13px/1.4 var(--mono); color: var(--text-2);
}
.stage-cap b { font: 400 22px/1.2 var(--serif); color: var(--cream); }

/* ---------- why memory is hard ---------- */
.hard { padding: 140px 0 150px; }
.cards { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--edge); }
.card { padding: 0 0 36px; border-right: 1px solid var(--edge); display: flex; flex-direction: column; }
.card:last-child { border-right: 0; }
.card .viz { height: 240px; border-bottom: 1px solid var(--edge); margin-bottom: 32px; position: relative; overflow: hidden; }
.card .viz svg { width: 100%; height: 100%; }
.card h3 { font: 300 25px/1.15 var(--serif); letter-spacing: -0.01em; color: var(--cream); margin: 0 32px 12px; }
.card p { margin: 0 32px; color: var(--cream); opacity: .66; font-size: 15px; line-height: 1.6; }

/* ---------- light sections ---------- */
.light { background: var(--paper); color: var(--cream-ink); }
.light .h2 { color: var(--cream-ink); }

/* ---------- ask-back spotlight ---------- */
.spot { padding: 140px 0; }
.spot .h2 { max-width: 880px; }
.spot-card {
  margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0;
  border: 1px solid var(--paper-line); border-radius: 8px; overflow: hidden; background: #fffdf6;
}
.spot-viz { background: var(--bg); padding: clamp(24px, 3vw, 40px); display: flex; align-items: center; min-height: 380px; position: relative; overflow: hidden; }
.spot-viz::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: radial-gradient(60% 70% at 85% 10%, rgba(45, 26, 185, .35), transparent 70%),
              radial-gradient(50% 60% at 10% 100%, rgba(24, 126, 8, .3), transparent 70%); }
.term { position: relative; width: 100%; font: 400 14px/1.55 var(--mono); color: var(--text-2); display: grid; gap: 12px; }
.term-row { border-left: 2px solid var(--line-2); padding: 2px 0 2px 14px; }
.term-row.q { color: var(--cream); font: 400 18px/1.4 var(--serif); border-color: var(--cream); }
.term-row .k { color: var(--found); margin-right: 10px; }
.term-row.hit { color: var(--text); border-color: var(--sent); }
.term-row.hit .k { color: var(--sent); }
.flip { margin-top: 10px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font: 300 clamp(26px, 2.6vw, 36px)/1.1 var(--serif); }
.flip s { color: var(--muted); text-decoration-thickness: 1px; }
.flip .arrow { color: var(--found); font-family: var(--sans); font-size: .7em; }
.flip b { font-weight: 400; color: var(--cream); }
.spot-text { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.spot-lead { margin: 0; font: 300 clamp(20px, 1.8vw, 25px)/1.35 var(--serif); letter-spacing: -0.005em; color: var(--cream-ink); }
.spot-stat { display: grid; gap: 8px; border-top: 1px solid var(--paper-line); padding-top: 24px; }
.big-num { font: 300 clamp(56px, 6vw, 88px)/1 var(--serif); letter-spacing: -0.02em; }
.stat-cap { font-size: 15px; line-height: 1.5; opacity: .7; max-width: 380px; }

/* ---------- numbers ---------- */
.nums { padding: 150px 0 140px; }
.nums-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.nums-intro { margin: 0; max-width: 440px; color: var(--cream); opacity: .8; font-size: 16px; line-height: 1.65; }
.climb { margin: 64px 0 0; border: 1px solid var(--edge); position: relative; padding: 28px 28px 0; }
.climb canvas { width: 100%; height: 260px; image-rendering: pixelated; }
.climb-labels { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--edge); margin: 0 -28px; }
.climb-labels span { padding: 12px 16px; font: 400 13px/1.3 var(--mono); color: var(--muted); border-right: 1px solid var(--edge); }
.climb-labels span:last-child { border-right: 0; color: var(--cream); }
.stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--edge); border-top: 0; }
.stats div { padding: 28px 28px 32px; border-right: 1px solid var(--edge); }
.stats div:last-child { border-right: 0; }
.stats dt { font: 300 clamp(38px, 3.6vw, 52px)/1 var(--serif); letter-spacing: -0.02em; color: var(--cream); }
.stats dd { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--cream); opacity: .66; }

/* ---------- shared section head (left heading, right line) ---------- */
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.sec-head .h2 { max-width: 760px; }
.sec-intro { margin: 0; max-width: 430px; font-size: 16px; line-height: 1.65; opacity: .8; }
.quiet { margin: 28px 0 0; font-size: 14px; opacity: .72; }
.light .sec-intro, .light .quiet { color: var(--cream-ink); }

/* ---------- personas ---------- */
.personas { padding: 140px 0 120px; }
.per-grid { margin-top: 64px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0;
  border: 1px solid var(--paper-line); background: #fffdf6; }
.fails { list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--paper-line); }
.fails li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: baseline;
  padding: 22px 32px; border-bottom: 1px solid var(--paper-line); }
.fails li:last-child { border-bottom: 0; }
.fails q { font: 300 clamp(19px, 1.6vw, 23px)/1.25 var(--serif); letter-spacing: -0.005em; color: var(--cream-ink); quotes: "“" "”"; }
.fails span { font-size: 15px; line-height: 1.5; color: var(--cream-ink); opacity: .74; }
.audit { margin: 0; padding: 32px; display: flex; flex-direction: column; gap: 28px; background: var(--bg); color: var(--cream); }
.audit-title { margin: 0; font: 300 22px/1.2 var(--serif); }
.audit-title span { display: block; margin-top: 6px; font: 400 14px/1.4 var(--sans); color: var(--text-2); }
.audit-line { list-style: none; margin: 0; padding: 0 0 0 18px; display: grid; gap: 18px; position: relative; }
.audit-line::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.audit-line li { position: relative; display: flex; align-items: baseline; gap: 18px; }
.audit-line li::before { content: ""; position: absolute; left: -18px; top: 7px; width: 7px; height: 7px; background: var(--sent); }
.audit-line li.ask::before { background: transparent; outline: 1px solid var(--found); }
.audit-line time { min-width: 56px; font: 400 13px/1.4 var(--mono); color: var(--text-2); }
.audit-line b { font: 300 26px/1.1 var(--serif); color: var(--cream); }
.audit-line li.ask b { font-size: 20px; color: var(--found); }
.audit figcaption { margin-top: auto; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.others { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  border-top: 1px solid var(--paper-line); }
.others article { padding: 32px 32px 0 0; }
.others .glyph { display: block; width: 30px; height: 30px; margin-bottom: 22px; }
.others .glyph svg { width: 100%; height: 100%; }
.others h3 { margin: 0 0 8px; font: 300 22px/1.2 var(--serif); color: var(--cream-ink); }
.others p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--cream-ink); opacity: .74; }

/* ---------- plugin ---------- */
.plugin { padding: 140px 0 130px; }
.plug-grid { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: stretch; }
.code-card { background: var(--bg); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 10px;
  border-bottom: 1px solid var(--edge); }
.code-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.code-tabs button, .copy { all: unset; cursor: pointer; font: 500 13px/1 var(--sans); color: var(--text-2);
  padding: 9px 12px; border-radius: 5px; }
.code-tabs button[aria-selected="true"] { background: var(--card-2); color: var(--cream); }
.code-tabs button:focus-visible, .copy:focus-visible { outline: 2px solid var(--cream); outline-offset: 1px; }
.copy { border: 1px solid var(--line-2); color: var(--cream); }
.copy:hover { border-color: var(--cream); }
.code-card pre { margin: 0; padding: 28px 24px 32px; overflow-x: auto; font: 400 14px/1.7 var(--mono); color: var(--cream);
  white-space: pre; flex: 1; }
.code-card pre:focus-visible { outline: 2px solid var(--cream); outline-offset: -2px; }
.tools { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--paper-line);
  background: #fffdf6; align-content: stretch; }
.tools div { padding: 22px 24px; border-bottom: 1px solid var(--paper-line); border-right: 1px solid var(--paper-line); }
.tools div:nth-child(2n) { border-right: 0; }
.tools div:nth-last-child(-n+2) { border-bottom: 0; }
.tools dt { font: 500 14px/1.3 var(--mono); color: var(--cream-ink); }
.tools dd { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--cream-ink); opacity: .74; }

/* ---------- closing CTA ---------- */
.cta { position: relative; overflow: hidden; isolation: isolate; padding: clamp(110px, 13vw, 187px) 0; }
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(13, 16, 18, .85) 38%, rgba(13, 16, 18, .1) 100%); }
.cta-in { display: grid; justify-items: start; gap: 20px; }
.cta-h { margin: 0; font: 300 clamp(42px, 4.5vw, 65px)/1.05 var(--serif); letter-spacing: -0.01em; color: var(--cream); }
.cta-sub { margin: 0 0 8px; max-width: 421px; color: var(--cream); opacity: .8; font-size: 16px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--edge); padding: 40px 0 48px; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 960px), (max-height: 700px) {
  .hiw { height: auto; }
  .hiw-sticky { position: static; min-height: 0; padding: 120px 0 100px; }
}
@media (max-width: 960px) {
  .hiw-head, .nums-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hiw-grid { grid-template-columns: 1fr; gap: 40px; }
  .stage { order: -1; }
  .cards { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--edge); }
  .card:last-child { border-bottom: 0; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 20px; }
  .per-grid, .plug-grid { grid-template-columns: 1fr; }
  .fails { border-right: 0; border-bottom: 1px solid var(--paper-line); }
  .others { grid-template-columns: 1fr; }
  .others article { padding: 28px 0 0; }
  .spot-card { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--edge); }
  .climb-labels span { padding: 10px 8px; font-size: 11px; }
  .hard, .spot, .nums, .personas, .plugin { padding: 96px 0; }
}
@media (max-width: 520px) {
  .hero-strip { font-size: 12.5px; bottom: 22px; }
  .hero-in { padding-bottom: 140px; }
  .climb { padding: 16px 16px 0; }
  .climb canvas { height: 180px; }
  .climb-labels { margin: 0 -16px; }
  .stats div { padding: 22px 18px 24px; }
  .card h3 { margin-left: 22px; margin-right: 22px; }
  .card p { margin-left: 22px; margin-right: 22px; }
  .fails li { grid-template-columns: 1fr; gap: 6px; padding: 18px 20px; }
  .audit { padding: 24px 20px; }
  .code-card pre { font-size: 11.5px; padding: 20px 14px 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .tools { grid-template-columns: 1fr; }
  .tools div { border-right: 0; }
  .tools div:nth-last-child(2) { border-bottom: 1px solid var(--paper-line); }
}

/* nav over cream sections (switched by landing.js) */
.nav .brand, .nav .links a { transition: color .25s; }
.nav.on-light { color: var(--cream-ink); }
.nav.on-light .brand { color: var(--cream-ink); }
.nav.on-light::before { background: linear-gradient(rgba(251, 248, 239, .88) 0%, rgba(251, 248, 239, .6) 70%, rgba(251, 248, 239, 0) 100%); }
.nav.on-light .btn { background: var(--cream-ink); color: var(--cream); border-color: var(--cream-ink); }
.nav.on-light .btn:hover { background: transparent; color: var(--cream-ink); }
