/* ============ DESIGN TOKENS ============ */
:root, [data-theme="light"] {
  /* Fluid type scale */
  --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);

  /* Spacing */
  --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;

  /* Colors — Black + amber industrial palette */
  --color-bg: #f5f3ee;             /* warm bone */
  --color-surface: #ffffff;
  --color-surface-2: #faf8f3;
  --color-surface-offset: #ecead9;
  --color-border: #d9d6cb;
  --color-divider: #e6e3d8;

  --color-text: #0e0e0e;           /* near-black for body */
  --color-text-muted: #4d4d4d;
  --color-text-faint: #8a8a8a;
  --color-text-inverse: #ffffff;

  --color-primary: #0a0a0a;        /* deep black */
  --color-primary-hover: #000000;
  --color-primary-soft: #1a1a1a;

  --color-accent: #e8911f;         /* signature amber */
  --color-accent-hover: #c4750e;
  --color-accent-soft: #fbe7c5;

  --color-success: #2f6f3e;

  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.22);

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-default: 1200px;
  --content-narrow: 720px;

  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
}

[data-theme="dark"] {
  --color-bg: #0a0a0a;             /* true black */
  --color-surface: #121212;
  --color-surface-2: #181818;
  --color-surface-offset: #1f1f1f;
  --color-border: #2a2a2a;
  --color-divider: #1f1f1f;

  --color-text: #f5f3ee;
  --color-text-muted: #9c9a93;
  --color-text-faint: #5e5d57;
  --color-text-inverse: #0a0a0a;

  --color-primary: #ffffff;
  --color-primary-hover: #f5f3ee;
  --color-primary-soft: #1a1a1a;

  --color-accent: #f2a13a;
  --color-accent-hover: #ffb757;
  --color-accent-soft: #3a2510;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a0a0a;
    --color-surface: #121212;
    --color-surface-2: #181818;
    --color-surface-offset: #1f1f1f;
    --color-border: #2a2a2a;
    --color-divider: #1f1f1f;
    --color-text: #f5f3ee;
    --color-text-muted: #9c9a93;
    --color-text-faint: #5e5d57;
    --color-text-inverse: #0a0a0a;
    --color-primary: #ffffff;
    --color-primary-hover: #f5f3ee;
    --color-primary-soft: #1a1a1a;
    --color-accent: #f2a13a;
    --color-accent-hover: #ffb757;
    --color-accent-soft: #3a2510;
  }
}

/* ============ BASE ============ */
*, *::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: var(--color-bg);
}

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

ul[role="list"], ol[role="list"] { list-style: none; }

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

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

p, li, figcaption {
  text-wrap: pretty;
}

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

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

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

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

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

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

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