/* ==========================================================================
   Mystoria — my-storia.com
   Apple-inspired premium design system
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #6366f1;
    --color-secondary: #a855f7;
    --color-accent: #ec4899;
    --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(168,85,247,0.08) 50%, rgba(236,72,153,0.08) 100%);

    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-elevated: #fbfbfd;
    --border: rgba(0, 0, 0, 0.08);

    --nav-height: 52px;
    --container-max: 1080px;
    --container-wide: 1200px;
    --section-padding: 140px;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 980px;

    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', Roboto, sans-serif;
    --transition: 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-slow: 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-feature-settings: "ss01", "cv11";
    letter-spacing: -0.011em;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

/* --- Typography --- */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.section-title {
    font-size: clamp(40px, 5.5vw, 64px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.section-subtitle {
    font-size: 19px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 16px auto 0;
    line-height: 1.5;
}

.section-header {
    text-align: center;
    margin-bottom: 80px;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: var(--transition);
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.nav-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    z-index: 1001;
}

.nav-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
}

.nav-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-cta {
    background: var(--text-primary);
    color: white !important;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 14px !important;
    transition: var(--transition);
}

.nav-cta:hover {
    opacity: 0.85;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 28px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    border: none;
    will-change: transform;
}

.btn-primary {
    background: var(--text-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    background: #000;
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-primary);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.06);
    transform: scale(1.02);
}

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

.btn-light:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height) + 72px) 24px 80px;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.hero-content {
    max-width: 820px;
    position: relative;
    z-index: 1;
}

.hero-headline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-bottom: 28px;
}

.hero-app-icon {
    width: clamp(72px, 9vw, 112px);
    height: clamp(72px, 9vw, 112px);
    border-radius: 24px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 12px 30px -10px rgba(0, 0, 0, 0.18),
        0 30px 60px -20px rgba(30, 15, 60, 0.22);
    flex-shrink: 0;
}

.hero-title {
    font-size: clamp(56px, 10vw, 104px);
    font-weight: 700;
    letter-spacing: -0.048em;
    line-height: 1.02;
    margin-bottom: 0;
    text-align: left;
}

.hero-subtitle {
    font-size: clamp(19px, 2.5vw, 24px);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 44px;
    line-height: 1.4;
    letter-spacing: -0.012em;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Sections --- */
.section {
    padding: var(--section-padding) 0;
}

.features {
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.04);
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.12);
    border-color: rgba(0,0,0,0.06);
}

.feature-stage {
    background: var(--bg-secondary);
    padding: 30px 30px 26px;
}

.feature-shot {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.3);
}

.feature-text {
    padding: 22px 28px 30px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- How It Works --- */
.how-it-works {
    background: var(--bg-primary);
}

.steps {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.step {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 700;
}

.step-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-content p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Research CTA --- */
.research-cta {
    background: var(--bg-secondary);
    padding: var(--section-padding) 0;
}

.research-card {
    background:
        radial-gradient(140% 100% at 80% 10%, rgba(255,255,255,0.14) 0%, transparent 55%),
        radial-gradient(120% 80% at 10% 90%, rgba(255,255,255,0.08) 0%, transparent 55%),
        linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #DB2777 100%);
    border-radius: var(--radius-lg);
    padding: 96px 64px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 40px 80px -32px rgba(99, 102, 241, 0.35),
        0 20px 40px -20px rgba(168, 85, 247, 0.25);
}

.research-card-content {
    position: relative;
    z-index: 1;
}

.research-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    color: white;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.research-card h2 {
    font-size: clamp(28px, 4vw, 40px);
    color: white;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.research-card p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* --- Get Notified --- */
.download {
    background: var(--bg-primary);
    padding: var(--section-padding) 0;
}

/* --- Footer --- */
.footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .nav-logo {
    color: white;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.6;
}

.footer-partner {
    margin-top: 20px;
}

.idealab-logo {
    height: 64px;
    width: auto;
    opacity: 0.7;
    transition: var(--transition);
}

.idealab-logo:hover {
    opacity: 1;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0;
}

.footer-links a {
    font-size: 14px;
    transition: var(--transition);
}

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

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* --- Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for feature cards */
.features-grid .feature-card:nth-child(2) { transition-delay: 0.1s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.2s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.3s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.4s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 64px;
    }

    body {
        font-size: 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 24px;
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: all;
    }

    .nav-links a {
        font-size: 28px;
        font-weight: 600;
        color: var(--text-primary);
    }

    .nav-cta {
        font-size: 20px !important;
        padding: 12px 32px;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        min-height: auto;
        padding: calc(var(--nav-height) + 40px) 24px 60px;
    }

    .hero-headline {
        gap: 16px;
        margin-bottom: 20px;
    }

    .hero-app-icon {
        width: 68px;
        height: 68px;
        border-radius: 18px;
    }

    .hero-title {
        font-size: clamp(42px, 11vw, 64px);
        letter-spacing: -0.04em;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-stage {
        padding: 22px 22px 20px;
    }

    .feature-text {
        padding: 20px 22px 26px;
    }

    .section-header {
        margin-bottom: 48px;
    }

    .section-subtitle {
        font-size: 17px;
    }

    .step {
        gap: 20px;
    }

    .step-number {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .research-card {
        padding: 48px 28px;
    }

    .research-card h2 {
        font-size: 28px;
    }

    .research-card p {
        font-size: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-brand {
        max-width: none;
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 36px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* --- Page-level styles (Privacy, Terms, Research) --- */
.page-hero {
    padding: calc(var(--nav-height) + 120px) 24px 96px;
    text-align: center;
    background: var(--bg-primary);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.page-hero h1 {
    font-size: clamp(44px, 6.5vw, 72px);
    margin-bottom: 18px;
    letter-spacing: -0.045em;
    line-height: 1.02;
    font-weight: 700;
}

.page-hero p {
    color: var(--text-tertiary);
    font-size: 15px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 500;
    max-width: 560px;
    margin: 0 auto;
}

.page-content {
    padding: 80px 24px 140px;
}

.page-content .container {
    max-width: 720px;
}

.page-content h2 {
    font-size: clamp(26px, 2.6vw, 32px);
    margin: 64px 0 20px;
    letter-spacing: -0.028em;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content h3 {
    font-size: 20px;
    margin: 36px 0 12px;
    letter-spacing: -0.02em;
    font-weight: 600;
    color: var(--text-primary);
}

.page-content p {
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.7;
    font-size: 17px;
    letter-spacing: -0.008em;
}

.page-content ul, .page-content ol {
    color: var(--text-secondary);
    margin-bottom: 18px;
    padding-left: 28px;
    line-height: 1.7;
    font-size: 17px;
    letter-spacing: -0.008em;
}

.page-content li {
    margin-bottom: 10px;
}

.page-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.page-content a:hover {
    color: var(--color-secondary);
    text-decoration-thickness: 2px;
}

.page-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Research Page --- */
.research-hero {
    padding: calc(var(--nav-height) + 120px) 24px 120px;
    text-align: center;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.research-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px 7px 14px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.18);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.005em;
    margin-bottom: 32px;
}

.research-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.research-hero h1 {
    font-size: clamp(48px, 8vw, 88px);
    margin: 0 auto 24px;
    letter-spacing: -0.045em;
    line-height: 1.02;
    font-weight: 700;
    max-width: 880px;
}

.research-hero p {
    color: var(--text-secondary);
    font-size: clamp(18px, 2vw, 22px);
    max-width: 640px;
    margin: 0 auto;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.research-section {
    padding: 104px 24px;
    border-bottom: none;
    background: var(--bg-primary);
}

.research-section--muted {
    background: var(--bg-secondary);
}

.research-section:last-of-type {
    border-bottom: none;
}

.research-section .container {
    max-width: 820px;
}

.research-section h2 {
    font-size: clamp(36px, 4.8vw, 56px);
    margin-bottom: 28px;
    letter-spacing: -0.038em;
    line-height: 1.05;
    font-weight: 700;
}

.research-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.research-section p,
.research-section li {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 17px;
    letter-spacing: -0.008em;
}

.research-section p + p {
    margin-top: 18px;
}

.research-section ul {
    padding-left: 0;
    margin-top: 24px;
    list-style: none;
}

.research-section li {
    position: relative;
    padding: 18px 22px 18px 44px;
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.04);
}

.research-section--muted li {
    background: var(--bg-primary);
}

.research-section li::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 28px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
}

/* --- Research CTA (dark capstone, blends into footer) --- */
.research-cta-section {
    padding: 128px 24px 96px;
    text-align: center;
    background: var(--text-primary);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.research-cta-section::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.20) 0%, rgba(168, 85, 247, 0.07) 40%, transparent 70%);
    pointer-events: none;
}

.research-cta-section .container {
    position: relative;
    max-width: 640px;
}

.research-cta-section h2 {
    font-size: clamp(40px, 5.5vw, 60px);
    margin-bottom: 20px;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: #fff;
    font-weight: 700;
}

.research-cta-section p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 19px;
    margin-bottom: 36px;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.research-cta-section p[style] {
    color: rgba(255, 255, 255, 0.5) !important;
}

.research-cta-section .btn-primary {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.research-cta-section .btn-primary:hover {
    background: #fff;
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.35);
}

/* Eligibility cards */
.eligibility-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
    counter-reset: elig;
}

.eligibility-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 32px 28px 28px;
    text-align: left;
    position: relative;
    counter-increment: elig;
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.eligibility-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.12);
}

.eligibility-item::before {
    content: counter(elig, decimal-leading-zero);
    position: absolute;
    top: 22px;
    right: 28px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.06em;
}

.eligibility-item h4 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.018em;
    color: var(--text-primary);
}

.eligibility-item p {
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 768px) {
    .eligibility-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Methodology Section --- */
.methodology {
    background: var(--bg-primary);
}

.methodology-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.methodology-text h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.methodology-text p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.methodology-principles {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.methodology-principles li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.principle-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--gradient-subtle);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.principle-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: 0;
}

.principle-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .methodology-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* --- Stats Section --- */
.stats {
    background: var(--bg-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.stat-card {
    text-align: center;
    padding: 32px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.stat-number {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

.stats-figures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.stats-figure {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
}

.stats-figure img {
    width: 100%;
    max-width: 480px;
    margin: 0 auto 16px;
    border-radius: var(--radius-sm);
}

.stats-figure figcaption {
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-number {
        font-size: 36px;
    }

    .stats-figures {
        grid-template-columns: 1fr;
    }

    .stats-figure {
        padding: 20px;
    }
}

/* --- FAQ Section --- */
.faq {
    background: var(--bg-primary);
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    letter-spacing: -0.01em;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--color-primary);
}

.faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    position: relative;
    margin-left: 16px;
}

.faq-icon::before,
.faq-icon::after {
    content: '';
    position: absolute;
    background: var(--text-tertiary);
    border-radius: 2px;
    transition: var(--transition);
}

.faq-icon::before {
    width: 14px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.faq-icon::after {
    width: 2px;
    height: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.faq-item.open .faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
                padding 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-answer p {
    padding-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 16px;
}

/* --- IRB Badge (Research page) --- */
.irb-info {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 36px 40px;
    margin-top: 32px;
    border: 1px solid rgba(0,0,0,0.04);
}

.irb-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 32px;
}

.irb-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.irb-field-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
}

.irb-field-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .irb-info-grid {
        grid-template-columns: 1fr;
    }

    .irb-info {
        padding: 20px 24px;
    }
}

/* --- Research Findings --- */
.findings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.finding-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 28px;
}

.finding-card img {
    width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.finding-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0;
}

.finding-card p {
    font-size: 14px;
    margin: 0;
}

@media (max-width: 768px) {
    .findings-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Research Team --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.team-member {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 32px 20px 28px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.team-member::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0.7;
}

.team-member:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.12);
}

.team-role {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 12px;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.team-name {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.018em;
}

.team-affiliation {
    font-size: 13px;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    .team-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Theme Toggle + Dark Mode
   ============================================================ */

/* Smooth swap on the body surface. Cards/buttons keep their own
   hover transitions; theme switch is instant on them — intentional,
   matches Apple's own site behavior and avoids breaking hovers. */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Toggle button --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-secondary);
    transition: color 0.3s ease, background 0.3s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.theme-icon {
    position: absolute;
    width: 18px;
    height: 18px;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Light mode: show moon (click → go dark) */
.theme-icon--moon { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-icon--sun  { opacity: 0; transform: rotate(-45deg) scale(0.6); }

/* Dark mode: show sun */
[data-theme="dark"] .theme-icon--moon { opacity: 0; transform: rotate(45deg) scale(0.6); }
[data-theme="dark"] .theme-icon--sun  { opacity: 1; transform: rotate(0deg) scale(1); }

/* --- Dark palette --- */
[data-theme="dark"] {
    --text-primary:   #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary:  #8e8e93;
    --bg-primary:     #000000;
    --bg-secondary:   #0a0a0a;
    --bg-elevated:    #1c1c1e;
    --border:         rgba(255, 255, 255, 0.1);

    /* Accent colors: slightly brighter in dark for contrast */
    --color-primary:   #818cf8;
    --color-secondary: #c084fc;
    --color-accent:    #f472b6;
    --gradient: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(129,140,248,0.12) 0%, rgba(192,132,252,0.12) 50%, rgba(244,114,182,0.12) 100%);
}

/* Nav glass flips */
[data-theme="dark"] .nav.scrolled {
    background: rgba(0, 0, 0, 0.72);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Mobile nav drawer */
[data-theme="dark"] .nav-links {
    background: rgba(0, 0, 0, 0.98);
}

.nav-toggle span {
    background: var(--text-primary);
}

/* Buttons: invert the dark-pill/light-pill relationship */
[data-theme="dark"] .btn-primary {
    background: #f5f5f7;
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .btn-primary:hover {
    background: #ffffff;
    color: #000;
    box-shadow: 0 10px 28px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .nav-cta {
    background: #f5f5f7;
    color: #000 !important;
}

[data-theme="dark"] .nav-cta:hover {
    background: #ffffff;
    opacity: 1;
}

[data-theme="dark"] .btn-secondary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(129, 140, 248, 0.1);
}

/* Cards lose their pale-on-white shadow, gain a thin border instead */
[data-theme="dark"] .feature-card,
[data-theme="dark"] .eligibility-item,
[data-theme="dark"] .team-member {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

[data-theme="dark"] .feature-shot {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .feature-card:hover,
[data-theme="dark"] .eligibility-item:hover,
[data-theme="dark"] .team-member:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7);
}

/* List cards (research) */
[data-theme="dark"] .research-section li {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .research-section--muted li {
    background: #000;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Research chip */
[data-theme="dark"] .research-chip {
    background: rgba(129, 140, 248, 0.14);
    border-color: rgba(129, 140, 248, 0.32);
}

/* IRB panel */
[data-theme="dark"] .irb-info {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.06);
}

/* Dark bands that stay dark in both modes */
[data-theme="dark"] .footer {
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .research-cta-section {
    background: #0a0a0a;
}

[data-theme="dark"] .research-cta-section::before {
    background: radial-gradient(circle, rgba(129, 140, 248, 0.28) 0%, rgba(192, 132, 252, 0.1) 40%, transparent 70%);
}

[data-theme="dark"] .research-cta-section .btn-primary {
    background: #ffffff;
    color: #000;
}

[data-theme="dark"] .research-cta-section .btn-primary:hover {
    background: #ffffff;
    color: #000;
    box-shadow: 0 16px 40px rgba(129, 140, 248, 0.4);
}

/* Legal page hero divider */
[data-theme="dark"] .page-hero {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Hero app icon — swap the outer ring to white-low-alpha */
[data-theme="dark"] .hero-app-icon {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 12px 30px -10px rgba(0, 0, 0, 0.6),
        0 30px 60px -20px rgba(0, 0, 0, 0.4);
}

/* Mobile menu overlay */
@media (max-width: 768px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
    }
    .theme-icon { width: 20px; height: 20px; }
}

/* ============================================================
   Launch-notification signup
   ============================================================ */
.notify-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 40px 34px;
    background: var(--bg-secondary);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    text-align: center;
}

.notify-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.022em;
    margin-bottom: 10px;
}

.notify-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 440px;
    margin: 0 auto 24px;
}

.notify-form {
    max-width: 440px;
    margin: 0 auto;
}

.notify-row {
    display: flex;
    gap: 10px;
}

.notify-input {
    flex: 1;
    min-width: 0;
    font-family: var(--font);
    font-size: 16px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 14px 20px;
    letter-spacing: -0.005em;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.notify-input::placeholder {
    color: var(--text-tertiary);
}

.notify-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.notify-input:disabled {
    opacity: 0.5;
}

.notify-input--full {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.notify-submit {
    flex-shrink: 0;
    white-space: nowrap;
}

.notify-submit:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

.notify-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    text-align: left;
    cursor: pointer;
}

.notify-check input {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.notify-check-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notify-check-note {
    display: block;
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--text-tertiary);
}

/* Honeypot — pulled off-screen so bots fill it but people never see it */
.notify-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.notify-consent {
    font-size: 12.5px;
    color: var(--text-tertiary);
    line-height: 1.5;
    margin-top: 14px;
}

.notify-consent a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.notify-status {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    margin-top: 12px;
    min-height: 20px;
}

.notify-status.is-success { color: #1a7f37; }
.notify-status.is-error { color: #d1242f; }

@media (max-width: 768px) {
    .notify-card {
        padding: 32px 24px 28px;
    }

    .notify-row {
        flex-direction: column;
    }

    .notify-submit {
        width: 100%;
        max-width: none;
    }
}

/* Dark mode */
[data-theme="dark"] .notify-card {
    background: var(--bg-elevated);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .notify-input {
    background: #000;
    border-color: var(--border);
}

[data-theme="dark"] .notify-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.18);
}

[data-theme="dark"] .notify-status.is-success { color: #3fb950; }
[data-theme="dark"] .notify-status.is-error { color: #f85149; }