/* Studio Workbench tokens — locked per Build_Handoff.md §3 */

:root {
  /* Light mode (default) — newsprint paper + Marvel/MTG ruby */
  --bg: #F4EBD9;
  --bg-elevated: #FFFFFF;
  --fg: #111111;
  --fg-muted: #4A4A4A;
  --fg-subtle: #8A8A8A;
  --border: #DAD2BD;
  --border-strong: #B8AE94;
  --accent: #8B2418;
  --accent-strong: #5C150C;
  --success: #1E5A3A;
  --success-bg: #E2EFE6;

  /* Type — fluid clamp() between mobile and desktop tokens */
  --display: clamp(40px, 4.6vw + 16px, 84px);
  --display-sm: clamp(32px, 2.2vw + 22px, 48px);
  --headline: clamp(22px, 0.6vw + 20px, 28px);
  --sub-headline: clamp(17px, 0.4vw + 16px, 21px);
  --body: clamp(16px, 0.1vw + 15.5px, 17px);
  --body-sm: clamp(14px, 0.1vw + 13.5px, 15px);
  --eyebrow: clamp(11px, 0.05vw + 10.8px, 12px);
  --mono: clamp(13px, 0.1vw + 12.5px, 14px);
  --mono-sm: clamp(11px, 0.05vw + 10.8px, 12px);

  /* Spacing — 8pt scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  --max-content: 1200px;
  --gutter: clamp(20px, 4vw, 48px);

  /* Type stacks */
  --font-sans: "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0F0F11;
  --bg-elevated: #1A1A1D;
  --fg: #F2EFE7;
  --fg-muted: #A8A39A;
  --fg-subtle: #6E6962;
  --border: #22221F;
  --border-strong: #38362F;
  --accent: #E8867A;
  --accent-strong: #F0A89F;
  --success: #5DCC8A;
  --success-bg: #0F2A1C;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" 1;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-size: var(--body);
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Type utilities */
.t-display    { font-size: var(--display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }
.t-display-sm { font-size: var(--display-sm); font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.t-headline   { font-size: var(--headline); font-weight: 500; line-height: 1.25; letter-spacing: -0.005em; }
.t-sub        { font-size: var(--sub-headline); font-weight: 400; line-height: 1.5; }
.t-body       { font-size: var(--body); font-weight: 400; line-height: 1.6; }
.t-body-sm    { font-size: var(--body-sm); font-weight: 400; line-height: 1.55; color: var(--fg-muted); }
.t-eyebrow    { font-size: var(--eyebrow); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.4; }
.t-mono       { font-family: var(--font-mono); font-size: var(--mono); font-variant-ligatures: none; }
.t-mono-sm    { font-family: var(--font-mono); font-size: var(--mono-sm); font-variant-ligatures: none; }

.muted   { color: var(--fg-muted); }
.subtle  { color: var(--fg-subtle); }
.accent  { color: var(--accent-strong); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hairline-top    { border-top: 1px solid var(--border); }
.hairline-bottom { border-bottom: 1px solid var(--border); }

/* Focus rings — instant, 2px accent w/ 2px offset (§14) */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip-to-content */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-elevated);
  color: var(--fg);
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  font-size: var(--body-sm);
  z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

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