/* =============================================
   simidiot.net - Dream Descent Surrealist Site
   Purple Mystique Palette
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --deep-bg: #1A0A2E;
    --primary-surface: #2D1B4E;
    --content-bg: #3D2B5A;
    --text-pale: #E8DFF5;
    --accent-gold: #C9A96E;
    --accent-cyan: #7BC8F6;
    --highlight: #B24BF3;
    --void: #0D0518;
    --time: 0;
    --scroll: 0;
    --corridor-width: 70;
}

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

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

body {
    background-color: var(--deep-bg);
    color: var(--text-pale);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    line-height: 1.9;
    overflow-x: hidden;
    cursor: default;
}

/* --- Constellation Canvas --- */
#constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

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

.blob {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    mix-blend-mode: screen;
    opacity: 0.35;
    will-change: border-radius, transform;
}

.blob-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -5%;
    background: var(--primary-surface);
    animation: morph1 16s ease-in-out infinite;
}

.blob-2 {
    width: 400px;
    height: 400px;
    top: 30%;
    right: -10%;
    background: var(--content-bg);
    animation: morph2 20s ease-in-out infinite;
    animation-delay: -4s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    bottom: 10%;
    left: 20%;
    background: var(--primary-surface);
    animation: morph3 12s ease-in-out infinite;
    animation-delay: -8s;
}

.blob-4 {
    width: 600px;
    height: 600px;
    top: 50%;
    left: 40%;
    background: var(--content-bg);
    animation: morph4 18s ease-in-out infinite;
    animation-delay: -2s;
    opacity: 0.25;
}

@keyframes morph1 {
    0%   { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: translate(0, 0) rotate(0deg); }
    17%  { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; }
    33%  { border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%; transform: translate(30px, -20px) rotate(5deg); }
    50%  { border-radius: 40% 60% 70% 30% / 50% 50% 30% 70%; }
    67%  { border-radius: 60% 40% 30% 70% / 70% 30% 50% 50%; transform: translate(-20px, 30px) rotate(-3deg); }
    83%  { border-radius: 30% 70% 50% 50% / 30% 70% 40% 60%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: translate(0, 0) rotate(0deg); }
}

@keyframes morph2 {
    0%   { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; transform: translate(0, 0) scale(1); }
    17%  { border-radius: 70% 30% 70% 30% / 30% 70% 30% 70%; }
    33%  { border-radius: 30% 70% 50% 50% / 50% 50% 70% 30%; transform: translate(-40px, 20px) scale(1.05); }
    50%  { border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%; }
    67%  { border-radius: 40% 60% 60% 40% / 70% 30% 50% 50%; transform: translate(20px, -30px) scale(0.95); }
    83%  { border-radius: 70% 30% 30% 70% / 50% 50% 60% 40%; }
    100% { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; transform: translate(0, 0) scale(1); }
}

@keyframes morph3 {
    0%   { border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%; transform: rotate(0deg); }
    25%  { border-radius: 30% 70% 70% 30% / 70% 30% 70% 30%; transform: rotate(3deg); }
    50%  { border-radius: 50% 50% 30% 70% / 30% 70% 50% 50%; transform: rotate(-2deg); }
    75%  { border-radius: 40% 60% 60% 40% / 60% 40% 30% 70%; transform: rotate(4deg); }
    100% { border-radius: 70% 30% 50% 50% / 40% 60% 40% 60%; transform: rotate(0deg); }
}

@keyframes morph4 {
    0%   { border-radius: 40% 60% 70% 30% / 50% 50% 30% 70%; transform: translate(0, 0); }
    20%  { border-radius: 60% 40% 30% 70% / 30% 70% 60% 40%; }
    40%  { border-radius: 30% 70% 50% 50% / 70% 30% 40% 60%; transform: translate(40px, -20px); }
    60%  { border-radius: 70% 30% 40% 60% / 40% 60% 70% 30%; }
    80%  { border-radius: 50% 50% 60% 40% / 60% 40% 30% 70%; transform: translate(-30px, 20px); }
    100% { border-radius: 40% 60% 70% 30% / 50% 50% 30% 70%; transform: translate(0, 0); }
}

/* --- Floating Eyes --- */
#floating-eyes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.floating-eye {
    position: absolute;
    transition: transform 0.3s ease-out;
}

.floating-eye svg {
    display: block;
}

.floating-eye .eye-pupil {
    transition: transform 0.15s ease-out;
}

@keyframes blink {
    0%   { transform: scaleY(1); }
    45%  { transform: scaleY(1); }
    50%  { transform: scaleY(0.1); }
    55%  { transform: scaleY(1); }
    100% { transform: scaleY(1); }
}

/* --- Chamber Navigation --- */
.chamber-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-pale);
    opacity: 0.25;
    cursor: pointer;
    transition: opacity 0.4s, transform 0.4s, box-shadow 0.4s;
}

.nav-dot:hover {
    opacity: 0.7;
    transform: scale(1.5);
}

.nav-dot.active {
    opacity: 1;
    box-shadow: 0 0 8px 2px var(--highlight);
    animation: nav-pulse 2s ease-in-out infinite;
}

@keyframes nav-pulse {
    0%, 100% { box-shadow: 0 0 8px 2px var(--highlight); }
    50%      { box-shadow: 0 0 16px 4px var(--highlight); }
}

/* --- Chambers Base --- */
.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

.chamber-content {
    position: relative;
    width: 100%;
    max-width: 100vw;
}

/* --- Transition Zones --- */
.transition-zone {
    height: 200vh;
    position: relative;
    z-index: 1;
}

/* --- Annotations (Handwritten Notes) --- */
.annotation {
    position: absolute;
    font-family: 'Homemade Apple', cursive;
    font-size: 0.85rem;
    color: var(--accent-gold);
    opacity: 0.6;
    pointer-events: none;
    z-index: 5;
}

.annotation-1 {
    bottom: 15%;
    right: 8%;
    transform: rotate(-2deg);
}

.annotation-2 {
    top: 8%;
    left: 5%;
    transform: rotate(1.5deg);
}

.annotation-3 {
    bottom: 12%;
    right: 10%;
    transform: rotate(-3deg);
}

.annotation-4 {
    top: 10%;
    right: 6%;
    transform: rotate(2deg);
}

/* ===========================================
   CHAMBER 1: THE THRESHOLD
   =========================================== */
.chamber-threshold {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, var(--primary-surface) 0%, var(--deep-bg) 60%, var(--void) 100%);
}

.threshold-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    color: var(--text-pale);
    text-align: center;
    will-change: transform;
    animation: title-breathe 6s ease-in-out infinite;
}

@keyframes title-breathe {
    0%, 100% { transform: skewX(0deg) scaleY(1); }
    25%      { transform: skewX(2deg) scaleY(1.02); }
    50%      { transform: skewX(-1deg) scaleY(0.98); }
    75%      { transform: skewX(1.5deg) scaleY(1.01); }
}

.threshold-subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 3vw, 2rem);
    color: var(--accent-gold);
    margin-top: 1rem;
    text-align: center;
    opacity: 0.8;
}

.scroll-invitation {
    margin-top: 3rem;
    text-align: center;
    animation: invitation-fade 3s ease-in-out infinite;
}

@keyframes invitation-fade {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.8; }
}

.inverted-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--accent-cyan);
    display: inline-block;
    transform: scaleX(-1);
    letter-spacing: 0.15em;
}

.scroll-arrow {
    margin-top: 1rem;
    animation: arrow-bob 2s ease-in-out infinite;
}

@keyframes arrow-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(10px); }
}

/* ===========================================
   CHAMBER 2: THE GALLERY OF SELVES
   =========================================== */
.chamber-gallery {
    min-height: 120vh;
    padding: 10vh 5vw;
    background: transparent;
}

.gallery-content {
    position: relative;
    height: 100vh;
    min-height: 600px;
}

.collage-panel {
    position: absolute;
    transition: transform 0.1s linear;
}

.panel-inner {
    box-shadow: 8px 8px 24px rgba(13, 5, 24, 0.6), -2px -2px 12px rgba(13, 5, 24, 0.3);
    overflow: hidden;
}

.panel-text {
    padding: 1.5rem 2rem;
    background: var(--content-bg);
}

.panel-text p, .panel-text h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--text-pale);
}

.panel-text h2 {
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.panel-text p {
    font-weight: 400;
    font-size: 1.15rem;
    line-height: 1.9;
}

.italic-whisper {
    font-style: italic;
    color: var(--accent-gold);
}

.panel-color {
    background: var(--primary-surface);
}

.panel-color-accent {
    background: var(--highlight);
    opacity: 0.5;
}

.panel-color-deep {
    background: var(--void);
}

.panel-abstract {
    background: var(--content-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.abstract-svg {
    width: 100%;
    height: 100%;
}

.panel-inverted {
    background: var(--text-pale);
    color: var(--void);
}

.panel-inverted p {
    color: var(--void);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.1em;
}

/* Panel positions - irregular, overlapping, rotated */
.panel-1 {
    top: 5%;
    left: 8%;
    width: 280px;
    transform: rotate(-12deg);
    z-index: 3;
}
.panel-2 {
    top: 2%;
    right: 15%;
    width: 180px;
    height: 220px;
    transform: rotate(18deg);
    z-index: 2;
}
.panel-3 {
    top: 25%;
    left: 30%;
    width: 320px;
    transform: rotate(-4deg);
    z-index: 5;
}
.panel-4 {
    top: 15%;
    right: 5%;
    width: 140px;
    height: 160px;
    transform: rotate(25deg);
    z-index: 1;
}
.panel-5 {
    top: 50%;
    left: 5%;
    width: 260px;
    transform: rotate(8deg);
    z-index: 4;
}
.panel-6 {
    top: 40%;
    right: 20%;
    width: 180px;
    height: 180px;
    transform: rotate(-15deg);
    z-index: 3;
}
.panel-7 {
    bottom: 10%;
    left: 25%;
    width: 300px;
    transform: rotate(5deg);
    z-index: 2;
}
.panel-8 {
    bottom: 5%;
    right: 10%;
    width: 200px;
    height: 140px;
    transform: rotate(-22deg);
    z-index: 1;
}
.panel-9 {
    top: 60%;
    left: 55%;
    width: 200px;
    transform: rotate(10deg);
    z-index: 6;
}

/* ===========================================
   CHAMBER 3: THE CORRIDOR
   =========================================== */
.chamber-corridor {
    min-height: 200vh;
    padding: 10vh 0;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.corridor-content {
    display: flex;
    justify-content: center;
    padding-top: 10vh;
}

.corridor-wrapper {
    width: calc(var(--corridor-width) * 1vw);
    max-width: 90vw;
    min-width: 60px;
    transition: width 0.05s linear;
    background: linear-gradient(180deg, var(--content-bg) 0%, var(--primary-surface) 50%, var(--void) 100%);
    padding: 4rem 3rem;
    border-left: 1px solid rgba(232, 223, 245, 0.1);
    border-right: 1px solid rgba(232, 223, 245, 0.1);
    overflow: hidden;
}

.corridor-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    color: var(--text-pale);
    margin-bottom: 2rem;
    text-align: center;
    animation: title-breathe 8s ease-in-out infinite;
}

.corridor-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--text-pale);
    font-size: 1.15rem;
    line-height: 1.9;
    margin-bottom: 2rem;
    text-align: center;
    transition: font-size 0.1s linear;
}

.narrow-whisper {
    font-family: 'Homemade Apple', cursive;
    color: var(--accent-gold);
    font-size: 1.5rem;
    letter-spacing: 0.5em;
}

/* ===========================================
   CHAMBER 4: THE POOL
   =========================================== */
.chamber-pool {
    min-height: 100vh;
    background: radial-gradient(ellipse at center, var(--content-bg) 0%, var(--deep-bg) 50%, var(--void) 100%);
}

.pool-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-center {
    position: absolute;
    z-index: 10;
}

.pool-core-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--highlight);
    letter-spacing: 0.15em;
    text-shadow: 0 0 30px rgba(178, 75, 243, 0.5), 0 0 60px rgba(178, 75, 243, 0.2);
    animation: core-pulse 4s ease-in-out infinite;
}

@keyframes core-pulse {
    0%, 100% { opacity: 0.8; text-shadow: 0 0 30px rgba(178, 75, 243, 0.5); }
    50%      { opacity: 1; text-shadow: 0 0 50px rgba(178, 75, 243, 0.7), 0 0 80px rgba(178, 75, 243, 0.3); }
}

.orbit-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.orbit-ring-1 {
    animation: orbit-spin 30s linear infinite;
}

.orbit-ring-2 {
    animation: orbit-spin 45s linear infinite reverse;
}

.orbit-ring-3 {
    animation: orbit-spin 60s linear infinite;
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-pale);
    opacity: 0.7;
    white-space: nowrap;
    pointer-events: none;
}

.orbit-ring-1 .orbit-item {
    transform: rotate(var(--angle)) translate(140px) rotate(calc(-1 * var(--angle)));
    color: var(--accent-cyan);
    font-size: 1.1rem;
}

.orbit-ring-2 .orbit-item {
    transform: rotate(var(--angle)) translate(240px) rotate(calc(-1 * var(--angle)));
    color: var(--text-pale);
    font-size: 0.95rem;
    opacity: 0.55;
}

.orbit-ring-3 .orbit-item {
    transform: rotate(var(--angle)) translate(340px) rotate(calc(-1 * var(--angle)));
    color: var(--accent-gold);
    font-size: 0.85rem;
    opacity: 0.45;
}

/* counter-rotate text to keep it readable */
.orbit-ring-1 .orbit-item {
    animation: counter-spin 30s linear infinite reverse;
}

.orbit-ring-2 .orbit-item {
    animation: counter-spin 45s linear infinite;
}

.orbit-ring-3 .orbit-item {
    animation: counter-spin 60s linear infinite reverse;
}

@keyframes counter-spin {
    from { transform: rotate(var(--angle)) translate(var(--radius, 140px)) rotate(calc(-1 * var(--angle) + 0deg)); }
    to   { transform: rotate(var(--angle)) translate(var(--radius, 140px)) rotate(calc(-1 * var(--angle) + 360deg)); }
}

/* ===========================================
   CHAMBER 5: THE EXIT
   =========================================== */
.chamber-exit {
    min-height: 100vh;
    background: var(--void);
}

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

.exit-element {
    width: 120px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.exit-element:hover {
    transform: scale(1.2);
}

.keyhole-eye {
    width: 120px;
    height: 60px;
}

.eye-blink-lid {
    fill: var(--void);
    stroke: var(--void);
    stroke-width: 0;
    transform-origin: center;
    animation: exit-blink 5s ease-in-out infinite;
}

@keyframes exit-blink {
    0%, 90%, 100% { transform: scaleY(0); }
    93%           { transform: scaleY(1); }
    97%           { transform: scaleY(1); }
}

.exit-whisper {
    font-family: 'Homemade Apple', cursive;
    font-size: 0.85rem;
    color: var(--accent-gold);
    margin-top: 2rem;
    opacity: 0;
    animation: whisper-reveal 8s ease-in-out infinite;
}

@keyframes whisper-reveal {
    0%, 70%, 100% { opacity: 0; transform: translateY(5px); }
    80%, 90%      { opacity: 0.6; transform: translateY(0); }
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .chamber-nav {
        right: 12px;
        gap: 12px;
    }

    .nav-dot {
        width: 6px;
        height: 6px;
    }

    .collage-panel {
        transform: rotate(0deg) !important;
    }

    .panel-1 { top: 0; left: 2%; width: 55%; }
    .panel-2 { top: 15%; right: 2%; width: 40%; height: auto; }
    .panel-3 { top: 30%; left: 10%; width: 70%; }
    .panel-4 { top: 22%; right: 0; width: 25%; height: auto; }
    .panel-5 { top: 48%; left: 0; width: 55%; }
    .panel-6 { top: 42%; right: 5%; width: 35%; height: auto; }
    .panel-7 { bottom: 15%; left: 5%; width: 60%; }
    .panel-8 { bottom: 8%; right: 2%; width: 40%; height: auto; }
    .panel-9 { top: 65%; left: 30%; width: 45%; }

    .orbit-ring-1 .orbit-item {
        transform: rotate(var(--angle)) translate(80px) rotate(calc(-1 * var(--angle)));
    }
    .orbit-ring-2 .orbit-item {
        transform: rotate(var(--angle)) translate(140px) rotate(calc(-1 * var(--angle)));
    }
    .orbit-ring-3 .orbit-item {
        transform: rotate(var(--angle)) translate(200px) rotate(calc(-1 * var(--angle)));
        font-size: 0.75rem;
    }

    .annotation {
        display: none;
    }
}

@media (max-width: 480px) {
    .threshold-title {
        font-size: clamp(2.5rem, 15vw, 5rem);
    }

    .corridor-wrapper {
        padding: 2rem 1.5rem;
    }

    .orbit-ring-3 {
        display: none;
    }
}
