/* ============================================================
   FONTS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Commissioner:wght@100;200;300;500;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;400i&display=swap');

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', serif;
    background-color: #F4A261;
    color: #E8D5C0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    scroll-snap-type: y proximity;
    transition: background-color 1.2s ease;
    --color-dark-brown: #1A0E08;
    --color-bark: #2A1810;
    --color-patina: #D4A574;
    --color-sienna: #E76F51;
    --color-cream: #E8D5C0;
    --color-amber: #F4A261;
    --color-bright-amber: #FFB347;
}

/* ============================================================
   ACT SECTIONS
   ============================================================ */

.act {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

/* Act I -- The Surface */
.act-i {
    background: radial-gradient(circle at 30% 70%, #F4A261, #2A1810);
    padding: 5vh 8vw;
    justify-content: flex-start;
    align-items: flex-end;
}

.domain-title {
    font-family: 'Commissioner', sans-serif;
    font-size: clamp(3rem, 12vw, 9rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    line-height: 1.05;
    color: #E8D5C0;
    mix-blend-mode: soft-light;
    position: absolute;
    bottom: 15vh;
    left: 8vw;
}

.act-tagline {
    position: absolute;
    top: 10vh;
    right: 8vw;
    max-width: 25vw;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #E8D5C0;
    opacity: 0.8;
}

/* Act II -- The Descent */
.act-ii {
    background: radial-gradient(circle at 35% 65%, #2A1810, #1A0E08);
    padding: 5vh 8vw;
    justify-content: flex-start;
    align-items: center;
}

.act-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8vw;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
}

.leaf-illustration {
    width: 100%;
    max-width: 300px;
    height: auto;
    opacity: 0.3;
    transition: opacity 0.4s ease;
    /* Uses #D4A574 for SVG strokes */
}

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

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 4vh;
    width: 100%;
}

.glass-card {
    backdrop-filter: blur(20px) saturate(1.2);
    background: rgba(244, 162, 97, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(26, 14, 8, 0.3);
    padding: 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.23, 1.0, 0.32, 1.0);
}

.glass-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.card-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(244, 162, 97, 0.7);
    margin-bottom: 1rem;
}

.glass-card p {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.7;
    color: #E8D5C0;
}

.card-1 { animation-delay: 0.1s; }
.card-2 { animation-delay: 0.2s; }
.card-3 { animation-delay: 0.3s; }

/* Act III -- The Protocol */
.act-iii {
    background: radial-gradient(circle at 40% 60%, #1A0E08, #0D0705);
    padding: 5vh 8vw;
    justify-content: center;
    align-items: center;
}

.protocol-band {
    height: 60vh;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8vw;
    width: 100%;
}

.protocol-text {
    max-width: 45ch;
    position: relative;
    left: 20%;
}

.protocol-text p {
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: #E8D5C0;
    text-align: justify;
}

.badge-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 200px;
}

.glass-badge {
    backdrop-filter: blur(20px) saturate(1.2);
    background: rgba(244, 162, 97, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.5rem 2.5rem;
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: #E8D5C0;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.23, 1.0, 0.32, 1.0);
}

.glass-badge.in-view {
    opacity: 1;
    transform: translateY(0);
}

.badge-1 { animation-delay: 0.1s; }
.badge-2 { animation-delay: 0.2s; }
.badge-3 { animation-delay: 0.3s; }
.badge-4 { animation-delay: 0.4s; }

/* Act IV -- The Network */
.act-iv {
    background: radial-gradient(circle at 45% 55%, #0D0705, #1A0E08);
    padding: 5vh 8vw;
    justify-content: space-between;
    align-items: center;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4vw;
}

.left-gutter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.leaf-sequence {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.leaf-icon {
    font-size: 2rem;
    opacity: 0.2;
    transition: opacity 0.4s ease;
}

.leaf-icon:nth-child(1) { animation-delay: 0s; }
.leaf-icon:nth-child(2) { animation-delay: 0.2s; }
.leaf-icon:nth-child(3) { animation-delay: 0.4s; }
.leaf-icon:nth-child(4) { animation-delay: 0.6s; }
.leaf-icon:nth-child(5) { animation-delay: 0.8s; }

.network-panel {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.glass-panel {
    backdrop-filter: blur(20px) saturate(1.2);
    background: rgba(244, 162, 97, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 3rem;
    width: 100%;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.23, 1.0, 0.32, 1.0);
}

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

.concept-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.concept-cell {
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(255, 179, 71, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.concept-cell h4 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: #D4A574;
    margin-bottom: 0.75rem;
}

.concept-cell p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #E8D5C0;
    opacity: 0.9;
}

/* Act V -- The Horizon */
.act-v {
    background: radial-gradient(circle at 50% 50%, #1A0E08, #0D0705);
    padding: 5vh 8vw;
    justify-content: center;
    align-items: center;
}

.horizon-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.horizon-center h2 {
    font-family: 'Commissioner', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: #E8D5C0;
    opacity: 0.8;
}

.rotating-leaf {
    font-size: 3rem;
    animation: spin 30s linear infinite;
}

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

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-bar {
    position: fixed;
    right: 0;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, #F4A261, #E76F51);
    z-index: 1000;
    transition: height 0.1s ease;
    box-shadow: 0 0 12px rgba(255, 179, 71, 0.6);
}

/* ============================================================
   MAGNETIC PARTICLE FIELD (CANVAS)
   ============================================================ */

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

canvas {
    display: block;
    position: absolute;
}

/* Magnetic particle color declaration */
canvas[data-particle-color="#FFB347"] {
    --particle-highlight: #FFB347;
}

/* ============================================================
   RESPONSIVE / SCROLL ANIMATIONS
   ============================================================ */

@media (max-width: 768px) {
    .act-grid {
        grid-template-columns: 1fr;
        gap: 4vh;
    }

    .domain-title {
        font-size: clamp(2rem, 10vw, 5rem);
        left: 4vw;
        bottom: 20vh;
    }

    .act-tagline {
        max-width: 80vw;
        right: 4vw;
        top: 5vh;
    }

    .protocol-band {
        flex-direction: column;
        height: auto;
        gap: 4vh;
    }

    .protocol-text {
        left: 0;
        text-align: left;
    }

    .concept-grid {
        grid-template-columns: 1fr;
    }

    .act-iv {
        grid-template-columns: 1fr;
    }

    .network-panel {
        justify-content: center;
    }
}
