/* AI Hashrate — the design system, as CSS.
 *
 * Tokens and type scale come from the Claude Design canvas
 * (AIHashrateDesignSystem_6d0606); the mockup's inline React styles are
 * classes here so the markup stays declarative and the vanilla modules can
 * paint into it. Colour keeps three jobs and no more: amber is "this is the
 * answer", mint "it fits", coral "it does not". Everything else is grey.
 *
 * The Latin faces are vendored under static/fonts/ (IBM Plex Sans + Mono,
 * Source Serif 4 — both OFL). They carry no CJK, so every stack falls through
 * to the system's Chinese faces; the Chinese page is meant to be read in
 * PingFang / Noto, not in a tofu grid.
 */

:root {
  --gray-950: #08080a;
  --gray-900: #101014;
  --gray-850: #15151b;
  --gray-800: #1c1c24;
  --gray-750: #22222b;
  --gray-700: #2a2a34;
  --gray-600: #3a3a46;
  --gray-500: #54545f;
  --gray-400: #78787f;
  --gray-300: #9c9ca3;
  --gray-200: #c1c1c6;
  --gray-100: #e0dfdc;
  --gray-50: #f4f2ee;

  --amber-900: #3a2400;
  --amber-700: #7a4b00;
  --amber-600: #c07f0e;
  --amber-500: #f5a623;
  --amber-400: #ffc04d;
  --amber-300: #ffd685;
  --amber-200: #ffe7b3;

  --mint-600: #1f8f63;
  --mint-500: #3fcf8e;
  --mint-400: #7ce4b3;
  --coral-600: #c23c3c;
  --coral-500: #ff5c5c;
  --coral-400: #ff8a8a;
  --blue-600: #3576c7;
  --blue-500: #5fa8ff;
  --blue-400: #8fc4ff;

  --bg-canvas: var(--gray-950);
  --bg-surface: var(--gray-900);
  --bg-surface-raised: var(--gray-850);
  --bg-inset: var(--gray-800);
  --bg-inset-strong: var(--gray-750);

  --border-hairline: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --border-accent: rgba(245, 166, 35, .45);

  --text-primary: var(--gray-50);
  --text-secondary: var(--gray-300);
  --text-tertiary: var(--gray-400);
  --text-disabled: var(--gray-600);

  --accent: var(--amber-500);
  --accent-strong: var(--amber-400);
  --accent-soft: rgba(245, 166, 35, .14);
  --accent-on: #1a1206;
  --positive: var(--mint-500);
  --positive-soft: rgba(63, 207, 142, .14);
  --negative: var(--coral-500);
  --negative-soft: rgba(255, 92, 92, .14);
  --info: var(--blue-500);
  --info-soft: rgba(95, 168, 255, .14);
  --focus-ring: 0 0 0 3px var(--accent-soft);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-14: 56px;
  --space-18: 72px;
  --space-24: 96px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .55);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  --shadow-glow-accent: 0 0 0 1px rgba(245, 166, 35, .4), 0 0 24px rgba(245, 166, 35, .22);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;

  --text-display-2xl: 72px;
  --text-display-xl: 56px;
  --text-display-lg: 40px;
  --text-display-md: 28px;
  --text-heading: 22px;
  --text-body-lg: 17px;
  --text-body: 15px;
  --text-body-sm: 13px;
  --text-caption: 12px;
  --text-mono-lg: 16px;
  --text-mono: 14px;
  --text-mono-sm: 12px;

  --measure: 900px;
  --gutter: 56px;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("static/fonts/source-serif-4-variable.woff2") format("woff2-variations");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("static/fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("static/fonts/ibm-plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("static/fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("static/fonts/ibm-plex-sans-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("static/fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("static/fonts/ibm-plex-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("static/fonts/ibm-plex-mono-600.woff2") format("woff2");
}

:root {
  --font-display: "Source Serif 4", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-sans: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", -apple-system, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

/* ── ground ─────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

html { background: var(--bg-canvas); }

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-strong); }
a:hover { color: var(--amber-300); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.hair { height: 1px; background: linear-gradient(to right, var(--border-strong), transparent); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.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;
}

/* ── frame ──────────────────────────────────────────────────────────── */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: 38px var(--gutter) 30px;
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: .02em;
}

.masthead-tools { display: flex; align-items: center; gap: var(--space-6); }

.rule-rail { max-width: var(--measure); margin: 0 auto; width: 100%; padding: 0 var(--gutter); }

main {
  flex: 1;
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
  padding: 72px var(--gutter) 100px;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.turn { animation: riseIn 620ms var(--ease-out) both; }

.turn-mark { margin-bottom: 28px; font-family: var(--font-mono); font-size: var(--text-body-sm); }
.turn-mark .now { color: var(--accent-strong); }
.turn-mark .of { color: var(--text-disabled); }

.ask {
  font-family: var(--font-display);
  font-size: var(--text-display-xl);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 var(--space-14);
  max-width: 640px;
}

.step-nav { display: flex; gap: var(--space-6); }

/* ── controls ───────────────────────────────────────────────────────── */

.memory-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 64px; }

.underline-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--text-display-lg);
  padding: 4px 0;
  outline: none;
  width: 180px;
  transition: border-color var(--duration-slow) var(--ease-out);
}
.underline-input:focus { border-color: var(--accent); }

.unit { font-family: var(--font-mono); font-size: var(--text-mono); color: var(--text-tertiary); }

.pill-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 13px 30px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 260ms var(--ease-out);
}
.pill-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.pill-btn.primary { border-color: var(--accent); color: var(--accent-strong); }
.pill-btn.primary:hover { background: var(--accent); color: var(--accent-on); }
.pill-btn.ghost { border-color: transparent; }

.seg-row { display: flex; gap: var(--space-10); margin-bottom: 64px; flex-wrap: wrap; }

.seg {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0 0 6px;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  transition: all 260ms var(--ease-out);
  text-align: left;
}
.seg:hover { color: var(--text-secondary); }
.seg.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.seg .gloss { font-family: var(--font-sans); font-size: var(--text-body-sm); color: var(--text-tertiary); }

.ctx-block { max-width: 480px; margin-bottom: 64px; }
.ctx-value { font-family: var(--font-display); font-size: var(--text-display-lg); margin-bottom: 18px; }

/* The context slider snaps to CTX_STEPS — seven stops, not a free sweep — so
 * the track carries seven ticks. Without them the thumb appears to jump for no
 * reason. The tick box is inset by half a thumb (7px) at each end because that
 * is the range the thumb's centre actually travels, and the repeat period is
 * (100% - 1px) / 6 so the seventh tick lands exactly on the right edge. */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; width: 100%; }

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gray-50);
  border: 2px solid var(--accent);
  margin-top: -4px;   /* centres the 14px thumb on the rail at y=2 */
  cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  /* The box has to be tall enough to hold the ticks: a background is clipped to
   * the border box, so a 1px track paints the rail and nothing else. */
  height: 10px;
  background:
    repeating-linear-gradient(to right,
      var(--border-strong) 0 1px,
      transparent 1px calc((100% - 1px) / 6))
      no-repeat 7px 5px / calc(100% - 13px) 5px,
    linear-gradient(var(--border-strong), var(--border-strong))
      no-repeat 0 2px / 100% 1px;
}
input[type=range]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gray-50);
  border: 2px solid var(--accent);
  cursor: pointer;
}
input[type=range]::-moz-range-track {
  height: 10px;
  background:
    repeating-linear-gradient(to right,
      var(--border-strong) 0 1px,
      transparent 1px calc((100% - 1px) / 6))
      no-repeat 7px 5px / calc(100% - 13px) 5px,
    linear-gradient(var(--border-strong), var(--border-strong))
      no-repeat 0 2px / 100% 1px;
}

.ctx-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-disabled);
  margin-top: var(--space-2);
}

/* ── verdict ────────────────────────────────────────────────────────── */

.verdict-name {
  font-family: var(--font-display);
  font-size: var(--text-display-2xl);
  font-weight: 400;
  line-height: 1.02;
  margin: 0 0 30px;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.spec {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 26px 0 30px;
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.spec .dot { margin: 0 16px; color: var(--text-disabled); }
.spec .tps { color: var(--accent-strong); }
/* The palette's three jobs, all present on a normal verdict: amber says "this
 * is the answer", mint "it fits", coral "it does not". Before this the memory
 * figure was neutral when it fitted, so mint never appeared at all. */
.spec .fits { color: var(--positive); }
.spec .over { color: var(--negative); }
/* Provenance is its own axis, not a third fit state — a measured figure reads
 * plain and confirmed, an estimated one carries the info blue that says "there
 * is a caveat here". Mint stays reserved for "it fits". */
.spec .measured { color: var(--text-primary); }
.spec .estimated { color: var(--info); }

.gloss-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 30px 0 48px;
}

.run-block { margin-bottom: var(--space-14); }

.runtime-tabs { display: flex; gap: var(--space-6); margin-bottom: var(--space-4); }
.runtime-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: none;
  border: none;
  padding: 0 0 4px;
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}
.runtime-tab:hover { color: var(--text-primary); border-bottom-color: var(--border-strong); }
.runtime-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

.cmd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  padding: 18px 0;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}
.cmd code {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--gray-100);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cmd code .flag { color: var(--accent-strong); }
.cmd code .cmt { color: var(--text-disabled); }

.copy-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-strong);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-accent);
  cursor: pointer;
  white-space: nowrap;
  padding: 0 0 3px;
  transition: all var(--duration-base) var(--ease-out);
}
.copy-link:hover { border-bottom-color: var(--accent); }
.copy-link[data-done] { color: var(--positive); }

.cmd-note {
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--text-tertiary);
  margin: var(--space-3) 0 0;
  max-width: 620px;
}

.disclosure {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-hairline);
  padding: 0 0 4px;
  cursor: pointer;
  margin-bottom: var(--space-14);
  display: inline-block;
  transition: all var(--duration-base) var(--ease-out);
}
.disclosure:hover { border-bottom-color: var(--border-strong); }
.disclosure[aria-expanded="true"] { margin-bottom: var(--space-6); }
.disclosure:hover { color: var(--text-primary); }

.alts { margin-bottom: var(--space-14); }
.alt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: 16px 0;
  border-top: 1px solid var(--border-hairline);
}
.alt-name { font-family: var(--font-display); font-size: 19px; }
.alt-spec {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--text-tertiary);
  letter-spacing: .03em;
  white-space: nowrap;
}
.alt-spec.over { color: var(--negative); }

.provenance {
  font-size: var(--text-caption);
  line-height: 1.7;
  color: var(--text-disabled);
  max-width: 620px;
  margin: 0 0 var(--space-10);
}

/* ── reported measurements ──────────────────────────────────────────── */

/* The crowd's number sits under the command, tied to the runtime shown above
 * it — a measurement belongs to a runtime as much as to a machine. It is
 * deliberately quieter than the verdict's own tok/s: amber stays reserved for
 * the answer, and this is evidence beside the answer, not a replacement. */
.reported { margin-top: var(--space-6); }

.reported-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
}

.reported-figure {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--text-primary);
  letter-spacing: .02em;
}

.reported-meta {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--text-tertiary);
  letter-spacing: .04em;
}

.reported-gap {
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--text-tertiary);
  max-width: 620px;
  margin: 0 0 var(--space-4);
}

.reported-note {
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--text-tertiary);
  max-width: 620px;
  margin: 0 0 var(--space-4);
}

.report-form { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }

.report-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
}

.report-select,
.report-tps {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  padding: 6px 0;
  outline: none;
  transition: border-color var(--duration-base) var(--ease-out);
}
.report-select { min-width: 220px; }
.report-tps { width: 110px; }
.report-select:focus,
.report-tps:focus { border-bottom-color: var(--accent); }
.report-select option { background: var(--bg-surface); color: var(--text-primary); }

.report-status {
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--text-tertiary);
  max-width: 620px;
  margin: 0;
}

@media (max-width: 720px) {
  .report-select { min-width: 0; width: 100%; }
  .report-fields { gap: var(--space-2); }
}

/* ── the ledger: what one task costs ────────────────────────────────── */

.ledger { margin: var(--space-6) 0 var(--space-8); }

.ledger-row {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--border-hairline);
}
.ledger-row:last-child { border-bottom: none; }

.ledger-figure {
  font-family: var(--font-display);
  font-size: var(--text-display-lg);
  line-height: 1.1;
  margin: var(--space-2) 0 var(--space-1);
  color: var(--text-primary);
}
.ledger-row:first-child .ledger-figure { color: var(--accent-strong); }

.ledger-gloss {
  font-size: var(--text-body-sm);
  line-height: 1.6;
  color: var(--text-tertiary);
  max-width: 620px;
}

/* ── chrome ─────────────────────────────────────────────────────────── */

.link-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-hairline);
  padding: 0 0 3px;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
}
.link-btn:hover { color: var(--text-primary); border-bottom-color: var(--border-strong); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: var(--text-body-sm);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
#toast[data-on] { opacity: 1; transform: translate(-50%, 0); }

/* ── narrow ─────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  :root {
    --gutter: 24px;
    --text-display-2xl: 40px;
    --text-display-xl: 32px;
    --text-display-lg: 30px;
  }
  .masthead { padding: 24px var(--gutter) 20px; }
  main { padding: 44px var(--gutter) 72px; }
  .ask { margin-bottom: var(--space-10); }
  .memory-row, .seg-row, .ctx-block { margin-bottom: var(--space-10); }
  .seg-row { gap: var(--space-6); }
  .seg { font-size: 21px; }
  .spec .dot { margin: 0 10px; }
  .cmd { flex-direction: column; gap: var(--space-3); }
  .pill-btn { padding: 12px 22px; }
  .alt { flex-direction: column; gap: var(--space-1); }
  .alt-spec { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .turn { animation: none; }
  * { transition-duration: 1ms !important; }
}
