/* Noa landing page. Dark-first; light via prefers-color-scheme or the toggle. */

:root {
  --bg: #111214;
  --bg-alt: #15161a;
  --surface: #1b1d21;
  --surface-2: #212328;
  --line: #2b2d32;
  --line-2: #3a3c42;
  --text: #f4f2ec;
  --body: #c2c0bb;
  --muted: #a09e99;
  --accent: #e8a33d;
  --accent-ink: #f0b157;
  --on-accent: #1b1308;
  --accent-soft: rgba(232, 163, 61, .12);
  --glow: rgba(232, 163, 61, .10);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);

  /* Terminal surfaces stay dark in both themes. */
  --t-bg: #16171a;
  --t-bar: #1e2024;
  --t-line: #2c2e33;
  --t-text: #ebe8e0;
  --t-dim: #8f8d88;
  --t-acc: #f0b157;
  --t-grn: #9cc48a;
  --t-red: #e8907f;
  --t-blu: #9db9dd;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 56px);
  --radius: 12px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f8f6f0;
    --bg-alt: #f0ede5;
    --surface: #fffdf8;
    --surface-2: #f4f1e9;
    --line: #dfd9cd;
    --line-2: #cdc6b8;
    --text: #1d1d21;
    --body: #45444a;
    --muted: #5f5d5a;
    --accent-ink: #8a4d03;
    --accent-soft: rgba(232, 163, 61, .16);
    --glow: rgba(232, 163, 61, .14);
    --shadow: 0 30px 70px -34px rgba(40, 30, 10, .35);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f8f6f0;
  --bg-alt: #f0ede5;
  --surface: #fffdf8;
  --surface-2: #f4f1e9;
  --line: #dfd9cd;
  --line-2: #cdc6b8;
  --text: #1d1d21;
  --body: #45444a;
  --muted: #5f5d5a;
  --accent-ink: #8a4d03;
  --accent-soft: rgba(232, 163, 61, .16);
  --glow: rgba(232, 163, 61, .14);
  --shadow: 0 30px 70px -34px rgba(40, 30, 10, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { color: var(--text); margin: 0; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 7.2vw, 5.4rem); line-height: .98; letter-spacing: -.055em; font-weight: 800; }
h2 { font-size: clamp(1.95rem, 4.2vw, 3.3rem); line-height: 1.04; letter-spacing: -.045em; }
h3 { font-size: 1.06rem; line-height: 1.3; letter-spacing: -.015em; }
.h3-lg { font-size: clamp(1.4rem, 2.4vw, 1.85rem); letter-spacing: -.035em; line-height: 1.12; }
p { margin: 0; }
code, kbd, pre { font-family: var(--mono); }
:not(pre) > code {
  font-size: .86em;
  padding: .1em .38em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  overflow-wrap: anywhere;
}
kbd {
  font-size: .8em;
  padding: .08em .4em;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--on-accent); border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.accent { color: var(--accent); }
.accent-ink { color: var(--t-acc); }

.eyebrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font: 500 .74rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.eyebrow code { text-transform: none; letter-spacing: 0; }
.pill {
  display: inline-block; padding: 3px 9px; border-radius: 99px;
  border: 1px solid var(--line-2); color: var(--text);
  font: 600 .72rem/1.3 var(--mono); letter-spacing: .02em; text-transform: none;
}
.pill--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lead { font-size: clamp(1.03rem, 1.3vw, 1.14rem); line-height: 1.65; color: var(--body); max-width: 62ch; text-wrap: pretty; }
.note { font-size: .92rem; color: var(--muted); line-height: 1.6; }
.text-link { display: inline-flex; gap: 6px; margin-top: 18px; font-weight: 600; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 2px; }
.text-link:hover { border-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px; border-radius: 10px;
  font-weight: 600; font-size: .98rem; text-decoration: none;
  border: 1px solid transparent; transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: #f0b157; }
.btn--ghost { color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.copy {
  font: 600 .74rem/1 var(--mono); letter-spacing: .02em;
  padding: 8px 10px; min-width: 64px; min-height: 32px; border-radius: 7px;
  background: var(--t-bar); color: var(--t-text);
  border: 1px solid var(--t-line); cursor: pointer;
}
.copy:hover { border-color: var(--accent); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.03em; min-height: 44px; }
.brand img { border-radius: 7px; }
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; color: var(--body); text-decoration: none; font-size: .93rem; font-weight: 500; border-radius: 8px; }
.nav__links a:hover { color: var(--text); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--text); }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .i-sun { display: none; }
  :root:not([data-theme]) .i-moon { display: block; }
}
.gh { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.gh:hover { border-color: var(--text); }

/* Sections */
.section { padding-block: clamp(72px, 9vw, 128px); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.head { margin-bottom: clamp(36px, 4.5vw, 56px); }
.head .lead { margin-top: 20px; }

/* Hero */
.hero { position: relative; padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(16px, 3vw, 40px); overflow-x: clip; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%); pointer-events: none;
}
.hero__top { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.hero__copy { padding-bottom: 36px; }
.hero__copy .lead { margin-top: 24px; max-width: 54ch; }
.hero__noa { width: clamp(180px, 20vw, 250px); margin-right: clamp(8px, 4vw, 64px); margin-bottom: -10px; position: relative; z-index: 2; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
.quick { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; margin-top: 22px; max-width: 560px; padding: 10px 10px 10px 14px; border-radius: 10px; background: var(--t-bg); border: 1px solid var(--t-line); }
.quick__label { grid-column: 1 / -1; font: 600 .66rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--t-acc); }
.quick__cmd { margin: 0; overflow-x: auto; color: var(--t-text); font-size: .8rem; line-height: 1.6; white-space: pre; scrollbar-width: thin; }

/* Demo window */
.demo { position: relative; z-index: 1; margin: 0; border-radius: 14px; background: var(--t-bg); border: 1px solid var(--t-line); box-shadow: var(--shadow); color: var(--t-text); overflow: hidden; }
.demo__bar, .term__bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--t-bar); border-bottom: 1px solid var(--t-line); font: 500 .76rem/1.2 var(--mono); color: var(--t-dim); }
.dots { display: inline-flex; gap: 6px; flex: none; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3c42; }
.demo__title, .term__title { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo__meta { color: var(--t-acc); white-space: nowrap; }
.demo__body { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr); min-height: 440px; }
.pane { min-width: 0; display: flex; flex-direction: column; }
.pane--orch { border-right: 1px solid var(--t-line); }
.pane__head { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--t-line); font: 600 .72rem/1.3 var(--mono); color: var(--t-text); }
.pane__sub { color: var(--t-dim); font-weight: 500; }
.orch { flex: 1; margin: 0; padding: 14px; overflow: auto; font-size: .76rem; line-height: 1.75; color: var(--t-text); white-space: normal; scrollbar-width: thin; }
.orch .ln { display: block; width: max-content; white-space: pre; }
.orch .pr { color: var(--t-acc); }
.orch .s { color: var(--t-grn); }
.orch .out { color: var(--t-dim); }
.orch .hl { color: var(--t-acc); }
.js .orch .ln { opacity: 0; transform: translateY(3px); transition: opacity .35s ease, transform .35s ease; }
.js .orch .ln.on { opacity: 1; transform: none; }
.cur, .t-cur, .tcur { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.2em; background: var(--t-acc); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.board { padding: 6px 8px 8px; font: .76rem/1.45 var(--mono); outline: none; border-radius: 0; }
.board:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.board__group { margin: 10px 8px 4px; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--t-dim); }
.row {
  display: grid;
  grid-template-columns: 1.6em 1.3em 6.6em minmax(0, 1fr) 4.4em 4.6em;
  column-gap: 6px; align-items: baseline;
  padding: 6px 8px; border-radius: 7px; border: 1px solid transparent;
  cursor: pointer; color: var(--t-text);
}
.row:hover { background: rgba(255, 255, 255, .04); }
.row[aria-selected="true"] { background: rgba(232, 163, 61, .1); border-color: rgba(232, 163, 61, .45); }
.row__n { color: var(--t-dim); }
.row__st { color: var(--t-dim); }
.row__lb { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__count, .tree { color: var(--t-dim); font-weight: 400; }
.row__ag { color: var(--t-blu); }
.row__tm { color: var(--t-dim); text-align: right; white-space: nowrap; }
.row__ms { grid-column: 3 / -1; color: var(--t-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row--child .row__ms { padding-left: 1.4em; }
.mk { font-weight: 700; }
.mk--need { color: var(--t-acc); }
.mk--run { color: var(--t-grn); }
.mk--done { color: var(--t-dim); }
.mk--err { color: var(--t-red); }
.board__folded { margin: 8px 8px 0; padding-top: 8px; border-top: 1px dashed var(--t-line); color: var(--t-dim); }
.preview { margin-top: auto; border-top: 1px solid var(--t-line); background: #131417; }
.preview__strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 14px; border-bottom: 1px solid var(--t-line); font: .72rem/1.3 var(--mono); color: var(--t-text); }
.badge { padding: 2px 7px; border-radius: 5px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.badge--run { background: #2a3a26; color: var(--t-grn); }
.preview__screen { margin: 0; padding: 12px 14px 14px; min-height: 9.5em; font-size: .74rem; line-height: 1.6; color: var(--t-text); white-space: pre; overflow-x: auto; scrollbar-width: thin; }
.preview__screen .d { color: var(--t-dim); }
.preview__screen .a { color: var(--t-acc); }
.preview__screen .g { color: var(--t-grn); }
.preview__screen .r { color: var(--t-red); }
.demo__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding: 10px 14px; background: var(--t-bar); border-top: 1px solid var(--t-line); font: .72rem/1.6 var(--mono); color: var(--t-dim); }
.demo__foot kbd { background: var(--t-bg); color: var(--t-text); border-color: var(--t-line); font-size: .9em; margin-inline: 1px; }
.legend b { font-weight: 700; }
.legend .mk--need { color: var(--t-acc); }
.legend .mk--run { color: var(--t-grn); }
.legend .mk--err { color: var(--t-red); }
.legend .mk--done { color: var(--t-text); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .95rem; }
.card .note { margin-top: 14px; font-size: .86rem; }
.k { font: 600 .74rem/1 var(--mono); color: var(--accent-ink); margin-right: 6px; vertical-align: .1em; }

.round { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(48px, 6vw, 80px); align-items: start; }
.round__code h3 { margin-bottom: 12px; font-size: 1.25rem; }
.round__code .note { margin: 14px 0 10px; }
.round__shots { display: grid; gap: 22px; }
.shot { margin: 0; }
.shot img { border-radius: 10px; border: 1px solid var(--t-line); background: #1f1f1f; }
.shot figcaption { margin-top: 10px; font-size: .9rem; color: var(--muted); }
.shot b { color: var(--text); }

.code { margin: 0; padding: 16px 18px; border-radius: 10px; background: var(--t-bg); border: 1px solid var(--t-line); color: var(--t-text); font-size: .8rem; line-height: 1.7; overflow-x: auto; white-space: pre; scrollbar-width: thin; }
.code--sm { font-size: .74rem; margin-top: 16px; }
.code .c { color: var(--t-dim); }
.code .s { color: var(--t-grn); }
.code .f { color: var(--t-acc); }
.codebox { position: relative; }
.codebox .code { padding-right: 84px; }
.codebox .copy { position: absolute; top: 9px; right: 9px; }

.ember { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center; margin-top: clamp(48px, 6vw, 80px); padding: clamp(22px, 3vw, 32px) clamp(22px, 3vw, 40px); border-radius: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.ember img { width: clamp(84px, 9vw, 112px); }
.ember h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -.03em; margin-bottom: 10px; }

/* Speed */
.speed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.speed__copy .lead { margin-top: 20px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 22px; }
.ticks li::before { content: "›"; position: absolute; left: 4px; top: -1px; color: var(--accent); font-weight: 700; }
.speed__panel { position: relative; display: flex; align-items: flex-end; justify-content: flex-start; padding-right: clamp(60px, 10vw, 150px); }
.meter { width: 100%; max-width: 440px; padding: 26px 26px 22px; border-radius: 14px; background: var(--t-bg); border: 1px solid var(--t-line); color: var(--t-text); box-shadow: var(--shadow); }
.meter__label { font: 500 .74rem/1 var(--mono); color: var(--t-dim); }
.meter__value { margin-top: 12px; font: 700 clamp(2.6rem, 5.4vw, 3.8rem)/1 var(--mono); letter-spacing: -.04em; color: var(--accent); }
.meter__value span { font-size: .36em; letter-spacing: 0; color: var(--t-text); }
.meter__rows { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.meter__rows li { display: grid; grid-template-columns: 3.4em 1fr; align-items: center; gap: 12px; font: .78rem var(--mono); }
.meter__rows i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #b97a22, var(--accent)); transform-origin: left; }
.meter__rows li:nth-child(1) i { width: 95%; }
.meter__rows li:nth-child(2) i { width: 96%; }
.meter__rows li:nth-child(3) i { width: 100%; }
.js .meter__rows i { transform: scaleX(0); transition: transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .meter.on .meter__rows i { transform: scaleX(1); }
.meter__foot { margin-top: 18px; font: .74rem/1.5 var(--mono); color: var(--t-dim); }
.speed__noa { position: absolute; right: 0; bottom: -28px; width: clamp(110px, 13vw, 170px); filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .3)); }

.cjk { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: center; margin-top: clamp(72px, 9vw, 120px); }
.cjk__copy > p { margin-top: 14px; }
.pipe { margin: 24px 0 0; display: grid; border-top: 1px solid var(--line); }
.pipe div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pipe dt { font: 600 .76rem/1.7 var(--mono); color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }
.pipe dd { margin: 0; font-size: .94rem; }
.lig { font-variant-ligatures: contextual; font-feature-settings: "calt" 1, "liga" 1; }
.u { text-decoration-line: underline; text-underline-offset: .22em; text-decoration-color: var(--accent); margin-right: .35em; color: var(--text); }
.u--double { text-decoration-style: double; }
.u--wavy { text-decoration-style: wavy; }
.u--dotted { text-decoration-style: dotted; text-decoration-thickness: 2px; }
.u--dashed { text-decoration-style: dashed; }

/* Generic terminal figure */
.term { margin: 0; border-radius: 12px; overflow: hidden; background: var(--t-bg); border: 1px solid var(--t-line); color: var(--t-text); box-shadow: var(--shadow); }
.term__body { margin: 0; padding: 16px 18px; font-size: .84rem; line-height: 1.7; white-space: pre; overflow-x: auto; scrollbar-width: thin; }
.term__caption { padding: 10px 16px; border-top: 1px solid var(--t-line); font: .72rem/1.5 var(--mono); color: var(--t-dim); }
.t-dim { color: var(--t-dim); }
.t-yel { color: var(--t-acc); font-weight: 700; }
.t-grn { color: var(--t-grn); }
.ime { text-decoration: underline; text-underline-offset: .25em; }

/* Ghostty + themes */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.two h3 { margin-bottom: 14px; font-size: 1.15rem; }
.two .note { margin-top: 14px; }
.note--honest { padding: 12px 14px; border-radius: 9px; border: 1px dashed var(--line-2); }
.note--honest b { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { padding: 6px 10px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); font: .76rem/1.3 var(--mono); color: var(--text); }

.themes { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 56px); align-items: center; margin-top: clamp(64px, 8vw, 104px); padding-top: clamp(48px, 6vw, 72px); border-top: 1px solid var(--line); }
.themes__copy > p { margin-top: 14px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px 0 8px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 .8rem var(--sans); cursor: pointer; }
.swatch i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(127, 127, 127, .4); }
.swatch[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.term--theme { --th-1: #d9725f; --th-2: #9cc48a; --th-3: #e8a33d; --th-4: #7a9cc6; --th-5: #b48ead; --th-6: #7fb3b5; --th-8: #82878f; }
.term--theme .term__body { background: var(--th-bg, #1b1d21); color: var(--th-fg, #f7f7f2); transition: background-color .25s ease, color .25s ease; }
.term--theme .tcur { background: var(--th-cur, #e8a33d); }
.p1 { color: var(--th-1); } .p2 { color: var(--th-2); } .p3 { color: var(--th-3); } .p4 { color: var(--th-4); }
.p5 { color: var(--th-5); } .p6 { color: var(--th-6); } .p8 { color: var(--th-8); }
.palette { display: grid; grid-template-columns: repeat(16, 1fr); height: 10px; }
.palette i { display: block; }

/* Platforms */
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card--tall { display: flex; flex-direction: column; }
.card--tall .note { margin-top: auto; padding-top: 14px; }
.box__title { margin: clamp(40px, 5vw, 56px) 0 16px; font-size: 1.05rem; }
.box { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.box li { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); font-size: .93rem; color: var(--body); }

/* Built */
.built { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.built__copy .lead { margin-top: 18px; }
.facts { margin: 28px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--text); font-weight: 600; }
.facts dd { margin: 4px 0 0; font-size: .95rem; }
.built__art { margin: 0; }
.built__art img { border-radius: 16px; }

/* Mascot */
.mascot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.mascot__art { position: relative; }
.mascot__sleep { border-radius: 16px; border: 1px solid var(--line); }
.mascot__ember { position: absolute; width: 64px; right: -14px; top: -26px; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.mascot__copy .lead { margin-top: 18px; }
.mascot__copy .note { margin-top: 16px; }

/* Install */
.install { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.install__intro p { margin-top: 18px; max-width: 34ch; }
.cursor { display: inline-block; width: .48em; height: .82em; margin-left: .12em; vertical-align: -.04em; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.install__noa { margin: 32px 0 0; display: flex; align-items: flex-end; gap: 14px; }
.install__noa img { width: clamp(110px, 12vw, 150px); }
.install__noa figcaption { font: 500 .95rem var(--mono); color: var(--muted); padding-bottom: 24px; }
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 20px 40px 20px 0; cursor: pointer; list-style: none; position: relative; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; position: absolute; right: 6px; top: 16px; font: 400 1.4rem/1 var(--mono); color: var(--accent-ink); }
.acc details[open] summary::after { content: "−"; }
.acc__t { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.acc__s { font: .74rem/1.4 var(--mono); color: var(--muted); }
.acc__body { padding: 0 0 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.acc, .acc details, .codebox { min-width: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding-block: 36px 44px; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.footer__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.footer__brand img { border-radius: 5px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.footer__links a { color: var(--body); text-decoration: none; font-size: .92rem; display: inline-block; padding: 6px 0; }
.footer__links a:hover { color: var(--text); text-decoration: underline; }
.footer__fine { flex-basis: 100%; font-size: .84rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .box { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row { grid-template-columns: 1.6em 1.3em 6.2em minmax(0, 1fr) 4.4em; }
  .row__ag { display: none; }
}

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__actions { margin-left: auto; }
  .demo__body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .pane--orch { border-right: 0; border-bottom: 1px solid var(--t-line); }
  .orch { max-height: 15.5em; }
  .round, .speed, .cjk, .two, .themes, .built, .mascot, .install { grid-template-columns: minmax(0, 1fr); }
  .trio { grid-template-columns: minmax(0, 1fr); }
  .speed__panel { padding-right: 120px; }
  .cjk .term { order: 2; }
  .built__art { max-width: 520px; }
  .install__noa { display: none; }
}

@media (max-width: 620px) {
  .hero__top { grid-template-columns: minmax(0, 1fr); }
  .hero__copy { padding-bottom: 0; }
  .hero__noa { display: none; }
  .demo { margin-top: 32px; }
  .demo__title { text-align: left; }
  .demo__meta { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .box { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1.4em 1.2em minmax(0, 1fr) 4.2em; }
  .row__st { display: none; }
  .row__ms { grid-column: 3 / -1; }
  .ember { grid-template-columns: minmax(0, 1fr); }
  .ember img { width: 72px; }
  .speed__panel { padding-right: 0; }
  .speed__noa { display: none; }
  .pipe div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gh span { display: none; }
  .gh { padding: 0 11px; }
  .btn { flex: 1 1 100%; }
  .mascot__ember { right: -4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .orch .ln { opacity: 1; transform: none; }
  .js .meter__rows i { transform: none; }
}

@media (max-width: 620px) {
  .term__body, .preview__screen { font-size: .7rem; }
}

/* Narrow screens: the code scrolls sideways, so the copy button sits below it instead of over it. */
@media (max-width: 620px) {
  .codebox { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
  .codebox .code { align-self: stretch; padding-right: 18px; }
  .codebox .copy { position: static; }
}
