/* Baton promotional page. Tokens follow the app's panel (ui/style.css): warm off-white, ink text, one clay accent.
   Body text uses a system sans; headlines use a system serif. No external resources. */
:root {
  color-scheme: light dark;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --panel: #f6f5f1;
  --ink: #0b0b0b;
  --muted: #5f5e5a;      /* 6.4:1 on --bg */
  --faint: #6e6d68;      /* 5.0:1 on --bg, for captions */
  --line: rgba(11, 11, 11, 0.1);
  --line-strong: rgba(11, 11, 11, 0.2);
  --hover: rgba(11, 11, 11, 0.045);
  --accent: #d97757;     /* clay: rings, focus, live state, the active path (never body text on light) */
  --accent-text: #a94f30; /* 5.3:1 on --bg */
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px rgba(0, 0, 0, 0.07);
  /* the stage is always dark: it matches the edge of the hero image */
  --stage: #1c1b19;
  --cream: #f6f1e7;      /* about 15:1 on --stage */
  --cream-2: #c9c3b6;    /* about 9.5:1 on --stage */
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Songti SC', 'Noto Serif CJK SC', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei UI', 'Noto Sans CJK SC', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --surface: #30302e;
    --panel: #1f1e1d;
    --ink: #f5f4ee;
    --muted: #bfbdb4;    /* about 9:1 on --bg */
    --faint: #a6a49c;    /* about 5.8:1 on --bg */
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.18);
    --hover: rgba(255, 255, 255, 0.06);
    --accent-text: #e3917a; /* about 6:1 on --bg */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 40px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure, pre { margin: 0; }
h1, h2, h3 { font-weight: 400; }
ul, ol { padding: 0; }
img { max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible, pre:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
button { font: inherit; color: inherit; }
[id] { scroll-margin-top: 72px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.mark { display: block; }
.mark circle { fill: none; stroke-width: 2.4; }
.mark .r1 { stroke: var(--accent); }
.mark .r2 { stroke: currentColor; }

/* nav: dark and translucent in both themes, like the stage it sits on */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(28, 27, 25, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cream);
}
.nav-in { display: flex; align-items: center; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 23px/1 var(--serif); letter-spacing: -0.01em; }
.brand .mark { width: 26px; height: 26px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.lang {
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgba(246, 241, 231, 0.3); background: none; color: var(--cream);
  font: 500 13px/1 var(--sans); letter-spacing: 0.02em; cursor: pointer;
}
.lang:hover { background: rgba(246, 241, 231, 0.08); }
.quiet { font-size: 15px; color: var(--cream-2); text-decoration: none; }
.quiet:hover { color: var(--cream); }

/* type */
h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6.6vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
h3 { font: 600 18px/1.35 var(--sans); letter-spacing: -0.01em; }
.eyebrow {
  font: 600 13px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 18px;
}
.lead {
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-wrap: pretty;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 24px; border-radius: 999px;
  border: 1px solid transparent; font: 500 16px/1 var(--sans);
  text-decoration: none; white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn-light { background: var(--cream); color: var(--stage); }
.btn-light:hover { opacity: 0.88; }
.btn-outline-light { border-color: rgba(246, 241, 231, 0.36); color: var(--cream); }
.btn-outline-light:hover { background: rgba(246, 241, 231, 0.08); }

/* stage */
.stage {
  background: var(--stage);
  color: var(--cream);
  text-align: center;
  padding-top: clamp(72px, 11vw, 132px);
  overflow: hidden;
}
.stage h1 { margin: 0 auto; max-width: 15em; }
.stage-lead {
  max-width: 34em; margin: 26px auto 0;
  font-size: clamp(18px, 2.1vw, 22px); line-height: 1.55; color: var(--cream-2);
  text-wrap: pretty;
}
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.stage-art { max-width: 1240px; margin: clamp(8px, 2vw, 24px) auto 0; }
.stage-art img {
  display: block; width: 100%; height: auto;
  /* soften the frame so the photo melts into the stage */
  -webkit-mask-image: radial-gradient(ellipse 72% 78% at 50% 50%, #000 58%, transparent 100%);
          mask-image: radial-gradient(ellipse 72% 78% at 50% 50%, #000 58%, transparent 100%);
}

/* the film: the next block of the same dark stage */
.stage-film { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(88px, 12vw, 144px); }
.film-card {
  max-width: 1080px; margin: clamp(40px, 6vw, 64px) auto 0;
  border-radius: clamp(16px, 2.4vw, 28px);
  border: 1px solid rgba(246, 241, 231, 0.14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden; background: #000;
}
.film-card video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* sections and dividers */
.section { padding: clamp(88px, 12vw, 144px) 0; border-top: 1px solid var(--line); }
.stage + .section { border-top: 0; }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .lead { margin-top: 20px; }

/* full-column imagery */
.shot {
  margin-bottom: clamp(48px, 7vw, 88px);
  border-radius: clamp(16px, 2.4vw, 28px);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--stage);
  aspect-ratio: 16 / 9;
}
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
#principles .shot { margin-bottom: clamp(56px, 8vw, 96px); }

/* text beside a visual */
.split { display: grid; gap: clamp(40px, 6vw, 72px); align-items: center; }
.split-text h2 { margin-bottom: 22px; }
.split-text p:not(.eyebrow) { color: var(--muted); font-size: 17px; max-width: 470px; }
.split-text p + p { margin-top: 14px; }

/* the panel replica (the only shadow on the page) */
.hero-fig { max-width: 580px; margin: 0 auto; text-align: center; }
.hero-fig figcaption, .diagram figcaption { margin-top: 16px; font-size: 13px; color: var(--faint); text-align: center; }
.mock {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.mock-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.mock-head .mark { width: 26px; height: 26px; }
.mock-head b { font: 400 23px/1 var(--serif); letter-spacing: -0.01em; }
.pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.job-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px 16px; margin-bottom: 14px;
}
.job-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-top b { font-weight: 600; font-size: 15px; }
.thread {
  margin-left: auto; font-size: 12.5px; color: var(--muted);
  background: var(--hover); padding: 5px 9px; border-radius: 7px;
}
.job-last {
  margin-top: 9px; font: 13px/1.4 var(--mono); color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.job-bar { position: absolute; left: 0; bottom: 0; width: 34%; height: 2px; background: var(--accent); }

.rail { display: flex; flex-direction: column; }
.acct {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 12px 8px; border-radius: 12px;
}
.acct + .acct { border-top: 1px solid var(--line); border-radius: 0; }
.av { position: relative; width: 40px; height: 40px; display: grid; place-items: center; flex: none; }
.av svg { position: absolute; inset: 0; width: 40px; height: 40px; transform: rotate(-90deg); overflow: visible; }
.av circle { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.av .track { stroke: var(--line); }
.av .ring { stroke: var(--faint); }
.av i {
  position: relative; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: normal 600 12px/1 var(--sans); font-style: normal;
  background: var(--panel); color: var(--ink);
}
.av .lead-i { background: var(--ink); color: var(--bg); }
.working .ring { stroke: var(--accent); }
.limited .ring { stroke: var(--faint); }
.limited .av i { opacity: 0.7; }

.who { min-width: 0; }
.who b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; font-size: 14.5px; overflow-wrap: anywhere; }
.who > small { display: block; margin-top: 2px; font-size: 13px; color: var(--faint); }
.working > .who > small { color: var(--accent-text); }
.tag {
  font: 600 10.5px/1 var(--sans); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--muted); background: var(--hover); padding: 4px 7px; border-radius: 6px;
}
.u {
  display: grid; grid-template-columns: 3.4em minmax(0, 1fr) 3em; gap: 8px; align-items: center;
  margin-top: 8px; font-size: 12px; color: var(--faint);
}
.u > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.u-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.u-bar i { display: block; height: 100%; border-radius: 2px; background: var(--muted); }
.u-bar i.hot { background: var(--accent); }
.model { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--faint); }
.sel {
  position: relative; padding: 2px 24px 2px 8px; border-radius: 6px;
  border: 1px solid var(--line-strong); color: var(--muted); font-size: 12px;
}
.sel::after {
  content: ""; position: absolute; right: 10px; top: 45%; width: 4px; height: 4px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}

/* small CSS visuals (memory, usage) */
.visual {
  border: 1px solid var(--line); border-radius: 22px; background: var(--surface);
  padding: clamp(22px, 3vw, 32px); min-height: 280px;
  display: flex; flex-direction: column; justify-content: center;
}
.v-label {
  font: 600 12px/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 10px;
}
.v-label + ul + .v-label { margin-top: 26px; }
.threads, .ledger { list-style: none; margin: 0; padding: 0; }
.threads li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.threads span { font-size: 15px; font-weight: 500; }
.threads small { font-size: 13px; color: var(--faint); overflow-wrap: anywhere; text-align: right; }
.ledger li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.ledger time { font: 13px/1.4 var(--mono); color: var(--faint); }
.ledger span { font: 13px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.reset { display: block; margin: 4px 0 0; font-size: 12px; color: var(--faint); }

/* diagrams (inline SVG) */
.dcard {
  border: 1px solid var(--line); border-radius: 22px; background: var(--panel);
  padding: clamp(18px, 3.4vw, 36px) clamp(10px, 2.6vw, 32px);
}
.dg { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; overflow: visible; }
.dg text { font-family: var(--sans); }
.dg .t { font-size: 14px; font-weight: 600; fill: var(--ink); }
.dg .s { font-size: 13px; fill: var(--muted); }
.dg .sm { font-size: 12.5px; }
.dg .m { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.dg .m.k { font-size: 10px; fill: var(--ink); }
.dg .a { font-size: 12.5px; font-weight: 600; fill: var(--accent-text); }
.dg .c { font-size: 13px; fill: var(--ink); }
.dg .inv { fill: var(--bg); }
.dg .serif { font-family: var(--serif); font-size: 19px; font-weight: 400; }
.dg .box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1; }
.dg .hub, .dg .end { stroke: var(--accent); }
.dg .q { stroke-dasharray: 4 3; }
.dg .start { fill: var(--ink); }
.dg .chip { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.dg .ac { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dg .ln { fill: none; stroke: var(--faint); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.dg .dash { stroke-dasharray: 3 4; }
.dg .mk1 { fill: none; stroke: var(--accent); stroke-width: 2; }
.dg .mk2 { fill: none; stroke: var(--ink); stroke-width: 2; }
.dg .trk { fill: var(--line-strong); }
.dg .fil { fill: var(--muted); }
.dg .lock { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linejoin: round; }
.dg .dot { fill: var(--accent); }

/* how it works */
.steps { list-style: none; display: grid; gap: 0; align-self: start; }
.steps li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--line); padding: 26px 0 30px; }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.num { font: 400 40px/1 var(--serif); letter-spacing: -0.02em; }
.steps p { margin-top: 8px; color: var(--muted); font-size: 16px; }

/* principles */
.principles { display: grid; gap: 0; }
.pr { border-top: 1px solid var(--line); padding: 28px 0 32px; }
.pr p { margin-top: 10px; color: var(--muted); font-size: 16px; max-width: 520px; }

/* good to know */
.notes { list-style: none; max-width: 740px; }
.notes li { border-top: 1px solid var(--line); padding: 20px 0; color: var(--muted); font-size: 16px; }
.notes li:last-child { border-bottom: 1px solid var(--line); }
.notes a { color: var(--ink); text-underline-offset: 3px; }

/* get baton */
.get-box {
  max-width: 720px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: clamp(26px, 4vw, 40px);
}
.get-note { color: var(--muted); font-size: 16px; }
.get-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn-ink { background: var(--ink); color: var(--bg); }
.btn-ink:hover { opacity: 0.88; }
.btn-line { border-color: var(--line-strong); color: var(--ink); }
.btn-line:hover { background: var(--hover); }
.get-src { margin-left: 6px; color: var(--accent-text); text-underline-offset: 3px; }
.get-notes { list-style: none; margin-top: 28px; display: grid; gap: 10px; color: var(--muted); font-size: 15px; }
.get-notes li { position: relative; padding-left: 20px; }
.get-notes li::before {
  content: ""; position: absolute; left: 2px; top: 0.6em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.build { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.build h3 { margin-bottom: 6px; }
pre {
  margin-top: 18px; padding: 18px 20px; border-radius: 12px;
  background: var(--bg); border: 1px solid var(--line);
  font: 15px/1.7 var(--mono); overflow-x: auto;
}

/* footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; }
.foot p { font-size: 14px; color: var(--faint); max-width: 640px; }

/* wider layouts */
@media (min-width: 760px) {
  .principles { grid-template-columns: 1fr 1fr; column-gap: 56px; }
}
@media (min-width: 920px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split.flip > .split-text { order: 2; }
  .how-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
}

/* motion: reveal on scroll and the diagrams' accent path drawing in. Only when motion is allowed
   and only once the script has set .js, so the page is complete without JavaScript. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .job-bar { animation: slide 2.2s ease-in-out infinite; }
  .js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 1.1s cubic-bezier(0.2, 0.6, 0.2, 1), transform 1.1s cubic-bezier(0.2, 0.6, 0.2, 1); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .diagram .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.9s cubic-bezier(0.45, 0, 0.2, 1) calc(var(--d, 0s) + 0.3s); }
  .js .diagram.in .draw { stroke-dashoffset: 0; }
  .js .diagram .tip { opacity: 0; transition: opacity 0.3s ease calc(var(--d, 0s) + 1.05s); }
  .js .diagram.in .tip { opacity: 1; }
  .js .stage-text > * { animation: rise 1.2s cubic-bezier(0.2, 0.6, 0.2, 1) both; }
  .js .stage-text > :nth-child(2) { animation-delay: 0.12s; }
  .js .stage-text > :nth-child(3) { animation-delay: 0.24s; }
  .js .stage-art { animation: fade 1.8s ease 0.2s both; }
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(195%); }
  100% { transform: translateX(-100%); }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* the nav is short on phones; the film is directly under the hero there anyway */
@media (max-width: 520px) {
  .nav-film { display: none; }
}

/* small phones (360px and up) */
@media (max-width: 420px) {
  .wrap { padding: 0 18px; }
  .mock { padding: 16px; }
  .brand { font-size: 21px; }
  .nav-right { gap: 14px; }
  .quiet { font-size: 14px; }
  .thread { margin-left: 0; }
  .cta .btn { flex: 1 1 100%; }
  /* let the diagrams use nearly the full width so their labels stay readable */
  .dcard { margin-left: -10px; margin-right: -10px; padding: 18px 4px; border-radius: 18px; }
}
