/* ==========================================================================
   anthpad — tokens + base
   Claude palette on a dark ground. One accent (clay) used for full stops,
   progress, active states, panel edges and stat boxes.
   ========================================================================== */

:root {
  --bg: #121211;
  --bg-2: #1a1918;
  --ink: #1f1e1d;
  --text: #f4f3ee;
  --text-2: #cfcbc1;
  --text-3: #8f8a80;
  --accent: #ff6a2b;
  --accent-rgb: 255 106 43;
  --accent-deep: #e5521a;
  --accent-ink: #160d08;        /* text on accent fills */
  --accent-soft: rgb(255 106 43 / 0.15);
  --tint-dots: rgb(244 243 238 / 0.045);
  --up: #86c497;
  --down: #ec8a72;

  --glass: rgb(30 29 28 / 0.58);
  --glass-strong: rgb(24 23 22 / 0.82);
  --glass-line: rgb(var(--tint) / 0.09);
  --line: rgb(var(--tint) / 0.1);
  --line-strong: rgb(var(--tint) / 0.22);
  --stat: #0c0c0b;
  --tint: 244 243 238;          /* foreground tint for hairlines and subtle fills */
  --well: rgb(10 10 9 / 0.5);   /* inset areas inside panels */
  --bar: rgb(18 18 17 / 0.72);
  --bar-strong: rgb(22 21 20 / 0.94);
  --node: rgb(28 27 26 / 0.95);
  --menu-scrim: rgb(12 12 11 / 0.72);
  --vignette: rgb(0 0 0 / 0.65);
  --glow: rgb(255 106 43 / 0.14);
  --tip-pos: #2f7a45;
  --tip-neg: #b0412f;

  --font-head: 'Heading', 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --fs-display: clamp(3.4rem, 7.4vw, 8.6rem);
  --fs-h1: clamp(2.8rem, 5.4vw, 5.6rem);
  --fs-h2: clamp(2.2rem, 3.8vw, 3.9rem);
  --fs-h3: clamp(1.5rem, 2vw, 1.9rem);
  --fs-lead: clamp(1.25rem, 1.5vw, 1.45rem);
  --fs-body: 1.125rem;   /* 18px */
  --fs-sm: 1rem;
  --fs-xs: 0.875rem;

  --max: 1480px;
  --pad: clamp(1.25rem, 3.4vw, 3rem);
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-pill: 999px;
  --topbar-h: 96px;
  --dock-h: 76px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }

/* Light theme: warm beige ground, ink text, the same single accent. */
[data-theme='light'] {
  --bg: #f7ecd9;
  --bg-2: #efe1c9;
  --ink: #1f1e1d;
  --text: #1f1e1d;
  --text-2: #3d3a36;
  --text-3: #6c665c;
  --accent: #ff5a0f;
  --accent-rgb: 255 90 15;
  --accent-deep: #e04a06;
  --accent-soft: rgb(255 90 15 / 0.13);
  --up: #367548;
  --down: #b4462f;
  --tint: 31 30 29;
  --glass: rgb(255 249 239 / 0.62);
  --glass-strong: rgb(252 245 233 / 0.92);
  --glass-line: rgb(31 30 29 / 0.09);
  --line: rgb(31 30 29 / 0.12);
  --line-strong: rgb(31 30 29 / 0.26);
  --stat: #1f1e1d;
  --well: rgb(255 251 244 / 0.6);
  --bar: rgb(247 236 217 / 0.82);
  --bar-strong: rgb(245 233 213 / 0.97);
  --node: rgb(255 251 244 / 0.96);
  --menu-scrim: rgb(247 236 217 / 0.86);
  --vignette: rgb(150 95 40 / 0.12);
  --glow: rgb(255 90 15 / 0.16);
  --tip-pos: #8fd3a1;
  --tip-neg: #f39b84;
  --tint-dots: rgb(90 60 30 / 0.09);
  color-scheme: light;
}
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease, fill 0.45s ease, stroke 0.45s ease !important;
}
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 2000; padding: 0.8rem 1.2rem; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font-weight: 600; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout --------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* Type ----------------------------------------------------------------- */
.h-display, .h1, .h2, .h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.h-display { font-size: var(--fs-display); line-height: 0.98; letter-spacing: -0.035em; }
.h1 { font-size: var(--fs-h1); line-height: 1.02; }
.h2 { font-size: var(--fs-h2); line-height: 1.05; }
.h3 { font-size: var(--fs-h3); line-height: 1.15; letter-spacing: -0.015em; }
.dot { color: var(--accent); }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--text-2); max-width: 46ch; }
.muted { color: var(--text-3); }
.fine { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.55; max-width: 70ch; }
.num, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.pos { color: var(--up); }
.neg { color: var(--down); }

/* Buttons -------------------------------------------------------------- */
.btn {
  --h: 62px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
  height: var(--h); padding: 0 2rem;
  border-radius: var(--r-pill);
  font-size: 1.125rem; font-weight: 600; letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden; isolation: isolate;
  transition: transform 0.35s var(--ease), background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(0.97); }
.btn[disabled], .btn.is-busy { opacity: 0.5; pointer-events: none; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); box-shadow: 0 10px 40px -10px rgb(var(--accent-rgb) / 0.75); }
.btn--light { background: var(--text); color: var(--bg); }
.btn--light:hover { background: #fff; }
.btn--ghost { box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--text); background: rgb(var(--tint) / 0.03); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); background: rgb(var(--tint) / 0.07); }
.btn--sm { --h: 48px; padding: 0 1.3rem; font-size: 1rem; }

/* Line icons ----------------------------------------------------------- */
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Glass panel ---------------------------------------------------------- */
.panel {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-xl);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 30px 80px -40px rgb(0 0 0 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.04);
}
.panel::before {
  /* accent edge */
  content: '';
  position: absolute; top: -1px; left: 40px;
  width: 72px; height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.panel--pad { padding: clamp(1.5rem, 3.4vw, 3.5rem); }

/* Stat box ------------------------------------------------------------- */
.stat {
  position: relative;
  display: grid; gap: 0.35rem; align-content: start;
  padding: 1.4rem 1.5rem 1.3rem;
  border-radius: var(--r-lg);
  background: var(--stat);
  border: 1px solid rgb(var(--tint) / 0.06);
  box-shadow: inset 3px 0 0 var(--accent);
  overflow: hidden;
  /* stat boxes stay dark in both themes */
  --tint: 244 243 238;
  --text: #f4f3ee;
  --text-3: #a29c90;
  --up: #86c497;
  --down: #ec8a72;
  --accent: #ff6a2b;
  color: var(--text);
}
.stat__value { font-family: var(--font-mono); font-size: clamp(2.2rem, 3.6vw, 3.2rem); font-weight: 500; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat__value small { font-size: 0.45em; color: var(--text-3); margin-left: 0.2em; letter-spacing: 0; }
.stat__caption { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.4; }
.stat__live { position: absolute; right: 1.1rem; top: 1.2rem; display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-3); }
.stat__live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgb(134 196 151 / 0.6); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgb(134 196 151 / 0); } 100% { box-shadow: 0 0 0 0 rgb(134 196 151 / 0); } }

/* Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
