/* CRITICAL: Prevent ALL scrolling issues */
html {
    overflow-x: hidden;
    max-width: 100vw;
    height: 100%;
}
@media (prefers-reduced-motion: no-preference) {
    html, #root { scroll-behavior: smooth; }
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-width: 100vw;
    /* column: [newsletter strip][#root scroller] — the strip's height is --strip-h */
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    transition: background 0.4s, color 0.4s;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Visited links — prevent browser default purple */
a:visited { color: inherit; }

/* iOS input zoom prevention */
input, select, textarea { font-size: 16px; }

/* CSS Variables */
:root,
[data-theme="dark"] {
    --bg:      #060608;
    --bg2:     #0d0d10;
    --bg3:     #131318;
    --text:    #ededf0;
    --text2:   rgba(237,237,240,0.68);
    --text3:   rgba(237,237,240,0.54);
    --border:  rgba(237,237,240,0.07);
    --border2: rgba(237,237,240,0.12);
    --accent1: #E91E8C;
    --accent2: #9B2FAD;
    --accent3: #2D7DD2;
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-mono:    'DM Mono', monospace;
    --font-body:    'DM Sans', sans-serif;
}

[data-theme="light"] {
    --bg:      #f8f8fa;
    --bg2:     #ffffff;
    --bg3:     #f0f0f4;
    --text:    #0c0c10;
    --text2:   rgba(12,12,16,0.65);
    --text3:   rgba(12,12,16,0.58);
    --border:  rgba(12,12,16,0.08);
    --border2: rgba(12,12,16,0.14);
}

/* CRITICAL: Section viewport fitting */
.snap-section {
    min-height: calc(100vh - var(--strip-h, 0px));
    min-height: calc(100dvh - var(--strip-h, 0px));
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Smooth scroll container - NO snap so footer is always reachable */
#root {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Card surface utility */
.card-surface {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.card-surface:hover {
    border-color: var(--border2);
}

.apple-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    opacity: 0.5;
}

/* Animations */
@keyframes float1 {
    0%, 100% { transform: translateY(-50%) rotate(-15deg); }
    50% { transform: translateY(-50%) rotate(-15deg) translateY(-12px); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(-50%) rotate(15deg) scaleX(-1); }
    50% { transform: translateY(-50%) rotate(15deg) scaleX(-1) translateY(-12px); }
}

@keyframes floatH {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes glow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bookFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes wave {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(1); }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); filter: blur(4px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0);   }
}

/* Animation Classes */
.anim-float1 { animation: float1 5s ease-in-out infinite; }
.anim-float2 { animation: float2 5s ease-in-out infinite 0.3s; }
.anim-floatH { animation: floatH 4s ease-in-out infinite; }
.anim-glow   { animation: glow 3s ease-in-out infinite; }
.anim-glow2  { animation: glow 3s ease-in-out infinite 1.5s; }
.anim-pulse  { animation: pulse 2s infinite; }
.book-float  { animation: bookFloat 3s ease-in-out infinite; }

/* Utility Classes */
.card-hover {
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 24px 48px rgba(0,0,0,0.35), 0 0 0 1px var(--border2);
}

.grad-border { position: relative; }
.grad-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(233,30,140,0.5), rgba(155,47,173,0.3), rgba(45,125,210,0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Slider */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 32px;               /* big touch target; the visible track is the 8px pseudo-element */
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}
.slider::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(233,30,140,0.35), rgba(45,125,210,0.35)); }
.slider::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(233,30,140,0.35), rgba(45,125,210,0.35)); }
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    margin-top: -10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E91E8C, #2D7DD2);
    box-shadow: 0 4px 15px rgba(233,30,140,0.4);
    cursor: pointer;
}
.slider::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #E91E8C, #2D7DD2); box-shadow: 0 4px 15px rgba(233,30,140,0.4); cursor: pointer; }

/* Stat Cards */
.stat-card { animation: fadeUp 0.6s ease-out forwards; opacity: 0; }
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Navigation Dots */
.nav-dot { transition: all 0.3s; }
.nav-dot.active {
    background: linear-gradient(135deg, #E91E8C, #2D7DD2);
    transform: scale(1.3);
}

/* Theme Button */
.theme-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.theme-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(233,30,140,0.3);
}

/* Premium reveal system */
.reveal-ready {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    /* opacity only — visibility:hidden used to make un-scrolled sections unreachable by keyboard and screen readers */
}
.reveal-ready:focus-within { opacity: 1; transform: translateY(0); }
.reveal-ready.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}
.reveal-ready:nth-child(1) { transition-delay: 0.05s; }
.reveal-ready:nth-child(2) { transition-delay: 0.13s; }
.reveal-ready:nth-child(3) { transition-delay: 0.21s; }
.reveal-ready:nth-child(4) { transition-delay: 0.29s; }
.reveal-ready:nth-child(5) { transition-delay: 0.37s; }

/* LIFESTYLE LEARNING SECTION ANIMATIONS */
@keyframes scrollLeft {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-33.333%); }
}

@keyframes scrollRight {
    0%   { transform: translateX(-33.333%); }
    100% { transform: translateX(0); }
}

.scroll-left {
    animation: scrollLeft 30s linear infinite;
    will-change: transform;
    display: flex;
    width: max-content;
}

.scroll-right {
    animation: scrollRight 35s linear infinite;
    will-change: transform;
    display: flex;
    width: max-content;
}

/* Pause on hover using pure CSS */
.carousel-container:hover .scroll-left,
.carousel-container:hover .scroll-right {
    animation-play-state: paused;
}

/* Flowing Wave Connector Animation */
@keyframes waveFlow {
    0% {
        transform: translateY(-100%) scaleY(0.8);
        opacity: 0;
    }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% {
        transform: translateY(100%) scaleY(1.2);
        opacity: 0;
    }
}

.wave-particle { animation: waveFlow 2.5s ease-in-out infinite; }
.wave-particle:nth-child(1) { animation-delay: 0s; }
.wave-particle:nth-child(2) { animation-delay: 0.2s; }
.wave-particle:nth-child(3) { animation-delay: 0.4s; }
.wave-particle:nth-child(4) { animation-delay: 0.6s; }
.wave-particle:nth-child(5) { animation-delay: 0.8s; }
.wave-particle:nth-child(6) { animation-delay: 1s; }
.wave-particle:nth-child(7) { animation-delay: 1.2s; }
.wave-particle:nth-child(8) { animation-delay: 1.4s; }

/* Card Hover Effects */
.lifestyle-card {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lifestyle-card:hover {
    transform: scale(1.08) translateY(-3px);
    z-index: 10;
}

/* Glow Effects */
.glow-pink {
    box-shadow: 0 0 20px rgba(233, 30, 140, 0.5),
                0 0 35px rgba(233, 30, 140, 0.3);
}
.glow-blue {
    box-shadow: 0 0 20px rgba(45, 125, 210, 0.5),
                0 0 35px rgba(45, 125, 210, 0.3);
}

/* Gradient Borders */
.gradient-border-pink {
    position: relative;
    background: linear-gradient(135deg, rgba(233,30,140,0.15), rgba(155,47,173,0.1));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.gradient-border-pink::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #E91E8C, #9B2FAD);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.gradient-border-blue {
    position: relative;
    background: linear-gradient(135deg, rgba(155,47,173,0.1), rgba(45,125,210,0.15));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.gradient-border-blue::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #9B2FAD, #2D7DD2);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .apple-glow {
        width: 200px;
        height: 200px;
        filter: blur(60px);
    }
    .scroll-left,
    .scroll-right { animation-duration: 25s; }
    .lifestyle-card:hover { transform: scale(1.05) translateY(-2px); }
}

/* Ensure no element causes overflow */
img {
    max-width: 100%;
    height: auto;
}
svg, video, canvas, iframe {
    max-width: 100%;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html, #root { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal-ready { visibility: visible !important; opacity: 1 !important; transform: none !important; }
    .scroll-left, .scroll-right { animation: none !important; }
}
