/* ==================== BASE TOKENS ==================== */
:root {
  /* Alexis Estate brand colors */
  --color-bordeaux: #581b25;
  --color-bordeaux-dark: #3d121a;
  --color-bordeaux-soft: #7a2c38;
  --color-gold: #b58e40;
  --color-gold-light: #d4b067;
  --color-gold-dark: #8e6e2f;
  --color-cream: #faf4e6;
  --color-cream-soft: #f5ecd6;
  --color-cream-warm: #efe4c8;
  --color-paper: #fcf8ed;
  --color-ink: #2a1410;
  --color-ink-soft: #5a3a30;
  --color-ink-faint: #8a6f60;

  /* Semantic tokens */
  --color-bg: var(--color-cream);
  --color-bg-alt: var(--color-cream-soft);
  --color-surface: var(--color-paper);
  --color-text: var(--color-ink);
  --color-text-muted: var(--color-ink-soft);
  --color-text-faint: var(--color-ink-faint);
  --color-accent: var(--color-bordeaux);
  --color-accent-hover: var(--color-bordeaux-dark);
  --color-divider: rgba(181, 142, 64, 0.3);
  --color-border: rgba(88, 27, 37, 0.15);

  /* 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);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 7rem);

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

  /* Layout */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(88, 27, 37, 0.06);
  --shadow-md: 0 6px 24px rgba(88, 27, 37, 0.1);
  --shadow-lg: 0 24px 64px rgba(88, 27, 37, 0.18);

  /* Fonts */
  --font-script: 'Allura', 'Snell Roundhand', cursive;
  --font-display: 'Cormorant Garamond', 'Cormorant', Georgia, serif;
  --font-smallcaps: 'Cormorant SC', 'Cormorant', Georgia, serif;
  --font-body: 'Cormorant Garamond', Georgia, serif;
}

/* ==================== RESETS ==================== */
*,
*::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: var(--space-12);
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  /* subtle paper texture via gradient */
  background-image:
    radial-gradient(at 20% 20%, rgba(181, 142, 64, 0.04) 0%, transparent 50%),
    radial-gradient(at 80% 80%, rgba(88, 27, 37, 0.03) 0%, transparent 50%);
}

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

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

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.15;
  font-weight: normal;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

::selection {
  background: rgba(181, 142, 64, 0.3);
  color: var(--color-bordeaux);
}

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

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

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