/* ===== Design tokens ===== */
:root {
  --primary: #1a1a2e;
  --accent: #007e7e;
  --accent-light: #00a89d;
  --accent-glow: rgba(0, 126, 126, 0.25);
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #6b7280;
  --header-text: rgba(255, 255, 255, 0.6);
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);
  --shadow-card: 0 1px 3px var(--shadow);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 56rem;
  --text-on-accent: #fff;
  --header-height: 3.5rem;
}

/* OS prefers dark → dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #0c0a09;
    --accent: #f8ce0d;
    --accent-light: #fde047;
    --accent-glow: rgba(248, 206, 13, 0.2);
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --text-on-accent: var(--primary);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
  }
}

/* Light OS + toggle checked → dark */
@media (prefers-color-scheme: light) {
  :root:has(#darkmode-switch:checked) {
    --primary: #0c0a09;
    --accent: #f8ce0d;
    --accent-light: #fde047;
    --accent-glow: rgba(248, 206, 13, 0.2);
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --text-on-accent: var(--primary);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
  }
}

/* Dark OS + toggle checked → light */
@media (prefers-color-scheme: dark) {
  :root:has(#darkmode-switch:checked) {
    --primary: #1a1a2e;
    --accent: #007e7e;
    --accent-light: #00a89d;
    --accent-glow: rgba(0, 126, 126, 0.25);
    --text-on-accent: #fff;
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #1c1917;
    --text-muted: #6b7280;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
  }
}

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

/* ===== Base ===== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

/* Only apply scroll-padding when navigating to a fragment */
html:has(:target) {
  scroll-padding-top: calc(var(--header-height) + 2rem);
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul {
  list-style: none;
}

strong {
  font-weight: 600;
}

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

/* ===== Typography scale ===== */
h1 { font-size: clamp(3rem, 8vw, 6rem); line-height: 1; letter-spacing: -0.03em; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-on-accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: var(--text-on-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-ghost {
  color: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}
