/* Chucksi design system: dark studio, one warm accent, condensed display type. */

@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/fonts/instrument-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0b0b0c;
  --bg-2: #101012;
  --surface: #161618;
  --surface-2: #1d1d20;
  --surface-3: #27272b;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f4f4f1;
  --muted: #9b9ba2;
  --dim: #6c6c73;
  --accent: #ffbf2f;
  --accent-hi: #ffd166;
  --accent-ink: #1c1400;
  --hot: #ff4f6d;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --nav-h: 58px;
  --pad: clamp(16px, 2.4vw, 32px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 6px; padding: 0 var(--pad);
  background: rgba(11, 11, 12, 0.86); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff; color: #0b0b0c; margin-right: 14px; flex: none; }
.nav-logo svg { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 500; font-size: 15px;
  border: 1px solid transparent; transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-links a[aria-current="page"] { color: var(--accent); border-color: rgba(255, 191, 47, 0.35); background: rgba(255, 191, 47, 0.06); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill-link {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.pill-link:hover { background: var(--surface-3); }
.pill-link .tag {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  background: var(--hot); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; padding: 3px 6px; border-radius: 5px; white-space: nowrap;
}
.btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px;
  transition: background 0.15s, transform 0.1s;
}
.btn-accent:hover { background: var(--accent-hi); }
.btn-accent:active { transform: translateY(1px); }
.btn-accent:disabled { opacity: 0.6; cursor: progress; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); font-weight: 500; font-size: 14px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-white { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 10px; border: 0; background: #fff; color: #0b0b0c; font-weight: 600; font-size: 15px; }
.btn-white:hover { background: #e9e9e6; }

/* ---------- shared bits ---------- */
.badge-new {
  display: inline-block; padding: 1px 6px 2px; border-radius: 4px; background: var(--accent); color: var(--accent-ink);
  font: italic 800 11px/1.3 var(--ui); letter-spacing: 0.02em; vertical-align: 2px; margin-left: 6px;
}
.eyebrow-num { font: 600 13px/1 var(--ui); color: var(--muted); }
.display { font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 0.92; letter-spacing: 0.005em; }
.muted { color: var(--muted); }
.wrap { padding: 0 var(--pad); }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90;
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 11px 16px; max-width: min(560px, calc(100vw - 32px)); font-size: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.toast.error { border-color: var(--hot); }

.foot {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between;
  margin-top: 64px; padding: 18px var(--pad); background: var(--bg-2); border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px;
}
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot a:hover { color: var(--text); }

/* ---------- dialog (ledger) ---------- */
.sheet {
  width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 22px 24px 24px;
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.72); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font: 900 34px/1 var(--display); text-transform: uppercase; }
.sheet .x { background: none; border: 0; font-size: 28px; color: var(--muted); line-height: 1; padding: 4px 8px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.sheet th, .sheet td { text-align: left; padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet th { color: var(--muted); font-weight: 500; }
.sheet td:last-child { color: var(--accent); font-weight: 700; }
.sheet .scroll { overflow-x: auto; }
.sheet p { color: var(--muted); }

@media (max-width: 760px) {
  :root { --nav-h: 54px; }
  .nav { gap: 2px; padding: 0 12px; }
  .nav-logo { margin-right: 6px; width: 30px; height: 30px; }
  .nav-links a { padding: 6px 8px; font-size: 14px; }
  .nav-right .pill-link, .nav-right .btn-ghost { display: none; }
  .nav-right .btn-accent { min-height: 34px; padding: 0 11px; font-size: 13px; }
}
@media (max-width: 420px) {
  .nav-right .btn-accent { display: none; }
}
.small { font-size: 12.5px; }

/* Hosted GPU panels (js/gpu-panel.js) */
.gpu-panel { max-width: 1100px; margin: 24px auto; padding: 18px 20px; border: 1px solid rgba(255, 191, 47, 0.25); border-radius: 14px; }
.gpu-panel h3 { margin: 0 0 6px; }
.gpu-panel .gpu-note, .gpu-panel .gpu-meter { opacity: 0.8; margin: 4px 0 12px; }
.gpu-form { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.gpu-form label { display: grid; gap: 4px; font-size: 0.9em; }
.gpu-form textarea { min-width: 260px; }
.gpu-result { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.gpu-result video { max-width: 100%; border-radius: 10px; }
.gpu-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.gpu-modes [aria-selected="true"] { border-color: rgba(255, 191, 47, 0.8); color: inherit; }
.gpu-panel .gpu-cost { font-size: 0.85em; opacity: 0.75; margin: 8px 0 0; }
.gpu-form select[name$="_library"] { max-width: 260px; }
