/* ============================================================
   GameHomeHub — tool bench.
   Two themes from the same tokens: "terminal" (dark, amber on
   near-black) and "paper" (light, cream and navy). The OS decides
   the default; the header toggle stores an override.
   Type: system stacks only — no webfont request, no layout shift.
   ============================================================ */

:root {
  --font-display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --base: #0b0d0f;
  --surface: #14171a;
  --surface-2: var(--surface);
  --hairline: #262b30;
  --hairline-strong: #3a4248;
  --ink: #e8e6e1;
  --muted: #8a8f94;
  --accent: #ffb000;
  --accent-dim: #8a5f00;
  --accent-wash: color-mix(in srgb, var(--accent) 12%, transparent);
  --glow: color-mix(in srgb, var(--accent) 7%, transparent);
  --grid: color-mix(in srgb, var(--ink) 4%, transparent);
  --radius: 2px;
  --wrap: 1120px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --base: #f3ecdc;
  --surface: #fffdf8;
  --surface-2: var(--surface);
  --hairline: #ddd1b6;
  --hairline-strong: #c4b48f;
  --ink: #211d16;
  --muted: #6d6453;
  --accent: #1d3557;
  --accent-dim: #7c8ca3;
  --accent-wash: color-mix(in srgb, var(--accent) 9%, transparent);
  --glow: color-mix(in srgb, var(--accent) 5%, transparent);
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--base);
  background-image:
    radial-gradient(60rem 32rem at 12% -8%, var(--glow), transparent 70%),
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: auto, 64px 64px, 64px 64px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.15s ease, color 0.15s ease;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--base); }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 20px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--base);
  padding: 8px 14px;
  z-index: 50;
}
.skip:focus { left: 12px; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--base) 88%, transparent);
  backdrop-filter: blur(8px);
}

.topbar-in { display: flex; align-items: center; gap: 18px; min-height: 62px; }

.brand { display: flex; align-items: baseline; gap: 9px; text-decoration: none; white-space: nowrap; }

.brand-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--base);
  background: var(--accent);
  padding: 3px 6px;
  border-radius: var(--radius);
  align-self: center;
}

.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.015em; }

.brand-tag {
  display: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

@media (min-width: 900px) { .brand-tag { display: inline; } }

.nav { display: none; margin-left: auto; align-items: center; gap: 16px; font-size: 14px; color: var(--muted); }

.nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-block: 4px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

@media (min-width: 760px) {
  .nav { display: flex; }
  .topbar-actions { margin-left: 0; }
  .nav-toggle { display: none; }
}

.nav-open .nav {
  display: flex;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 20px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}

.nav-open .nav a { padding: 9px 0; width: 100%; }

.icon-btn {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 7px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.icon-btn:hover { color: var(--ink); border-color: var(--hairline-strong); }

/* ---------- shared blocks ---------- */

main { flex: 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.12; margin: 0; }

h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 700; }
h2 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 650; }
h3 { font-size: 16.5px; font-weight: 650; }

.lead { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--muted); max-width: 62ch; margin: 14px 0 0; }

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

.hero { padding: clamp(38px, 6vw, 76px) 0 clamp(26px, 4vw, 44px); border-bottom: 1px solid var(--hairline); }

.hero h1 { max-width: 20ch; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta span::before { content: "▪"; color: var(--accent-dim); margin-right: 7px; }

/* ---------- tool directory ---------- */

.directory { padding: clamp(30px, 4vw, 52px) 0; }

.directory-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }

.directory-head .mono-note { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

.tool-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

@media (min-width: 700px) { .tool-grid { grid-template-columns: 1fr 1fr; } }

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.tool-card:hover { border-color: var(--accent-dim); background: var(--surface-2); transform: translateY(-2px); }

.tool-card .idx {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hairline-strong);
}

.tool-card .kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.tool-card h2 { font-size: 21px; padding-right: 28px; }

.tool-card .question { font-size: 15px; color: var(--accent); font-style: italic; margin: 0; }

.tool-card p { margin: 0; font-size: 14.5px; color: var(--muted); }

.tool-card .go {
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.tool-card:hover .go { color: var(--accent); }

/* ---------- promise strip ---------- */

.promise {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  padding: clamp(26px, 3.6vw, 42px) 0;
}

.promise-in { display: grid; gap: 22px; grid-template-columns: 1fr; }

@media (min-width: 820px) { .promise-in { grid-template-columns: 1.1fr 1fr; gap: 40px; } }

.promise h2 { max-width: 26ch; }
.promise p { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

.promise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14.5px; }

.promise-list li { padding-left: 24px; position: relative; color: var(--muted); }

.promise-list li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-family: var(--font-mono); }

.promise-list strong { color: var(--ink); font-weight: 600; }

/* ---------- tool page ---------- */

.page-head { padding: clamp(34px, 5vw, 58px) 0 18px; }

.page-head h1 { max-width: 24ch; }

.crumb { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin: 0 0 18px; }

.crumb a { text-decoration: none; border-bottom: 1px solid var(--hairline); }
.crumb a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.crumb span { color: var(--hairline-strong); margin: 0 8px; }

/* ---------- the calculator panel ---------- */

.tool-panel {
  position: relative;
  border: 1px solid var(--hairline-strong);
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(16px, 2.4vw, 26px);
  margin: 26px 0 34px;
}

.tool-panel::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}

.tool-panel .panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}

.tool-panel .panel-title h2 { font-size: 15px; letter-spacing: 0.02em; }

.panel-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.06em; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 18px; }

@media (min-width: 640px) { .field-grid { grid-template-columns: repeat(4, 1fr); } }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="number"], select {
  width: 100%;
  background: var(--base);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input[type="number"]:focus, select:focus { border-color: var(--accent-dim); outline: none; }

input[type="range"] { width: 100%; accent-color: var(--accent); }

.seg, .fill-seg { display: flex; border: 1px solid var(--hairline); border-radius: var(--radius); overflow: hidden; }

.seg button, .fill-seg button {
  flex: 1;
  appearance: none;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 6px;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.seg button:last-child, .fill-seg button:last-child { border-right: 0; }
.seg button:hover, .fill-seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .fill-seg button[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-wash);
}

.result-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }

@media (min-width: 640px) { .result-grid { grid-template-columns: repeat(3, 1fr); } }

.stat { border: 1px solid var(--hairline); background: var(--base); border-radius: var(--radius); padding: 14px 14px 12px; }

.stat dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}

.stat dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat .sub { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-top: 4px; }

.stat .conv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 3px 0;
  border-top: 1px dashed var(--hairline);
}

.stat .conv:first-of-type { border-top: 0; }
.stat .conv .k { color: var(--muted); }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }

.preset-row .label, .quick-row .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}

.chip {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 9px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.chip:hover { color: var(--ink); border-color: var(--hairline-strong); }
.chip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-dim); }

.data-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.data-table caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 8px;
}

.data-table th, .data-table td { border-bottom: 1px solid var(--hairline); padding: 7px 10px; text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; color: var(--muted); }

.data-table thead th {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.table-scroll { overflow-x: auto; }

.tool-card h3 { font-size: 21px; padding-right: 28px; line-height: 1.25; }

/* design review 2026-11-21: card air, mobile breathing room, tighter eyebrow */
.tool-card { padding: 28px 26px; }
.tool-card h3 { margin-bottom: 12px; }

@media (max-width: 640px) {
  .topbar-in { padding-inline: 20px; }
  .eyebrow { letter-spacing: 0.06em; }
  .cover .play-btn, .play-bar button { max-width: calc(100% - 40px); }
  .tool-card { padding: 24px 20px; }
}

.fineprint { font-family: var(--font-mono); font-size: 12px; line-height: 1.65; color: var(--muted); margin: 16px 0 0; max-width: 92ch; }
.fineprint em { color: var(--ink); font-style: normal; }

/* ---------- canvas tools ---------- */

.canvas-wrap {
  border: 1px solid var(--hairline);
  background: var(--base);
  border-radius: var(--radius);
  padding: 12px;
  overflow: auto;
  max-height: 64vh;
  margin-bottom: 14px;
}

.canvas-wrap canvas { display: block; margin: 0 auto; max-width: 100%; height: auto; }

.stat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}

.stat-line b { font-size: 22px; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

.btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 10px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink);
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}

.btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn.primary { border-color: var(--accent-dim); color: var(--accent); background: var(--accent-wash); }
.btn[disabled] { opacity: 0.5; cursor: progress; }

.quick-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- prose ---------- */

.prose { max-width: 70ch; color: var(--muted); font-size: 15.5px; line-height: 1.72; }

.prose > * + * { margin-top: 14px; }
.prose h2 { color: var(--ink); font-size: 22px; margin-top: 38px; }
.prose h3 { color: var(--ink); font-size: 16.5px; margin-top: 24px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.prose code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1px 5px;
  color: var(--ink);
}

.prose ul, .prose ol { padding-left: 20px; }
.prose li + li { margin-top: 7px; }

.prose blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--ink);
}

.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12.5px; }
.prose th, .prose td { border-bottom: 1px solid var(--hairline); padding: 7px 10px; text-align: left; }
.prose th { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

.page-body { padding-bottom: 40px; }

.faq { margin-top: 38px; max-width: 70ch; }

.faq details { border-top: 1px solid var(--hairline); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--hairline); }

.faq summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }

.faq details p { color: var(--muted); font-size: 14.5px; margin: 10px 0 0; max-width: 66ch; }

.next-tools { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--hairline); }
.next-tools h2 { font-size: 17px; margin-bottom: 14px; }

.next-links { display: flex; flex-wrap: wrap; gap: 10px; }

.next-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--muted);
  transition: color 0.12s ease, border-color 0.12s ease;
}

.next-links a:hover { color: var(--accent); border-color: var(--accent-dim); }

/* ---------- prose pages (about / privacy / contact) ---------- */

.doc { padding: clamp(34px, 5vw, 60px) 0 60px; }
.doc h1 { max-width: 22ch; }
.doc .prose { margin-top: 26px; }
.doc .prose h2 { margin-top: 30px; }

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

.foot { border-top: 1px solid var(--hairline); margin-top: 60px; padding: 34px 0 40px; font-size: 13.5px; color: var(--muted); }

.foot-in { display: grid; gap: 26px; grid-template-columns: 1fr; }

@media (min-width: 820px) { .foot-in { grid-template-columns: 1.2fr 1fr; gap: 40px; } }

.foot .brand-tag { display: inline; }
.foot p { margin: 10px 0 0; max-width: 46ch; }

.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-content: start; justify-content: flex-start; }

@media (min-width: 820px) { .foot-links { justify-content: flex-end; } }

.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

.foot-legal {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

/* ---------- misc ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

@media (max-width: 759px) {
  .hero h1 { font-size: clamp(28px, 8vw, 40px); }
  .page-head h1 { font-size: clamp(26px, 7vw, 36px); }
  .foot { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
