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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-canvas);
  color: var(--fg-default);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-dimmed); }
* { scrollbar-width: thin; scrollbar-color: var(--neutral-muted) transparent; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-muted);
  border-radius: var(--radius-sm);
}

a { color: var(--accent-fg); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-light); }

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-backdrop-blur);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-heading);
  text-decoration: none;
}
.logo svg { width: 24px; height: 24px; color: var(--accent-fg); }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-desktop a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color 0.15s;
}
.nav-desktop a:hover { color: var(--fg-default); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
}
.btn-ghost:hover { color: var(--fg-default); background: var(--neutral-subtle); }
.btn-primary {
  background: var(--accent-fg);
  color: var(--fg-on-emphasis);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: var(--bg-surface);
  color: var(--fg-default);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover { background: var(--bg-inset); }
.btn-lg { padding: 12px 28px; font-size: 1rem; border-radius: var(--radius-md); }

.lang-toggle {
  background: var(--neutral-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s var(--ease-out);
}
.lang-toggle:hover { background: var(--neutral-muted); border-color: var(--border-default); }
.lang-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
}
.lang-toggle:hover .lang-label { color: var(--fg-default); }

.theme-toggle {
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  transition: all 0.15s var(--ease-out);
}
.theme-toggle:hover { color: var(--fg-default); background: var(--neutral-subtle); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Mobile nav toggle */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.nav-mobile-toggle:hover { color: var(--fg-default); background: var(--neutral-subtle); }
.nav-mobile-toggle svg { width: 20px; height: 20px; }

.nav-mobile {
  display: none;
  position: fixed;
  top: 56px; left: 0; right: 0; bottom: 0;
  background: var(--bg-canvas);
  z-index: 99;
  padding: var(--space-6) var(--space-5);
  flex-direction: column;
  gap: var(--space-4);
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--fg-secondary);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.nav-mobile a:hover { color: var(--accent-fg); }

@media (max-width: 768px) {
  .nav-desktop { display: none; }
  .nav-mobile-toggle { display: inline-flex; }
}

/* ---------- Sections ---------- */
section { position: relative; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-fg);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--fg-heading);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 640px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-7) 0 var(--space-6);
  margin-top: var(--space-8);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--fg-heading);
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
}
.footer-brand svg { width: 20px; height: 20px; color: var(--accent-fg); }
.footer-copy { font-size: 0.8rem; color: var(--fg-subtle); }
.footer-links { display: flex; gap: var(--space-6); flex-wrap: wrap; }
.footer-col h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: var(--space-3);
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--fg-subtle);
  padding: 2px 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--fg-default); }

/* ---------- Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-spring), transform 0.7s var(--ease-spring);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
