/* ============ TOKENS ============ */
:root, [data-theme="light"] {
  /* Type scale (fluid) */
  --text-xs:    clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:    clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:    clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:    clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:   clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:   clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero:  clamp(2.75rem, 1rem + 6vw, 6.5rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Editorial palette — warm cream surfaces, deep ink, headline gold */
  --color-bg: #f6f1e8;
  --color-surface: #fbf6ed;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ede5d4;
  --color-surface-offset-2: #e3d8bf;
  --color-divider: #d9cdb3;
  --color-border: #c8b993;

  --color-text: #1a1816;
  --color-text-muted: #6b665c;
  --color-text-faint: #a59f91;
  --color-text-inverse: #fbf6ed;

  --color-primary: #c8881f;       /* warm amber — headline gold */
  --color-primary-hover: #a76e10;
  --color-primary-active: #855608;
  --color-primary-highlight: #efdfb9;

  --color-ink: #1a1816;
  --color-ink-soft: #2a2622;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows (warm) */
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, 0.08);
  --shadow-md: 0 6px 18px rgba(60, 40, 10, 0.10);
  --shadow-lg: 0 18px 40px rgba(60, 40, 10, 0.14);

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 1080px;
  --content-wide: 1240px;

  /* Fonts */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
  --color-bg: #15130f;
  --color-surface: #1c1a16;
  --color-surface-2: #232019;
  --color-surface-offset: #2a261d;
  --color-surface-offset-2: #322d22;
  --color-divider: #3a3327;
  --color-border: #4a412f;

  --color-text: #f0e8d6;
  --color-text-muted: #a59f8e;
  --color-text-faint: #6e6856;
  --color-text-inverse: #1a1816;

  --color-primary: #e6a843;
  --color-primary-hover: #f0bb5d;
  --color-primary-active: #f5cb7a;
  --color-primary-highlight: #4a3a18;

  --color-ink: #f0e8d6;
  --color-ink-soft: #d6cdb8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}

/* ============ RESET ============ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}

p, li {
  text-wrap: pretty;
  max-width: 68ch;
}

::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a, button, [role="button"] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
