:root,
[data-theme='light'] {
  --color-bg: #f7f2ea;
  --color-surface: #fbf7f0;
  --color-surface-2: #ffffff;
  --color-surface-offset: #efe8dc;
  --color-surface-offset-2: #e7dfd0;
  --color-surface-dynamic: #ddd3c0;
  --color-divider: #d6ccb8;
  --color-border: #c9bea7;

  --color-text: #1a1715;
  --color-text-muted: #5c544b;
  --color-text-faint: #8c8678;
  --color-text-inverse: #fbf7f0;

  --color-primary: #b8531d;
  --color-primary-hover: #9a4214;
  --color-primary-active: #7a320d;
  --color-primary-highlight: #f0dac9;

  --color-success: #437a22;
  --color-error: #a12c7b;

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

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

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 60 / 0.06);
  --shadow-md: 0 4px 16px oklch(0.2 0.01 60 / 0.08);
  --shadow-lg: 0 16px 40px oklch(0.2 0.01 60 / 0.14);

  --content-narrow: 560px;
  --content-default: 720px;
  --content-wide: 1080px;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --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.35rem + 2.2vw, 3.25rem);

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

[data-theme='dark'] {
  --color-bg: #121110;
  --color-surface: #1a1817;
  --color-surface-2: #221f1d;
  --color-surface-offset: #1e1c1a;
  --color-surface-offset-2: #262322;
  --color-surface-dynamic: #2f2b28;
  --color-divider: #2a2624;
  --color-border: #3a342f;

  --color-text: #eae3d6;
  --color-text-muted: #9a9183;
  --color-text-faint: #6b6458;
  --color-text-inverse: #121110;

  --color-primary: #e08247;
  --color-primary-hover: #f19a5f;
  --color-primary-active: #ffb07b;
  --color-primary-highlight: #3a2618;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #121110;
    --color-surface: #1a1817;
    --color-surface-2: #221f1d;
    --color-surface-offset: #1e1c1a;
    --color-surface-offset-2: #262322;
    --color-surface-dynamic: #2f2b28;
    --color-divider: #2a2624;
    --color-border: #3a342f;
    --color-text: #eae3d6;
    --color-text-muted: #9a9183;
    --color-text-faint: #6b6458;
    --color-text-inverse: #121110;
    --color-primary: #e08247;
    --color-primary-hover: #f19a5f;
    --color-primary-active: #ffb07b;
    --color-primary-highlight: #3a2618;
  }
}

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

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}

body {
  min-height: 100dvh;
  line-height: 1.55;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  font-feature-settings: 'ss01', 'cv11';
}

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

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

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

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

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--color-primary);
  text-decoration-skip-ink: auto;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--color-primary-hover);
}

::selection {
  background: color-mix(in oklab, var(--color-primary) 25%, transparent);
}

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus {
  top: 0;
}

@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'],
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);
}
