/* ===== Reset & root ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ===== Theme tokens ===== */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --space-10: 64px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.18);
  --shadow-lg: 0 24px 60px rgba(0,0,0,0.45);

  --transition: 160ms cubic-bezier(0.2, 0, 0.2, 1);
}

/* Dark theme (default) */
html[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-elevated: #16161a;
  --bg-card: #1a1a1f;
  --bg-card-hover: #1f1f25;
  --bg-input: #1a1a1f;

  --fg: #ececef;
  --fg-muted: #a0a0a8;
  --fg-subtle: #6e6e76;

  --accent: #d97757;        /* Claude orange */
  --accent-fg: #fff;
  --accent-soft: rgba(217,119,87,0.15);

  --border: #26262d;
  --border-strong: #34343c;
  --kbd-bg: #232329;
  --kbd-border: #34343c;
  --kbd-fg: #ececef;

  --highlight: rgba(217,119,87,0.22);
  --backdrop: rgba(8,8,12,0.6);
}

/* Light theme */
html[data-theme="light"] {
  --bg: #fbfbf9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f4f0;
  --bg-input: #ffffff;

  --fg: #1a1a1d;
  --fg-muted: #58585e;
  --fg-subtle: #8a8a90;

  --accent: #c2410c;
  --accent-fg: #fff;
  --accent-soft: rgba(194,65,12,0.10);

  --border: #ececea;
  --border-strong: #d8d8d4;
  --kbd-bg: #f5f4f0;
  --kbd-border: #d8d8d4;
  --kbd-fg: #1a1a1d;

  --highlight: rgba(194,65,12,0.18);
  --backdrop: rgba(20,20,24,0.35);
}

/* ===== Body & typography ===== */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv02", "cv03";
  line-height: 1.55;
  font-size: 15px;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.05rem; line-height: 1.4; }
p  { margin: 0; color: var(--fg-muted); }

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

/* ===== Focus ring ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ===== Scrollbar (subtle) ===== */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--fg-subtle); }
