/* ============================================
   JJUGGL.com - Ethereal Fairycore Design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --midnight-glade: #0b0e1a;
    --twilight-moss: #131b2e;
    --foxfire-blue: #5ea8d4;
    --luna-periwinkle: #9fb8e0;
    --dewdrop-cyan: #a3f0e4;
    --firefly-gold: #f0d98c;
    --mist-white: #e8edf5;
    --fern-silver: #8b97a8;
    --rose-thorn: #d4728c;
}

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

html {
    scroll-behavior: smooth;
    overflow: hidden;
}

body {
    font-family: 'Karla', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--mist-white);
    background-color: var(--midnight-glade);
    overflow: hidden;
}

/* --- Noise Texture Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Scroll Snap Container --- */
#scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

/* --- Clearings (Sections) --- */
.clearing {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.clearing__content {
    position: relative;
    z-index: 10;
    max-width: 560px;
    padding: 2rem;
}

.clearing__content--center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.clearing__content--left {
    margin-right: auto;
    margin-left: 8%;
    text-align: left;
}

.clearing__content--right {
    margin-left: auto;
    margin-right: 8%;
    text-align: left;
}

/* --- Hero Section --- */
.clearing--hero {
    background: radial-gradient(ellipse 60% 50% at 50% 45%, rgba(94, 168, 212, 0.12), transparent 70%),
                linear-gradient(180deg, var(--midnight-glade) 0%, var(--twilight-moss) 100%);
    flex-direction: column;
}

.lottie-backdrop {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 1;
    opacity: 0.5;
    pointer-events: none;
}

.hero-title {
    font-family: 'Nabla', system-ui;
    font-size: clamp(64px, 10vw, 96px);
    letter-spacing: 0.08em;
    position: relative;
    z-index: 10;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: charReveal 0.8s ease forwards;
}

.hero-char:nth-child(1) { animation-delay: 0.1s; }
.hero-char:nth-child(2) { animation-delay: 0.15s; }
.hero-char:nth-child(3) { animation-delay: 0.2s; }
.hero-char:nth-child(4) { animation-delay: 0.25s; }
.hero-char:nth-child(5) { animation-delay: 0.3s; }
.hero-char:nth-child(6) { animation-delay: 0.35s; }

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 300;
    font-style: italic;
    color: var(--luna-periwinkle);
    position: relative;
    z-index: 10;
    letter-spacing: 0.02em;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Silkscreen', cursive;
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 400;
    color: var(--mist-white);
    margin-bottom: 1.2rem;
    text-shadow: 0 0 30px rgba(94, 168, 212, 0.2);
}

.section-heading--large {
    font-family: 'Nabla', system-ui;
    font-size: clamp(36px, 5vw, 64px);
    text-shadow: 0 0 40px rgba(163, 240, 228, 0.15);
}

/* --- Section Body --- */
.section-body {
    font-family: 'Karla', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--fern-silver);
    max-width: 480px;
}

.section-body--light {
    color: var(--luna-periwinkle);
    max-width: 520px;
}

/* --- Intro Section --- */
.clearing--intro {
    background: linear-gradient(180deg, var(--twilight-moss) 0%, var(--midnight-glade) 100%);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 4rem 2rem;
}

/* --- Concept Section --- */
.clearing--concept {
    background: linear-gradient(180deg, var(--midnight-glade) 0%, var(--twilight-moss) 100%);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 4rem 2rem;
}

/* --- Photography Treatment --- */
.clearing__imagery {
    position: relative;
    z-index: 10;
    flex: 0 0 auto;
}

.clearing__imagery--right {
    margin-left: auto;
    margin-right: 6%;
}

.clearing__imagery--left {
    margin-right: auto;
    margin-left: 6%;
}

.photo-frame {
    width: clamp(260px, 30vw, 380px);
    height: clamp(320px, 36vw, 460px);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(94, 168, 212, 0.15);
}

.photo-treatment {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: saturate(0.4) contrast(1.1);
}

.photo-treatment::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(94, 168, 212, 0.15), rgba(240, 217, 140, 0.1));
    mix-blend-mode: color;
}

/* Procedural photo textures using gradients */
#photo-fern {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(94, 168, 212, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(163, 240, 228, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(240, 217, 140, 0.1) 0%, transparent 60%),
        linear-gradient(160deg, #0b1420, #152238, #0d1a2d, #0f1e32);
}

#photo-mushroom {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(240, 217, 140, 0.25) 0%, transparent 45%),
        radial-gradient(ellipse at 35% 70%, rgba(94, 168, 212, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212, 114, 140, 0.1) 0%, transparent 55%),
        linear-gradient(200deg, #0d1525, #131b2e, #0b1420, #162340);
}

/* --- Climax Section --- */
.clearing--climax {
    background: linear-gradient(180deg, var(--twilight-moss) 0%, var(--midnight-glade) 100%);
    position: relative;
}

.climax-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 40% 35%, rgba(163, 240, 228, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 65% 65%, rgba(94, 168, 212, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 80%, rgba(240, 217, 140, 0.08) 0%, transparent 40%),
        linear-gradient(170deg, #0b1420, #131b2e, #0d1a2d);
    filter: saturate(0.4) contrast(1.1);
}

.climax-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(94, 168, 212, 0.15), rgba(240, 217, 140, 0.1));
    mix-blend-mode: color;
}

.climax-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 14, 26, 0.45);
    z-index: 5;
}

/* --- Ending Section --- */
.clearing--end {
    background: var(--midnight-glade);
    flex-direction: column;
    position: relative;
}

.starfield {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.end-orb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--dewdrop-cyan) 0%, rgba(163, 240, 228, 0.3) 40%, transparent 70%);
    margin-bottom: 2rem;
    animation: orbPulse 4s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(163, 240, 228, 0.3);
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}

.end-text {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 300;
    font-style: italic;
    color: var(--fern-silver);
    margin-bottom: 2.5rem;
    max-width: 420px;
    line-height: 1.6;
    position: relative;
    z-index: 10;
}

.return-link {
    font-family: 'Crimson Pro', serif;
    font-size: 18px;
    font-weight: 300;
    font-style: italic;
    color: var(--foxfire-blue);
    text-decoration: none;
    position: relative;
    z-index: 10;
    transition: color 0.4s ease, text-shadow 0.4s ease;
    padding: 0.5rem 1rem;
}

.return-link:hover {
    color: var(--dewdrop-cyan);
    text-shadow: 0 0 16px rgba(163, 240, 228, 0.4);
}

/* --- Star & Crescent Markers --- */
.star-marker,
.crescent-marker {
    margin-bottom: 1.2rem;
    opacity: 0.8;
}

/* --- Section Dividers --- */
.section-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 5;
    pointer-events: none;
}

.section-divider svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Navigation Pill --- */
.nav-pill {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    gap: 0.2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background: rgba(11, 14, 26, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(94, 168, 212, 0.2);
}

.nav-pill__link {
    font-family: 'Silkscreen', cursive;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--fern-silver);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: color 0.3s ease, text-shadow 0.3s ease, background-color 0.3s ease;
}

.nav-pill__link:hover {
    color: var(--dewdrop-cyan);
    text-shadow: 0 0 12px rgba(163, 240, 228, 0.6);
}

.nav-pill__link.active {
    color: var(--dewdrop-cyan);
    background-color: rgba(163, 240, 228, 0.08);
    text-shadow: 0 0 8px rgba(163, 240, 228, 0.3);
}

/* --- Firefly Particles --- */
#fireflies {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
    overflow: hidden;
}

.firefly {
    position: absolute;
    bottom: -20px;
    left: var(--x-start);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle, var(--dewdrop-cyan) 0%, rgba(163, 240, 228, 0.4) 50%, transparent 70%);
    box-shadow: 0 0 8px rgba(163, 240, 228, 0.5), 0 0 20px rgba(163, 240, 228, 0.2);
    mix-blend-mode: screen;
    opacity: 0;
    animation: fireflyFloat var(--duration) var(--delay) infinite ease-in-out;
}

@keyframes fireflyFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    25% {
        transform: translateY(-25vh) translateX(30px);
    }
    50% {
        transform: translateY(-50vh) translateX(-20px);
        opacity: 0.6;
    }
    75% {
        transform: translateY(-75vh) translateX(25px);
        opacity: 0.4;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-105vh) translateX(-15px);
        opacity: 0;
    }
}

/* --- SVG Fairy Trails --- */
#fairy-trails {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.15;
}

.fairy-path {
    fill: none;
    stroke: var(--foxfire-blue);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: trailDraw 8s ease-in-out forwards;
}

.fairy-path:nth-child(2) { animation-delay: 1s; }
.fairy-path:nth-child(3) { animation-delay: 2s; }
.fairy-path:nth-child(4) { animation-delay: 3s; }
.fairy-path:nth-child(5) { animation-delay: 4s; }

@keyframes trailDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Fade-Up Animation --- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .clearing--intro,
    .clearing--concept {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .clearing__content--left,
    .clearing__content--right {
        margin: 0;
        text-align: center;
    }

    .clearing__imagery--left,
    .clearing__imagery--right {
        margin: 0;
    }

    .photo-frame {
        width: clamp(220px, 60vw, 320px);
        height: clamp(260px, 40vh, 380px);
    }

    .hero-title {
        font-size: clamp(48px, 12vw, 72px);
    }

    .nav-pill {
        gap: 0;
        padding: 0.6rem 1rem;
    }

    .nav-pill__link {
        font-size: 10px;
        padding: 0.3rem 0.5rem;
        letter-spacing: 0.1em;
    }
}

@media (max-width: 600px) {
    .clearing--intro,
    .clearing--concept {
        padding: 2rem 1rem;
    }

    .section-heading {
        font-size: clamp(22px, 6vw, 32px);
    }

    .section-body {
        font-size: 15px;
    }

    .lottie-backdrop {
        width: 300px;
        height: 300px;
    }
}

/* --- Scrollbar Styling --- */
#scroll-container::-webkit-scrollbar {
    width: 4px;
}

#scroll-container::-webkit-scrollbar-track {
    background: var(--midnight-glade);
}

#scroll-container::-webkit-scrollbar-thumb {
    background: rgba(94, 168, 212, 0.3);
    border-radius: 2px;
}

#scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(94, 168, 212, 0.5);
}

/* --- Selection Styling --- */
::selection {
    background: rgba(94, 168, 212, 0.3);
    color: var(--mist-white);
}
