/* ============================================================
   beisl — landing page
   Palette per branding/CONCEPT.md:
     Beislrot #7A1F33 (signature; #B14358 on dark)
     Kaffeehauscreme #F4EDE4 · Wirtshausholz #2B2320
   Rule: Beislrot frames, layer colours testify — the signature
   colour is chrome only and never appears inside a chart.
   Layer/data colours (chart.rs truth):
     kernel #5A6777 · driver vendor/#3A9188 · game #E0A030
     dxvk #8E6FD6 · wine #9C2B3B
   ============================================================ */

:root {
  --cream: #f4ede4;
  --wood: #2b2320;
  --wood-deep: #17110f;
  --beislrot: #7a1f33;
  --beislrot-hell: #b14358;

  /* light theme (default) */
  --ground: #f4ede4;
  --panel: #fbf7f1;
  --panel-2: #efe6d9;
  --ink: #2b2320;
  --muted: #6b5f58;
  --hair: #e0d3c3;
  --accent: #7a1f33;
  --on-accent: #f4ede4;
  --code-bg: #2b2320;
  --code-ink: #f4ede4;
  --shadow: 0 14px 38px rgba(43, 35, 32, 0.14);

  /* data ink — never chrome */
  --l-kernel: #5a6777;
  --l-driver: #3a9188;
  --l-game: #e0a030;
  --l-dxvk: #8e6fd6;
  --l-wine: #9c2b3b;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, ui-serif, serif;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Noto Sans",
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1e1815;
    --panel: #29211d;
    --panel-2: #322822;
    --ink: #f4ede4;
    --muted: #b6a99f;
    --hair: #3a2f2a;
    --accent: #b14358;
    --on-accent: #f4ede4;
    --code-bg: #17110f;
    --code-ink: #f4ede4;
    --shadow: 0 14px 38px rgba(0, 0, 0, 0.4);
  }
}
/* explicit override from the theme toggle — must beat the media query both ways */
:root[data-theme="light"] {
  --ground: #f4ede4; --panel: #fbf7f1; --panel-2: #efe6d9;
  --ink: #2b2320; --muted: #6b5f58; --hair: #e0d3c3;
  --accent: #7a1f33; --on-accent: #f4ede4;
  --code-bg: #2b2320; --code-ink: #f4ede4;
  --shadow: 0 14px 38px rgba(43, 35, 32, 0.14);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ground: #1e1815; --panel: #29211d; --panel-2: #322822;
  --ink: #f4ede4; --muted: #b6a99f; --hair: #3a2f2a;
  --accent: #b14358; --on-accent: #f4ede4;
  --code-bg: #17110f; --code-ink: #f4ede4;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1024px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 44px); }

h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; text-wrap: balance; }
h2 { font-size: clamp(26px, 4vw, 38px); line-height: 1.14; margin: 0 0 14px; }
h3 { font-family: var(--sans); font-size: 16px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.01em; }
p { max-width: 64ch; }
.muted { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.hero :focus-visible, .site-header :focus-visible { outline-color: var(--beislrot-hell); }

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 12px;
}

section { padding: clamp(56px, 9vw, 104px) 0; }
section + section { border-top: 1px solid var(--hair); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: 0 0 8px 0;
  font-family: var(--sans); font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- wordmark: lowercase, the i-dot is the spike tick ---------- */

.wordmark {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}
.wordmark .i { position: relative; }
.wordmark .tick {
  position: absolute;
  left: 50%; top: -0.34em;
  width: 0.2em; height: 0.2em;
  background: var(--wm-tick, var(--accent));
  transform: translateX(-50%) rotate(45deg);
  border-radius: 12%;
}

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--wood-deep) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244, 237, 228, 0.1);
  color: var(--cream);
}
.site-header .bar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
}
.site-header .brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--cream); text-decoration: none;
}
.site-header .brand img { width: 26px; height: 26px; display: block; }
.site-header .wordmark { font-size: 21px; --wm-tick: var(--beislrot-hell); }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: clamp(10px, 2.5vw, 26px); }
.site-header nav a {
  color: rgba(244, 237, 228, 0.82); text-decoration: none;
  font-size: 14px; font-weight: 550; white-space: nowrap;
}
.site-header nav a:hover { color: var(--cream); text-decoration: underline; text-underline-offset: 4px; }
.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(244, 237, 228, 0.3);
  color: rgba(244, 237, 228, 0.85);
  border-radius: 999px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: rgba(244, 237, 228, 0.6); color: var(--cream); }
@media (max-width: 620px) { .site-header nav a.hide-sm { display: none; } }

/* ---------- hero: always the dim pub, whatever the theme ----------
   The one loud room on the page. A live frametime trace runs behind it
   like the meniscus in the icon; everything after this is quiet. */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 480px at 18% -10%, rgba(177, 67, 88, 0.14), transparent 62%),
    linear-gradient(178deg, #241c18 0%, var(--wood-deep) 74%);
  color: var(--cream);
  padding: clamp(72px, 11vw, 140px) 0 clamp(80px, 11vw, 148px);
  border-bottom: 3px solid var(--beislrot);
}
.hero canvas {
  position: absolute; inset: auto 0 0 0;
  width: 100%; height: 46%;
  display: block;
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-lockup {
  display: grid;
  grid-template-columns: clamp(120px, 16vw, 176px) 1fr;
  gap: clamp(24px, 4.5vw, 52px);
  align-items: center;
}
.hero-lockup .glass {
  width: 100%; height: auto;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.5));
}
.hero .wordmark { font-size: clamp(52px, 9vw, 92px); color: var(--cream); --wm-tick: var(--beislrot-hell); }
.hero .tagline {
  font-family: var(--serif);
  font-size: clamp(24px, 3.6vw, 34px);
  font-weight: 600;
  margin: 16px 0 0;
  color: var(--beislrot-hell);
}
.hero .lede {
  font-size: clamp(16px, 2vw, 18.5px);
  color: rgba(244, 237, 228, 0.85);
  max-width: 56ch;
  margin: 16px 0 0;
}
.hero .lede b { color: var(--cream); font-weight: 650; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 650; font-size: 15px;
  text-decoration: none;
  border-radius: 10px;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--beislrot); color: var(--cream); }
.btn-primary:hover { background: #8d2740; }
.btn-ghost { border-color: rgba(244, 237, 228, 0.35); color: var(--cream); }
.btn-ghost:hover { border-color: rgba(244, 237, 228, 0.7); }
.hero-cmd {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 14px;
  color: rgba(244, 237, 228, 0.9);
  background: rgba(244, 237, 228, 0.07);
  border: 1px solid rgba(244, 237, 228, 0.16);
  border-radius: 9px;
  padding: 10px 14px;
}
.hero-cmd .prompt { color: var(--beislrot-hell); user-select: none; }
@media (max-width: 640px) {
  .hero-lockup { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-lockup .glass { width: 128px; }
  .hero .lede { margin-inline: auto; }
  .hero-cta { justify-content: center; }
}

/* ---------- cards ---------- */

.card {
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 16px;
  padding: clamp(22px, 3.5vw, 36px);
}

/* ---------- the verdict centerpiece ---------- */

.verdict-head { max-width: 62ch; }
.verdict-card { margin-top: 30px; box-shadow: var(--shadow); }

.scenario-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 26px;
}
.scenario-row .spacer { flex: 1; }
.scenario-btn {
  appearance: none;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}
.scenario-btn:hover { border-color: var(--muted); }
.scenario-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.vendor-field {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}
.vendor-field select {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}

/* the stacked bar — 3px surface gaps between segments so identity never
   rests on fill contrast alone; every share is repeated in the tab below */
.layerbar {
  display: flex;
  height: 62px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
}
.layerbar .seg {
  position: relative;
  display: grid; place-items: center;
  min-width: 3px;
  border: 0; padding: 0; margin: 0;
  cursor: default;
  transition: flex-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.35s ease;
}
.layerbar .seg + .seg { margin-left: 3px; }
.layerbar .seg .pct {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  white-space: nowrap;
}
.layerbar .seg:focus-visible { outline-offset: -3px; border-radius: 6px; }

.attributed-note {
  font-size: 13px; color: var(--muted);
  margin: 12px 0 0;
  font-variant-numeric: tabular-nums;
}

/* the tab: legend + shares + per-layer symbol coverage, doubling as the
   accessible table view of the bar */
.tab-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 14px; }
.tab-table caption {
  text-align: left;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.13em;
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding-bottom: 10px;
}
.tab-table th, .tab-table td {
  text-align: left;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--hair);
  font-weight: 400;
  vertical-align: middle;
}
.tab-table thead th {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); border-bottom-color: var(--muted);
}
.tab-table tbody tr:last-child th, .tab-table tbody tr:last-child td { border-bottom: 0; }
.tab-table .layer-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-family: var(--sans); }
.tab-table .chip { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.tab-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.covmeter {
  display: inline-block; vertical-align: middle;
  width: 72px; height: 5px; border-radius: 3px;
  background: var(--hair);
  margin-left: 10px;
  overflow: hidden;
}
.covmeter i {
  display: block; height: 100%;
  background: var(--muted);
  border-radius: 3px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.cov-hint { color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) {
  .tab-table .cov-cell .covmeter { display: none; }
  .tab-table th, .tab-table td { padding-right: 8px; }
}

/* the regular's verdict line */
.verdict-line {
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 24px);
  line-height: 1.45;
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--hair);
  max-width: 100%;
}
.verdict-line .who {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--muted);
  display: block; margin-bottom: 8px;
}
.demo-footnote { font-size: 13px; color: var(--muted); margin: 18px 0 0; max-width: 72ch; }

/* shared tooltip */
.tooltip {
  position: fixed; z-index: 50;
  pointer-events: none;
  background: var(--wood);
  color: var(--cream);
  font-family: var(--sans); font-size: 12.5px; line-height: 1.45;
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  max-width: 260px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tooltip.show { opacity: 1; }
.tooltip b { font-weight: 700; }
.tooltip .tt-dim { color: rgba(244, 237, 228, 0.72); }

/* ---------- two-column feature sections ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.split.rev { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
@media (max-width: 780px) {
  .split, .split.rev { grid-template-columns: 1fr; }
}

/* frametime figure */
.frametime-fig { margin: 0; }
.frametime-fig svg { width: 100%; height: auto; display: block; }
.frametime-fig .axis-label { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.frametime-fig .gridline { stroke: var(--hair); stroke-width: 1; }
.frametime-fig .trace { stroke: var(--ink); stroke-width: 2; fill: none; stroke-linejoin: round; }
.frametime-fig .spike-flag { font-family: var(--sans); font-size: 11.5px; font-weight: 650; fill: var(--ink); }
.frametime-fig .spike-mark { fill: var(--ink); }
.frametime-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* tier table */
.tier-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.tier-table th, .tier-table td {
  text-align: left; padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
.tier-table thead th {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
  border-bottom-color: var(--muted);
}
.tier-table tbody tr:last-child th, .tier-table tbody tr:last-child td { border-bottom: 0; }
.tier-table code { font-size: 13px; }
.tier-table .tier-name { font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- good runs interlude ---------- */

.goodrun {
  text-align: center;
  background: var(--panel);
}
.goodrun .quote {
  font-family: var(--serif);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.3;
  max-width: 26ch;
  margin: 0 auto;
  text-wrap: balance;
}
.goodrun .quote em { font-style: normal; color: var(--accent); }
.goodrun .attrib { font-size: 14.5px; color: var(--muted); max-width: 58ch; margin: 18px auto 0; }

/* ---------- how it works ---------- */

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-top: 34px;
  counter-reset: step;
}
.step { counter-increment: step; position: relative; }
.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.06em;
}
.step h3 { font-size: 17px; }
.step p { font-size: 14.5px; color: var(--muted); margin: 6px 0 0; }
.step code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--panel-2);
  border-radius: 5px; padding: 1.5px 6px;
  white-space: nowrap;
}
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }

.surfaces { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.surface {
  border: 1px solid var(--hair); border-radius: 14px;
  padding: 18px 20px;
  font-size: 14px; color: var(--muted);
  background: var(--ground);
}
.surface b { color: var(--ink); font-weight: 650; display: block; margin-bottom: 4px; }
.surface code { font-family: var(--mono); font-size: 12.5px; }
@media (max-width: 780px) { .surfaces { grid-template-columns: 1fr; } }

/* ---------- install ---------- */

.install-grid {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}
@media (max-width: 820px) { .install-grid { grid-template-columns: 1fr; } }

.codeblock {
  position: relative;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 14px;
  border: 1px solid rgba(244, 237, 228, 0.1);
  padding: 40px 24px 22px;
  overflow-x: auto;
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 237, 228, 0.3) transparent;
}
.codeblock pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
}
.codeblock .c { color: #b6a99f; }               /* comments: warm gray, not brand */
.codeblock .cmd { color: var(--cream); font-weight: 600; }
.codeblock .hl { color: #e9b7c1; }              /* the %command% — a cream-rosé lift */
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  appearance: none;
  font-family: var(--sans); font-size: 12px; font-weight: 650;
  background: rgba(244, 237, 228, 0.1);
  color: var(--cream);
  border: 1px solid rgba(244, 237, 228, 0.22);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(244, 237, 228, 0.18); }
.status-note {
  margin-top: 20px;
  font-size: 13.5px; color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  max-width: 60ch;
}
.entry-list { margin: 18px 0 0; padding: 0; list-style: none; font-size: 14.5px; }
.entry-list li { padding: 9px 0; border-bottom: 1px solid var(--hair); display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.entry-list li:last-child { border-bottom: 0; }
.entry-list .ctx { font-weight: 650; font-family: var(--sans); min-width: 118px; }
.entry-list code { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border-radius: 5px; padding: 1.5px 6px; }

/* ---------- family ---------- */

.family { text-align: center; }
.family .sibs {
  display: flex; justify-content: center; align-items: baseline;
  gap: clamp(16px, 4vw, 40px);
  flex-wrap: wrap;
  font-family: var(--serif); font-size: clamp(18px, 2.6vw, 24px); font-weight: 600;
  margin-top: 18px;
}
.family .sibs .dotsep { color: var(--hair); font-size: 0.8em; }
.family .sibs .self { color: var(--accent); }
.family .sibs .other { color: var(--muted); }
.family p { margin-inline: auto; }

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

.site-footer {
  background: var(--wood-deep);
  color: rgba(244, 237, 228, 0.75);
  padding: 56px 0 44px;
  font-size: 14px;
  border-top: 3px solid var(--beislrot);
}
.site-footer .cols {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 32px; align-items: center;
}
.site-footer .coaster { width: 72px; height: 72px; display: block; }
.site-footer a { color: var(--cream); }
.site-footer .wordmark { color: var(--cream); font-size: 18px; --wm-tick: var(--beislrot-hell); }
.site-footer .fine { margin-top: 6px; max-width: 60ch; }
.site-footer .easter {
  font-family: var(--serif); font-style: italic;
  color: rgba(244, 237, 228, 0.4);
  text-align: right;
}
@media (max-width: 680px) {
  .site-footer .cols { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .site-footer .easter { text-align: center; }
}

/* forced colors: keep segment boundaries visible */
@media (forced-colors: active) {
  .layerbar .seg { border: 1px solid CanvasText; }
  .covmeter { border: 1px solid CanvasText; }
}

/* ---------- release notes (releasenotes.md, rendered by site.js) ---------- */
.release-notes h3 { margin: 4px 0 6px; font-size: 1.25em; }
.release-notes h3 + p { color: var(--muted); }
.release-notes h4 { margin: 20px 0 8px; letter-spacing: 0.02em; }
.release-notes ul { margin: 8px 0 16px; padding-left: 22px; }
.release-notes li { margin: 7px 0; }
.release-notes hr { border: none; border-top: 1px solid var(--hair); margin: 28px 0; }
.release-notes { position: relative; } /* offsetParent for the two-release height cap */
.release-notes.scrolls { overflow-y: auto; padding-right: 22px; } /* keep text off the scrollbar */
