/* Pokemon Predictor design system
   Ported from the Stitch "PokeTerminal" export. Tokens unified across the
   export's two palettes; bright yellow #ffe245 is the canonical accent. */

/* ---------- Fonts (self hosted) ---------- */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrainsmono-regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrainsmono-medium.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrainsmono-semibold.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrainsmono-bold.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg-0: #0a0a0a;        /* page */
  --bg-1: #121212;        /* widget panel */
  --bg-2: #1c1b1b;        /* container low */
  --bg-3: #2a2a2a;        /* container high */
  --bg-4: #353534;        /* container highest */
  --hairline: #2c2c2c;
  --outline-var: #4c4733;

  --text: #e5e2e1;
  --text-variant: #cec6ac;
  --muted: #8e8e93;

  --yellow: #ffe245;
  --yellow-dim: #e2c60f;
  --on-yellow: #211b00;
  --green: #5bffa1;
  --green-dim: #00e383;
  --red: #ffb4ab;
  --crimson: #a90219;
  --blue: #007bff;

  --font-ui: "Inter", system-ui, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, monospace;

  --gutter: 16px;
  --widget-gap: 12px;
  --margin: 16px;

  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-xl: 12px;
}
@media (min-width: 768px) {
  :root { --margin: 32px; }
}

/* ---------- Reset + mobile overflow guard (do not remove) ---------- */
* { box-sizing: border-box; }
*, *::before, *::after { min-width: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
table { border-collapse: collapse; }

::selection { background: var(--yellow); color: var(--on-yellow); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline-var); }

/* ---------- Type scale ---------- */
.t-display {
  font-weight: 800;
  font-size: clamp(30px, 5.5vw, 48px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
}
.t-headline {
  font-weight: 700;
  font-size: clamp(20px, 3vw, 24px);
  line-height: 1.33;
  margin: 0;
}
.t-label {
  font-family: var(--font-data);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.05em;
  font-weight: 500;
  text-transform: uppercase;
}
.t-data-xl {
  font-family: var(--font-data);
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.t-data {
  font-family: var(--font-data);
  font-size: 20px;
  line-height: 28px;
  font-weight: 500;
}
.t-data-sm { font-family: var(--font-data); font-size: 14px; line-height: 20px; font-weight: 500; }
.t-body { font-size: 16px; line-height: 24px; }
.t-muted { color: var(--muted); }
.t-variant { color: var(--text-variant); }
.up { color: var(--green); }
.down { color: var(--red); }
.accent { color: var(--yellow); }

/* ---------- Layout ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: var(--margin); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }
@media (max-width: 1023px) {
  .col-8, .col-6, .col-4 { grid-column: span 12; }
}

/* ---------- Panels ---------- */
.panel {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.panel-pad { padding: 16px; }
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #1a1a1a;
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.panel-yellow { border-color: var(--yellow); box-shadow: 0 0 4px rgba(255, 226, 69, 0.2); }
.panel-crimson { border-color: var(--crimson); box-shadow: 0 0 8px rgba(169, 2, 25, 0.2); }
.panel-green { border-color: var(--green-dim); }

/* ---------- Header / nav ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.site-head-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 var(--margin);
}
.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 20px;
  color: var(--yellow);
  text-decoration: none;
  white-space: nowrap;
}
.brand .brand-tld { color: var(--muted); font-weight: 600; }
.main-nav { display: flex; gap: 24px; align-items: center; }
.main-nav a {
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-variant);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.main-nav a:hover { color: var(--yellow); }
.main-nav a[aria-current="page"] { color: var(--yellow); border-bottom-color: var(--yellow); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--text);
  padding: 8px 12px;
  font-family: var(--font-data);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 900px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--hairline);
    padding: 8px 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px var(--margin); border-bottom: none; }
  .main-nav a[aria-current="page"] { background: var(--bg-3); }
  .nav-toggle { display: block; }
}

/* ---------- Ticker ---------- */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: var(--bg-1);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  height: 32px;
  display: flex;
  align-items: center;
}
.ticker { display: inline-block; padding-left: 100%; animation: ticker 40s linear infinite; }
.ticker-wrap:hover .ticker { animation-play-state: paused; }
.ticker-item {
  display: inline-block;
  padding: 0 2rem;
  color: var(--text-variant);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.05em;
}
@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker { animation: none; padding-left: 0; }
}

/* ---------- Chips, buttons ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--r-xl);
  border: 1px solid var(--hairline);
  background: var(--bg-3);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-variant);
}
.chip-yellow { background: rgba(255, 226, 69, 0.1); color: var(--yellow); border-color: var(--yellow); }
.chip-green { background: rgba(0, 227, 131, 0.1); color: var(--green-dim); border-color: var(--green-dim); }
.chip-red { background: rgba(255, 180, 171, 0.1); color: var(--red); border-color: var(--crimson); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--text);
  font-family: var(--font-data);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--yellow); color: var(--yellow); }
.btn-solid { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); font-weight: 700; }
.btn-solid:hover { background: var(--yellow-dim); border-color: var(--yellow-dim); color: var(--on-yellow); }

/* ---------- Tables ---------- */
.data-table-scroll { overflow-x: auto; }
.data-table { width: 100%; min-width: 640px; text-align: left; }
.data-table thead tr {
  background: var(--bg-0);
  border-bottom: 1px solid var(--hairline);
}
.data-table th {
  padding: 10px 14px;
  font-family: var(--font-data);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-data);
  font-size: 14px;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: var(--bg-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ---------- Cards / thumbnails ---------- */
.card-thumb {
  width: 56px;
  border-radius: 3px;
  border: 1px solid var(--hairline);
  background: var(--bg-0);
  display: block;
}
.slab-img { border-radius: var(--r-md); }

/* ---------- Sparkline ---------- */
.spark { width: 100%; height: 40px; }
.spark path { fill: none; stroke-width: 2; }
.spark .up-line { stroke: var(--green-dim); filter: drop-shadow(0 0 3px rgba(0, 227, 131, 0.35)); }
.spark .down-line { stroke: var(--crimson); filter: drop-shadow(0 0 3px rgba(169, 2, 25, 0.45)); }
.spark .flat-line { stroke: var(--yellow-dim); }

/* ---------- Stat blocks ---------- */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kv .v { font-family: var(--font-data); font-size: 20px; line-height: 28px; font-weight: 500; }

/* ---------- Forms (calculator) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-data); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-variant); }
.field input, .field select {
  background: var(--bg-2);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-data);
  font-size: 16px;
  padding: 10px 12px;
  width: 100%;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--yellow); }

/* ---------- FAQ ---------- */
.faq details {
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg-1);
  margin-bottom: var(--widget-gap);
}
.faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-data); color: var(--yellow); font-size: 18px; }
.faq details[open] summary::after { content: "-"; }
.faq .faq-body { padding: 0 16px 14px; color: var(--text-variant); }

/* ---------- Footer ---------- */
.site-foot {
  border-top: 1px solid var(--hairline);
  background: var(--bg-1);
  margin-top: 48px;
}
.site-foot-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px var(--margin);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
}
@media (max-width: 620px) {
  .site-foot-inner { grid-template-columns: 1fr; }
}
.site-foot h4 { font-family: var(--font-data); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.site-foot a { color: var(--text-variant); text-decoration: none; font-size: 14px; }
.site-foot a:hover { color: var(--yellow); }
.foot-legal {
  border-top: 1px solid var(--hairline);
  padding: 16px var(--margin);
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.foot-legal a { color: var(--text-variant); }

/* ---------- Helpers ---------- */
.stack { display: flex; flex-direction: column; gap: var(--widget-gap); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.hide-mobile { display: initial; }
@media (max-width: 620px) { .hide-mobile { display: none; } }
.long-text { overflow-wrap: anywhere; }
.section-gap { margin-top: 40px; }
.prose { max-width: 72ch; color: var(--text-variant); }
.prose h2 { color: var(--text); margin-top: 32px; }
.prose a { color: var(--yellow); }
@media (max-width: 620px) { .prose { max-width: 100%; } }
