/* ── Fonts ── */
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

/* ── Design Tokens ── */
:root {
  --bg: #faf9f7;
  --surface: #f2f1ef;
  --surface2: #e6e4e0;
  --text: #1a1916;
  --text-secondary: #6b6860;
  --accent: #1a6ed8;
  --accent-hover: #1560c4;
  --accent-subtle: rgba(26, 110, 216, 0.08);
  --border: rgba(26, 25, 22, 0.08);
  --nav-bg: rgba(250, 249, 247, 0.80);
  --shadow-card: 0 2px 16px rgba(26, 25, 22, 0.06), 0 1px 3px rgba(26, 25, 22, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 980px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e0d;
    --surface: #1c1a18;
    --surface2: #2a2724;
    --text: #f0ede8;
    --text-secondary: #8f8a83;
    --accent: #4d9fff;
    --accent-hover: #6aafff;
    --accent-subtle: rgba(77, 159, 255, 0.12);
    --border: rgba(240, 237, 232, 0.09);
    --nav-bg: rgba(15, 14, 13, 0.85);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  }
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 800;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 22px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* ── Focus ── */
:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* ── Navigation ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
nav.nav--scrolled {
  border-bottom-color: var(--border);
}
.nav-inner {
  width: 100%; max-width: 980px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.2px;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-mail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent) !important;
  background: var(--accent-subtle);
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  transition: background 0.2s, color 0.2s !important;
}
.nav-mail:hover {
  background: rgba(26, 110, 216, 0.16) !important;
  color: var(--accent) !important;
}
@media (prefers-color-scheme: dark) {
  .nav-mail:hover {
    background: rgba(77, 159, 255, 0.22) !important;
  }
}
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav-back:hover { opacity: 0.7; }

/* ── Hamburger ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Footer ── */
footer {
  padding: 40px 22px;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-copy { font-size: 14px; color: var(--text-secondary); }
.footer-links { display: flex; gap: 20px; list-style: none; }
.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: none; }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 40ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 80ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 120ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 160ms; }
.reveal-stagger.visible > * { opacity: 1; transform: none; }

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav-hamburger span { transition: none; }
  .btn, .card { transition: none; }
}

/* ── Responsive Nav ── */
@media (max-width: 700px) {
  .nav-hamburger { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a {
    display: block;
    padding: 14px 22px;
    font-size: 16px;
    min-height: 44px;
  }
  .nav-links li:last-child a {
    margin: 8px 22px 8px;
    display: inline-flex;
  }
  .footer-inner { flex-direction: column; align-items: center; }
}
