/* ============================================
   parallengine.com - Ambient Vaporwave Meditation
   Palette: Deep Void #1a1035, Twilight Mauve #3d2b5a,
   Dusk Rose #6b4c7a, Faded Coral #c4857a,
   Frosted Lavender #d4c5e2, Pale Smoke #e8e0f0,
   Soft Peach #e8a990, Phantom Lilac #8b7aad
   ============================================ */

:root {
    --deep-void: #1a1035;
    --twilight-mauve: #3d2b5a;
    --dusk-rose: #6b4c7a;
    --faded-coral: #c4857a;
    --frosted-lavender: #d4c5e2;
    --pale-smoke: #e8e0f0;
    --soft-peach: #e8a990;
    --phantom-lilac: #8b7aad;

    --hue-shift: 0deg;
    --gradient-x: 30%;
    --gradient-y: 20%;
    --scroll-y: 0;
    --convergence-progress: 0;
}

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

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

body {
    background: var(--deep-void);
    color: var(--pale-smoke);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Plane 0: Background Canvas (Fixed)
   ============================================ */

#plane-0 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

.gradient-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: background 2s ease;
}

.gradient-primary {
    background: radial-gradient(
        ellipse at var(--gradient-x) var(--gradient-y),
        var(--twilight-mauve) 0%,
        var(--deep-void) 50%
    );
    filter: hue-rotate(var(--hue-shift));
}

.gradient-secondary {
    background: radial-gradient(
        ellipse at 70% 80%,
        var(--dusk-rose) 0%,
        transparent 60%
    );
    opacity: 0.6;
    filter: hue-rotate(var(--hue-shift));
}

/* ============================================
   Perspective Container
   ============================================ */

#perspective-container {
    position: relative;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    z-index: 1;
}

/* ============================================
   Plane 1: Content Layer
   ============================================ */

#plane-1 {
    position: relative;
    z-index: 2;
    transform: translateZ(0);
}

/* ============================================
   Plane 2: Floating Artifacts
   ============================================ */

#plane-2 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* ============================================
   Watercolor Washes
   ============================================ */

.watercolor-wash {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 50% 40% 60% 50%;
    mix-blend-mode: screen;
    will-change: transform;
    transition: transform 0.1s linear;
}

.wash-opening {
    width: 60vw;
    height: 40vh;
    top: 5vh;
    right: -10vw;
    background: radial-gradient(
        ellipse at 40% 50%,
        var(--faded-coral) 0%,
        transparent 70%
    );
    opacity: 0.15;
    filter: blur(60px);
}

.wash-midpage {
    width: 35vw;
    height: 35vw;
    top: 35vh;
    left: 5vw;
    background: radial-gradient(
        ellipse at 50% 50%,
        var(--frosted-lavender) 0%,
        transparent 70%
    );
    opacity: 0.2;
    filter: blur(50px);
    border-radius: 50% 45% 55% 40% / 45% 55% 40% 50%;
}

.wash-deep {
    width: 50vw;
    height: 50vh;
    top: 20vh;
    right: 10vw;
    background: radial-gradient(
        ellipse at 50% 50%,
        var(--phantom-lilac) 0%,
        transparent 65%
    );
    opacity: 0.12;
    filter: blur(70px);
    border-radius: 45% 55% 50% 50% / 55% 45% 55% 45%;
}

/* ============================================
   Typographic Artifacts
   ============================================ */

.typo-artifact {
    position: absolute;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(5rem, 15vw, 12rem);
    color: var(--pale-smoke);
    opacity: 0.04;
    white-space: nowrap;
    will-change: transform;
    user-select: none;
    mix-blend-mode: screen;
}

.artifact-1 {
    top: 15vh;
    left: -5vw;
    transform: rotate(-2deg);
}

.artifact-2 {
    top: 55vh;
    right: -8vw;
    transform: rotate(3deg);
}

.artifact-3 {
    top: 30vh;
    left: 10vw;
    transform: rotate(1deg);
    opacity: 0.05;
}

.artifact-4 {
    top: 70vh;
    left: 30vw;
    transform: rotate(-1.5deg);
    opacity: 0.06;
}

/* ============================================
   Circuit Motifs
   ============================================ */

.circuit-motif {
    position: absolute;
    will-change: transform;
    mix-blend-mode: screen;
}

.circuit-grid {
    width: 25vw;
    height: auto;
    top: 25vh;
    right: 8vw;
    opacity: 0.5;
    filter: blur(0.5px);
}

.circuit-tree {
    width: 20vw;
    height: auto;
    top: 10vh;
    left: 15vw;
    opacity: 0.4;
    filter: blur(0.5px);
}

/* ============================================
   Sections (Meditation Panels)
   ============================================ */

.section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    padding: clamp(4rem, 8vw, 10rem);
}

.section-void {
    height: 100vh;
    justify-content: center;
}

.section-meditation {
    min-height: 90vh;
}

.section-depth {
    height: 100vh;
    justify-content: center;
    align-items: center;
}

.section-convergence {
    height: 100vh;
    justify-content: center;
    align-items: center;
}

.section-closing {
    height: 60vh;
    justify-content: center;
    align-items: center;
}

/* ============================================
   Opening Void
   ============================================ */

.site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: -0.02em;
    color: var(--pale-smoke);
    opacity: 0.25;
    text-align: left;
    position: relative;
    left: -5vw;
    top: 5vh;
}

/* ============================================
   Content Blocks
   ============================================ */

.content-block {
    max-width: 42ch;
    position: relative;
}

.content-left {
    margin-right: auto;
}

.content-right {
    margin-left: auto;
    text-align: right;
}

.section-divider {
    width: 300px;
    margin-bottom: 2rem;
    opacity: 0.6;
}

.divider-right {
    margin-left: auto;
}

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

.metadata-label {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--phantom-lilac);
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: -0.02em;
    color: var(--pale-smoke);
    margin-bottom: 2rem;
    line-height: 1.3;
}

.section-title em {
    font-style: italic;
}

.body-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--pale-smoke);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.body-italic {
    font-weight: 300;
    font-style: italic;
}

/* ============================================
   Depth Reveal Section
   ============================================ */

.depth-focal-point {
    text-align: center;
}

.depth-focal-point .metadata-label {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    opacity: 0.4;
}

/* ============================================
   Convergence Section
   ============================================ */

.convergence-point {
    text-align: center;
    position: relative;
}

.convergence-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    color: var(--pale-smoke);
    opacity: 0.8;
}

.convergence-point .metadata-label {
    opacity: 0.5;
}

/* ============================================
   Closing Void
   ============================================ */

.closing-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    color: var(--phantom-lilac);
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* ============================================
   Reveal Animation
   ============================================ */

.reveal-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-element[data-delay="200"] {
    transition-delay: 200ms;
}

.reveal-element[data-delay="300"] {
    transition-delay: 300ms;
}

.reveal-element[data-delay="400"] {
    transition-delay: 400ms;
}

/* Restore specific opacities after reveal */
.body-text.revealed {
    opacity: 0.9;
}

.closing-text.revealed {
    opacity: 0.5;
}

.convergence-title.revealed {
    opacity: 0.8;
}

/* ============================================
   Convergence Collapse Animation
   ============================================ */

.section-convergence .watercolor-wash,
.section-convergence .circuit-motif {
    transition: transform 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* ============================================
   Backdrop Frost Effect on Content Panels
   ============================================ */

.content-block::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: -2rem;
    right: -2rem;
    bottom: -2rem;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 8px;
    z-index: -1;
    opacity: 0.3;
}

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

@media (max-width: 768px) {
    .section {
        padding: clamp(2rem, 6vw, 4rem);
    }

    .content-right {
        text-align: left;
        margin-left: 0;
    }

    .divider-right {
        margin-left: 0;
    }

    .site-title {
        left: 0;
        font-size: clamp(2.2rem, 10vw, 4rem);
    }

    .typo-artifact {
        font-size: clamp(3rem, 12vw, 8rem);
    }

    .circuit-grid,
    .circuit-tree {
        width: 40vw;
    }

    .watercolor-wash.wash-opening {
        width: 80vw;
    }

    .watercolor-wash.wash-midpage {
        width: 50vw;
        height: 50vw;
    }
}
