:root {
    --space-black: #05060f;
    --space-deep: #080a18;
    --space-dark: #0c0e22;
    --space-mid: #12152e;
    --space-card: rgba(15, 18, 40, 0.6);
    --space-card-hover: rgba(20, 24, 52, 0.75);
    --space-card-border: rgba(139, 92, 246, 0.08);
    --nebula-purple: #7C3AED;
    --nebula-violet: #8B5CF6;
    --nebula-indigo: #6366F1;
    --nebula-blue: #3B82F6;
    --nebula-pink: #A855F7;
    --nebula-cyan: #06B6D4;
    --text-primary: #E8EAFF;
    --text-secondary: rgba(232, 234, 255, 0.6);
    --text-muted: rgba(232, 234, 255, 0.35);
    --text-accent: #C4B5FD;
    --border-subtle: rgba(139, 92, 246, 0.1);
    --border-light: rgba(255, 255, 255, 0.06);
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-display); background: var(--space-black); color: var(--text-primary); overflow-x: hidden; line-height: 1.6; }
::selection { background: rgba(139,92,246,0.35); color: #fff; }
a { color: inherit; text-decoration: none; }

/* ===== SKIP NAV ===== */
.skip-nav {
    position: absolute; top: -100%; left: 1rem; z-index: 10000;
    padding: 0.75rem 1.5rem; background: var(--nebula-purple); color: #fff;
    border-radius: 0 0 8px 8px; font-weight: 600; font-size: 0.85rem;
    transition: top 0.2s ease;
}
.skip-nav:focus { top: 0; }

/* ===== GRAIN OVERLAY ===== */
body::after {
    content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
    opacity: 0.025;
    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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== NEBULA BG ===== */
.nebula-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.nebula-layer { position: absolute; border-radius: 50%; filter: blur(120px); }
.nebula-layer.n1 {
    width: 800px; height: 800px; opacity: 0.3;
    background: radial-gradient(circle, rgba(124,58,237,0.5), rgba(99,102,241,0.2), transparent 70%);
    top: -20%; right: -10%; animation: nFloat 25s ease-in-out infinite;
}
.nebula-layer.n2 {
    width: 600px; height: 600px; opacity: 0.25;
    background: radial-gradient(circle, rgba(59,130,246,0.3), rgba(6,182,212,0.15), transparent 70%);
    bottom: 10%; left: -15%; animation: nFloat 30s ease-in-out infinite reverse;
}
.nebula-layer.n3 {
    width: 400px; height: 400px; opacity: 0.2;
    background: radial-gradient(circle, rgba(168,85,247,0.3), transparent 70%);
    top: 50%; left: 40%; animation: nFloat 20s ease-in-out infinite; animation-delay: -10s;
}
@keyframes nFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    25% { transform: translate(40px,-30px) scale(1.05); }
    50% { transform: translate(-20px,40px) scale(0.95); }
    75% { transform: translate(30px,20px) scale(1.02); }
}

#starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ===== NAV ===== */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 1.25rem 2.5rem; display: flex; justify-content: space-between; align-items: center;
    transition: all 0.4s var(--ease);
}
nav.scrolled {
    background: rgba(5,6,15,0.85); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle); padding: 0.75rem 2.5rem;
}
nav.always-blur {
    background: rgba(5,6,15,0.85); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle); padding: 1rem 2.5rem;
}
.nav-logo { display: flex; align-items: center; gap: 0.85rem; font-weight: 700; font-size: 1.2rem; color: var(--text-primary); letter-spacing: -0.01em; }
.m31-mark {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--nebula-purple), var(--nebula-indigo));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.6rem; font-family: var(--font-mono);
    font-weight: 700; letter-spacing: 0.08em;
    box-shadow: 0 0 24px rgba(124,58,237,0.35), inset 0 0 12px rgba(255,255,255,0.1);
    position: relative;
}
.m31-mark::after {
    content: ''; position: absolute; inset: -3px; border-radius: 50%;
    border: 1px solid rgba(139,92,246,0.25); animation: mPulse 3s ease-in-out infinite;
}
@keyframes mPulse { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.15); opacity: 0; } }

.nav-links { display: flex; gap: 2.5rem; list-style: none; align-items: center; }
.nav-links a {
    font-size: 0.85rem; font-weight: 500; color: var(--text-secondary);
    transition: color 0.3s ease; position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:focus-visible { outline: 2px solid var(--nebula-violet); outline-offset: 4px; border-radius: 4px; }
.nav-cta {
    background: rgba(124,58,237,0.15) !important; border: 1px solid rgba(139,92,246,0.3) !important;
    color: var(--text-accent) !important; padding: 0.55rem 1.4rem; border-radius: 100px;
    font-size: 0.8rem !important; font-weight: 600 !important; transition: all 0.3s var(--ease) !important;
}
.nav-cta:hover {
    background: rgba(124,58,237,0.25) !important; border-color: rgba(139,92,246,0.5) !important;
    color: #fff !important; box-shadow: 0 0 24px rgba(124,58,237,0.2); transform: translateY(-1px);
}
.nav-hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    background: none; border: none; padding: 4px;
}
.nav-hamburger:focus-visible { outline: 2px solid var(--nebula-violet); outline-offset: 4px; border-radius: 4px; }
.nav-hamburger span { width: 24px; height: 2px; background: var(--text-secondary); border-radius: 2px; transition: all 0.3s ease; }

.mobile-menu {
    display: none; position: fixed; inset: 0;
    background: rgba(5,6,15,0.97); backdrop-filter: blur(20px); z-index: 999;
    flex-direction: column; align-items: center; justify-content: center; gap: 2rem;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu a { font-size: 1.5rem; font-weight: 600; color: var(--text-secondary); transition: color 0.3s ease; }
.mobile-menu a:hover { color: var(--text-primary); }
.mobile-menu a:focus-visible { outline: 2px solid var(--nebula-violet); outline-offset: 4px; border-radius: 4px; }
.mobile-close {
    position: absolute; top: 1.25rem; right: 2rem;
    background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--text-secondary);
}
.mobile-close:focus-visible { outline: 2px solid var(--nebula-violet); outline-offset: 4px; border-radius: 4px; }

/* ===== FOOTER ===== */
footer { position: relative; z-index: 1; border-top: 1px solid var(--border-subtle); padding: 2.5rem 2.5rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.78rem; color: var(--text-muted); transition: color 0.3s ease; }
.footer-links a:hover { color: var(--nebula-violet); }
.footer-links a:focus-visible { outline: 2px solid var(--nebula-violet); outline-offset: 4px; border-radius: 4px; }

/* ===== SECTION UTILITIES ===== */
section { position: relative; z-index: 1; }
.container { max-width: 1100px; margin: 0 auto; }
.section-label {
    font-family: var(--font-mono); font-size: 0.7rem;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--nebula-violet); margin-bottom: 1rem;
}
.section-title {
    font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 700;
    letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1.25rem;
}
.section-desc { font-size: 1.05rem; color: var(--text-secondary); max-width: 540px; line-height: 1.7; }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: all 0.7s var(--ease-out-quart); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }
.reveal-d5 { transition-delay: 0.40s; }

/* ===== GLOBAL FOCUS ===== */
:focus-visible { outline: 2px solid var(--nebula-violet); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* ===== BUTTONS ===== */
.btn-glow {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, var(--nebula-purple), var(--nebula-indigo));
    color: white; padding: 0.9rem 2.2rem; border-radius: 100px;
    font-weight: 600; font-size: 0.95rem; border: none; cursor: pointer;
    transition: all 0.3s var(--ease);
    box-shadow: 0 0 30px rgba(124,58,237,0.25), 0 4px 20px rgba(0,0,0,0.3);
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(124,58,237,0.35), 0 8px 30px rgba(0,0,0,0.4); }
.btn-glow:active { transform: translateY(0); }
.btn-glow svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; color: var(--text-secondary);
    padding: 0.9rem 2.2rem; border-radius: 100px;
    font-weight: 600; font-size: 0.95rem; border: 1px solid var(--border-light);
    cursor: pointer; transition: all 0.3s var(--ease);
}
.btn-ghost:hover { border-color: rgba(139,92,246,0.3); color: var(--text-primary); background: rgba(139,92,246,0.05); }
.btn-ghost:active { transform: translateY(0); }

/* ===== LEGAL PAGE SHARED ===== */
.page-header { padding: 8rem 2rem 3.5rem; text-align: center; position: relative; z-index: 1; }
.page-eyebrow {
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--nebula-violet);
    letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 0.75rem;
}
.page-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.03em; }
.page-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.5rem; }

.legal-content { max-width: 780px; margin: 0 auto; padding: 0 2rem 6rem; position: relative; z-index: 1; }
.back-link {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; font-weight: 500; color: var(--text-accent);
    margin-bottom: 2rem; transition: all 0.3s ease;
}
.back-link:hover { gap: 0.75rem; color: #fff; }
.back-link svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

.legal-content h2 {
    font-size: 1.3rem; font-weight: 700; color: var(--text-primary);
    margin-top: 3rem; margin-bottom: 0.75rem; padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}
.legal-content h2:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }
.legal-content h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin-top: 2rem; margin-bottom: 0.5rem; }
.legal-content p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.75; margin-bottom: 1rem; }
.legal-content a { color: var(--text-accent); transition: color 0.3s ease; }
.legal-content a:hover { color: #fff; }
.legal-content ul { list-style: none; margin: 0.75rem 0 1.25rem; }
.legal-content ul li {
    font-size: 0.95rem; color: var(--text-secondary); line-height: 1.75;
    padding-left: 1.25rem; position: relative; margin-bottom: 0.35rem;
}
.legal-content ul li::before {
    content: ''; position: absolute; left: 0; top: 0.65rem;
    width: 5px; height: 5px; border-radius: 50%; background: rgba(139,92,246,0.4);
}

.info-box {
    background: var(--space-card); border: 1px solid var(--border-light);
    border-radius: 12px; padding: 1.25rem 1.5rem; margin: 1.5rem 0; backdrop-filter: blur(10px);
}
.info-box p { margin-bottom: 0.25rem; color: var(--text-secondary); }
.info-box p:last-child { margin-bottom: 0; }
.info-box strong { color: var(--text-primary); }

/* ===== RESPONSIVE SHARED ===== */
@media (max-width: 768px) {
    nav { padding: 1rem 1.5rem; }
    nav.scrolled { padding: 0.75rem 1.5rem; }
    nav.always-blur { padding: 1rem 1.5rem; }
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .mobile-menu { display: flex; }
    .page-header { padding: 7rem 1.5rem 2.5rem; }
    .legal-content { padding: 0 1.5rem 4rem; }
    .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto !important; }
    .marquee { animation: none; }
    #starfield { display: none; }
    .reveal { opacity: 1; transform: none; }
}
