/* Stemwise landing. Colours, type and radii come from design/tokens.css (direction "Atelier"). */

@font-face { font-family: "Figtree"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/bricolage-grotesque-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #19121B; --bg-band: #1E1620; --panel: #241C26; --tile: #2F2631; --ctl: #3B313E;
  --line: #423745; --line-soft: #2C232E; --line-strong: #5E5262;
  --tx-1: #F5F0F6; --tx-2: #D2CAD3; --tx-3: #B5ABB7;
  --mix: #CEE654; --mix-hi: #E0F27E; --mix-tx: #171A04;
  --master: #CDAFFF; --master-tx: #1B1128; --indigo: #171223; --indigo-panel: #211B30; --indigo-line: #3A3152;
  --ai: #8FD8EC;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --ui: "Figtree", system-ui, sans-serif;
  --shadow: 0 18px 60px rgba(10, 5, 12, 0.7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tx-1); font: 400 17px/1.5 var(--ui); }
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
h1, h2 { font-family: var(--display); text-wrap: balance; }
a { color: var(--mix); }
a:hover { color: var(--mix-hi); }
:focus-visible { outline: 2px solid var(--ai); outline-offset: 3px; border-radius: 4px; }
strong { color: var(--tx-1); font-weight: 600; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--mix); color: var(--mix-tx); padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 10; }
.skip:focus { top: 16px; }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 32px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 24px; border-radius: 10px; background: var(--ctl); color: var(--tx-1); font-weight: 600; text-decoration: none; }
.btn:hover { background: #473C4B; color: var(--tx-1); }
.btn-primary { background: var(--mix); color: var(--mix-tx); }
.btn-primary:hover { background: var(--mix-hi); color: var(--mix-tx); }
.btn-s { min-height: 44px; padding: 0 18px; }
.btn-icon { width: 44px; padding: 0; justify-content: center; }
.nav .btn-icon { margin-left: -16px; }
.gh { flex: none; }

/* ---------- nav ---------- */
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.brand img { height: 28px; width: auto; }
.nav nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; }
.nav nav a:not(.btn) { color: var(--tx-2); text-decoration: none; }
.nav nav a:not(.btn):hover { color: var(--tx-1); }

/* ---------- shared type ---------- */
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mix); }
.eyebrow.ai { color: var(--ai); }
.fine { font-size: 14px; color: var(--tx-3); }
.fine .platforms { display: block; margin-top: 4px; }
.fine a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.fine a:hover { color: var(--tx-1); }
h2 { font-weight: 600; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.01em; }
h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.copy p, .card p, .facts p, .author p { color: var(--tx-2); }
.narrow { max-width: 780px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- hero ---------- */
.hero { display: flex; flex-direction: column; align-items: center; gap: 28px; padding-block: 72px 96px; text-align: center; }
.hero h1 { max-width: 1000px; font-weight: 700; font-size: clamp(40px, 6vw, 84px); line-height: 1.02; letter-spacing: -0.02em; }
.hero h1 .accent { font-style: normal; color: var(--mix); }
.hero .lead { max-width: 680px; font-size: 20px; color: var(--tx-2); }
.hero .cta { justify-content: center; }
.film { width: 100%; margin-top: 28px; display: flex; flex-direction: column; gap: 14px; text-align: left; }

/* ---------- film ---------- */
.stage { position: relative; width: 100%; aspect-ratio: 1440 / 900; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); }
.scaler, .world { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; transform-origin: 0 0; }
.world { will-change: transform; }
.world > * { position: absolute; }
.world > picture { left: 0; top: 0; }
.full { left: 0; top: 0; width: 1440px; height: 900px; max-width: none; }
.hid { opacity: 0; }
#laneCover { left: 354px; top: 132px; width: 430px; height: 448px; background: var(--panel); opacity: 0; }
#lanes { left: 0; top: 0; width: 1440px; height: 900px; }
#lanes div { position: absolute; left: 354px; width: 0; background-size: 1440px 900px; background-repeat: no-repeat; }
#fieldCover { left: 1138px; top: 706px; width: 274px; height: 50px; background: #110B12; opacity: 0; }
#typed { left: 1143px; top: 712px; width: 264px; font: 400 14px/20px var(--ui); color: var(--tx-1); }
#caret { display: inline-block; width: 1px; height: 15px; background: var(--mix); vertical-align: -2px; margin-left: 1px; }
#Lwork { left: 1116px; top: 52px; width: 316px; height: 838px; max-width: none; opacity: 0; }
#scan { top: 132px; height: 448px; width: 90px; background: linear-gradient(90deg, transparent, rgba(143, 216, 236, 0.3) 85%, var(--ai) 100%); opacity: 0; }
#sweep { left: 8px; top: 588px; width: 776px; height: 302px; border-radius: 14px; overflow: hidden; opacity: 0; }
#sweep i { position: absolute; top: 0; left: 0; width: 220px; height: 100%; background: linear-gradient(90deg, transparent, rgba(206, 230, 84, 0.35), transparent); }
#expBase { background: var(--bg); }
#expBase > div, #wave { position: absolute; background-size: 1440px 900px; background-repeat: no-repeat; }
#expTop { left: 0; top: 0; width: 1440px; height: 52px; }
#expMap { left: 8px; top: 52px; width: 0; height: 848px; background-position: -8px -52px; }
#expWords { left: 936px; top: 52px; width: 504px; height: 848px; background-position: -936px -52px; opacity: 0; }
#indigo { background: var(--indigo); }
#wave { left: 8px; top: 52px; width: 776px; height: 190px; background-position: -8px -52px; border-radius: 14px; }
.film-on #lanes div { background-image: url(img/full-mix.avif); }
.film-on .bgexp { background-image: url(img/full-explain.avif); }
.film-on .bgmas { background-image: url(img/full-master.avif); }
.ring { border: 2px solid var(--ai); border-radius: 12px; pointer-events: none; opacity: 0; }
.ring.lime { border-color: var(--mix); }
.ring.lilac { border-color: var(--master); }
#pointer { width: 22px; height: 22px; opacity: 0; }
.over { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#why { background: #110B13; }
#why .card { position: absolute; left: 170px; top: 284px; width: 1100px; height: 331px; padding: 0; background: none; transform-origin: 50% 50%; }
#why .card img { position: absolute; left: 0; top: 0; width: 1100px; height: 331px; max-width: none; border-radius: 22px; }
#why .dim { opacity: 0.26; }
#end { background: var(--bg); display: flex; align-items: center; justify-content: center; }
#end .lock { height: 104px; width: auto; max-width: none; }
#veil { background: var(--bg); }
#cap { position: absolute; left: 40px; bottom: 40px; max-width: 1000px; padding: 16px 26px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line-strong); font: 600 38px/1.15 var(--display); letter-spacing: -0.01em; opacity: 0; }

.bar { display: flex; align-items: center; gap: 12px; }
#play { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mix); color: var(--mix-tx); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.strip { position: relative; flex: 1; min-width: 0; display: flex; gap: 4px; }
.seg { flex: none; min-width: 0; height: 44px; padding: 0; border: 0; border-radius: 6px; background: var(--tile); color: var(--tx-2); font: 500 13px/1 var(--ui); cursor: pointer; }
.seg:hover { background: var(--ctl); }
.seg.on { background: var(--mix); color: var(--mix-tx); }
.seg.on.m { background: var(--master); color: var(--master-tx); }
#head { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--tx-1); pointer-events: none; }
#now { flex: none; width: 96px; font-size: 14px; color: var(--tx-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#time { flex: none; width: 36px; text-align: right; font-size: 14px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.snd { flex: none; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--mix); background: transparent; color: var(--tx-1); font: 600 14px/1 var(--ui); display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.snd[aria-pressed="true"] { background: var(--mix); color: var(--mix-tx); }
#sndChip { position: absolute; right: 14px; top: 14px; background: var(--bg); }
#sndChip[aria-pressed="true"] { background: var(--mix); }

/* ---------- chapter rail ---------- */
.rail { background: var(--bg-band); border-block: 1px solid var(--line-soft); }
.rail-in { display: flex; flex-direction: column; gap: 24px; padding-block: 40px; }
.rail h2 { font-size: 28px; line-height: 1.15; }
.chips { display: flex; gap: 8px; font-size: 15px; font-weight: 500; }
.chips a { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 8px; background: var(--tile); color: var(--tx-1); text-decoration: none; white-space: nowrap; }
.chips a:hover { background: var(--ctl); }
@media (max-width: 1080px) {
  .chips { flex-direction: column; }
  .chips a { justify-content: flex-start; }
}

/* ---------- steps ---------- */
.step { padding-top: 128px; }
.step.last { padding-bottom: 128px; }
.split { display: flex; flex-wrap: wrap; align-items: center; gap: 48px 64px; }
.split.top { align-items: flex-start; }
.split.rev { flex-direction: row-reverse; }
.split > .copy, .split > .cards, .split > .card { flex: 1 1 340px; }
.split > .shot.wide { flex: 1.55 1 480px; }
.stack { display: flex; flex-direction: column; gap: 40px; }
.shot { min-width: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.shot.bare { border: 0; }
.shot img { width: 100%; }
.cards { display: flex; flex-wrap: wrap; gap: 20px; min-width: 0; }
.cards.col { flex-direction: column; }
.cards.col .card { flex: none; }
.card { flex: 1 1 260px; min-width: 0; background: var(--panel); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.card p { font-size: 15px; }
.card.big { flex-basis: 380px; padding: 32px; gap: 14px; }
.card.big h3 { font-family: var(--display); font-size: 26px; line-height: 1.15; }
.card.big p { font-size: 17px; }
.card .inset { margin-top: 8px; width: 100%; max-width: 350px; border-radius: 14px; }

/* ---------- master room ---------- */
.master { background: var(--indigo); border-top: 1px solid #2B2440; padding-block: 112px 128px; }
.master .eyebrow { color: var(--master); }
.master .shot { border-color: var(--indigo-line); }
.master .card { background: var(--indigo-panel); }

/* ---------- blocks ---------- */
.block { padding-top: 128px; }
.facts { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); }
.facts > div { flex: 1 1 240px; min-width: 0; padding: 24px 24px 0 0; display: flex; flex-direction: column; gap: 8px; }
.facts p { font-size: 15px; }
/* ---------- free and open source: a lime band, dark on light ---------- */
.band { margin-top: 128px; padding-block: 104px 112px; background: var(--mix); color: var(--mix-tx); }
.band .stack { gap: 48px; }
.band a { color: inherit; font-weight: 600; }
.band a:hover { color: #3A4210; }
.band .btn { margin-top: 8px; background: var(--mix-tx); color: var(--mix); }
.band .btn:hover { background: #2A300A; color: var(--mix-hi); }
.band .eyebrow { align-self: flex-start; padding: 5px 12px; border-radius: 6px; background: var(--mix-tx); color: var(--mix); font-size: 13px; }
.band h2 { font-weight: 700; font-size: clamp(42px, 7.2vw, 108px); line-height: 0.96; letter-spacing: -0.03em; }
.band h2 span { color: #5F6B1F; }
.band .copy p { color: var(--mix-tx); font-size: 20px; }
.band .card { background: var(--mix-tx); color: var(--tx-1); box-shadow: 0 18px 50px rgba(23, 26, 4, 0.35); }
.plain { display: flex; flex-direction: column; gap: 32px; padding-top: 56px; border-top: 2px solid var(--mix-tx); }
.plain h3 { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4.4vw, 60px); line-height: 1; letter-spacing: -0.02em; }
.plain ul { padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 40px 64px; }
.plain li { flex: 1 1 400px; min-width: 0; padding-top: 20px; border-top: 1px solid rgba(23, 26, 4, 0.3); font-size: 18px; color: #2A300A; }
.plain li strong { display: block; margin-bottom: 8px; font: 700 26px/1.15 var(--display); letter-spacing: -0.01em; color: var(--mix-tx); }
.plain > p { font-size: 18px; color: var(--mix-tx); }
.author { display: flex; flex-wrap: wrap; align-items: center; gap: 32px 56px; padding: 48px; border-radius: 14px; background: var(--panel); }
.portrait { flex: none; width: 280px; height: 280px; border-radius: 14px; object-fit: cover; }
.author-copy { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.author-copy p:not(.eyebrow) { font-size: 18px; }
.author-copy .cta { margin-top: 8px; }

.final { display: flex; flex-direction: column; align-items: center; gap: 24px; padding-block: 128px 112px; text-align: center; }
.final h2 { max-width: 820px; font-weight: 700; font-size: clamp(34px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.02em; }
.final .cta { justify-content: center; }

footer { border-top: 1px solid var(--line-soft); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 32px; font-size: 14px; color: var(--tx-3); }
.foot .links { display: flex; flex-wrap: wrap; gap: 24px; }
.foot a { color: var(--tx-3); }
.foot a:hover { color: var(--tx-1); }

/* ---------- motion (motion.js adds .motion, .rv and .in; without it nothing here applies) ---------- */
.motion .rv { opacity: 0; transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms), transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0ms); will-change: opacity, transform; }
.motion .rv.rise { transform: translateY(20px); }
.motion .rv.settle { transform: translateY(28px) scale(0.975); }
.motion .rv.in { opacity: 1; transform: none; }
.playhead { position: fixed; z-index: 20; left: 0; top: 0; width: 100%; height: 3px; background: var(--mix); transform: scaleX(0); transform-origin: 0 50%; transition: background-color 0.3s; pointer-events: none; }
.playhead.in-master { background: var(--master); }
.playhead.in-band { background: var(--mix-tx); }
.btn, .chips a { transition: background-color 0.15s, color 0.15s, transform 0.15s; }
.btn:hover, .chips a:hover { transform: translateY(-1px); }
.btn:active, .chips a:active { transform: none; }
.cards .card { transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1); }
.step .card:hover, .master .card:hover, .block .card:hover { transform: translateY(-3px); }
.shot img { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.shot:hover img { transform: scale(1.015); }
@media (prefers-reduced-motion: reduce) {
  .btn, .chips a, .cards .card, .shot img { transition: none; }
  .btn:hover, .chips a:hover, .step .card:hover, .master .card:hover, .block .card:hover, .shot:hover img { transform: none; }
}

/* ---------- narrow screens ---------- */
@media (max-width: 860px) {
  .nav nav a:not(.btn) { display: none; }
  #now { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .hero { padding-block: 40px 64px; gap: 22px; }
  .hero .lead { font-size: 18px; }
  .step, .block { padding-top: 88px; }
  .step.last { padding-bottom: 88px; }
  .master { padding-block: 80px 88px; }
  .split, .stack { gap: 32px; }
  .author { padding: 24px; }
  .portrait { width: 160px; height: 160px; }
  .band { margin-top: 88px; padding-block: 72px 80px; }
  .band .copy p, .plain li, .plain > p { font-size: 17px; }
  .bar { flex-wrap: wrap; }
  .strip { order: 5; flex-basis: 100%; }
  #time { margin-left: auto; }
  #sndChip { display: none; }
  .final { padding-block: 88px 80px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
