/* ==========================================================================
   recycle.wiki — Wabi-Sabi Parallax Lifecycle
   Palette: Translucent Frost
   Fonts: Space Grotesk, Inter, IBM Plex Mono
   ========================================================================== */

/* Custom Properties */
:root {
    --glacier-white: #EDF1F4;
    --frosted-pane: rgba(235, 240, 245, 0.55);
    --graphite-ash: #2C3338;
    --weathered-steel: #788C9B;
    --verdigris: #5B8A72;
    --kiln-blush: #C4A882;
    --ore-shadow: #1A1E22;
    --melt-water: #D4E4EF;
    --grain-opacity: 0.04;
    --scroll-offset: 0;
}

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: var(--graphite-ash);
    background-color: var(--glacier-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Grain Overlay
   ========================================================================== */

#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: var(--grain-opacity);
    mix-blend-mode: multiply;
    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)' opacity='0.5'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    background-attachment: fixed;
}

/* ==========================================================================
   Intro Screen
   ========================================================================== */

#intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--ore-shadow);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color 1500ms ease-in-out, opacity 600ms ease;
}

#intro-screen.transitioned {
    background-color: var(--glacier-white);
}

#intro-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.intro-line {
    width: 0;
    height: 1px;
    background-color: var(--weathered-steel);
    opacity: 0.3;
    transition: width 1000ms cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-line.expanded {
    width: min(80vw, 500px);
}

.intro-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4rem);
    text-transform: lowercase;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--glacier-white);
    opacity: 0;
    transition: opacity 800ms ease-out, color 1500ms ease-in-out;
}

.intro-title.visible {
    opacity: 1;
}

#intro-screen.transitioned .intro-title {
    color: var(--graphite-ash);
}

.intro-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    color: var(--weathered-steel);
    opacity: 0;
    transition: opacity 600ms ease-out;
    letter-spacing: 0.005em;
}

.intro-subtitle.visible {
    opacity: 0.7;
}

.intro-chevron {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 600ms ease-out;
    animation: chevron-breathe 2400ms ease-in-out infinite;
}

.intro-chevron.visible {
    opacity: 1;
}

@keyframes chevron-breathe {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/* ==========================================================================
   Progress Navigation
   ========================================================================== */

#progress-nav {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: opacity 600ms ease;
}

#progress-nav.visible {
    opacity: 1;
}

.progress-track {
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: rgba(120, 140, 155, 0.15);
    border-radius: 1px;
}

.progress-fill {
    width: 100%;
    height: 0%;
    background-color: var(--verdigris);
    border-radius: 1px;
    transition: height 300ms ease;
    opacity: 0.6;
}

.progress-markers {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 280px;
    position: relative;
}

.progress-marker {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.marker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(120, 140, 155, 0.3);
    transition: background-color 300ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-marker.active .marker-dot {
    background-color: var(--verdigris);
    transform: scale(1.4);
}

.marker-ripple {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid var(--verdigris);
    opacity: 0;
    pointer-events: none;
}

.progress-marker.active .marker-ripple {
    animation: marker-ripple-anim 2000ms ease-out infinite;
}

@keyframes marker-ripple-anim {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(4); opacity: 0; }
}

/* ==========================================================================
   Lifecycle Sections
   ========================================================================== */

.lifecycle-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 2rem;
}

/* Background Layer */
.section-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-size: cover;
    background-position: center;
    filter: grayscale(0.7) brightness(1.1) contrast(0.9) blur(1px);
    will-change: transform;
    z-index: 1;
}

/* Section-specific background textures via gradients (simulated macro textures) */
[data-stage="extraction"] .section-bg {
    background: linear-gradient(145deg, #d4ccc4 0%, #b8b0a6 30%, #c8c0b4 60%, #ddd6cc 100%);
}

[data-stage="manufacture"] .section-bg {
    background: linear-gradient(160deg, #c0c8d0 0%, #a8b4c0 35%, #b8c4d0 65%, #d0d8e0 100%);
}

[data-stage="use"] .section-bg {
    background: linear-gradient(135deg, #d8dce0 0%, #c4ccd4 30%, #d0d8dc 60%, #e0e4e8 100%);
}

[data-stage="discard"] .section-bg {
    background: linear-gradient(150deg, #c8c0b8 0%, #b0a898 35%, #beb6aa 65%, #d4ccc2 100%);
}

[data-stage="collection"] .section-bg {
    background: linear-gradient(140deg, #ccd4d8 0%, #b4c0c8 30%, #c4d0d4 60%, #dce0e4 100%);
}

[data-stage="processing"] .section-bg {
    background: linear-gradient(155deg, #bcc4cc 0%, #a4b0bc 35%, #b4c0c8 65%, #d0d8dc 100%);
}

[data-stage="rebirth"] .section-bg {
    background: linear-gradient(145deg, #2a2e34 0%, #1e2228 35%, #24282e 65%, #1A1E22 100%);
    filter: none;
}

.section-bg-dark {
    filter: none !important;
}

/* Kiln Blush warm overlay on certain sections */
[data-stage="extraction"] .section-bg::after,
[data-stage="discard"] .section-bg::after,
[data-stage="processing"] .section-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--kiln-blush);
    mix-blend-mode: color;
    opacity: 0.08;
}

/* Frost Panel */
.frost-panel {
    position: relative;
    z-index: 10;
    background: var(--frosted-pane);
    backdrop-filter: blur(12px) saturate(0.6);
    -webkit-backdrop-filter: blur(12px) saturate(0.6);
    box-shadow: 0 8px 40px rgba(26, 30, 34, 0.08);
    max-width: 720px;
    width: 90%;
    padding: clamp(2.5rem, 5vw, 4rem);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1), transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.frost-panel.in-view {
    opacity: 1;
    transform: translateY(0);
}

.frost-panel-dark {
    background: rgba(26, 30, 34, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Panel Content */
.panel-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stage-number {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--weathered-steel);
}

.stage-number-light {
    color: rgba(120, 140, 155, 0.7);
}

.stage-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-transform: lowercase;
    color: var(--graphite-ash);
}

.stage-title-light {
    color: var(--glacier-white);
}

.stage-text {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 0.5rem;
}

.stage-text p {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.005em;
    max-width: 38ch;
    color: var(--graphite-ash);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.stage-text p.text-visible {
    opacity: 1;
    transform: translateY(0);
}

.stage-text-light p {
    color: rgba(237, 241, 244, 0.85);
}

/* Ripple Zones */
.ripple-zone {
    cursor: default;
    position: relative;
}

/* ==========================================================================
   SVG Curves
   ========================================================================== */

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

.curve-path {
    stroke-dasharray: var(--curve-length, 2000);
    stroke-dashoffset: var(--curve-length, 2000);
    transition: stroke-dashoffset 0.1s linear;
}

/* ==========================================================================
   Rebirth Section Special
   ========================================================================== */

.section-rebirth {
    background-color: var(--ore-shadow);
}

.rebirth-message {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    opacity: 0;
    transition: opacity 1200ms ease;
}

.rebirth-message.visible {
    opacity: 1;
}

.rebirth-message p {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.3rem, 2.8vw, 2rem);
    letter-spacing: -0.01em;
    text-transform: lowercase;
    color: var(--glacier-white);
}

/* ==========================================================================
   Ripple Effect
   ========================================================================== */

#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
}

.ripple-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--verdigris);
    opacity: 0.2;
    animation: ripple-expand 1200ms ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.2;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* ==========================================================================
   Hover States
   ========================================================================== */

.frost-panel:hover {
    box-shadow: 0 8px 40px rgba(26, 30, 34, 0.12);
}

.progress-marker:hover .marker-dot {
    background-color: var(--melt-water);
}

.progress-marker.active:hover .marker-dot {
    background-color: var(--verdigris);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    #progress-nav {
        left: 0.75rem;
    }

    .progress-markers {
        height: 200px;
    }

    .frost-panel {
        width: 95%;
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .lifecycle-section {
        padding: 3rem 1rem;
    }

    .stage-text p {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    #progress-nav {
        display: none;
    }

    .frost-panel {
        width: 100%;
        clip-path: none !important;
        border-radius: 2px;
    }
}
