/* ====================================
   dilemma.studio - Styles
   Frosted Glass Philosophical Journey
   ==================================== */

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

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

body {
    background-color: #1B1F27;
    color: #C8CDD6;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====================================
   Progress Indicator
   ==================================== */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: rgba(124, 111, 224, 0.4);
    transform: scaleY(0);
    transform-origin: top;
    z-index: 1000;
    will-change: transform;
}

/* ====================================
   Organic Blobs
   ==================================== */
.blobs-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 60% 30% 70% 40%;
    background: radial-gradient(ellipse at center, rgba(124, 111, 224, 0.15) 0%, rgba(27, 31, 39, 0.05) 70%);
    will-change: transform, border-radius;
    filter: blur(2px);
}

.blob-1 {
    width: 500px;
    height: 500px;
    top: 5%;
    left: -5%;
    animation: blobRotate1 30s infinite linear, blobMorph1 20s infinite ease-in-out;
}

.blob-2 {
    width: 350px;
    height: 350px;
    top: 25%;
    right: -3%;
    animation: blobRotate2 35s infinite linear, blobMorph2 25s infinite ease-in-out;
}

.blob-3 {
    width: 600px;
    height: 600px;
    top: 45%;
    left: 15%;
    animation: blobRotate1 40s infinite linear reverse, blobMorph3 22s infinite ease-in-out;
}

.blob-4 {
    width: 250px;
    height: 250px;
    top: 65%;
    right: 20%;
    animation: blobRotate2 28s infinite linear, blobMorph1 18s infinite ease-in-out;
}

.blob-5 {
    width: 400px;
    height: 400px;
    top: 85%;
    left: 30%;
    animation: blobRotate1 33s infinite linear, blobMorph2 27s infinite ease-in-out;
}

/* Color reference: #5B6B8A (Graphite Blue), #F4F1ED (Parchment Breath), #FFFFFF (Crystal Edge) */
.blob.color-shifted {
    background: radial-gradient(ellipse at center, rgba(91, 107, 138, 0.15) 0%, rgba(27, 31, 39, 0.05) 70%); /* #5B6B8A */
    transition: background 2s ease;
}

@keyframes blobRotate1 {
    0% { transform: rotate(0deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.0); }
    100% { transform: rotate(360deg) scale(0.9); }
}

@keyframes blobRotate2 {
    0% { transform: rotate(0deg) scale(1.0); }
    50% { transform: rotate(180deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1.0); }
}

@keyframes blobMorph1 {
    0%, 100% { border-radius: 40% 60% 70% 30% / 60% 30% 70% 40%; }
    25% { border-radius: 70% 30% 50% 50% / 30% 70% 40% 60%; }
    50% { border-radius: 50% 50% 30% 70% / 50% 50% 60% 40%; }
    75% { border-radius: 30% 70% 60% 40% / 70% 40% 30% 60%; }
}

@keyframes blobMorph2 {
    0%, 100% { border-radius: 60% 40% 30% 70% / 40% 60% 70% 30%; }
    33% { border-radius: 40% 60% 60% 40% / 60% 40% 40% 60%; }
    66% { border-radius: 70% 30% 40% 60% / 30% 70% 60% 40%; }
}

@keyframes blobMorph3 {
    0%, 100% { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
    50% { border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%; }
}

/* ====================================
   Refraction Lines
   ==================================== */
.refraction-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.refraction-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    will-change: transform;
}

/* ====================================
   Scenes (Common)
   ==================================== */
.scene {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* ====================================
   Scene 1: The Void
   ==================================== */
.scene-void {
    background: transparent;
    flex-direction: column;
}

.scene-void .scene-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.title-reveal {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 10vw, 9rem);
    color: #E8ECF1;
    letter-spacing: 0.04em;
    display: flex;
    gap: 0.02em;
}

.letter {
    display: inline-block;
    filter: blur(8px);
    opacity: 0;
    transition: filter 2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 1.5s ease;
}

.letter.revealed {
    filter: blur(0px);
    opacity: 1;
}

.chevron-pulse {
    position: absolute;
    bottom: 8vh;
    opacity: 0;
    animation: chevronFade 2.5s infinite ease-in-out;
    animation-delay: 3s;
    cursor: pointer;
}

@keyframes chevronFade {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(6px); }
}

/* ====================================
   Glass Panels
   ==================================== */
.glass-panel {
    position: relative;
    background: rgba(232, 236, 241, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18); /* #FFFFFF at 18% */
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: clamp(2rem, 4vw, 4rem);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
    will-change: transform, opacity;
    overflow: hidden;
}

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

/* Active panel focus ring */
.glass-panel.active-panel {
    border-image: conic-gradient(from var(--border-angle, 0deg), rgba(124, 111, 224, 0.6), rgba(255, 255, 255, 0.18), rgba(124, 111, 224, 0.6)) 1;
    animation: borderTrace 3s linear infinite;
}

@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes borderTrace {
    to { --border-angle: 360deg; }
}

/* Grain overlay */
.panel-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' fill='%23000' fill-opacity='0.4'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ====================================
   Bifurcated Content
   ==================================== */
.bifurcated-content {
    display: flex;
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: flex-start;
}

.column-question {
    flex: 0 0 38%;
    background: #F4F1ED;
    background-color: rgba(244, 241, 237, 0.08);
    padding: clamp(1rem, 2vw, 2rem);
    border-radius: 3px;
}

.column-response {
    flex: 0 0 58%;
}

.display-question {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.3;
    color: #2C3038;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.72;
    color: #4A4F5C;
    margin-bottom: 1.2em;
}

.body-text:last-child {
    margin-bottom: 0;
}

/* ====================================
   Scene 2: First Glass
   ==================================== */
.scene-glass {
    padding: 0 clamp(2rem, 6vw, 8rem);
}

.scene-glass .glass-panel {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

/* ====================================
   Floating Medallions
   ==================================== */
.medallion {
    position: relative;
    z-index: 3;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(232, 236, 241, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -3vh auto;
    opacity: 0;
    transition: opacity 600ms ease, transform 600ms ease;
    will-change: transform;
}

.medallion.visible {
    opacity: 1;
}

.medallion-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9B8FFF;
}

/* ====================================
   Scene 3: The Fork
   ==================================== */
.scene-fork {
    padding: 0 clamp(2rem, 4vw, 6rem);
}

.fork-container {
    position: relative;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 0;
}

.fork-panel {
    flex: 1;
    max-width: 52%;
}

.fork-left {
    transform: translateY(30px) rotate(-1.5deg);
    z-index: 2;
}

.fork-left.visible {
    transform: translateY(0) rotate(-1.5deg);
}

.fork-right {
    transform: translateY(30px) rotate(1.5deg);
    margin-left: -4%;
    z-index: 1;
}

.fork-right.visible {
    transform: translateY(0) rotate(1.5deg);
}

.fork-divider {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 80%;
    background: #7C6FE0;
    z-index: 5;
    opacity: 0;
    transition: opacity 1200ms ease 400ms;
}

.fork-divider.visible {
    opacity: 0.8;
}

.fork-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    color: #2C3038;
    margin-bottom: 1.2rem;
}

.fork-content .body-text {
    font-size: clamp(0.9rem, 1vw, 1rem);
}

/* ====================================
   Scene 4: Depth Stack
   ==================================== */
.scene-depth {
    padding: 0 clamp(2rem, 6vw, 8rem);
    perspective: 1200px;
}

.depth-container {
    position: relative;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    height: 70vh;
    perspective: 1200px;
}

.depth-panel {
    position: absolute;
    width: 100%;
    left: 0;
    transition: opacity 800ms ease-out, transform 800ms ease-out, filter 600ms ease;
}

.depth-back {
    top: 5%;
    filter: blur(6px);
    opacity: 0;
    transform: translateY(30px) translateZ(-200px) scale(0.92);
    z-index: 1;
}

.depth-back.visible {
    opacity: 0.4;
    transform: translateY(0) translateZ(-200px) scale(0.92);
}

.depth-mid {
    top: 12%;
    filter: blur(3px);
    opacity: 0;
    transform: translateY(30px) translateZ(-100px) scale(0.96);
    z-index: 2;
}

.depth-mid.visible {
    opacity: 0.65;
    transform: translateY(0) translateZ(-100px) scale(0.96);
}

.depth-front {
    top: 20%;
    z-index: 3;
}

.depth-front.visible {
    transform: translateY(0) translateZ(0);
}

.depth-text {
    font-size: clamp(1rem, 1.4vw, 1.3rem);
    color: #6B7280;
    text-align: center;
    padding: 2rem;
}

.depth-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

/* ====================================
   Scene 5: The Paradox
   ==================================== */
.scene-paradox {
    padding: 0 clamp(2rem, 6vw, 8rem);
}

.paradox-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    perspective: 1200px;
}

.paradox-card {
    position: relative;
    width: 100%;
    min-height: 420px;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.paradox-card.flipped {
    transform: rotateY(180deg);
}

.paradox-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.paradox-front {
    z-index: 2;
}

.paradox-front .glass-panel,
.paradox-back .glass-panel {
    height: 100%;
    display: flex;
    align-items: center;
}

.paradox-back {
    transform: rotateY(180deg);
}

.paradox-back .glass-panel {
    opacity: 1;
    transform: none;
}

.paradox-front .glass-panel.visible {
    opacity: 1;
    transform: none;
}

/* ====================================
   Scene 6: Dissolution
   ==================================== */
.scene-dissolution {
    padding: 0 clamp(2rem, 6vw, 8rem);
}

.dissolution-panel {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    transition: opacity 800ms ease-out, transform 800ms ease-out, backdrop-filter 2s ease, border-color 2s ease;
}

.dissolution-panel.dissolving {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(232, 236, 241, 0.3);
}

.dissolution-question {
    transition: opacity 2s ease;
}

.dissolution-text {
    transition: opacity 2s ease;
}

.dissolution-panel.dissolving .dissolution-question {
    opacity: 0.7;
}

.dissolution-panel.dissolving .dissolution-text {
    opacity: 0.6;
}

/* ====================================
   Scene 7: Stillness
   ==================================== */
.scene-stillness {
    background: transparent;
}

.stillness-content {
    text-align: center;
}

.closing-thought {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.06em;
    color: #6B7280;
    opacity: 0;
    transition: opacity 2s ease;
}

.closing-thought.visible {
    opacity: 1;
}

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

    .column-question {
        flex: 1 1 auto;
    }

    .column-response {
        flex: 1 1 auto;
    }

    .fork-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .fork-panel {
        max-width: 100%;
    }

    .fork-left,
    .fork-left.visible {
        transform: translateY(0) rotate(0deg);
    }

    .fork-right,
    .fork-right.visible {
        transform: translateY(0) rotate(0deg);
        margin-left: 0;
    }

    .depth-container {
        perspective: none;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .depth-panel {
        position: relative;
        transform: none;
        filter: none;
    }

    .depth-back.visible,
    .depth-mid.visible {
        opacity: 1;
        transform: none;
        filter: none;
    }

    .depth-front.visible {
        transform: none;
    }

    .paradox-card {
        min-height: 550px;
    }

    .medallion {
        width: 64px;
        height: 64px;
    }

    .medallion-text {
        font-size: 0.5rem;
    }
}

@media (max-width: 480px) {
    .title-reveal {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .glass-panel {
        padding: clamp(1.2rem, 3vw, 2rem);
    }

    .paradox-card {
        min-height: 650px;
    }
}
