/* archetype.boo - Jungian Dream Theater */

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

::selection {
    background: #9b8ec4;
    color: #1a1625;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #1a1625;
    color: #e8e4f0;
    font-family: 'Questrial', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    overflow-x: hidden;
}

/* === Spectral Navigation === */
.spectral-nav {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9b8ec4;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s;
}

.nav-dot:hover {
    transform: scale(1.4);
    box-shadow: 0 0 12px rgba(155, 142, 196, 0.5);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

.spectral-nav.open .nav-menu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.nav-item {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: #c8c0d4;
    text-decoration: none;
    text-align: right;
    transition: color 0.3s;
}

.nav-item:hover {
    color: #9b8ec4;
}

/* === Whisper Text === */
.whisper {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: #7a6f8a;
    font-style: normal;
}

/* === Floating Glyphs === */
.floating-glyphs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.glyph {
    position: absolute;
    opacity: 0.06;
    animation: glyphFloat 40s linear infinite;
}

.glyph-1 { top: 15%; left: 8%; animation-delay: 0s; animation-duration: 45s; }
.glyph-2 { top: 40%; left: 85%; animation-delay: -5s; animation-duration: 38s; }
.glyph-3 { top: 65%; left: 12%; animation-delay: -12s; animation-duration: 50s; }
.glyph-4 { top: 25%; left: 70%; animation-delay: -8s; animation-duration: 42s; }
.glyph-5 { top: 80%; left: 55%; animation-delay: -20s; animation-duration: 55s; }
.glyph-6 { top: 10%; left: 45%; animation-delay: -15s; animation-duration: 48s; }
.glyph-7 { top: 55%; left: 90%; animation-delay: -25s; animation-duration: 43s; }
.glyph-8 { top: 90%; left: 30%; animation-delay: -30s; animation-duration: 52s; }

@keyframes glyphFloat {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-30px) rotate(5deg); }
    50% { transform: translateY(10px) rotate(-3deg); }
    75% { transform: translateY(-15px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* === Sections === */
.section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

/* === Section 1: The Veil === */
.section-veil {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1625;
}

.rorschach-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vmin;
    height: 60vmin;
    z-index: 2;
}

.rorschach {
    width: 100%;
    height: 100%;
}

.ink-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    opacity: 0.4;
    transition: stroke-dashoffset 3.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.ink-path.animate {
    stroke-dashoffset: 0;
}

.veil-title {
    position: relative;
    z-index: 10;
    text-align: center;
}

.title-display {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 5.5rem);
    letter-spacing: 0.08em;
    color: #e8e4f0;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.title-display.visible {
    opacity: 1;
}

.title-whisper {
    margin-top: 16px;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.23, 1, 0.32, 1);
    min-height: 28px;
}

.title-whisper.visible {
    opacity: 1;
}

/* === Section 2: Archetypes Gallery === */
.section-archetypes {
    background: #1a1625;
    padding: clamp(4rem, 8vw, 10rem) clamp(2rem, 5vw, 6rem);
    display: flex;
    flex-direction: column;
    gap: clamp(6rem, 12vw, 12rem);
}

.archetype-card {
    display: flex;
    gap: clamp(2rem, 4vw, 5rem);
    align-items: center;
    max-width: 1100px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.archetype-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.archetype-left {
    margin-left: 5%;
    margin-right: auto;
}

.archetype-right {
    margin-right: 5%;
    margin-left: auto;
}

.tarot-frame {
    position: relative;
    width: 280px;
    min-width: 280px;
    height: 392px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(42, 36, 56, 0.5);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s;
}

.tarot-frame:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.frame-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.frame-line {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.archetype-card.in-view .frame-line {
    stroke-dashoffset: 0;
}

.archetype-symbol {
    width: 120px;
    height: 120px;
    z-index: 2;
}

.archetype-symbol svg {
    width: 100%;
    height: 100%;
}

.archetype-name {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: 0.08em;
    margin-top: 20px;
    z-index: 2;
}

.archetype-text {
    flex: 1;
    position: relative;
}

.body-text {
    font-family: 'Questrial', sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: #c8c0d4;
}

.annotation {
    display: inline-block;
    margin-top: 16px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.8s 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.archetype-card.in-view .annotation {
    opacity: 1;
}

/* === Section 3: The Mirror === */
.section-mirror {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1625;
    min-height: 80vh;
}

.mirror-line {
    width: 1px;
    height: 0;
    background: linear-gradient(to bottom, transparent, #9b8ec4, transparent);
    transition: height 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mirror-line.animate {
    height: 200px;
}

.mirror-text {
    margin: 40px 0;
    text-align: center;
    opacity: 0;
    transition: opacity 1.5s 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mirror-text.visible {
    opacity: 1;
}

.mirror-phrase {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.08em;
    color: #e8e4f0;
}

.mirror-reflection {
    width: 1px;
    height: 0;
    background: linear-gradient(to bottom, transparent, #9b8ec4, transparent);
    transition: height 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mirror-reflection.animate {
    height: 200px;
}

/* === Section 4: The Threshold === */
.section-threshold {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1625;
    min-height: 60vh;
    padding: 4rem 2rem;
}

.threshold-phrases {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.threshold-phrase {
    font-family: 'Cormorant Infant', serif;
    font-weight: 300;
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    letter-spacing: 0.08em;
    color: #e8e4f0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s cubic-bezier(0.23, 1, 0.32, 1), transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.threshold-phrase.visible {
    opacity: 1;
    transform: translateY(0);
}

.phrase-3 {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #9b8ec4;
    transition: opacity 3s cubic-bezier(0.23, 1, 0.32, 1), transform 1s cubic-bezier(0.23, 1, 0.32, 1), filter 3s;
}

.phrase-3.dissolve {
    opacity: 0;
    filter: blur(8px);
}

.final-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9b8ec4;
    margin-top: 60px;
    opacity: 0;
    transition: opacity 2s 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.final-dot.visible {
    opacity: 0.5;
}

/* === Ink Diffusion Transitions === */
.ink-divider {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
}

.ink-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(155, 142, 196, 0.15), transparent 70%);
    border-radius: 50%;
    transition: width 2s cubic-bezier(0.23, 1, 0.32, 1), height 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.ink-divider.animate::before {
    width: 300px;
    height: 300px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .spectral-nav {
        right: 16px;
    }

    .archetype-card {
        flex-direction: column;
        text-align: center;
    }

    .archetype-right {
        flex-direction: column-reverse;
    }

    .tarot-frame {
        width: 220px;
        min-width: 220px;
        height: 308px;
    }

    .split-screen {
        grid-template-columns: 1fr;
    }

    .archetype-left,
    .archetype-right {
        margin-left: auto;
        margin-right: auto;
    }
}
