/*!
 * base.css
 * Reset, box-sizing, root variables, skip-link, focus styles, prefers-reduced-motion
 * Variant: 03-retro-film-reel-5 (Drive-in Theater)
 */

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

/* ─── Root variables ─────────────────────────────────────────────────────────── */
:root {
  /* Colors - Drive-in Theater brand kit */
  --color-primary: #9c2a1b;
  --color-secondary: #f5e9d4;
  --color-accent: #1abc9c;
  --color-muted: #8c5e3c;

  /* Semantic colors - retro cream + teal + soft brown */
  --color-bg: #f5e9d4;
  --color-bg-alt: #1abc9c;
  --color-bg-elevated: #d4a017;
  --color-surface: #a3e4d7;
  --color-text: #111;
  --color-text-body: #111;
  --color-text-muted: #4a3424;
  --color-silver: #d4a017;
  --color-silver-light: #f5e9d4;
  --color-border: #8c5e3c;

  /* Typography */
  --font-headline: 'Bebas Neue', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --font-ui: 'Nunito', sans-serif;
  --font-code: 'Cousine', monospace;

  /* Font sizes - fluid scale */
  --text-xs: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --text-4xl: clamp(2.5rem, 2rem + 2.5vw, 4rem);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border radius - smooth velvet feel */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Border width */
  --border-thin: 1px;
  --border-medium: 2px;
  --border-thick: 3px;

  /* Shadows - retro warmth */
  --shadow-sm: 0 2px 8px rgb(26, 188, 156, 0.15);
  --shadow-md: 0 4px 16px rgb(26, 188, 156, 0.2);
  --shadow-lg: 0 8px 32px rgb(26, 188, 156, 0.25);
  --shadow-glow: 0 0 20px rgb(163, 228, 215, 0.4);
  --shadow-silver: 0 0 15px rgb(212, 160, 23, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --max-width: 1200px;
  --header-height: 72px;
}

/* ─── Base styles ───────────────────────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-body);
  background-color: var(--color-bg);
  min-height: 100vh;
}

/* ─── Typography ───────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headline);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: 0.1em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: 0.08em;
}

h3 {
  font-size: var(--text-2xl);
  letter-spacing: 0.06em;
}

h4 {
  font-size: var(--text-xl);
  letter-spacing: 0.04em;
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

p {
  margin-bottom: var(--space-md);
  max-width: 65ch;
  color: var(--color-text-body);
}

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

a:hover {
  color: var(--color-silver-light);
  text-decoration: underline;
}

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

/* ─── Skip link ────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 9999;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-accent);
  color: var(--color-secondary);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.skip-link:focus {
  top: var(--space-md);
  outline: var(--border-medium) solid var(--color-silver);
}

/* ─── Focus styles ─────────────────────────────────────────────────────────── */
:focus {
  outline: none;
}

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

/* ─── Selection ─────────────────────────────────────────────────────────────── */
::selection {
  background-color: var(--color-accent);
  color: var(--color-secondary);
}

/* ─── Lists ─────────────────────────────────────────────────────────────────── */
ul,
ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

/* ─── Images ────────────────────────────────────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── Code ─────────────────────────────────────────────────────────────────── */
code {
  font-family: var(--font-code);
  font-size: 0.9em;
  background-color: var(--color-bg-alt);
  color: var(--color-accent);
  padding: 0.1em 0.3em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

pre {
  font-family: var(--font-code);
  font-size: var(--text-sm);
  background-color: var(--color-bg-alt);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: var(--border-medium) solid var(--color-border);
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

pre code {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* ─── Layout helpers ───────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (width >= 768px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

/* ─── Visually hidden (screen reader only) ─────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
