/*
 * The app's palette, as CSS custom properties — one property per key of
 * COLOR/FILL (dark) and LIGHT_COLOR/LIGHT_FILL (light) in src/theme/tokens.ts,
 * under the same name. Dark is the default because Electric Lime is the theme
 * the app shipped with; paper follows the reader's system setting.
 *
 * Copied, not generated: src/site/site.test.ts compares every value here with
 * tokens.ts and fails the moment the app's palette moves without this file.
 */
:root {
  color-scheme: dark;
  --bg: #0E0F0C; --card: #16180F; --card2: #1C1E14;
  --ink: #ECEEF0; --muted: #868B91; --faint: #5A5F65;
  --accent: #C5F03C; --accent2: #9FB52E; --gold: #E9C56B; --warn: #E8A23C; --slate: #7FA3C0;
  --line: rgba(236,238,240,0.08); --line2: rgba(236,238,240,0.13); --danger: #E8455C;
  --scrim: rgba(7,8,6,0.55);
  --mediaLight: #FFFFFF;
  --grabber: rgba(236,238,240,0.18);
  --accentInk: #C5F03C;
  --onAccent: #0E0F0C;
  --onDanger: #ECEEF0;
  --overlay: rgba(7,8,6,0.55);
  --onOverlay: #ECEEF0;

  --accentSoft: rgba(197,240,60,0.13); --goldSoft: rgba(233,197,107,0.13);
  --warnSoft: rgba(232,162,60,0.13); --slateSoft: rgba(127,163,192,0.13);
  --accentMid: rgba(197,240,60,0.34); --accentStrong: rgba(197,240,60,0.78);
  --neutralSoft: rgba(134,139,145,0.16);
  --accentBorder: rgba(197,240,60,0.5); --goldBorder: rgba(233,197,107,0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F6F5EF; --card: #FFFFFF; --card2: #E3E2D9;
    --ink: #16180F; --muted: #62665B; --faint: #878B7C;
    --accent: #C5F03C; --accent2: #556C16; --gold: #73560F; --warn: #854E0D; --slate: #315D83;
    --line: rgba(22,24,15,0.12); --line2: rgba(22,24,15,0.17); --danger: #C4162C;
    --scrim: rgba(22,24,15,0.35);
    --mediaLight: #FFFFFF;
    --grabber: rgba(22,24,15,0.20);
    --accentInk: #44570C;
    --onAccent: #16180F;
    --onDanger: #FFFFFF;
    --overlay: rgba(7,8,6,0.55);
    --onOverlay: #ECEEF0;

    --accentSoft: rgba(92,122,14,0.27); --goldSoft: rgba(160,120,15,0.15);
    --warnSoft: rgba(190,110,20,0.14); --slateSoft: rgba(45,100,140,0.13);
    --accentMid: rgba(92,122,14,0.67); --accentStrong: rgba(58,79,6,1);
    --neutralSoft: rgba(107,111,99,0.14);
    --accentBorder: rgba(92,122,14,0.60); --goldBorder: rgba(160,120,15,0.50);
  }
}

/*
 * escalo.app — one stylesheet for every page, built on tokens.css.
 *
 * The app's rules, translated rather than loosened (design-system.md §5):
 * two weights (400/500), Instrument Serif for display and Geist for the rest,
 * tabular numbers wherever a number sits, lime as a FILL only — text and lines
 * that must be read take `accentInk`, text on lime takes `onAccent`. One solid
 * pairing, `card` on `bg`; everything nested is a tint. No motion beyond hover
 * and press.
 *
 * Sizes are the app's scale (display 30/24/18, body 15, label 12, micro 10)
 * multiplied by --scale, which grows with the viewport so the proportions
 * between them never change.
 */
@font-face { font-family: 'Instrument Serif'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/InstrumentSerif-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Geist'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/Geist-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/Geist-Medium.ttf') format('truetype'); }

:root {
  --scale: 1.07;
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 7px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
  --gutter: 16px;
  --max: 1120px;
}
@media (min-width: 720px) { :root { --scale: 1.2; --gutter: 32px; } }
@media (min-width: 1100px) { :root { --scale: 1.3; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--ui); font-weight: 400;
  font-size: calc(15px * var(--scale)); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accentInk); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
strong, b { font-weight: 500; }
:focus-visible { outline: 2px solid var(--accentInk); outline-offset: 3px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.wordmark { font-family: var(--display); font-size: calc(24px * var(--scale)); color: var(--ink); text-decoration: none; line-height: 1; }
.wordmark span { color: var(--accentInk); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: calc(12px * var(--scale));
  padding: 10px 10px; border-radius: var(--r-sm); min-height: 44px; display: inline-flex; align-items: center;
}
.site-nav a:hover { color: var(--ink); background: var(--neutralSoft); }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); margin-top: calc(48px * var(--scale)); }
.site-foot .wrap { padding-top: 28px; padding-bottom: 40px; display: grid; gap: 12px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: calc(12px * var(--scale)); }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-links a.mail { color: var(--accentInk); }
.foot-note { color: var(--faint); font-size: calc(12px * var(--scale)); margin: 0; max-width: 60ch; }

/* ── Shared type ────────────────────────────────────────────────────── */
.micro {
  font-size: calc(10px * var(--scale)); font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.h-display { font-family: var(--display); font-weight: 400; letter-spacing: -0.005em; line-height: 1.1; margin: 0; }
.h-xl { font-size: calc(30px * var(--scale) * 1.25); }
.lede { color: var(--muted); max-width: 46ch; margin: 0; }

/* ── Home: hero ─────────────────────────────────────────────────────── */
.hero { padding: calc(40px * var(--scale)) 0 calc(24px * var(--scale)); }
.hero .wrap { display: grid; gap: calc(28px * var(--scale)); align-items: center; }
.hero h1 { font-size: calc(34px * var(--scale) * 1.35); line-height: 1.04; max-width: 12ch; }
.hero .lede { margin-top: 18px; font-size: calc(15px * var(--scale) * 1.1); }
.platform { margin: 14px 0 0; color: var(--faint); font-size: calc(12px * var(--scale)); }
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.1fr 1fr; gap: 64px; }
  .hero h1 { font-size: calc(34px * var(--scale) * 1.7); }
}

/* ── Home: sections ─────────────────────────────────────────────────── */
.section { padding: calc(36px * var(--scale)) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-grid { display: grid; gap: calc(22px * var(--scale)); align-items: start; }
.section-grid > header { display: grid; gap: 12px; }
@media (min-width: 900px) {
  .section-grid { grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
  .section-grid.flip > header { order: 2; }
}

/* ── The exhibit: a card as the app draws it ────────────────────────── */
.exhibit {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: calc(14px * var(--scale)); display: grid; gap: calc(8px * var(--scale));
  width: 100%; max-width: 480px; margin: 0;
}
@media (min-width: 900px) { .exhibit { justify-self: end; } .flip .exhibit { justify-self: start; } }
.ex-name { color: var(--muted); font-size: calc(12px * var(--scale)); font-weight: 500; margin: 0 0 2px; }
.set-head { display: flex; align-items: center; justify-content: space-between; }
.set-lbl { color: var(--faint); font-size: calc(12px * var(--scale)); }

.box {
  width: calc(24px * var(--scale)); height: calc(24px * var(--scale)); border-radius: var(--r-sm);
  border: 1.5px solid var(--line2); display: inline-flex; align-items: center; justify-content: center;
  color: transparent; font-size: calc(12px * var(--scale)); flex: none;
}
.box.done { background: var(--accent); border-color: var(--accent); color: var(--onAccent); }

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side {
  position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: calc(10px * var(--scale)) calc(12px * var(--scale));
}
.side.done { background: var(--accentSoft); }
.side::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--edge); }
.side.l { --edge: var(--accentInk); }
.side.r { --edge: var(--gold); }
.side-lbl { font-size: calc(9px * var(--scale)); letter-spacing: 1px; text-transform: uppercase; color: var(--faint); margin: 0 0 5px; }
.side-val { font-size: calc(18px * var(--scale)); color: var(--ink); font-variant-numeric: tabular-nums; margin: 0; white-space: nowrap; }
.side-val .unit, .side-val .x { color: var(--faint); font-size: 0.72em; }

.coach {
  display: flex; gap: 11px; align-items: flex-start; background: var(--neutralSoft);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: calc(12px * var(--scale)); margin-top: 4px;
}
.coach-icon {
  width: calc(22px * var(--scale)); height: calc(22px * var(--scale)); border-radius: 6px; background: var(--accentSoft);
  color: var(--accentInk); display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-size: calc(12px * var(--scale));
}
.coach p { margin: 0; color: var(--muted); font-size: calc(12px * var(--scale)); line-height: 1.5; }

/* ── Model rows ─────────────────────────────────────────────────────── */
.models { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.models li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: calc(12px * var(--scale)) 0; border-top: 1px solid var(--line);
}
.models li:last-child { border-bottom: 1px solid var(--line); }
.tag {
  justify-self: start; border-radius: var(--r-sm); padding: 4px 9px;
  font-size: calc(10px * var(--scale)); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
}
.models .move { grid-column: 1; color: var(--ink); }
.models .data { grid-column: 2; grid-row: 1 / span 2; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.models .data .unit { color: var(--faint); }
.models .data .nw { white-space: nowrap; display: inline-block; }

/* ── Chart ──────────────────────────────────────────────────────────── */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: calc(12px * var(--scale)); }
.legend i { width: 10px; height: 10px; border-radius: 5px; background: var(--c); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ylab { fill: var(--faint); font-family: var(--ui); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .band { fill: var(--warn); fill-opacity: 0.15; }
.chart .left { stroke: var(--accentInk); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .right { stroke: var(--gold); fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot-l { fill: var(--accentInk); }
.chart .dot-r { fill: var(--gold); }
.note { color: var(--muted); margin: 0; }

/* ── Superset rounds ────────────────────────────────────────────────── */
.round { display: grid; gap: 6px; padding: 6px 0; }
.round + .round { border-top: 1px solid var(--line); padding-top: 12px; }
.round-head { display: flex; align-items: center; justify-content: space-between; }
.round-lbl { color: var(--muted); font-size: calc(12px * var(--scale)); font-weight: 500; letter-spacing: 0.05em; }
.round-row { margin: 0; display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.round-row span { color: var(--muted); }

/* ── Facts ──────────────────────────────────────────────────────────── */
.facts { display: grid; gap: 12px; margin-top: calc(22px * var(--scale)); }
@media (min-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: calc(16px * var(--scale)); }
.fact h3 { font-family: var(--display); font-weight: 400; font-size: calc(18px * var(--scale) * 1.15); line-height: 1.2; margin: 0 0 6px; }
.fact p { margin: 0; color: var(--muted); font-size: calc(12px * var(--scale) * 1.1); }

/* ── Plans ──────────────────────────────────────────────────────────── */
.plans { display: grid; gap: 12px; margin-top: calc(22px * var(--scale)); }
@media (min-width: 720px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: calc(18px * var(--scale)); }
.plan.pro { border-color: var(--accentBorder); }
.plan h3 { font-family: var(--display); font-weight: 400; font-size: calc(24px * var(--scale)); margin: 6px 0 4px; display: flex; align-items: center; gap: 10px; }
.chip {
  font-family: var(--ui); background: var(--accent); color: var(--onAccent); border-radius: var(--r-sm);
  font-size: calc(10px * var(--scale)); font-weight: 500; letter-spacing: 0.08em; padding: 3px 7px;
}
.plan .sub { color: var(--muted); margin: 0 0 10px; font-size: calc(12px * var(--scale)); }
.plan ul { list-style: none; margin: 0; padding: 0; }
.plan li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.plan li::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: var(--accentInk); flex: none; transform: translateY(-2px); }

/* ── Contact strip ──────────────────────────────────────────────────── */
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  background: var(--accent); color: var(--onAccent); border-radius: var(--r-md); text-decoration: none; font-weight: 500;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); filter: brightness(0.96); }

/* ── Prose pages: Support, Privacy, Terms ───────────────────────────── */
.prose { max-width: 46rem; padding-top: calc(36px * var(--scale)); line-height: 1.65; }
.prose h1 { font-family: var(--display); font-weight: 400; font-size: calc(30px * var(--scale) * 1.25); line-height: 1.1; margin: 0 0 1.25rem; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: calc(24px * var(--scale)); line-height: 1.2; margin: 2.5rem 0 .6rem; }
.prose h3 { font-weight: 500; font-size: 1em; margin: 1.8rem 0 .4rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--faint); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose code { background: var(--neutralSoft); padding: .12em .35em; border-radius: 4px; font-size: .9em; }
.prose blockquote { margin: 1.5rem 0; padding: .6rem 1rem; border-left: 2px solid var(--line2); color: var(--muted); }
.prose .tablewrap { overflow-x: auto; margin: 1.25rem 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9em; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5rem .65rem; text-align: left; vertical-align: top; }
.prose th { background: var(--neutralSoft); font-weight: 500; }
mark.ph { background: var(--warnSoft); color: var(--warn); padding: .1em .4em; border-radius: 4px; font-weight: 500; font-size: .9em; }
