/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: light dark; }

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg:            #ffffff;
  --bg-subtle:     #fafafa;
  --fg:            #09090b;
  --fg-muted:      #52525b;
  --fg-subtle:     #71717a;
  --border:        #e4e4e7;
  --border-strong: #d4d4d8;
  --card:          #ffffff;
  --muted:         #f4f4f5;
  --accent:        #6366f1;
  --accent-dark:   #4f46e5;
  --accent-bg:     #eef2ff;
  --accent-ring:   rgba(99, 102, 241, 0.22);

  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --sp-1: 8px;   --sp-2: 16px;  --sp-3: 24px;  --sp-4: 32px;
  --sp-5: 40px;  --sp-6: 48px;  --sp-8: 64px;  --sp-10: 80px;
  --sp-12: 96px; --sp-16: 128px;

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-full: 100px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover:  0 12px 40px rgba(0,0,0,0.07), 0 3px 10px rgba(0,0,0,0.04);
  --shadow-accent: 0 0 0 3px var(--accent-ring);
}

/* ─── Dark mode ─────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0e0e10;
    --bg-subtle:     #131316;
    --fg:            #f4f4f5;
    --fg-muted:      #a1a1aa;
    --fg-subtle:     #71717a;
    --border:        #27272a;
    --border-strong: #3f3f46;
    --card:          #131316;
    --muted:         #18181b;
    --accent:        #818cf8;
    --accent-dark:   #6366f1;
    --accent-bg:     rgba(129, 140, 248, 0.12);
    --accent-ring:   rgba(129, 140, 248, 0.25);

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.25), 0 1px 2px rgba(0,0,0,0.18);
    --shadow-hover:  0 12px 40px rgba(0,0,0,0.35), 0 3px 10px rgba(0,0,0,0.2);
  }
  .nav {
    background: rgba(14, 14, 16, 0.88);
  }
  .nav.scrolled {
    background: rgba(14, 14, 16, 0.96);
  }
}

/* ─── Base ───────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

a { color: inherit; text-decoration: none; touch-action: manipulation; }
button { touch-action: manipulation; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); }

/* ─── Skip link ─────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: var(--sp-2);
  top: var(--sp-2);
  z-index: 999;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform 200ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--sp-3);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--sp-5); }
}

/* ─── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.96);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.wordmark {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 2px;
  transition: opacity 150ms ease;
}
.wordmark:hover { opacity: 0.55; }
.wordmark:focus-visible {
  outline: none;
  box-shadow: var(--shadow-accent);
  border-radius: var(--radius-sm);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: var(--accent);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  min-height: 44px;
  touch-action: manipulation;
  transition:
    background 150ms ease,
    transform 150ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 150ms ease;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.38);
}
.btn-primary:focus-visible {
  outline: none;
  box-shadow: var(--shadow-accent);
}
.btn-primary:active { transform: translateY(0); }

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-3);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.footer-copy {
  font-size: 0.8125rem;
  color: var(--fg-subtle);
}
.footer-links { display: flex; }
.footer-links a {
  font-size: 0.8125rem;
  color: var(--fg-subtle);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--sp-1);
  transition: color 150ms ease;
}
.footer-links a:hover { color: var(--fg-muted); }
.footer-links a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-accent);
  border-radius: 3px;
}

/* ─── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
