/* ==========================================================================
   base.css
   Design tokens, themes, reset and element defaults.
   Light is the default theme. Dark is opt-in via <html data-theme="dark">.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Colour */
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #16140f;
  --text-muted: #55514a;
  --line: #e4e1d9;
  --line-strong: #c9c5ba;
  --accent: #7a1f3d;
  --accent-hover: #5e1830;
  --accent-contrast: #ffffff;
  --accent-soft: #f4e9ed;
  --shadow: 0 1px 2px rgba(22, 20, 15, 0.04), 0 8px 24px rgba(22, 20, 15, 0.06);

  /* Type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Layout */
  --container: 1120px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --header-h: 84px;
  --section-space: clamp(4rem, 9vw, 7rem);
  --radius: 14px;
  --radius-sm: 8px;
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #12110e;
  --surface: #1a1915;
  --surface-2: #221f1a;
  --text: #f4f1ea;
  --text-muted: #b5afa3;
  --line: #2e2b25;
  --line-strong: #47433a;
  --accent: #e58aa6;
  --accent-hover: #f0a6bc;
  --accent-contrast: #2a0f1a;
  --accent-soft: #2c1a22;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Typography ------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
}

h3 {
  font-size: clamp(1.15rem, 1.6vw, 1.35rem);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

strong,
b {
  font-weight: 600;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Focus ------------------------------------------------------------------ */

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

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