/* Palette values come from the validated reference instance; the six series
   slots were run through validate_palette.js in both modes before use. */
:root {
  color-scheme: light;
  --page:        #f9f9f7;
  --surface:     #fcfcfb;
  --ink:         #0b0b0b;
  --ink-2:       #52514e;
  --muted:       #898781;
  --grid:        #e1e0d9;
  --axis:        #c3c2b7;
  --hair:        rgba(11,11,11,0.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --good:        #006300;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7;
    --muted: #898781; --grid: #2c2c2a; --axis: #383835;
    --hair: rgba(255,255,255,0.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --s4: #c98500; --s5: #d55181; --s6: #008300;
    --good: #0ca30c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #ffffff; --ink-2: #c3c2b7;
  --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --hair: rgba(255,255,255,0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --s4: #c98500; --s5: #d55181; --s6: #008300;
  --good: #0ca30c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; }

/* ---------- masthead ---------- */
header.top {
  border-bottom: 1px solid var(--hair); padding: 14px 0;
  position: sticky; top: 0; background: var(--page); z-index: 20;
}
header.top .wrap { display: flex; align-items: center; gap: 16px; }
.brand { font-family: var(--display); font-weight: 600; font-size: 17px;
  letter-spacing: -0.005em; margin-right: auto; }
.brand span { color: var(--muted); font-weight: 400; }
nav.top a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
nav.top a:hover { color: var(--ink); }

/* ---------- hero ----------
   Area is price. A log chart is the honest way to *analyse* a 95x fall and the
   worst way to *feel* one -- it exists to flatten magnitude. So the hero shows
   the fall linearly: one square per quarter, sized by price. */
.hero { padding: 54px 0 14px; }
.hero-h {
  font-family: var(--display); font-weight: 600; margin: 0 0 30px;
  font-size: clamp(36px, 6vw, 64px); line-height: 1.0; letter-spacing: -0.02em;
  font-optical-sizing: auto; font-variation-settings: "SOFT" 40, "WONK" 1;
}
.hero-figure { position: relative; margin: 0 0 22px; }
#herochart { display: block; width: 100%; height: auto; overflow: visible; }
.hero-claim { margin: 0; font-size: 19px; line-height: 1.45; color: var(--ink-2); max-width: 52ch; }
.hero-claim b { color: var(--ink); font-weight: 600; }
.hero-note { margin: 14px 0 0; color: var(--muted); font-size: 14.5px; max-width: 62ch; line-height: 1.6; }

.sq { fill: var(--s1); }
.sq-last { fill: var(--ink); }
.sq-hit { fill: transparent; cursor: default; }
.hero-q { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.hero-big { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  fill: var(--ink); font-variant-numeric: lining-nums; font-variation-settings: "SOFT" 30; }
.hero-small { fill: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.hero-base { stroke: var(--axis); stroke-width: 1; }
.hero-model { fill: var(--muted); font-size: 11.5px; }

@media (prefers-reduced-motion: no-preference) {
  .sq-in { opacity: 0; animation: sqin 380ms cubic-bezier(.2,.7,.2,1) forwards; }
  .hero-fade { opacity: 0; animation: fade 420ms ease forwards; }
}
@keyframes sqin { to { opacity: 1; } }
@keyframes fade { to { opacity: 1; } }

/* Figures read as a row of measurements, not a rack of identical cards --
   hairline rules between values, no boxes, no shadows. */
.figures {
  display: flex; flex-wrap: wrap; gap: 0 34px; margin: 40px 0 0; padding: 20px 0 0;
  border-top: 1px solid var(--hair);
}
.figures div { padding: 2px 0; }
.figures dt { color: var(--muted); font-size: 12.5px; order: 2; margin-top: 3px; }
.figures dd {
  margin: 0; order: 1; font-family: var(--display); font-weight: 600;
  font-size: 27px; letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums; font-optical-sizing: auto;
}
.figures div { display: flex; flex-direction: column; }

/* Hero chart type: the two prices are the headline, so they are set at
   display size directly on the line's endpoints. */
.hero-price { font-family: var(--display); font-weight: 700;
  font-size: 46px; letter-spacing: -0.03em; }
.hero-price-sm { font-family: var(--display); font-weight: 700;
  font-size: 34px; letter-spacing: -0.03em; }
.hero-meta { fill: var(--muted); font-size: 12.5px; }
.hero-model { fill: var(--ink-2); font-size: 13px; font-weight: 500; }
.hero-line { fill: none; stroke-width: 2.5; stroke-linejoin: round;
  stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
  .hero-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
    animation: draw 1100ms cubic-bezier(.22,.61,.36,1) forwards; }
  .hero-fade { opacity: 0; animation: fade 420ms ease forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* ---------- sections ---------- */
section { padding: 46px 0; border-top: 1px solid var(--hair); margin-top: 46px; }
section:first-of-type { border-top: 0; }
h2 { font-family: var(--display); font-size: 27px; letter-spacing: -0.01em;
  margin: 0 0 6px; font-weight: 600; font-optical-sizing: auto; }
.sub { color: var(--ink-2); margin: 0 0 22px; max-width: 68ch; font-size: 14.5px; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 18px; }
.seg { display: inline-flex; border: 1px solid var(--hair); border-radius: 8px;
  overflow: hidden; background: var(--surface); }
.seg button { appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; color: var(--ink-2); padding: 7px 13px; }
.seg button + button { border-left: 1px solid var(--hair); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
.seg button:focus-visible { outline: 2px solid var(--s1); outline-offset: -2px; }
input[type="search"], input[type="number"], select {
  font: inherit; font-size: 14px; padding: 7px 11px; border-radius: 8px;
  border: 1px solid var(--hair); background: var(--surface); color: var(--ink);
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--s1); outline-offset: -1px; }

/* ---------- chart ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--hair);
  border-radius: 12px; padding: 18px 18px 10px; }
.chart-wrap { position: relative; }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.axisline { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.endlabel { font-size: 11.5px; font-weight: 560; paint-order: stroke;
  stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; }
.crosshair { stroke: var(--axis); stroke-width: 1; pointer-events: none; }
.dot { stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 2px;
  font-size: 12.5px; color: var(--ink-2); }
.legend button { appearance: none; background: none; border: 0; font: inherit;
  color: inherit; cursor: pointer; display: inline-flex; align-items: center;
  gap: 6px; padding: 3px 2px; border-radius: 5px; }
.legend button[aria-pressed="false"] { opacity: 0.38; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.tip { position: absolute; pointer-events: none; background: var(--surface);
  border: 1px solid var(--hair); border-radius: 9px; padding: 9px 11px;
  font-size: 12.5px; min-width: 190px; box-shadow: 0 6px 22px rgba(0,0,0,.13);
  opacity: 0; transition: opacity .1s; z-index: 5; }
.tip .d { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
.tip .row { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.tip .row .sw { width: 9px; height: 9px; border-radius: 2px; flex: none;
  position: relative; top: -1px; }
.tip .row .nm { color: var(--ink-2); }
.tip .row .val { margin-left: auto; font-variant-numeric: tabular-nums;
  font-weight: 580; }
.tip .mdl { color: var(--muted); font-size: 11px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--hair); border-radius: 10px;
  background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--hair);
  white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky;
  top: 0; background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.pill { font-size: 11px; padding: 1.5px 7px; border-radius: 999px;
  border: 1px solid var(--hair); color: var(--ink-2); }
.drop { color: var(--good); font-weight: 580; }
.spark { display: block; }

/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(230px, 300px) 1fr; gap: 26px; }
.calc .fields { display: flex; flex-direction: column; gap: 13px; }
.calc label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.calc input, .calc select { width: 100%; }
.bignum { font-family: var(--display); font-size: 44px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: lining-nums; }
.bignum small { display: block; font-size: 13px; font-weight: 400; color: var(--muted);
  letter-spacing: 0; margin-top: 5px; }

footer { border-top: 1px solid var(--hair); margin-top: 56px; padding: 26px 0 46px;
  color: var(--muted); font-size: 13px; }
footer a { color: var(--ink-2); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .calc { grid-template-columns: 1fr; }
  .hero { padding: 30px 0 8px; }
  .hero-h { margin-bottom: 20px; }
  .hero-claim { font-size: 16.5px; }
  .figures { gap: 0 24px; }
  .figures dd { font-size: 21px; }
  section { padding: 34px 0; margin-top: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* The model column holds ids as long as
   `fireworks_ai/accounts/fireworks/models/...`; left to stretch it pushes the
   price columns -- the reason to visit -- off the right edge. */
#mtable { table-layout: auto; }
#mtable th:first-child, #mtable td:first-child {
  max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
#mtable th, #mtable td { padding-left: 10px; padding-right: 10px; }
#mtable td:nth-child(3) { width: 96px; }

/* ---------- individual model pages ---------- */
.mpage { padding: 34px 0 0; }
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.crumbs a { color: var(--ink-2); }
.mpage h1 {
  font-family: var(--display); font-weight: 600; font-size: clamp(28px, 4.4vw, 46px);
  letter-spacing: -0.015em; margin: 0 0 8px; word-break: break-word;
  font-optical-sizing: auto; font-variation-settings: "SOFT" 40, "WONK" 1;
}
.mlede { font-size: 19px; margin: 0 0 6px; color: var(--ink); }
.mpage h2 { font-size: 19px; margin: 40px 0 6px; letter-spacing: -0.015em; }
.mfigure {
  margin: 26px 0 8px; border: 1px solid var(--hair); border-radius: 12px;
  background: var(--surface); padding: 10px 6px;
}
.mspark { display: block; width: 100%; height: auto; }
.muted { color: var(--muted); }
.mpage code {
  font-size: 12.5px; background: var(--surface); padding: 1px 5px;
  border: 1px solid var(--hair); border-radius: 4px;
}
.mpage .figures { margin-top: 26px; }
/* Model names in the explorer are links to their own page. */
#mtable td a { color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--hair); }
#mtable td a:hover { border-bottom-color: var(--s1); color: var(--s1); }

#mtable th button {
  appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-size: inherit; font-weight: 500; color: inherit;
  cursor: pointer; white-space: nowrap;
}
#mtable th.num button { width: 100%; text-align: right; }
#mtable th button:hover { color: var(--ink); }
#mtable th button:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
#mtable th[aria-sort="ascending"] button::after { content: " \2191"; }
#mtable th[aria-sort="descending"] button::after { content: " \2193"; }

.mfoot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.mfoot .sub { margin: 0; }
button.more {
  appearance: none; font: inherit; font-size: 13.5px; cursor: pointer;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--hair);
  background: var(--surface); color: var(--ink);
}
button.more:hover { border-color: var(--axis); }
button.more:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }

/* ---------- model page v2 ----------
   One bold element: the price card, set dark so the two numbers a visitor came
   for read first. Everything else stays on the light ground. */
.mhead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; margin: 0 0 8px; }
.mhead h1 { margin: 0; }
.mtags { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.tag { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--hair);
  color: var(--ink-2); background: var(--surface); }
.tag-fp { border-color: var(--s1); color: var(--s1); }
.tag-good { border-color: var(--good); color: var(--good); }
.aliases { margin: 0 0 22px; font-size: 13px; line-height: 1.9; }

.pcard { background: var(--ink); color: var(--page); border-radius: 14px;
  margin: 22px 0 36px; overflow: hidden; }
.pcard-main { display: grid; grid-template-columns: repeat(3, 1fr); }
.pcell { padding: 26px 26px 22px; display: flex; flex-direction: column; gap: 2px; }
.pcell + .pcell { border-left: 1px solid rgba(255,255,255,.14); }
.plab { font-size: 12.5px; color: rgba(255,255,255,.62); }
.pval { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 4.4vw, 50px);
  letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: lining-nums; font-optical-sizing: auto; }
.punit { font-size: 12.5px; color: rgba(255,255,255,.62); }
.pcard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  padding: 12px 26px; border-top: 1px solid rgba(255,255,255,.14);
  font-size: 13.5px; color: rgba(255,255,255,.75); }
.pcard-foot b { color: var(--page); font-weight: 600; }
:root[data-theme="dark"] .pcard, .pcard { }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pcard { background: var(--surface); color: var(--ink); border: 1px solid var(--hair); } 
  :root:not([data-theme="light"]) .plab, :root:not([data-theme="light"]) .punit,
  :root:not([data-theme="light"]) .pcard-foot { color: var(--ink-2); }
  :root:not([data-theme="light"]) .pcard-foot b { color: var(--ink); }
  :root:not([data-theme="light"]) .pcell + .pcell, :root:not([data-theme="light"]) .pcard-foot { border-color: var(--hair); } }
:root[data-theme="dark"] .pcard { background: var(--surface); color: var(--ink); border: 1px solid var(--hair); }
:root[data-theme="dark"] .plab, :root[data-theme="dark"] .punit, :root[data-theme="dark"] .pcard-foot { color: var(--ink-2); }
:root[data-theme="dark"] .pcard-foot b { color: var(--ink); }
:root[data-theme="dark"] .pcell + .pcell, :root[data-theme="dark"] .pcard-foot { border-color: var(--hair); }

.mchart { display: block; width: 100%; height: auto; }
.mfigure { margin: 12px 0 8px; padding: 14px 8px 6px; }
.onerow { margin: 14px 0 8px; }
.vs { margin: 26px 0 8px; padding: 18px 22px; border-left: 3px solid var(--s1);
  background: var(--surface); border-radius: 0 10px 10px 0; }
.vs h2 { margin: 0 0 6px; font-size: 19px; }
.vs p { margin: 0; line-height: 1.55; }
.vs-lead { border-left-color: var(--good); }
.mfacts { margin-top: 30px; }
.rise { color: var(--s2); font-weight: 580; }
.related ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 22px; }
.related li { padding: 8px 0; border-bottom: 1px solid var(--hair); display: flex;
  justify-content: space-between; gap: 12px; font-size: 14px; }
.related a { color: var(--ink); text-decoration: none; }
.related a:hover { color: var(--s1); }
@media (max-width: 640px) {
  .pcard-main { grid-template-columns: 1fr; }
  .pcell + .pcell { border-left: 0; border-top: 1px solid rgba(255,255,255,.14); }
}

.share { float: right; appearance: none; font: inherit; font-size: 13px; cursor: pointer;
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--hair);
  background: var(--surface); color: var(--ink-2); margin-left: 16px; }
.share:hover { color: var(--ink); border-color: var(--axis); }

/* ---------- hero rotation + ticker ---------- */
.hero-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.hero-dots button { appearance: none; font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 4px 11px; border-radius: 999px; border: 1px solid var(--hair);
  background: var(--surface); color: var(--ink-2); }
.hero-dots button[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.hero-dots button:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }

.ticker { margin: 26px 0 0; padding: 10px 0; border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair); overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; gap: 34px; padding-right: 34px;
  animation: tick 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker a { color: var(--ink); text-decoration: none; font-size: 13.5px; }
.ticker a b { font-weight: 600; }
.ticker a span { color: var(--muted); }
.ticker a:hover b { color: var(--s1); }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
}

/* ---------- launch essay ---------- */
.essay { max-width: 42rem; padding: 40px 20px 0; }
.essay-kicker { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.essay h1 {
  font-family: var(--display); font-weight: 600; margin: 0 0 12px;
  font-size: clamp(32px, 5.4vw, 52px); line-height: 1.05; letter-spacing: -0.02em;
  text-wrap: balance; font-optical-sizing: auto; font-variation-settings: "SOFT" 40, "WONK" 1;
}
.essay-dek { margin: 0 0 36px; font-size: 20px; line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }
.essay p { margin: 0 0 1.15em; font-size: 17.5px; line-height: 1.65; color: var(--ink); text-wrap: pretty; }
.essay h2 {
  font-size: 24px; margin: 2.2em 0 0.55em; letter-spacing: -0.015em;
}
.essay a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.essay a:hover { color: var(--s1); }
.essay figure { margin: 1.8em 0; }
.essay figure img {
  display: block; width: 100%; height: auto; border-radius: 10px;
  border: 1px solid var(--hair); background: var(--surface);
}
.essay figcaption { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.essay-end { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--hair); }
.essay-end a { display: inline-block; margin-bottom: 0.35em; }
