:root {
    /* Remindion brand (matches ColorPalette.swift) */
    --primary: #007AFF;
    --primary-dark: #0056CC;
    --primary-glow: #0A84FF;
    --secondary: #5856D6;
    --accent: #FFB84D;
    --accent-dark: #FFC96B;
    --success: #34C759;

    /* Legacy aliases */
    --primary-soft: var(--primary-glow);
    --accent-green: var(--success);
    --accent-blue: var(--primary);
    --accent-purple: var(--secondary);

    /* Text — iOS dark mode */
    --text-main: #FFFFFF;
    --text-muted: #98989D;
    --text-soft: #AEAEB2;
    --text-bright: #FFFFFF;

    /* Surfaces — iOS dark mode */
    --bg-body: #000000;
    --bg-card: #1C1C1E;
    --bg-panel: #2C2C2E;
    --bg-deep: #000000;
    --bg-gradient-start: #0A1628;
    --bg-header: rgba(0, 0, 0, 0.82);

    /* Borders & shadows */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-faint: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-header: rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.5);
    --shadow-btn: 0 8px 24px rgba(0, 122, 255, 0.35);
    --shadow-accent: 0 8px 32px rgba(255, 184, 77, 0.2);

    /* Layout */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 20px;
    --radius-pill: 50px;
    --transition-base: 0.3s ease;
    --header-height: 5.5rem;
    --content-max: 980px;
    --layout-max: 1100px;

    --focus-ring: 2px solid var(--accent);
    --focus-offset: 3px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 0.75rem);
}

section[id] {
    scroll-margin-top: calc(var(--header-height) + 0.75rem);
}

@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;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
}

/* Ambient brand glow */
body.page-home::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 50% at 15% -5%, rgba(0, 122, 255, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 85% 10%, rgba(255, 184, 77, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(88, 86, 214, 0.08) 0%, transparent 50%);
}

body.page-home > *:not(.skip-link) { position: relative; z-index: 1; }

a.skip-link {
    position: fixed;
    top: 0;
    left: 1rem;
    z-index: 2000;
    padding: 0;
    margin: -1px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    background: var(--accent);
    color: var(--bg-deep);
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-decoration: none;
}

a.skip-link:focus {
    outline: none;
}

a.skip-link:focus-visible {
    width: auto;
    height: auto;
    padding: 0.75rem 1.25rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
    top: 1rem;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
.menu-toggle:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
}

.btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-offset);
    box-shadow: 0 0 0 4px rgba(255, 184, 77, 0.25);
}

body > header {
    background: var(--bg-header);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-header);
}

nav {
    max-width: var(--layout-max);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    gap: 1rem;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: white;
    text-decoration: none;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.logo img {
    height: 38px;
    width: auto;
    border-radius: 9px;
}

.nav-links {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition-base);
}

.nav-links a:hover { color: white; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    border-radius: var(--radius-sm);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

.btn {
    padding: 0.9rem 1.75rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
    display: inline-block;
    border: none;
    cursor: pointer;
    font: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-glow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-btn);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}

.cta-buttons {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    flex-wrap: wrap;
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    margin-bottom: 0.75rem;
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.section-lead {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

body > footer {
    background: var(--bg-card);
    color: white;
    padding: 3rem 2rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-faint);
}

.footer-content { max-width: var(--layout-max); margin: 0 auto; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.75;
    font-size: 0.95rem;
}

.footer-links a:hover { opacity: 1; }

.copyright { opacity: 0.5; margin-top: 2rem; font-size: 0.9rem; }

.page-story main,
.page-whitepaper main,
.page-legal main {
    padding-top: var(--header-height);
}

.page-story,
.page-whitepaper {
    background: radial-gradient(circle at 20% 0%, var(--bg-gradient-start) 0%, var(--bg-deep) 45%);
}

.text-accent { color: var(--accent); }

@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 0.75rem);
        right: 2rem;
        left: 2rem;
        flex-direction: column;
        gap: 0;
        background: var(--bg-card);
        border: 1px solid var(--border-header);
        border-radius: 14px;
        padding: 0.5rem 0;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.open { display: flex; }
    .nav-links li { border-bottom: 1px solid var(--border-faint); }
    .nav-links li:last-child { border-bottom: none; }
    .nav-links a { display: block; padding: 0.85rem 1.25rem; }
}
