/* recycle.wiki - Immersive Material Descent */

/* ============================================
   BASE & BODY
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: linear-gradient(
        180deg,
        #e8f4f0 0%,
        #6bb8a7 14%,
        #2a6b6e 35%,
        #0d2b3e 57%,
        #061520 78%,
        #0d2b3e 90%,
        #6bb8a7 100%
    );
    background-size: 100% 700vh;
    background-attachment: fixed;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    color: #f0ede8;
    min-height: 700vh;
}

/* ============================================
   GRID UNDERLAY
   ============================================ */

#grid-underlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(240, 237, 232, 0.03) 0.5px, transparent 0.5px),
        linear-gradient(90deg, rgba(240, 237, 232, 0.03) 0.5px, transparent 0.5px);
    background-size: 80px 80px;
}

/* ============================================
   CANDLE GLOW POINTS
   ============================================ */

#candle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

#candle-container.active {
    opacity: 1;
}

.candle-glow {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(240, 200, 98, 0.06) 0%,
        rgba(214, 167, 105, 0.05) 35%,
        transparent 70%
    );
    animation: candle-flicker ease-in-out infinite;
    transform: translate(-50%, -50%);
}

@keyframes candle-flicker {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1.0; }
}

/* ============================================
   BUBBLE CANVAS
   ============================================ */

#bubble-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* ============================================
   ZONE 0 - SURFACE
   ============================================ */

#zone-0 {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

.caustic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.caustic-overlay::before,
.caustic-overlay::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    border-radius: 40%;
}

.caustic-overlay::before {
    background:
        radial-gradient(ellipse 600px 400px at 30% 40%, rgba(107, 184, 167, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 70% 60%, rgba(232, 244, 240, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 300px 200px at 50% 30%, rgba(240, 237, 232, 0.08) 0%, transparent 70%);
    animation: caustic1 12s linear infinite;
}

.caustic-overlay::after {
    background:
        radial-gradient(ellipse 500px 350px at 60% 50%, rgba(107, 184, 167, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 350px 250px at 25% 70%, rgba(232, 244, 240, 0.08) 0%, transparent 70%);
    animation: caustic2 8s linear infinite;
}

@keyframes caustic1 {
    0% { transform: translate(0%, 0%) rotate(0deg); }
    25% { transform: translate(5%, 3%) rotate(2deg); }
    50% { transform: translate(-3%, 5%) rotate(-1deg); }
    75% { transform: translate(2%, -3%) rotate(1deg); }
    100% { transform: translate(0%, 0%) rotate(0deg); }
}

@keyframes caustic2 {
    0% { transform: translate(0%, 0%) rotate(0deg); }
    33% { transform: translate(-4%, 6%) rotate(-2deg); }
    66% { transform: translate(6%, -4%) rotate(3deg); }
    100% { transform: translate(0%, 0%) rotate(0deg); }
}

.zone-0-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-left: 10vw;
    width: 100%;
}

.domain-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: clamp(4rem, 14vw, 10rem);
    letter-spacing: 0.15em;
    color: rgba(240, 237, 232, 0.85);
    text-align: left;
    line-height: 1.1;
}

.domain-title-renewal {
    color: #d6a769;
    text-align: center;
    padding-left: 0;
}

.chevron-pulse {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    animation: chevron-bob 3s ease-in-out infinite;
}

@keyframes chevron-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 1; }
}

/* ============================================
   ZONES 1-4 GENERAL
   ============================================ */

.zone {
    position: relative;
    z-index: 2;
}

#zone-1 {
    padding: 20vh 0;
    min-height: 150vh;
}

#zone-2 {
    padding: 20vh 0;
    min-height: 150vh;
}

#zone-3 {
    padding: 10vh 0;
    min-height: 150vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

#zone-4 {
    position: relative;
    min-height: 150vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ============================================
   CONTENT PANELS
   ============================================ */

.panel {
    position: relative;
    max-width: 520px;
    padding: 2.5rem 3rem;
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    background: rgba(240, 237, 232, 0.06);
    border: 1px solid rgba(240, 237, 232, 0.08);
    border-radius: 12px;
    margin-bottom: 40vh;
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: transform, opacity;
}

.panel-left {
    margin-left: 15vw;
    transform: translateX(-60px);
}

.panel-right {
    margin-left: calc(55vw - 520px);
    transform: translateX(60px);
}

.panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.panel-thermocline {
    border-color: rgba(214, 167, 105, 0.15);
}

.panel h2 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 4vw, 3rem);
    letter-spacing: 0.06em;
    margin-bottom: 1.2rem;
    color: #f0ede8;
}

.panel p {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
    max-width: 38ch;
    margin-bottom: 1rem;
    color: #f0ede8;
}

.panel p:last-child {
    margin-bottom: 0;
}

.caption {
    font-family: 'EB Garamond', 'Georgia', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 1rem) !important;
    color: #8fb8b0 !important;
    opacity: 0.9;
}

.numeric {
    font-family: 'Lora', 'Georgia', serif;
    font-weight: 500;
    color: #d6a769;
}

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
    position: absolute;
    top: 2.5rem;
    left: 3rem;
    right: 3rem;
    bottom: 2.5rem;
    z-index: 2;
    pointer-events: none;
}

.skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: rgba(143, 184, 176, 0.15);
    margin-bottom: 16px;
    animation: skeleton-pulse 2s ease-in-out infinite;
}

.skeleton-line:nth-child(1) { animation-delay: 0s; }
.skeleton-line:nth-child(2) { animation-delay: 0.15s; }
.skeleton-line:nth-child(3) { animation-delay: 0.3s; }
.skeleton-line:nth-child(4) { animation-delay: 0.45s; }
.skeleton-line:nth-child(5) { animation-delay: 0.6s; }
.skeleton-line:nth-child(6) { animation-delay: 0.75s; }
.skeleton-line:nth-child(7) { animation-delay: 0.9s; }
.skeleton-line:nth-child(8) { animation-delay: 1.05s; }

@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.15; }
}

.skeleton.dissolving .skeleton-line {
    animation: skeleton-dissolve 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.skeleton.dissolving .skeleton-line:nth-child(1) { animation-delay: 0s; }
.skeleton.dissolving .skeleton-line:nth-child(2) { animation-delay: 0.08s; }
.skeleton.dissolving .skeleton-line:nth-child(3) { animation-delay: 0.16s; }
.skeleton.dissolving .skeleton-line:nth-child(4) { animation-delay: 0.24s; }
.skeleton.dissolving .skeleton-line:nth-child(5) { animation-delay: 0.32s; }
.skeleton.dissolving .skeleton-line:nth-child(6) { animation-delay: 0.40s; }
.skeleton.dissolving .skeleton-line:nth-child(7) { animation-delay: 0.48s; }
.skeleton.dissolving .skeleton-line:nth-child(8) { animation-delay: 0.56s; }

@keyframes skeleton-dissolve {
    to {
        opacity: 0;
        transform: scaleX(0);
        transform-origin: left;
    }
}

.panel-content {
    opacity: 0;
    transition: opacity 0.6s ease-out;
    position: relative;
    z-index: 1;
}

.panel.revealed .panel-content {
    opacity: 1;
}

.panel.revealed .skeleton {
    display: none;
}

/* ============================================
   DEEP TEXT (Zone 3)
   ============================================ */

.deep-text {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    line-height: 1.6;
    letter-spacing: 0.04em;
    color: rgba(214, 167, 105, 0.7);
    max-width: 30ch;
    text-align: center;
    padding: 4vh 2rem;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.deep-text.visible {
    opacity: 1;
}

.deep-text:nth-child(odd) {
    align-self: flex-start;
    margin-left: 12vw;
    text-align: left;
}

.deep-text:nth-child(even) {
    align-self: flex-end;
    margin-right: 12vw;
    text-align: right;
}

/* ============================================
   ZONE 4 - RENEWAL
   ============================================ */

#renewal-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.renewal-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .panel {
        max-width: 90vw;
        padding: 1.8rem 2rem;
        margin-bottom: 25vh;
    }

    .panel-left {
        margin-left: 5vw;
    }

    .panel-right {
        margin-left: 5vw;
    }

    .zone-0-content {
        padding-left: 5vw;
    }

    .domain-title {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .deep-text:nth-child(odd) {
        margin-left: 5vw;
    }

    .deep-text:nth-child(even) {
        margin-right: 5vw;
    }

    .skeleton {
        left: 2rem;
        right: 2rem;
    }
}

/* Candle Core Highlight */
.numeric {
    color: #f0c862;
    text-shadow: 0 0 20px rgba(240, 200, 98, 0.3);
}
