/* base.css — reset + tokens v2 (quiet-punk) */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Type */
  --text-xs: clamp(0.72rem, 0.7rem + 0.15vw, 0.82rem);
  --text-sm: clamp(0.86rem, 0.8rem + 0.3vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.15rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 3vw, 3.75rem);
  --text-3xl: clamp(2.75rem, 1rem + 5vw, 6rem);
  --text-hero: clamp(3.75rem, 0.5rem + 11vw, 11rem);

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

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1240px;
  --content-xl: 1440px;

  --font-display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --font-grotesk: 'Space Grotesk', 'Neue Haas Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', system-ui, sans-serif;

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

/* LIGHT — bone paper + ink + magenta */
:root,
[data-theme='light'] {
  --color-bg: #f2ebdb;
  --color-paper: #ede4cf;
  --color-surface: #efe6d3;
  --color-surface-2: #f8f2e5;
  --color-surface-offset: #e5d9bc;
  --color-divider: #d3c8ac;
  --color-border: #beb191;

  --color-text: #17150f;
  --color-text-muted: #5c5648;
  --color-text-faint: #948c76;
  --color-text-inverse: #f6efdf;

  --color-primary: #5f6b76; /* warm steel — grey with a hint of blue */
  --color-primary-hover: #4a5560;
  --color-accent: #b7541e; /* saffron secondary */
  --color-ink: #17150f;

  --shadow-sm: 0 1px 2px rgb(23 21 15 / 0.06);
  --shadow-md: 0 12px 30px rgb(23 21 15 / 0.1);
  --shadow-lg: 0 40px 80px rgb(23 21 15 / 0.18);
}

/* DARK */
[data-theme='dark'] {
  --color-bg: #0d0c09;
  --color-paper: #100e0a;
  --color-surface: #14120d;
  --color-surface-2: #191510;
  --color-surface-offset: #201b14;
  --color-divider: #2a251d;
  --color-border: #3c3628;

  --color-text: #ede3cd;
  --color-text-muted: #948a72;
  --color-text-faint: #5a5344;
  --color-text-inverse: #0d0c09;

  --color-primary: #8b96a2; /* warm steel — lifted for dark mode */
  --color-primary-hover: #a3aeba;
  --color-accent: #d9873a;
  --color-ink: #ede3cd;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 10px 30px rgb(0 0 0 / 0.55);
  --shadow-lg: 0 30px 80px rgb(0 0 0 / 0.7);
}

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

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 400ms ease, color 400ms ease;
  overflow-x: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: none;
}
a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
  letter-spacing: -0.015em;
}
p,
li {
  text-wrap: pretty;
}

::selection {
  background: var(--color-primary);
  color: #fff;
}

: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;
  }
}

.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;
}
.sr-only:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  clip: auto;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  z-index: 100;
}

a,
button {
  transition: color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    opacity var(--transition-interactive),
    transform var(--transition-interactive);
}
