/* ==========================================================================
   LEGAL PAGES DESIGN SYSTEM (Inherits Luxury SaaS Base)
   ========================================================================== */
   :root {
    /* Colors - Deep, rich layering */
    --bg-base: #030303;          
    --bg-surface: #0A0A0B;       
    --bg-surface-hover: #121214;
    
    --bg-glass: rgba(10, 10, 11, 0.7);
    --border-glass: rgba(255, 255, 255, 0.06); 
    --border-glass-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #EDEDED;     
    --text-muted: #8A8F98;       
    --text-dark: #52525A;
    
    /* Core Accents */
    --accent-primary: #5E6AD2;   
    --accent-primary-hover: #6D7AF5;
    --accent-glow: rgba(94, 106, 210, 0.4);
    
    --accent-gold: #E5A63B;
    --accent-light: #A5B4FC;
    
    --status-error: #E5484D;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    
    /* Spacing */
    --space-1: 0.5rem;   
    --space-2: 1rem;     
    --space-3: 1.5rem;   
    --space-4: 2rem;     
    --space-6: 3rem;     
    --space-8: 4rem;     
    --space-12: 6rem;    
    --space-16: 8rem;    
    
    /* Motion & Shadows */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out-expo);
    --transition-base: 300ms var(--ease-out-expo);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
    --shadow-inner: inset 0 1px 0 rgba(255,255,255,0.08); 
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; font-size: 16px; background-color: var(--bg-base); }
body {
    background-color: var(--bg-base); color: var(--text-primary);
    font-family: var(--font-sans); line-height: 1.7;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
::selection { background: rgba(94, 106, 210, 0.3); color: #FFF; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #2A2A2E; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3A3A40; }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.2; letter-spacing: -0.03em; color: #FFFFFF; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.04em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-3xl { font-size: 1.875rem; }

.text-muted { color: var(--text-muted); }
.text-dark { color: var(--text-dark); }
.text-white { color: #FFF; }
.text-accent { color: var(--accent-primary); }
.text-gold { color: var(--accent-gold); }
.text-light { color: var(--accent-light); }
.text-error { color: var(--status-error); }

.mono-text { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.font-medium { font-weight: 500; }
.leading-relaxed { line-height: 1.8; }

/* Links */
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #FFF; }

:where(a, button, .btn-nav, .toc a):focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    transform: translateY(-140%);
    background: #FFFFFF;
    color: #000000;
    padding: 10px 12px;
    border-radius: 6px;
    z-index: 1000;
    font-weight: 600;
}

.skip-link:focus-visible {
    transform: translateY(0);
}

/* ==========================================================================
   LAYOUT & UTILITIES
   ========================================================================== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4); }
.page-wrap { max-width: 800px; margin: 0 auto; padding: 160px var(--space-4) 80px; position: relative; z-index: 10; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: var(--space-2); }
.gap-6 { gap: var(--space-3); }
.gap-8 { gap: var(--space-4); }

.m-0 { margin: 0; }
.mb-2 { margin-bottom: var(--space-1); }
.mb-4 { margin-bottom: var(--space-2); }
.mb-6 { margin-bottom: var(--space-3); }
.mb-8 { margin-bottom: var(--space-4); }
.mb-12 { margin-bottom: var(--space-6); }
.mb-16 { margin-bottom: var(--space-8); }
.mt-1 { margin-top: 4px; }
.mt-6 { margin-top: var(--space-3); }
.mt-8 { margin-top: var(--space-4); }
.mt-12 { margin-top: var(--space-6); }
.mx-auto { margin-left: auto; margin-right: auto; }

.py-12 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.border-t { border-top: 1px solid var(--border-glass); }
.border-glass { border-color: var(--border-glass); }
.block { display: block; }

/* ==========================================================================
   BACKGROUNDS & NAV
   ========================================================================== */
.noise-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E"); pointer-events: none; z-index: 50; mix-blend-mode: overlay; }
.grid-background { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-image: linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; z-index: 1; -webkit-mask-image: radial-gradient(ellipse at center 20%, black 0%, transparent 70%); mask-image: radial-gradient(ellipse at center 20%, black 0%, transparent 70%); }
.ambient-glow { position: fixed; width: 800px; height: 800px; background: radial-gradient(circle at center, var(--accent-glow) 0%, rgba(94, 106, 210, 0) 60%); pointer-events: none; z-index: 0; opacity: 0.3; filter: blur(80px); }
.origin-top { top: -400px; left: 50%; transform: translateX(-50%); }

.navbar { position: fixed; top: 0; width: 100%; background: rgba(3, 3, 3, 0.6); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 1px solid var(--border-glass); z-index: 100; height: 64px; display: flex; align-items: center; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.125rem; font-weight: 500; color: #FFF; letter-spacing: -0.04em; }
.logo .dot { color: var(--accent-primary); }
.beta-tag { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-muted); border: 1px solid var(--border-glass); padding: 2px 6px; border-radius: 4px; margin-left: 12px; }
.btn-nav { background: #FFF; color: #000 !important; padding: 6px 16px; min-height: 40px; border-radius: 6px; font-weight: 500; font-size: 0.875rem; transition: transform var(--transition-fast); }
.btn-nav:hover { transform: scale(0.98); background: #EAEAEA; }

/* ==========================================================================
   LEGAL COMPONENTS
   ========================================================================== */
.glass-card {
    background: linear-gradient(180deg, rgba(24, 24, 27, 0.4) 0%, rgba(10, 10, 11, 0.8) 100%);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-inner), var(--shadow-md);
    border-radius: 12px; padding: var(--space-6);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    position: relative; overflow: hidden;
}
.glass-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); z-index: 1; pointer-events: none; }

/* Doc Meta Header */
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4); padding: var(--space-4); }

/* Table of Contents */
.toc ol { list-style: none; padding: 0; columns: 2; column-gap: var(--space-6); }
.toc li { margin-bottom: 12px; }
.toc a { color: var(--text-muted); font-size: 0.95rem; min-height: 44px; display: inline-flex; align-items: center; }
.toc a:hover, .toc a.active { color: var(--accent-light); padding-left: 4px; }

.doc-section { scroll-margin-top: 96px; content-visibility: auto; contain-intrinsic-size: 1px 560px; }

/* Typography inside docs */
.doc-body p { color: var(--text-muted); margin-bottom: 1.25rem; }
.doc-body strong { color: #FFF; font-weight: 500; }

/* Feature Lists */
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { position: relative; padding-left: 24px; margin-bottom: 12px; color: var(--text-muted); }
.feature-list li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--border-glass-hover); border: 1px solid var(--text-dark); }
.feature-list li strong { color: #FFF; }

/* Callout Boxes */
.alert-box { border-left: 3px solid var(--accent-gold); background: rgba(229, 166, 59, 0.05); }
.warning-box { border-left: 3px solid var(--status-error); background: rgba(229, 72, 77, 0.05); }

/* Tables */
.table-container { overflow-x: auto; border: 1px solid var(--border-glass); border-radius: 8px; }
.tier-table { width: 100%; border-collapse: collapse; text-align: left; }
.tier-table th { background: rgba(255,255,255,0.03); padding: 16px; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border-glass); }
.tier-table td { padding: 16px; border-bottom: 1px solid var(--border-glass); font-size: 0.875rem; }
.tier-table tr:last-child td { border-bottom: none; }

/* Section Divider */
.section-divider { width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--border-glass), transparent); margin: var(--space-12) 0; }

/* Contact Block */
.contact-block { border-left: 3px solid var(--accent-primary); background: rgba(94, 106, 210, 0.05); }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.reveal, .fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); will-change: opacity, transform; }
.reveal.active, .fade-in.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .page-wrap { padding-top: 120px; }
    .doc-meta { grid-template-columns: 1fr 1fr; }
    .toc ol { columns: 1; }
    h1 { font-size: 2.5rem; }
}
@supports not (backdrop-filter: blur(1px)) {
    .navbar {
        background: rgba(3, 3, 3, 0.92);
    }

    .glass-card {
        background: #0F1012;
    }
}
@media (max-width: 480px) {
    .page-wrap {
        padding: 108px 1rem 64px;
    }

    .doc-meta {
        grid-template-columns: 1fr;
    }

    .toc a {
        font-size: 0.875rem;
    }

    h1 {
        font-size: 2rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

