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

:root {
    --alabaster: #f5f0eb;
    --blush: #e8c4c4;
    --lavender: #c8b8d4;
    --fossil: #8a8290;
    --basalt: #2d2836;
    --mint: #b8d4c8;
    --smoke: #d9d3cc;
    --scroll-y: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--alabaster);
    color: var(--fossil);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* === SVG Filters (hidden) === */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* === Marble Base Layers === */
.marble-base {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--alabaster);
    z-index: -10;
}

.marble-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#marble-noise);
    opacity: 0.6;
}

.marble-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        110deg,
        rgba(200, 184, 212, 0.06) 0px,
        transparent 2px,
        transparent 80px,
        rgba(200, 184, 212, 0.04) 82px
    );
    z-index: -9;
    pointer-events: none;
}

.radial-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 20%, rgba(200, 184, 212, 0.15), transparent 70%);
    z-index: -8;
    pointer-events: none;
}

/* === Floating Elements === */
.floater {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: multiply;
    will-change: transform;
}

.floater-circle {
    border-radius: 50%;
}

.floater-1 {
    width: 45px;
    height: 45px;
    background: rgba(200, 184, 212, 0.25);
    top: 15%;
    left: 80%;
    animation: drift1 28s ease-in-out infinite alternate;
}

.floater-2 {
    width: 30px;
    height: 30px;
    background: rgba(232, 196, 196, 0.3);
    top: 60%;
    left: 10%;
    animation: drift2 35s ease-in-out infinite alternate;
}

.floater-3 {
    width: 55px;
    height: 55px;
    background: rgba(184, 212, 200, 0.2);
    top: 75%;
    left: 65%;
    animation: drift3 22s ease-in-out infinite alternate;
}

.floater-rect {
    border: 1px solid rgba(200, 184, 212, 0.3);
    background: rgba(232, 196, 196, 0.15);
}

.floater-4 {
    width: 60px;
    height: 80px;
    top: 30%;
    left: 5%;
    animation: drift4 32s ease-in-out infinite alternate;
}

.floater-5 {
    width: 40px;
    height: 55px;
    top: 45%;
    left: 90%;
    animation: drift5 25s ease-in-out infinite alternate;
}

.floater-ring {
    width: 70px;
    height: 70px;
    top: 20%;
    left: 40%;
    animation: ringRotate 60s linear infinite;
    mix-blend-mode: multiply;
    opacity: 0.35;
}

@keyframes drift1 {
    0% { transform: translate(0, 0) translateY(calc(var(--scroll-y) * -0.1px)); }
    100% { transform: translate(-4vw, 3vh) translateY(calc(var(--scroll-y) * -0.1px)); }
}
@keyframes drift2 {
    0% { transform: translate(0, 0) translateY(calc(var(--scroll-y) * -0.2px)); }
    100% { transform: translate(5vw, -4vh) translateY(calc(var(--scroll-y) * -0.2px)); }
}
@keyframes drift3 {
    0% { transform: translate(0, 0) translateY(calc(var(--scroll-y) * -0.15px)); }
    100% { transform: translate(-3vw, -5vh) translateY(calc(var(--scroll-y) * -0.15px)); }
}
@keyframes drift4 {
    0% { transform: translate(0, 0) translateY(calc(var(--scroll-y) * -0.25px)); }
    100% { transform: translate(4vw, 2vh) translateY(calc(var(--scroll-y) * -0.25px)); }
}
@keyframes drift5 {
    0% { transform: translate(0, 0) translateY(calc(var(--scroll-y) * -0.3px)); }
    100% { transform: translate(-5vw, -3vh) translateY(calc(var(--scroll-y) * -0.3px)); }
}
@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === Zone 1: The Threshold === */
.zone-threshold {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.hero-panel {
    position: absolute;
    transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.hero-panel-1 {
    width: 65vw;
    height: 70vh;
    top: 10vh;
    left: 0;
    background: linear-gradient(135deg, rgba(232, 196, 196, 0.2), rgba(245, 240, 235, 0.4));
    clip-path: polygon(2% 0%, 97% 1%, 100% 35%, 98% 97%, 3% 100%, 0% 42%);
    opacity: 0;
    transform: scale(0.97);
    animation: panelIn 0.8s ease 0.3s forwards;
}

.hero-panel-1::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#marble-dense);
    opacity: 0.5;
}

.hero-panel-2 {
    width: 45vw;
    height: 55vh;
    top: calc(10vh + 40px);
    left: calc(0px + 50px);
    background: rgba(200, 184, 212, 0.3);
    clip-path: polygon(0% 2%, 95% 0%, 100% 40%, 97% 98%, 4% 100%, 1% 55%);
    opacity: 0;
    transform: scale(0.97);
    animation: panelIn 0.8s ease 0.3s forwards;
}

@keyframes panelIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-vein-diagonal {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 1px;
    height: 60%;
    background: var(--lavender);
    opacity: 0.4;
    transform: rotate(-25deg);
    transform-origin: top right;
}

.hero-title {
    position: absolute;
    top: 30%;
    left: 8%;
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 9rem);
    color: var(--basalt);
    letter-spacing: -0.02em;
    z-index: 5;
    text-shadow: -1px 0 rgba(200, 184, 212, 0.2), 1px 0 rgba(232, 196, 196, 0.2);
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.hero-letter.visible {
    opacity: 1;
}

.threshold-pulse {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--lavender);
    animation: pulse 3s ease-in-out infinite;
    z-index: 5;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* === Zone 2: The Drift === */
.zone-drift {
    position: relative;
    min-height: 150vh;
    padding: 10vh 0;
    width: 100%;
}

.drift-panel {
    position: relative;
    padding: clamp(2rem, 4vw, 3.5rem);
    max-width: 500px;
    margin-bottom: -40px;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    box-shadow: 0 8px 40px rgba(45, 40, 54, 0.06);
    text-shadow: -1px 0 rgba(200, 184, 212, 0.2), 1px 0 rgba(232, 196, 196, 0.2);
}

.drift-panel.in-view {
    opacity: 1;
    transform: translate(0, 0) !important;
}

.drift-panel.glitch-active {
    text-shadow: -3px 0 rgba(200, 184, 212, 0.6), 3px 0 rgba(232, 196, 196, 0.6);
}

.drift-panel-left {
    margin-left: 5%;
    transform: translateX(-40px);
}

.drift-panel-right {
    margin-left: auto;
    margin-right: 5%;
    transform: translateX(40px);
}

.drift-panel-center {
    margin-left: auto;
    margin-right: auto;
    transform: scale(0.95);
}

.drift-panel-1 {
    background: rgba(232, 196, 196, 0.15);
    backdrop-filter: blur(2px);
}

.drift-panel-2 {
    background: rgba(200, 184, 212, 0.12);
    backdrop-filter: blur(2px);
}

.drift-panel-3 {
    background: rgba(245, 240, 235, 1);
    z-index: 2;
}

.drift-panel-3::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#marble-noise);
    opacity: 0.3;
    pointer-events: none;
}

.drift-panel-4 {
    background: rgba(184, 212, 200, 0.1);
    backdrop-filter: blur(2px);
}

.drift-panel-5 {
    background: rgba(200, 184, 212, 0.12);
    backdrop-filter: blur(2px);
}

.drift-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    color: var(--fossil);
}

.drift-quote {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    line-height: 1.4;
    color: var(--basalt);
    letter-spacing: -0.02em;
}

.drift-vein {
    width: 80px;
    height: 1px;
    background: var(--lavender);
    opacity: 0.5;
    margin: 60px 0;
}

.drift-vein-1 {
    margin-left: 35%;
}

.drift-vein-2 {
    margin-left: 60%;
    width: 50px;
}

/* === Zone 3: The Vein === */
.zone-vein {
    position: relative;
    min-height: 100vh;
}

.vein-spacer {
    height: 10vh;
}

.vein-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.vein-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vein-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.05s linear;
}

.vein-annotation {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--fossil);
    opacity: 0;
    transition: opacity 0.4s ease;
    letter-spacing: 0.05em;
}

.vein-annotation.visible {
    opacity: 0.7;
}

.vein-ann-1 { top: 48%; left: 12%; }
.vein-ann-2 { top: 28%; left: 32%; }
.vein-ann-3 { top: 32%; left: 50%; }
.vein-ann-4 { top: 55%; left: 72%; }
.vein-ann-5 { top: 48%; left: 88%; }

/* === Zone 4: The Dissolution === */
.zone-dissolution {
    position: relative;
    min-height: 100vh;
    padding: 10vh 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ghost-title {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 9rem);
    color: var(--smoke);
    opacity: 0.2;
    position: absolute;
    top: 15%;
    left: 10%;
    backdrop-filter: blur(30px);
    letter-spacing: -0.02em;
    z-index: 0;
}

.ghost-panel {
    position: absolute;
    border: 1px solid rgba(138, 130, 144, 0.15);
    background: transparent;
    z-index: 0;
}

.ghost-panel-1 {
    width: 55vw;
    height: 40vh;
    top: 5%;
    left: 3%;
}

.ghost-panel-2 {
    width: 35vw;
    height: 30vh;
    top: 25%;
    right: 8%;
}

.ghost-panel-3 {
    width: 40vw;
    height: 25vh;
    bottom: 20%;
    left: 15%;
}

.dissolution-core {
    position: relative;
    z-index: 5;
    max-width: 600px;
    padding: 0 2rem;
    text-align: center;
}

.dissolution-core p {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    line-height: 1.5;
    color: var(--basalt);
    letter-spacing: -0.01em;
}

.dissolution-breath {
    height: 20vh;
}

/* === Utility === */
.zone {
    position: relative;
}
