/* oning.stream - Cottagecore x Art-Deco Fusion */
/* Color Palette:
   #faf3e7 - Cream White (lightest bg)
   #f5e6c8 - Parchment Light
   #d4b896 - Warm Sand
   #8d6e63 - Dried Clay (primary stroke)
   #b87333 - Copper (accent)
   #c9a84c - Gold (highlight)
   #3e2723 - Deep Brown (text on light)
   #2c1e12 - Darkest Brown (darkest bg)
*/

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Lora', Georgia, serif;
    color: #3e2723;
    background-color: #faf3e7;
    overflow-x: hidden;
}

#scroll-container {
    width: 100%;
}

/* ============================================
   SECTION BASE
   ============================================ */
.section {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section__inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section__header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.section__title {
    font-family: 'Poiret One', 'Lora', serif;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3e2723;
    text-align: center;
}

.section__title--light {
    color: #f5e6c8;
}

.deco-frame {
    width: 20px;
    flex-shrink: 0;
}

.frame-svg {
    width: 100%;
    height: auto;
}

/* ============================================
   SECTION 1: THRESHOLD
   ============================================ */
.section--threshold {
    background: linear-gradient(180deg, #faf3e7 0%, #f5e6c8 60%, #ede0c8 100%);
}

.section--threshold::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 600px 400px at 20% 30%, rgba(184,115,51,0.04) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 80% 60%, rgba(201,168,76,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.threshold__ornament {
    width: 100%;
    max-width: 400px;
}

.threshold__ornament--top {
    margin-bottom: 1.5rem;
}

.threshold__ornament--bottom {
    margin-top: 1.5rem;
}

.ornament-svg {
    width: 100%;
    height: auto;
    opacity: 0.7;
}

.threshold__title {
    font-family: 'Poiret One', 'Lora', serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #3e2723;
    text-align: center;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.threshold__title.animated {
    opacity: 1;
    transform: translateY(0);
}

.threshold__subtitle {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: #8d6e63;
    letter-spacing: 0.2em;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.3s, transform 1s ease 0.3s;
}

.threshold__subtitle.animated {
    opacity: 1;
    transform: translateY(0);
}

.threshold__botanical {
    margin: 2rem 0;
    width: 120px;
    opacity: 0.6;
}

.botanical-svg {
    width: 100%;
    height: auto;
}

.threshold__scroll-hint {
    width: 24px;
    margin-top: 1rem;
    opacity: 0.5;
}

.threshold__scroll-hint.pulse-active {
    animation: scrollPulse 2.5s ease-in-out infinite;
}

.scroll-arrow {
    width: 100%;
    height: auto;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(6px); }
}

/* ============================================
   SECTION 2: THE STUDY
   ============================================ */
.section--study {
    background: #faf3e7;
}

.section--study::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 80px,
            rgba(212,184,150,0.08) 80px,
            rgba(212,184,150,0.08) 81px
        );
    pointer-events: none;
    z-index: 1;
}

.study__content {
    display: flex;
    align-items: center;
    gap: 3rem;
    width: 100%;
}

.study__text {
    flex: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.study__text.animated {
    opacity: 1;
    transform: translateY(0);
}

.study__paragraph {
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    color: #3e2723;
    margin-bottom: 1.5rem;
}

.study__paragraph--mono {
    font-family: 'Inconsolata', 'Courier New', monospace;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    color: #8d6e63;
    background: rgba(212,184,150,0.15);
    border-left: 2px solid #b87333;
    padding: 1rem 1.5rem;
    border-radius: 0 4px 4px 0;
}

.mono-line {
    display: block;
    line-height: 1.8;
}

.study__illustration {
    flex: 0 0 280px;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.study__illustration.animated {
    opacity: 1;
}

.illustration-svg {
    width: 100%;
    height: auto;
}

.copper-wire {
    width: 100%;
    margin-top: 2rem;
    opacity: 0.4;
}

.wire-svg {
    width: 100%;
    height: 20px;
}

/* ============================================
   SECTION 3: THE ENGINE ROOM
   ============================================ */
.section--engine {
    background: linear-gradient(180deg, #2c1e12 0%, #3e2723 50%, #2c1e12 100%);
}

.section--engine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 300px 300px at 30% 40%, rgba(184,115,51,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 250px 250px at 70% 60%, rgba(201,168,76,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.engine__grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.engine__mechanism {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.engine__mechanism.animated {
    opacity: 1;
    transform: translateY(0);
}

.mechanism-svg {
    width: 140px;
    height: 140px;
}

.mechanism__label {
    font-family: 'Inconsolata', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #d4b896;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.gear-outer {
    animation: gearRotate 20s linear infinite;
    transform-origin: 80px 80px;
}

@keyframes gearRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.filament {
    animation: filamentGlow 3s ease-in-out infinite;
}

@keyframes filamentGlow {
    0%, 100% { opacity: 0.6; stroke: #c9a84c; }
    50% { opacity: 1; stroke: #e0c060; }
}

.engine__stream {
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    border-top: 1px solid rgba(184,115,51,0.3);
    border-bottom: 1px solid rgba(184,115,51,0.3);
    padding: 0.75rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.engine__stream.animated {
    opacity: 1;
    transform: translateY(0);
}

.stream__ticker {
    display: flex;
    gap: 4rem;
    animation: tickerScroll 25s linear infinite;
    white-space: nowrap;
}

.ticker__item {
    font-family: 'Inconsolata', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #d4b896;
    opacity: 0.7;
    flex-shrink: 0;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   SECTION 4: THE HERBARIUM
   ============================================ */
.section--herbarium {
    background: linear-gradient(180deg, #f5e6c8 0%, #faf3e7 40%, #f5e6c8 100%);
}

.section--herbarium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 800px 400px at 50% 50%, rgba(212,184,150,0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.herbarium__specimens {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.specimen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.specimen.animated {
    opacity: 1;
    transform: translateY(0);
}

.specimen__frame {
    background: rgba(250,243,231,0.6);
    padding: 0.5rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.specimen__frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(44,30,18,0.1);
}

.specimen-svg {
    width: 160px;
    height: auto;
}

.specimen__label {
    font-family: 'Inconsolata', 'Courier New', monospace;
    font-size: 0.8rem;
    color: #8d6e63;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.herbarium__quote {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #8d6e63;
    text-align: center;
    max-width: 600px;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.herbarium__quote.animated {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   SECTION 5: THE CONTINUATION
   ============================================ */
.section--continuation {
    background: linear-gradient(180deg, #2c1e12 0%, #1a120a 100%);
}

.continuation__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.continuation__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.continuation__content.animated {
    opacity: 1;
    transform: translateY(0);
}

.continuation__text {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    color: #d4b896;
    text-align: center;
    max-width: 550px;
}

.continuation__spiral {
    width: 200px;
}

.spiral-svg {
    width: 100%;
    height: auto;
}

.spiral-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawSpiral 4s ease-in-out forwards;
    animation-play-state: paused;
}

.section--continuation.in-view .spiral-path {
    animation-play-state: running;
}

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

.continuation__domain {
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.continuation__domain.animated {
    opacity: 1;
    transform: translateY(0);
}

.domain-echo {
    font-family: 'Poiret One', 'Lora', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #f5e6c8;
}

.domain-echo--dim {
    color: #8d6e63;
    opacity: 0.6;
}

.continuation__footer {
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
}

.footer-ornament {
    width: 100%;
    height: auto;
}

/* ============================================
   NAVIGATION DOTS
   ============================================ */
.section-nav {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 100;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #8d6e63;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-dot:hover {
    background: rgba(184,115,51,0.3);
    border-color: #b87333;
}

.nav-dot--active {
    background: #b87333;
    border-color: #b87333;
    transform: scale(1.3);
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */
[data-animate] {
    will-change: opacity, transform;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .study__content {
        flex-direction: column;
    }

    .study__illustration {
        flex: 0 0 auto;
        width: 200px;
    }

    .engine__grid {
        gap: 1.5rem;
    }

    .mechanism-svg {
        width: 100px;
        height: 100px;
    }

    .herbarium__specimens {
        gap: 1.5rem;
    }

    .specimen-svg {
        width: 120px;
    }

    .section-nav {
        right: 0.75rem;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
    }

    .section__inner {
        padding: 1.5rem;
    }

    .continuation__spiral {
        width: 150px;
    }

    .deco-frame {
        display: none;
    }
}

@media (max-width: 480px) {
    .herbarium__specimens {
        flex-direction: column;
        align-items: center;
    }

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

    .threshold__botanical {
        width: 80px;
    }
}