/* ============================================================
   aiice.quest — Styles
   Aesthetic: Inflated-3D / Dark-Neon / Botanical
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
    --void-indigo: #0d0b2e;
    --deep-midnight: #1a1040;
    --neon-magenta: #ff2d7b;
    --electric-teal: #00ffd5;
    --bio-gold: #ffd700;
    --frost-white: #e8f4f8;
    --lunar-silver: #9ca3af;
    --frozen-glass: #c4e0f0;

    --font-display: 'Syne', sans-serif;
    --font-sub: 'Space Grotesk', sans-serif;
    --font-body: 'Crimson Pro', serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-growth: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--void-indigo);
    color: var(--frost-white);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.78;
    overflow: hidden;
}

/* ---- Snap Container ---- */
.snap-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

/* ---- Section Base ---- */
.section {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8vh 6vw;
}

/* ---- Fade Reveal System ---- */
.fade-group > * {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 800ms var(--ease-reveal),
        transform 800ms var(--ease-reveal);
    transition-delay: calc(var(--i, 0) * 120ms);
}

.fade-group.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Botanical SVG Growth ---- */
.botanical-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.5s var(--ease-growth);
}

.visible .botanical-path,
.section.in-view .botanical-path {
    stroke-dashoffset: 0;
}

/* ---- Scroll Indicator ---- */
.scroll-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    z-index: 100;
    animation: pulse-indicator 2.4s ease-in-out infinite;
}

@keyframes pulse-indicator {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.scroll-indicator-fill {
    transition: stroke-dashoffset 300ms ease;
}

/* ============================================================
   SECTION 1 — THE GERMINATION
   ============================================================ */
.section-germination {
    background: var(--void-indigo);
    flex-direction: column;
    gap: 1.5rem;
}

.botanical-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.botanical-bg-germination .fern-svg {
    position: absolute;
    height: 80%;
    top: 10%;
    opacity: 0.08;
}

.botanical-bg-germination .fern-left {
    left: 5%;
}

.botanical-bg-germination .fern-right {
    right: 5%;
    transform: scaleX(-1);
}

.section-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 90vw;
}

/* Hero Letter — Inflated 3D */
.hero-letter {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(20rem, 50vw, 40rem);
    line-height: 0.85;
    color: transparent;
    background: linear-gradient(135deg, var(--deep-midnight) 0%, var(--neon-magenta) 50%, var(--electric-teal) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(255, 45, 123, 0.3));
    animation: breathe 6s ease-in-out infinite;
    transform: perspective(800px) rotateX(2deg);
    text-shadow:
        0 1px 0 rgba(26, 16, 64, 0.8),
        0 2px 0 rgba(26, 16, 64, 0.7),
        0 3px 0 rgba(26, 16, 64, 0.6),
        0 4px 0 rgba(26, 16, 64, 0.5),
        0 5px 0 rgba(26, 16, 64, 0.4),
        0 6px 0 rgba(26, 16, 64, 0.3),
        0 7px 0 rgba(26, 16, 64, 0.2),
        0 8px 0 rgba(26, 16, 64, 0.1);
    user-select: none;
}

@keyframes breathe {
    0%, 100% {
        transform: perspective(800px) rotateX(2deg) scale(0.97);
        filter: drop-shadow(0 0 30px rgba(255, 45, 123, 0.3));
    }
    50% {
        transform: perspective(800px) rotateX(2deg) scale(1.03);
        filter: drop-shadow(0 0 50px rgba(255, 45, 123, 0.5));
    }
}

.hero-subtitle {
    margin-top: 1rem;
}

.hero-tagline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--frost-white);
    letter-spacing: 0.02em;
}

.mono-text {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--lunar-silver);
    font-feature-settings: 'zero' 1;
}

/* ============================================================
   SECTION 2 — THE ROOT SYSTEM
   ============================================================ */
.section-roots {
    background: var(--void-indigo);
}

.roots-grid {
    display: grid;
    grid-template-columns: 30% 40% 30%;
    gap: 0;
    width: 100%;
    max-width: 1400px;
    align-items: end;
}

.roots-col {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.roots-col-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem;
    padding: 0 2rem;
}

.root-illustration {
    width: 100%;
    max-width: 250px;
    height: auto;
    opacity: 0.2;
}

.root-left-svg {
    transform: scaleX(-1);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1.05;
    color: var(--frost-white);
    background: linear-gradient(135deg, var(--deep-midnight) 0%, var(--neon-magenta) 50%, var(--electric-teal) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 45, 123, 0.4));
    transform: perspective(800px) rotateX(2deg);
}

.section-subtitle {
    font-family: var(--font-sub);
    font-weight: 500;
    font-size: clamp(1rem, 2.2vw, 1.6rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--electric-teal);
}

.section-body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.78;
    color: var(--frost-white);
    max-width: 38em;
}

.section-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--lunar-silver);
    font-feature-settings: 'zero' 1;
    text-align: left;
    line-height: 1.8;
}

/* ============================================================
   SECTION 3 — THE CANOPY
   ============================================================ */
.section-canopy {
    background: var(--void-indigo);
    flex-direction: column;
}

.canopy-top,
.canopy-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 150px;
    pointer-events: none;
    z-index: 0;
}

.canopy-top {
    top: 0;
}

.canopy-bottom {
    bottom: 0;
}

.canopy-svg {
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.canopy-content {
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.canopy-marquee {
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

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

.marquee-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 7vw, 6rem);
    color: transparent;
    background: linear-gradient(135deg, var(--deep-midnight) 0%, var(--neon-magenta) 50%, var(--electric-teal) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    white-space: nowrap;
    filter: drop-shadow(0 0 15px rgba(255, 45, 123, 0.3));
    transform: perspective(800px) rotateX(2deg);
}

.canopy-text-block {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 48rem;
}

/* ============================================================
   SECTION 4 — THE BLOOM
   ============================================================ */
.section-bloom {
    background: var(--void-indigo);
    flex-direction: column;
    gap: 2rem;
}

.bloom-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.bloom-center {
    position: relative;
    width: clamp(280px, 50vw, 500px);
    height: clamp(280px, 50vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bloom-radial {
    position: absolute;
    inset: 0;
}

.bloom-petal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 160px;
    transform-origin: center bottom;
    transform: translate(-50%, -100%) rotate(var(--rotation, 0deg));
    opacity: 0;
    transition: opacity 1.5s var(--ease-reveal), transform 1.5s var(--ease-reveal);
    transition-delay: calc(var(--i, 0) * 200ms);
}

.visible .bloom-petal {
    opacity: 0.6;
}

.bloom-petal svg {
    width: 100%;
    height: 100%;
}

.bloom-core {
    position: relative;
    z-index: 2;
    text-align: center;
}

.bloom-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: transparent;
    background: linear-gradient(135deg, var(--neon-magenta) 0%, var(--bio-gold) 50%, var(--electric-teal) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.4));
    transform: perspective(800px) rotateX(2deg);
    line-height: 1.1;
}

.bloom-subtitle {
    font-family: var(--font-sub);
    font-weight: 500;
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bio-gold);
    margin-top: 0.5rem;
}

.bloom-text {
    text-align: center;
    max-width: 38em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.bloom-body {
    color: var(--frost-white);
}

/* ============================================================
   SECTION 5 — THE FROST
   ============================================================ */
.section-frost {
    background: var(--frozen-glass);
    flex-direction: column;
}

.frost-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.frost-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.frost-panel {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 3rem;
}

.frost-panel-main {
    grid-column: 1 / -1;
    text-align: center;
}

.frost-title {
    background: linear-gradient(135deg, var(--deep-midnight) 0%, var(--neon-magenta) 60%, var(--void-indigo) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 15px rgba(26, 16, 64, 0.3));
}

.frost-subtitle {
    color: var(--deep-midnight);
}

.frost-body {
    color: var(--deep-midnight);
    line-height: 1.78;
}

.frost-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--deep-midnight);
    opacity: 0.8;
    font-feature-settings: 'zero' 1;
    line-height: 1.9;
}

.frost-signature {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-top: 2rem;
}

.frost-domain {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--deep-midnight);
    letter-spacing: 0.02em;
}

.frost-year {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--lunar-silver);
    font-feature-settings: 'zero' 1;
}

/* ---- Ice Crystals ---- */
.ice-crystals {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ice-crystal {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   PARTICLES
   ============================================================ */
.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: float-up var(--duration, 40s) linear infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0.6;
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-10vh) translateX(var(--drift, 20px));
        opacity: 0;
    }
}

/* Frost section particles are darker */
.particles-frost .particle {
    opacity: 0.3;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .roots-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .roots-col-left,
    .roots-col-right {
        display: none;
    }

    .roots-col-center {
        padding: 0 1rem;
    }

    .frost-panels {
        grid-template-columns: 1fr;
    }

    .bloom-center {
        width: 250px;
        height: 250px;
    }

    .bloom-petal {
        width: 60px;
        height: 120px;
    }

    .hero-letter {
        font-size: clamp(12rem, 50vw, 20rem);
    }

    .section {
        padding: 6vh 4vw;
    }

    .frost-panel {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .canopy-marquee {
        padding: 1rem 0;
    }

    .bloom-center {
        width: 200px;
        height: 200px;
    }

    .bloom-petal {
        width: 45px;
        height: 90px;
    }
}
