/* ===========================================================================
   Tokenometer — tokenometer.live

   Direction: instrument datasheet. The page is the spec sheet, printed on pale
   technical stock; the app is the dark instrument sitting on it. Every measured
   value is set in mono, because on a datasheet the number and its unit are the
   content and the prose is the caption.

   Paper colours are the app's own light palette (Palette.swift) re-tuned for
   legibility on stock; the vivid greens and ambers are the app's dark palette
   and appear ONLY inside dark instrument surfaces, where they belong.
   =========================================================================== */

/* --- faces ---------------------------------------------------------------
   Self-hosted, latin subset only. A site whose argument is that the app makes
   no network calls has no business fetching fonts from someone else's server. */

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2-variations');
  font-weight: 500 800;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face { font-family:'Plex'; src:url('/fonts/plexsans-400.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'Plex'; src:url('/fonts/plexsans-500.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'Plex'; src:url('/fonts/plexsans-600.woff2') format('woff2'); font-weight:600; font-display:swap; }
@font-face { font-family:'PlexMono'; src:url('/fonts/plexmono-400.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face { font-family:'PlexMono'; src:url('/fonts/plexmono-500.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face { font-family:'PlexMono'; src:url('/fonts/plexmono-600.woff2') format('woff2'); font-weight:600; font-display:swap; }

:root {
  --paper:    #e7e9e2;
  --panel:    #f4f5f1;
  --ink:      #14161a;
  --graphite: #585e64;
  --faint:    #878d92;
  --rule:     #c6cbc1;
  --rule-firm:#a9b0a5;
  --signal:   #d9572a;

  /* instrument semantics — dark surfaces only */
  --dark:     #17191d;
  --dark-2:   #1f2226;
  --good:     #47d975;
  --warn:     #ffb32e;
  --crit:     #ff6357;
  --sonnet:   #4a90e2;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Plex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'PlexMono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gut: 26px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection { background: var(--signal); color: #fff; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

/* --- shell ---------------------------------------------------------------- */

.sheet { max-width: 1160px; margin: 0 auto; padding: 0 var(--gut); }
.col   { max-width: 68ch; }

/* --- mono utility --------------------------------------------------------- */

.spec {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --- masthead ------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule-firm);
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
}
.masthead .sheet {
  display: flex; align-items: center; gap: 18px; height: 58px;
}
.wordmark {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .01em;
}
.wordmark svg { width: 22px; height: 22px; display: block; border-radius: 5px; }
.designation {
  margin-left: 4px; padding-left: 18px;
  border-left: 1px solid var(--rule);
  color: var(--faint);
}
@media (max-width: 860px) { .designation { display: none; } }
@media (max-width: 720px) { .masthead nav a.hide-md { display: none; } }
@media (max-width: 560px) { .masthead nav a.hide-sm { display: none; } }

.masthead nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.masthead nav a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; text-decoration: none; color: var(--graphite);
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.masthead nav a:hover { color: var(--ink); border-bottom-color: var(--signal); }

/* --- hero ----------------------------------------------------------------- */

.hero { padding: 78px 0 0; }

.hero .lockup { display: grid; grid-template-columns: 1fr; gap: 0; }

.hero h1 {
  font-family: var(--display);
  font-stretch: 116%;
  font-weight: 700;
  font-size: clamp(42px, 7.2vw, 88px);
  line-height: .96;
  letter-spacing: -.022em;
  margin: 16px 0 0;
  max-width: 15ch;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--signal); }

.hero .stand {
  margin: 26px 0 0;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: var(--graphite);
  max-width: 52ch;
}
.hero .stand b { color: var(--ink); font-weight: 600; }

/* --- the instrument ------------------------------------------------------- */

.instrument {
  margin: 46px 0 0;
  background: var(--dark);
  border-radius: 6px;
  padding: 24px 26px 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset,
              0 18px 44px -26px rgba(12,14,18,.55);
}

.inst-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.inst-head .spec { color: #7c848c; }
.inst-head .who { margin-left: auto; color: #7c848c; }

.readout { display: grid; grid-template-columns: 1fr 232px; gap: 30px; align-items: stretch; }
@media (max-width: 820px) { .readout { grid-template-columns: 1fr; gap: 22px; } }

.readout svg { display: block; width: 100%; height: auto; }

/* verdict panel */
.verdict {
  border-left: 1px solid rgba(255,255,255,.10);
  padding-left: 24px;
  display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 820px) {
  .verdict { border-left: 0; border-top: 1px solid rgba(255,255,255,.10); padding: 20px 0 0; }
}
.verdict .spec { color: #7c848c; margin-bottom: 12px; }
.verdict .figure {
  font-family: var(--display); font-stretch: 112%; font-weight: 700;
  font-size: 52px; line-height: 1; letter-spacing: -.02em;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}
.verdict .figure.ok { color: var(--good); }
.verdict .said {
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
  color: #b9c0c6; margin-top: 14px;
}
.verdict .said strong { color: #eceff2; font-weight: 500; }

.badge {
  display: inline-block; align-self: flex-start; margin-top: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 3px;
}
.badge--good { background: rgba(71,217,117,.16); color: var(--good); }
.badge--warn { background: rgba(255,179,46,.16); color: var(--warn); }
.badge--crit { background: rgba(255,99,87,.16);  color: var(--crit); }

.chip { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.10); }
.chip .spec { display: block; color: #6e767d; margin-bottom: 10px; }
.chip svg { display: block; width: 150px; height: 28px; }

#needle { transition: transform .55s cubic-bezier(.3,.8,.3,1); }
#chipFill, #barTokens { transition: width .55s cubic-bezier(.3,.8,.3,1), fill .3s ease; }
@media (prefers-reduced-motion: reduce) {
  #needle, #chipFill, #barTokens { transition: none; }
}

/* switches */
.switches {
  margin-top: 22px; display: flex; gap: 0; flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,.16); border-radius: 4px; overflow: hidden;
  width: fit-content; max-width: 100%;
}
.switches button {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: #99a1a8;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; padding: 9px 15px;
  transition: background .18s, color .18s;
}
.switches button + button { border-left: 1px solid rgba(255,255,255,.16); }
.switches button:hover { color: #e6eaed; }
.switches button[aria-pressed="true"] { background: var(--signal); color: #fff; }

.inst-foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.inst-foot p {
  margin: 0; max-width: 74ch;
  color: #6e767d; font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
}

/* --- section rhythm ------------------------------------------------------- */

.block { padding: 76px 0; border-top: 1px solid var(--rule); }
.block:first-of-type { border-top: 0; }

.block-grid { display: grid; grid-template-columns: 152px 1fr; gap: 40px; }
@media (max-width: 860px) { .block-grid { grid-template-columns: 1fr; gap: 18px; } }

.rail { padding-top: 6px; }
.rail .spec { display: block; }
.rail .rail-note {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  margin-top: 10px; line-height: 1.6;
}
@media (max-width: 860px) { .rail .rail-note { display: none; } }

h2 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(27px, 3.3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.018em;
  margin: 0 0 20px;
  max-width: 20ch;
  text-wrap: balance;
}
h3 {
  font-family: var(--body);
  font-size: 17px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.005em;
}

p { margin: 0 0 16px; max-width: 66ch; }
p:last-child { margin-bottom: 0; }
.lede { font-size: 19px; color: var(--graphite); }
.lede b, p b { color: var(--ink); font-weight: 600; }

/* --- measured table ------------------------------------------------------- */

.measure { width: 100%; max-width: 820px; border-collapse: collapse; margin: 6px 0 0; }
.measure th {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); font-weight: 500;
  text-align: left; padding: 0 16px 9px 0; border-bottom: 1px solid var(--rule-firm);
}
.measure th.num, .measure td.num { text-align: right; padding-right: 0; }
.measure td {
  padding: 13px 16px 13px 0; border-bottom: 1px solid var(--rule);
  vertical-align: baseline; font-size: 15.5px;
}
.measure td.num {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-weight: 500; white-space: nowrap;
}
.measure tr[data-pick] td { background: rgba(217,87,42,.06); }
.measure tr[data-pick] td:first-child { box-shadow: inset 2px 0 0 var(--signal); padding-left: 12px; }
.measure .fail { color: var(--faint); }
.measure .pick-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--signal); margin-left: 10px;
}
.scroll { overflow-x: auto; }

/* --- feature rows --------------------------------------------------------- */

.rows { display: grid; gap: 0; }
.row { padding: 24px 0; border-bottom: 1px solid var(--rule); display: grid;
       grid-template-columns: 26px 1fr; gap: 16px; }
.row:first-child { padding-top: 0; }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row { grid-template-columns: 104px 1fr; }
.row .idx {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--signal);
  padding-top: 4px; font-weight: 500;
}
@media (max-width: 560px) { .row { grid-template-columns: 1fr; gap: 6px; } }
.row p { color: var(--graphite); font-size: 15.5px; margin: 0; }

/* --- shots ---------------------------------------------------------------- */

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .shots { grid-template-columns: 1fr; } }
.shot { margin: 0; }
.shot img {
  display: block; width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 14px 34px -22px rgba(12,14,18,.6);
}
/* These are 2x renders of the real app. Never display one wider than the pixels
   it actually has, or the UI it is meant to show off goes soft. */
.shot--card   { max-width: 520px; }
.shot--window { max-width: 344px; }
.shot--wide   { max-width: 640px; }
.shot figcaption {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  margin-top: 12px; line-height: 1.6; max-width: 58ch;
}
.shot figcaption b { color: var(--graphite); font-weight: 500; }

.aside {
  margin-top: 28px; padding: 20px 22px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 5px;
}
.aside .spec { display: block; margin-bottom: 8px; }
.aside p { margin: 0; font-size: 15px; color: var(--graphite); }

/* --- inverted band -------------------------------------------------------- */

.invert { background: var(--dark); color: #e9ecef; padding: 84px 0; }
.invert h2 { color: #fff; max-width: 22ch; }
.invert .spec { color: #7c848c; }
.invert p { color: #aab1b8; }
.invert p b, .invert .lede b { color: #fff; }
.invert .rule { border-color: rgba(255,255,255,.12); }

.claims { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 0; }
.claims li {
  display: grid; grid-template-columns: 92px 1fr; gap: 20px;
  padding: 16px 0; border-top: 1px solid rgba(255,255,255,.12);
  font-size: 15.5px; color: #aab1b8; line-height: 1.55;
}
.claims li:last-child { border-bottom: 1px solid rgba(255,255,255,.12); }
.claims .k {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--good); padding-top: 3px;
}
.claims b { color: #fff; font-weight: 600; }

/* --- buttons -------------------------------------------------------------- */

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .09em;
  text-transform: uppercase; text-decoration: none;
  padding: 13px 20px; border-radius: 4px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  transition: background .16s, color .16s, border-color .16s;
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-firm); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
.invert .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.invert .btn:hover { background: var(--signal); border-color: var(--signal); color: #fff; }

.note { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 16px; }

/* --- footer --------------------------------------------------------------- */

footer { border-top: 1px solid var(--rule-firm); padding: 40px 0 64px; }
footer .top { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: baseline; }
footer nav { margin-left: auto; display: flex; gap: 24px; flex-wrap: wrap; }
footer nav a {
  font-family: var(--mono); font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; text-decoration: none; color: var(--graphite);
}
footer nav a:hover { color: var(--signal); }
footer .fine {
  margin: 26px 0 0; max-width: 74ch; font-size: 13px; line-height: 1.65; color: var(--faint);
}

/* --- documents (privacy / support) ---------------------------------------- */

.doc { padding: 62px 0 20px; }
.doc-head { border-bottom: 1px solid var(--rule-firm); padding-bottom: 26px; margin-bottom: 44px; }
.doc-head h1 {
  font-family: var(--display); font-stretch: 114%; font-weight: 700;
  font-size: clamp(34px, 5vw, 52px); line-height: 1.02; letter-spacing: -.02em;
  margin: 14px 0 0;
}
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 18px; }

.doc-body { display: grid; grid-template-columns: 168px 1fr; gap: 44px; align-items: start; }
@media (max-width: 900px) { .doc-body { grid-template-columns: 1fr; gap: 0; } }

.toc { position: sticky; top: 78px; }
@media (max-width: 900px) { .toc { display: none; } }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.toc li { margin-bottom: 9px; }
.toc a {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.45;
  text-decoration: none; color: var(--faint); display: block;
}
.toc a:hover { color: var(--signal); }

.prose h2 {
  font-family: var(--display); font-stretch: 108%; font-weight: 700;
  font-size: 23px; line-height: 1.2; letter-spacing: -.012em;
  margin: 52px 0 14px; padding-top: 20px; border-top: 1px solid var(--rule);
  max-width: none;
}
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 16.5px; font-weight: 600; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--graphite); font-size: 16px; line-height: 1.68; }
.prose ul { padding-left: 20px; margin: 0 0 16px; max-width: 66ch; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--rule-firm); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .callout {
  background: var(--panel); border-left: 2px solid var(--signal);
  padding: 20px 22px; margin: 0 0 26px; border-radius: 0 4px 4px 0;
}
.prose .callout p { margin: 0; color: var(--ink); font-size: 17px; }
.prose .callout p + p { margin-top: 12px; }

code, .mono { font-family: var(--mono); font-size: .87em; }
.prose code, .measure code {
  background: rgba(20,22,26,.06); border: 1px solid var(--rule);
  padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}
.invert code { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.14); color: #dfe4e8; }

/* --- motion --------------------------------------------------------------- */

/* Both projections live in the SVG; only one is lit at a time. */
.proj { opacity: 0; transition: opacity .42s ease; }
.proj.is-on { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .draw {
    stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
    animation: draw 1.4s cubic-bezier(.22,.68,.32,1) .2s forwards;
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .proj { transition: none; }
}
