/* ── Shared design tokens & base styles ── */
:root {
  --bg: #050505;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-solid: #0a0a0f;
  --border: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.12);
  --text: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-tertiary: #888;
  --text-tag: #8e8e9e;
  --accent: #818cf8;
  --accent-dim: #6366f1;
  --accent-light: #a5b4fc;
  --accent-glow: rgba(129, 140, 248, 0.08);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Outfit', system-ui, sans-serif;
  --max-w: 1200px;
  --nav-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }
::selection { background: var(--accent-dim); color: #fff; }
a { color: inherit; text-decoration: none; }

/* Skip link */
.skip-link { position: absolute; top: -100%; left: 16px; z-index: 1000; padding: 8px 16px; background: var(--accent); color: #fff; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; font-family: var(--sans); transition: top 0.2s; }
.skip-link:focus { top: 12px; }

/* Focus visible */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Background layers */
.mesh-gradient { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--bg); }
.mesh-gradient::before { content: ''; position: absolute; top: -20%; left: -10%; right: -10%; height: 85%; background:
  radial-gradient(ellipse 90% 45% at 20% 0%, rgba(99,102,241,0.08) 0%, transparent 60%),
  radial-gradient(ellipse 60% 35% at 80% 5%, rgba(139,92,246,0.055) 0%, transparent 50%),
  radial-gradient(ellipse 45% 25% at 50% 20%, rgba(99,102,241,0.035) 0%, transparent 50%);
  pointer-events: none; animation: aurora-breathe 12s ease-in-out infinite; }
@keyframes aurora-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.mesh-gradient::after { content: ''; position: absolute; inset: 0; opacity: 0.45; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E"); background-repeat: repeat; background-size: 200px 200px; pointer-events: none; }
.bg-scanlines { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,0.012) 3px, rgba(255,255,255,0.012) 4px); }
.bg-vignette { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 40%, rgba(0,0,0,0.5) 100%); }
.particles-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h); display: flex; align-items: center; justify-content: center; transition: all 0.4s cubic-bezier(0.22,1,0.36,1); border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(5,5,5,0.85); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); border-bottom-color: var(--border); }
.nav-inner { width: 100%; max-width: var(--max-w); padding: 0 32px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; }
.logo-mark { width: 32px; height: 20px; transition: transform 0.3s, filter 0.3s; }
.nav-logo:hover .logo-mark { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(129,140,248,0.5)); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { font-size: 13px; font-weight: 400; color: var(--text-tertiary); letter-spacing: 0.01em; transition: color 0.3s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links .chat-link, .nav-links .nav-icon-link { display: flex; align-items: center; gap: 6px; }
.nav-links .chat-link { color: var(--accent); }
.nav-links .chat-link:hover { color: var(--accent-light); }
.nav-links .chat-link svg, .nav-links .nav-icon-link svg { width: 13px; height: 13px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; width: 44px; height: 44px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--text-secondary); transition: all 0.3s; }
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }
.nav-mobile { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; background: rgba(5,5,5,0.95); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--border); padding: 16px 32px; flex-direction: column; gap: 4px; list-style: none; transform: translateY(-8px); opacity: 0; transition: transform 0.3s, opacity 0.3s; pointer-events: none; z-index: 99; }
.nav-mobile.open { display: flex; transform: translateY(0); opacity: 1; pointer-events: all; }
.nav-mobile a { font-size: 15px; font-weight: 400; color: var(--text-secondary); padding: 10px 0; }
@media (max-width: 768px) { .nav-links { display: none; } .nav-toggle { display: flex; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.15s !important; }
  html { scroll-behavior: auto; }
  .particles-canvas { display: none; }
}
