/* ============================================
   ppzz.ee — Watercolor Split-Screen Experience
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    background: #0E0D0B;
    color: #C9C0AB;
    font-family: 'Libre Baskerville', serif;
    -webkit-font-smoothing: antialiased;
}

/* --- Design Palette Colors --- */
.text-on-wash {
    color: #1A1A1A;
}

.text-on-light {
    color: #2A2520;
}

.deep-accent {
    border-color: #3D2E1E;
}

/* --- SVG Defs (hidden) --- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Noise Texture Overlay --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    transition: opacity 0.5s ease;
}

.noise-overlay.intensified {
    opacity: 0.07;
}

/* --- Gold Split Rule --- */
.split-rule {
    position: fixed;
    top: 0;
    left: 45%;
    width: 2px;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        #D4A843 0%,
        #F0D48A 25%,
        #D4A843 50%,
        #F0D48A 75%,
        #D4A843 100%
    );
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}

.split-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #D4A843;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    position: relative;
    left: -3px;
}

.split-dot.active {
    animation: dot-pulse 3s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1.0; }
}

/* --- Folio Index Toggle --- */
.folio-index-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
    background: transparent;
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.folio-index-toggle:hover {
    border-color: #D4A843;
    background-color: rgba(212, 168, 67, 0.08);
}

/* --- Folio Index Overlay --- */
.folio-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 13, 11, 0.92);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.folio-overlay.open {
    opacity: 1;
    visibility: visible;
}

.folio-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.folio-overlay-item {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #D4A843;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.folio-overlay-item:hover {
    opacity: 1;
    transform: translateX(12px);
}

/* --- Falling Leaves --- */
.falling-leaves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 90;
}

.falling-leaf {
    position: absolute;
    animation-fill-mode: forwards;
}

.leaf-1 {
    width: 32px;
    top: -50px;
    left: 15%;
    animation: leaf-fall-1 10s ease-in-out forwards;
}

.leaf-2 {
    width: 24px;
    top: -40px;
    left: 55%;
    animation: leaf-fall-2 12s ease-in-out 0.5s forwards;
}

.leaf-3 {
    width: 28px;
    top: -45px;
    left: 35%;
    animation: leaf-fall-3 9s ease-in-out 1.2s forwards;
}

.leaf-4 {
    width: 20px;
    top: -35px;
    left: 72%;
    animation: leaf-fall-4 11s ease-in-out 0.8s forwards;
}

@keyframes leaf-fall-1 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0.6; }
    25% { transform: translate(30px, 25vh) rotate(45deg); }
    50% { transform: translate(-20px, 50vh) rotate(90deg); }
    75% { transform: translate(15px, 75vh) rotate(135deg); }
    100% { transform: translate(-10px, 110vh) rotate(180deg); opacity: 0; }
}

@keyframes leaf-fall-2 {
    0% { transform: translate(0, 0) rotate(20deg); opacity: 0.5; }
    25% { transform: translate(-25px, 25vh) rotate(70deg); }
    50% { transform: translate(20px, 50vh) rotate(120deg); }
    75% { transform: translate(-15px, 75vh) rotate(170deg); }
    100% { transform: translate(10px, 110vh) rotate(220deg); opacity: 0; }
}

@keyframes leaf-fall-3 {
    0% { transform: translate(0, 0) rotate(-15deg); opacity: 0.45; }
    30% { transform: translate(20px, 30vh) rotate(40deg); }
    60% { transform: translate(-25px, 60vh) rotate(95deg); }
    100% { transform: translate(5px, 110vh) rotate(160deg); opacity: 0; }
}

@keyframes leaf-fall-4 {
    0% { transform: translate(0, 0) rotate(10deg); opacity: 0.4; }
    35% { transform: translate(-18px, 35vh) rotate(55deg); }
    70% { transform: translate(22px, 70vh) rotate(110deg); }
    100% { transform: translate(-8px, 110vh) rotate(175deg); opacity: 0; }
}

/* --- Cursor Follow Elements --- */
.cursor-glow {
    position: fixed;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 212, 138, 0.15) 0%, transparent 70%);
    mix-blend-mode: soft-light;
    pointer-events: none;
    z-index: 80;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cursor-glow.visible {
    opacity: 1;
}

.cursor-dots {
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 80;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cursor-dots.visible {
    opacity: 1;
}

.orbit-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #D4A843;
}

.dot-1 { transform: translate(20px, 0); }
.dot-2 { transform: translate(0, -25px); }
.dot-3 { transform: translate(-30px, 5px); }
.dot-4 { transform: translate(10px, 35px); }

/* --- Folio Base Layout --- */
.folio {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.folio-wet {
    width: 45%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background: #E8DFD0;
}

.folio-dry {
    width: 55%;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

/* --- Watercolor Layers --- */
.watercolor-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Folio 1 base */
.wc-base-1 {
    background: #E8DFD0;
}

.leaf-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 260px;
}

/* Folio 2 watercolors */
.wc-base-2 {
    background: #E8DFD0;
}

.wc-sap-green {
    background: radial-gradient(
        ellipse 60vw 50vh at 55% 45%,
        rgba(107, 127, 94, 0.2) 0%,
        rgba(107, 127, 94, 0.08) 40%,
        transparent 70%
    );
    mix-blend-mode: multiply;
    transform: scale(0.6);
    transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wc-sap-green.bloomed {
    transform: scale(1.0);
}

/* Folio 3 watercolors */
.wc-base-3 {
    background: #E8DFD0;
}

.wc-sap-green-dim {
    background: radial-gradient(
        ellipse 50vw 45vh at 40% 50%,
        rgba(107, 127, 94, 0.15) 0%,
        rgba(107, 127, 94, 0.05) 50%,
        transparent 70%
    );
    mix-blend-mode: multiply;
}

.wc-burnt-sienna {
    background: radial-gradient(
        ellipse 55vw 50vh at 60% 55%,
        rgba(139, 111, 78, 0.22) 0%,
        rgba(139, 111, 78, 0.08) 45%,
        transparent 70%
    );
    mix-blend-mode: multiply;
    transform: scale(0.6);
    transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wc-burnt-sienna.bloomed {
    transform: scale(1.0);
}

/* Folio 4 watercolors */
.wc-base-4 {
    background: #E8DFD0;
}

.wc-sap-green-layer {
    background: radial-gradient(
        ellipse 45vw 40vh at 35% 40%,
        rgba(107, 127, 94, 0.18) 0%,
        rgba(107, 127, 94, 0.06) 50%,
        transparent 70%
    );
    mix-blend-mode: multiply;
}

.wc-sienna-layer {
    background: radial-gradient(
        ellipse 40vw 35vh at 55% 60%,
        rgba(139, 111, 78, 0.18) 0%,
        rgba(139, 111, 78, 0.06) 50%,
        transparent 70%
    );
    mix-blend-mode: multiply;
}

.wc-slate-teal {
    background: radial-gradient(
        ellipse 50vw 45vh at 50% 50%,
        rgba(74, 102, 112, 0.22) 0%,
        rgba(74, 102, 112, 0.1) 40%,
        transparent 70%
    );
    mix-blend-mode: multiply;
    transform: scale(0.6);
    transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wc-slate-teal.bloomed {
    transform: scale(1.0);
}

/* Scatter leaves in Folio 4 */
.scatter-leaf {
    position: absolute;
    opacity: 0;
    transition: opacity 1s ease;
}

.scatter-leaf.visible {
    opacity: 1;
}

.sl-1 { width: 30px; top: 20%; left: 15%; transform: rotate(25deg); }
.sl-2 { width: 22px; top: 65%; left: 70%; transform: rotate(-40deg); }
.sl-3 { width: 18px; top: 40%; left: 80%; transform: rotate(60deg); }
.sl-4 { width: 26px; top: 75%; left: 25%; transform: rotate(-15deg); }
.sl-5 { width: 20px; top: 30%; left: 55%; transform: rotate(45deg); }

/* Folio 5 watercolors — the bleed */
.wet-5 {
    width: 55%;
}

.folio-5 .folio-dry {
    width: 45%;
}

.wc-base-5 {
    background: #E8DFD0;
}

.wc-full-mix {
    background:
        radial-gradient(ellipse 50vw 40vh at 40% 35%, rgba(107, 127, 94, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 45vw 35vh at 65% 60%, rgba(139, 111, 78, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 40vw 40vh at 55% 45%, rgba(74, 102, 112, 0.18) 0%, transparent 65%);
    mix-blend-mode: multiply;
}

/* Pigment stains on dry side of folio 5 */
.dry-5 {
    background: #0E0D0B;
}

.dry-5::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 30vw 25vh at 10% 30%, rgba(107, 127, 94, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 25vw 20vh at 20% 70%, rgba(139, 111, 78, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Folio 6 — maximum saturation */
.wet-6 {
    width: 60%;
}

.folio-6 .folio-dry {
    width: 40%;
}

.wc-base-6 {
    background: #E8DFD0;
}

.wc-saturated {
    background:
        radial-gradient(ellipse 60vw 50vh at 45% 40%, rgba(107, 127, 94, 0.38) 0%, rgba(107, 127, 94, 0.12) 50%, transparent 70%),
        radial-gradient(ellipse 55vw 45vh at 60% 55%, rgba(139, 111, 78, 0.32) 0%, rgba(139, 111, 78, 0.1) 45%, transparent 65%),
        radial-gradient(ellipse 50vw 50vh at 50% 50%, rgba(74, 102, 112, 0.28) 0%, rgba(74, 102, 112, 0.08) 40%, transparent 60%);
    mix-blend-mode: multiply;
    filter: url(#turbulence);
}

.dry-6 {
    background: #0E0D0B;
}

.dry-6::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 35vw 30vh at 15% 40%, rgba(107, 127, 94, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 30vw 25vh at 25% 65%, rgba(139, 111, 78, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 25vw 20vh at 10% 80%, rgba(74, 102, 112, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

/* --- Folio Dry Backgrounds --- */
.dry-1 {
    background: #0E0D0B;
}

.dry-2 {
    background: #1C1A16;
}

.dry-3 {
    background: #0E0D0B;
    flex-direction: column;
    gap: 16px;
}

.dry-4 {
    background: #1C1A16;
}

/* --- Typography --- */
.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #D4A843;
    background: linear-gradient(90deg, #D4A843 0%, #F0D48A 50%, #D4A843 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.6s ease;
}

.hero-title:hover {
    background-position: 0% 0;
}

.body-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    color: #C9C0AB;
    max-width: 480px;
}

.italic-text {
    font-style: italic;
}

.meta-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8A7D5A;
}

.meta-date {
    opacity: 0.7;
}

.meta-gold {
    color: #D4A843;
    margin-top: 32px;
}

/* Folio 5 accent colors for bleed text */
.accent-green {
    color: #6B7F5E;
}

.accent-sienna {
    color: #8B6F4E;
}

.bleed-text {
    max-width: 400px;
}

/* Folio 6 final word — rendered in watercolor palette */
.final-word {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6B7F5E;
    background: linear-gradient(135deg, #6B7F5E 0%, #8B6F4E 50%, #4A6670 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- Folio Entrance Animations --- */
.folio-dry {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}

.folio-dry.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* --- Gold Shimmer on Hover for Headings --- */
.folio-overlay-item {
    background: linear-gradient(90deg, #D4A843 0%, #F0D48A 50%, #D4A843 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.6s ease, opacity 0.3s ease, transform 0.3s ease;
}

.folio-overlay-item:hover {
    background-position: 0% 0;
}

/* --- Split Boundary (organic edge via clip-path) --- */
.folio-wet {
    clip-path: polygon(0 0, 100% 0%, var(--edge-warp, 98%) 20%, var(--edge-warp2, 100%) 40%, var(--edge-warp3, 97%) 60%, var(--edge-warp4, 100%) 80%, var(--edge-warp5, 99%) 100%, 0 100%);
}

/* --- Mobile Adaptation --- */
@media (max-width: 768px) {
    .folio {
        flex-direction: column;
    }

    .folio-wet,
    .folio-dry,
    .wet-5,
    .wet-6,
    .folio-5 .folio-dry,
    .folio-6 .folio-dry {
        width: 100%;
        min-height: 50vh;
        clip-path: none;
    }

    .folio-wet {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 0;
        opacity: 0.3;
    }

    .folio-dry {
        position: relative;
        z-index: 1;
        min-height: 100vh;
        padding: 40px 24px;
    }

    .split-rule {
        display: none;
    }

    .cursor-glow,
    .cursor-dots {
        display: none;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .body-text {
        max-width: 100%;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .falling-leaf,
    .bloom-element,
    .split-dot.active,
    .final-word {
        animation: none;
    }

    .wc-sap-green,
    .wc-burnt-sienna,
    .wc-slate-teal {
        transform: scale(1);
        transition: none;
    }

    .folio-dry {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-title,
    .folio-overlay-item {
        transition: none;
    }
}
