/*
  base.css
  Global reset, design tokens, typography, color themes, and
  mobile/accessibility defaults. Layout and components live in
  the other CSS files so this file stays easy to scan.
*/

/* ---------- Reset ---------- */

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--text);
  background: var(--bg);
}

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

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

/* 16px minimum on form controls so iOS does not zoom the page. */
input,
textarea,
select {
  font-size: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

button,
a,
[role="button"] {
  touch-action: manipulation;
}

button,
[role="button"],
.chip,
.filter-btn {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- Tokens ---------- */

:root {
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --header-h: 4.25rem;
  --space: 1.25rem;
  --max: 70rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Gray-black, not pure black, so body text stays readable. */
  --bg: #161616;
  --bg-elevated: #222222;
  --bg-muted: #2a2a2a;
  --text: #f4f1ea;
  --text-muted: #c4beb4;
  --accent: #f5c518;
  --accent-hover: #ffd84a;
  --accent-ink: #1a1400;
  --accent-soft: rgba(245, 197, 24, 0.16);
  --border: rgba(244, 241, 234, 0.14);
  --header: rgba(22, 22, 22, 0.78);
  --focus: #f5c518;
  --danger: #f97066;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* ---------- Type ---------- */

.display,
h1 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-optical-sizing: auto;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.lede,
.muted {
  color: var(--text-muted);
}

/* ---------- Accessibility ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  transform: translateY(-150%);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Fade-in used by IntersectionObserver in main.js */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
  }
}
