:root {
    --bg-color: #0c0c0e;
    --card-bg: #161618;
    --accent-gold: #f1c40f;
    --accent-gold-dark: #d4af37;
    --accent-gold-glow: rgba(241, 196, 15, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #88888b;
    --radius: 16px;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-premium: 0 20px 50px rgba(0,0,0,0.1);
}

/* ── Legacy Browser Compatibility ─────────────────────────── */
html {
    background-color: #0c0c0e; /* Prevent white flash on old browsers */
}

/* Prevent iOS zoom on input focus */
input, textarea, select {
    font-size: 16px !important;
}

/* Touch target minimum */
button, a, [role="button"], input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
}

/* Momentum scrolling for legacy iOS */
.scrollable-container,
.overflow-y-scroll,
.overflow-y-auto {
    -webkit-overflow-scrolling: touch;
}

/* Light Mode Overrides for Onboarding */
.onboarding-body {
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #111111;
    --text-secondary: #666666;
    background-color: #ffffff;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@700&family=Outfit:wght@300;600;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
}

.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(241, 196, 15, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(241, 196, 15, 0.03) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
header {
    padding: 1.5rem 5%;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: rgba(12, 12, 14, 0.9);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
}

.logo-container img {
    height: 88px;
    transition: height 0.3s ease;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-gold);
}

/* ============================================
   DeModern Animated Burger Menu
   ============================================ */

/* Burger Button */
.hamburger-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    cursor: pointer;
    margin-left: 1.5rem;
    z-index: 3000;
    border-radius: 50%;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: rgba(241, 196, 15, 0.12);
}

.hamburger-btn span {
    display: block;
    position: absolute;
    width: 26px;
    height: 2px;
    background: #f1c40f;
    border-radius: 2px;
    transition: transform 0.45s cubic-bezier(0.23, 1, 0.32, 1),
                opacity 0.3s ease,
                width 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    transform-origin: center;
}

.hamburger-btn span:nth-child(1) {
    transform: translateY(-8px);
}

.hamburger-btn span:nth-child(2) {
    width: 18px;
    transform: translateX(4px);
}

.hamburger-btn span:nth-child(3) {
    transform: translateY(8px);
}

/* Active state - morphs to X */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(0) rotate(45deg);
    width: 26px;
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
    width: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: translateY(0) rotate(-45deg);
    width: 26px;
}

/* Backdrop */
.dm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.dm-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* Mobile Menu Panel - DeModern style */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(420px, 90vw);
    height: 100vh;
    background: #111;
    z-index: 2000;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-left: 3px solid #f1c40f;
    pointer-events: none;
    transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.mobile-nav-overlay.active {
    right: 0;
    pointer-events: all;
}

/* Gold accent top stripe */
.mobile-nav-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f1c40f;
}

/* Close button inside panel */
.dm-close-btn {
    position: absolute;
    top: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #f1c40f;
    font-size: 1.5rem;
    border-radius: 50%;
    transition: background 0.3s ease, transform 0.3s ease;
    background: rgba(241, 196, 15, 0.1);
}

.dm-close-btn:hover {
    background: rgba(241, 196, 15, 0.2);
    transform: rotate(90deg);
}

/* Nav links container */
.dm-nav-links {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    align-items: stretch;
    -webkit-align-items: stretch;
    flex: 1;
    -webkit-flex: 1;
    padding: 70px 28px 30px;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar but keep scrollable */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.dm-nav-links::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Individual menu links */
.mobile-nav-overlay a.menu-link {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    color: #111;
    background: #f1c40f;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    padding: 0.55rem 1rem;
    margin-bottom: 0.45rem;
    display: block;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    transform: translateX(60px);
    opacity: 0;
    flex-shrink: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s ease,
                background 0.25s ease,
                color 0.25s ease;
}

.mobile-nav-overlay a.menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #111;
    transition: width 0.3s ease;
}

.mobile-nav-overlay a.menu-link:hover {
    background: #e6b800;
    color: #000;
}

.mobile-nav-overlay a.menu-link:hover::after {
    width: 100%;
}

/* Staggered entrance animation */
.mobile-nav-overlay.active a.menu-link {
    transform: translateX(0);
    opacity: 1;
}

.mobile-nav-overlay.active a.menu-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-nav-overlay.active a.menu-link:nth-child(2) { transition-delay: 0.10s; }
.mobile-nav-overlay.active a.menu-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-nav-overlay.active a.menu-link:nth-child(4) { transition-delay: 0.20s; }
.mobile-nav-overlay.active a.menu-link:nth-child(5) { transition-delay: 0.25s; }
.mobile-nav-overlay.active a.menu-link:nth-child(6) { transition-delay: 0.30s; }
.mobile-nav-overlay.active a.menu-link:nth-child(7) { transition-delay: 0.35s; }
.mobile-nav-overlay.active a.menu-link:nth-child(8) { transition-delay: 0.40s; }

/* Divider inside menu */
.dm-divider {
    height: 1px;
    background: rgba(241, 196, 15, 0.2);
    margin: 0.5rem 0;
    flex-shrink: 0;
}

/* Bottom branding in menu */
.dm-menu-footer {
    padding: 1rem 28px;
    border-top: 1px solid rgba(241, 196, 15, 0.15);
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    color: #555;
    letter-spacing: 2px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Results star spin animation */
@keyframes landing-star-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 5%;
    }

    .logo-container {
        margin-bottom: 1rem;
    }

    nav {
        width: 100%;
        justify-content: flex-end;
    }

    nav a:not(.btn-primary) {
        display: none; /* Hide standard links, use hamburger */
    }

    .logo-container img {
        height: 50px;
    }
}

/* Hero Section */
.story-hero-container {
    max-width: 900px;
    margin: 0 auto 3rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 20px rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.2);
}

.story-hero-container img {
    width: 100%;
    display: block;
    mix-blend-mode: normal;
    transition: mix-blend-mode 0.5s ease;
}

.story-hero-container:hover img {
    mix-blend-mode: normal;
}

.hero {
    padding: 8rem 5% 4rem;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.badge {
    display: inline-block;
    background: rgba(241, 196, 15, 0.1);
    color: var(--accent-gold);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    border: 1px solid rgba(241, 196, 15, 0.2);
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 2rem;
    letter-spacing: -2px;
}

.hero-title .highlight {
    color: var(--accent-gold);
    background: linear-gradient(to bottom, var(--accent-gold), #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subheadline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
}

.btn-primary {
    display: inline-block;
    background: var(--accent-gold);
    color: #ffffff;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(241, 196, 15, 0.3);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(241, 196, 15, 0.5);
    background: #ffdb4d;
}

/* Flip-Flap Integration */
.flip-flap-section {
    margin: 4rem 0;
    display: flex;
    justify-content: center;
}

.flip-flap-container {
    display: grid;
    grid-template-columns: repeat(15, 50px);
    gap: 4px;
    perspective: 1000px;
    width: fit-content;
    margin: 0 auto;
}

.flap {
    width: 50px;
    height: 75px;
    background-color: var(--card-bg);
    border-radius: 4px;
    position: relative;
    font-family: var(--font-mono);
    font-size: 3rem;
    color: #f5f5f7;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.flap-unit {
    position: absolute;
    width: 100%;
    height: 50%;
    left: 0;
    overflow: hidden;
    background-color: #1a1a1c;
    backface-visibility: hidden;
}

.flap-unit span {
    position: absolute;
    width: 100%;
    height: var(--flap-height);
    display: flex;
    justify-content: center;
    align-items: center;
    left: 0;
}

.flap-top {
    top: 0;
    border-radius: 8px 8px 0 0;
    z-index: 1;
    border-bottom: 1px solid rgba(0,0,0,0.3);
}

.flap-top span { top: 0; }

.flap-bottom {
    bottom: 0;
    border-radius: 0 0 8px 8px;
    z-index: 0;
}

.flap-bottom span { top: -37.5px; }

.flap-leaf {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    z-index: 10;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom center;
    transform-style: preserve-3d;
}

.flap-leaf-front {
    background-color: #1a1a1c;
    border-radius: 8px 8px 0 0;
    z-index: 2;
    backface-visibility: hidden;
}

.flap-leaf-back {
    background-color: #1a1a1c;
    border-radius: 0 0 8px 8px;
    transform: rotateX(-180deg);
    z-index: 1;
    backface-visibility: hidden;
}

.flap-leaf-front span { top: 0; }
.flap-leaf-back span { top: -37.5px; }

.flipping .flap-leaf {
    transform: rotateX(-180deg);
}

/* Features Grid */
.features {
    padding: 3rem 5%;
    background: linear-gradient(to bottom, transparent, rgba(241, 196, 15, 0.02));
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: rgba(241, 196, 15, 0.2);
}

.feature-tag {
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.feature-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.vault-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: left;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-family: var(--font-mono);
    color: var(--accent-gold);
    font-weight: 700;
}

/* Footer */
footer {
    padding: 2rem 5% 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.onboarding-body footer {
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Redesigned Footer */
.sd-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 5%;
    max-width: 900px;
    margin: 0 auto;
}

.sd-footer-logo {
    height: 36px;
    width: auto;
    opacity: 0.9;
}

.sd-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    max-width: 700px;
}

.sd-footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    white-space: nowrap;
}

.sd-footer-links a:hover {
    color: var(--accent-gold);
}

.sd-footer-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
    align-self: center;
}

.sd-footer-copy {
    font-size: 0.72rem;
    color: #555;
    font-weight: 500;
}

.sd-footer-copy a {
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid rgba(102,102,102,0.3);
    transition: color 0.2s;
}

.sd-footer-copy a:hover {
    color: var(--accent-gold);
}

@media (max-width: 600px) {
    .sd-footer-links {
        gap: 0.4rem 1rem;
    }
    .sd-footer-links a {
        font-size: 0.72rem;
    }
    .sd-footer-logo {
        height: 30px;
    }
}

@media (max-width: 1100px) {
    .flip-flap-container {
        transform: scale(0.8);
        transform-origin: center;
    }
}

@media (max-width: 900px) {
    .flip-flap-container {
        transform: scale(0.6);
        transform-origin: center;
    }
}

@media (max-width: 600px) {
    .hero { padding-top: 2rem; }
    .flip-flap-container {
        transform: scale(0.45);
        transform-origin: center;
    }
}
/* Onboarding Specific Layouts */
.onboarding-body .onboarding-container {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.onboarding-step {
    background: var(--card-bg);
    padding: 3rem 2.5rem;
    border-radius: 32px;
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(0,0,0,0.03);
    display: none;
    animation: fadeIn 0.5s ease;
}

.onboarding-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.onboarding-body .step-header {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #111;
    letter-spacing: -1px;
}

.onboarding-body .step-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

/* Enhanced Mobile-Friendly Inputs */
.onboarding-body input[type="text"],
.onboarding-body input[type="email"],
.onboarding-body input[type="password"] {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    background: #f1f3f5;
    border: 2px solid transparent;
    border-radius: 16px;
    color: #111;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
}

.onboarding-body input:focus {
    outline: none;
    border-color: var(--accent-gold);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(241, 196, 15, 0.1);
}

.onboarding-body label {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    color: #888;
    margin-bottom: 0.75rem;
    margin-left: 0.5rem;
}

/* Premium Gold Buttons */
.onboarding-body .btn-action {
    display: block;
    width: 100%;
    background: var(--accent-gold);
    color: #ffffff;
    padding: 1.4rem;
    border: none;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px rgba(241, 196, 15, 0.3);
}

.onboarding-body .btn-action:hover:not(:disabled),
.onboarding-body .btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(241, 196, 15, 0.4);
    background: #f7d757;
}

.onboarding-body .btn-action:disabled,
.onboarding-body .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #eee;
    color: #999;
}

.onboarding-body .sync-card {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.onboarding-body .sync-title {
    color: #111111;
    font-weight: 800;
    font-size: 1.3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.onboarding-body .sync-prompt {
    color: #666666;
    font-size: 0.9rem;
}

.onboarding-body .input-box {
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.onboarding-body .url-preview input {
    color: #111111;
}

.onboarding-body .sync-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold);
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.onboarding-body .btn-later {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s;
}

.onboarding-body .btn-later:hover {
    color: #111;
}

/* Progress Pills */
.step-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 3rem;
    justify-content: center;
}

.step-pill {
    height: 6px;
    width: 40px;
    background: #eee;
    border-radius: 10px;
    transition: all 0.5s ease;
}

.step-pill.active {
    background: var(--accent-gold);
    width: 80px;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .onboarding-container {
        margin: 2rem auto;
    }
    
    .onboarding-step {
        padding: 2.5rem 1.5rem;
        border-radius: 24px;
    }
    
    .onboarding-body .step-header {
        font-size: 1.8rem;
    }
    
    .onboarding-body input {
        font-size: 1rem;
        padding: 1rem 1.25rem;
    }
}
