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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #2c2825;
    color: #a0856b;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    filter: url(#grain);
    mix-blend-mode: overlay;
    opacity: 0.12;
}

/* === Typography === */
.label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #a0856b;
}

/* === Spacing === */
.zone {
    padding-left: clamp(3rem, 8vw, 10rem);
    padding-right: clamp(3rem, 8vw, 10rem);
    position: relative;
}

.zone-1 { margin-bottom: 80px; }
.zone-2 { margin-bottom: 130px; }
.zone-3 { margin-bottom: 210px; }
.zone-4 { margin-bottom: 130px; }

/* === Reveal Animation === */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Zone 1: Signal / Noise === */
.zone-1 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.hero-grid-svg {
    width: 100%;
    height: 100%;
    animation: gridPulse 12s ease-in-out infinite;
}

.zone-1-noise {
    position: absolute;
    inset: 0;
    z-index: 2;
    filter: url(#grain);
    background: #8b7355;
    mix-blend-mode: overlay;
    animation: noisePulse 12s ease-in-out infinite;
}

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

.hero-title {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(6rem, 15vw, 14rem);
    letter-spacing: -0.04em;
    line-height: 1;
    color: #d4c4a8;
    text-shadow:
        0 0 2px rgba(200, 121, 65, 0.4),
        1px 1px 0 rgba(44, 40, 37, 0.6),
        -1px 0 3px rgba(139, 115, 85, 0.3);
    filter: url(#grain);
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: #a0856b;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.15; }
}

@keyframes noisePulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.25; }
}

/* === Zone 2: Structure / Entropy === */
.zone-2 {
    min-height: 80vh;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.zone-2-circuit {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.3;
}

.circuit-svg {
    width: 100%;
    height: 100%;
}

.circuit-line {
    animation: dissolve 8s ease-in-out infinite alternate;
}

.circuit-node {
    animation: nodePulse 4s ease-in-out infinite;
}

@keyframes dissolve {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 50; }
}

@keyframes nodePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.zone-2-left {
    width: 15%;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    padding-top: 4rem;
}

.zone-2-left .label {
    display: block;
    margin-bottom: 1.5rem;
    color: #c87941;
}

.zone-2-left p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #a0856b;
    max-width: 100%;
}

.zone-2-right {
    width: 35%;
    margin-left: auto;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.registration-effect {
    position: relative;
    width: 300px;
    height: 300px;
}

.reg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.reg-1 { opacity: 0.3; }
.reg-2 { opacity: 0.3; transform: translate(2px, 1px); }
.reg-3 { opacity: 0.3; transform: translate(-1px, 2px); }

/* === Zone 3: Permanent / Ephemeral === */
.zone-3 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #1a1714;
}

.sun-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(500px, 80vw);
    height: min(500px, 80vw);
}

.veiled-sun {
    width: 100%;
    height: 100%;
    animation: sunRotate 60s linear infinite;
}

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

.veil-blur {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(26, 23, 20, 0.15);
    animation: drift 20s ease-in-out infinite;
    top: 50%;
    left: 50%;
    margin-top: -100px;
    margin-left: -100px;
}

@keyframes drift {
    0% { transform: translate(-80px, -40px); }
    33% { transform: translate(60px, -60px); }
    66% { transform: translate(-30px, 70px); }
    100% { transform: translate(-80px, -40px); }
}

.zone-3-text {
    position: relative;
    z-index: 2;
    max-width: 38rem;
    text-align: center;
}

.zone-3-epigraph {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: #d4c4a8;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.zone-3-text p:last-child {
    color: #a0856b;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.8;
}

/* === Zone 4: Macro / Micro === */
.zone-4 {
    min-height: 90vh;
    position: relative;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.zone-4-label {
    display: block;
    margin-bottom: 2rem;
    color: #c87941;
}

.network-container {
    width: 100%;
    position: relative;
}

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

.network-node {
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

.node-text {
    font-family: 'IBM Plex Mono', monospace;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.network-node.zoomed {
    transform: scale(2.5);
}

.network-node.zoomed .node-text {
    opacity: 1;
}

/* === Zone 5: Beginning / End === */
.zone-5 {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.zone-5-grain {
    position: absolute;
    inset: 0;
    filter: url(#grain);
    background: #8b7355;
    mix-blend-mode: overlay;
    opacity: 0.3;
    z-index: 1;
}

.zone-5-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.closing-title-container {
    position: relative;
}

.closing-title {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 10rem);
    letter-spacing: -0.04em;
    line-height: 1;
    color: #5b8a91;
    /* Clean, sharp — no text-shadow, no filter: contradiction reversed */
}

.closing-line {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: #5b8a91;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
}

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

    .zone-2-left {
        width: 100%;
    }

    .zone-2-right {
        width: 100%;
        margin-left: 0;
        margin-top: 3rem;
    }

    .sun-container {
        width: 60vw;
        height: 60vw;
    }

    .veil-blur {
        width: 120px;
        height: 120px;
        margin-top: -60px;
        margin-left: -60px;
    }
}
