/* ============================================================
   ronri.xyz — Logic as Landscape
   Surreal dreamscape promo
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --void-indigo: #0d0b2e;
    --mist-lavender: #b8a9c9;
    --paradox-amber: #daa520;
    --fog-white: #e8e0f0;
    --deep-teal: #1a4a4a;
    --ethereal-pink: #c4a0b5;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Lora', Georgia, serif;
    --font-mono: 'Space Mono', 'Courier New', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-indigo);
    color: var(--fog-white);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.8;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ---------- Star Field ---------- */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.starfield::before,
.starfield::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Stars are generated via JS for randomness */

/* ---------- Fog Layers (Fixed Parallax) ---------- */
.fog-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
}

.fog-layer-1 {
    background:
        radial-gradient(ellipse 80% 50% at 20% 30%, rgba(26, 74, 74, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 70%, rgba(13, 11, 46, 0.25) 0%, transparent 55%);
}

.fog-layer-2 {
    background:
        radial-gradient(ellipse 70% 60% at 60% 20%, rgba(184, 169, 201, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 50% 70% at 30% 80%, rgba(196, 160, 181, 0.06) 0%, transparent 60%);
}

.fog-layer-3 {
    background:
        radial-gradient(ellipse 90% 40% at 50% 50%, rgba(232, 224, 240, 0.04) 0%, transparent 70%),
        radial-gradient(ellipse 40% 80% at 10% 60%, rgba(26, 74, 74, 0.12) 0%, transparent 50%);
}

/* ---------- Scene Base ---------- */
.scene {
    min-height: 100vh;
    position: relative;
    overflow: visible;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vh 5vw;
}

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

/* ---------- Scene 1: Opening ---------- */
.scene-opening {
    min-height: 100vh;
    align-items: center;
    text-align: center;
    padding: 0;
}

.scene-bg-opening {
    background: linear-gradient(180deg, #0d0b2e 0%, #0a1220 60%, #0d0b2e 100%);
}

.opening-title {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInDrift 2s ease-out both;
}

.domain-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: rgba(218, 165, 32, 0.6);
    text-transform: lowercase;
}

.display-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 600;
    color: var(--fog-white);
    letter-spacing: -0.01em;
    line-height: 1;
    text-shadow: 0 0 80px rgba(184, 169, 201, 0.3), 0 0 40px rgba(218, 165, 32, 0.1);
}

.display-subtitle {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-style: italic;
    color: var(--mist-lavender);
    opacity: 0.8;
    margin-top: 0.5rem;
    letter-spacing: 0.1em;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 6vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(218, 165, 32, 0.6), transparent);
    animation: scrollPulse 2.5s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ---------- Scene 2: Void ---------- */
.scene-void {
    min-height: 150vh;
    padding: 15vh 5vw;
}

.scene-bg-void {
    background: linear-gradient(180deg, #0a1a1a 0%, #061212 50%, #0a1818 100%);
}

/* ---------- Scene 3: Ambiguity ---------- */
.scene-ambiguity {
    min-height: 150vh;
    padding: 15vh 5vw;
}

.scene-bg-ambiguity {
    background: linear-gradient(180deg, #0d1f1f 0%, #0a1818 40%, #091414 100%);
}

/* ---------- Scene 4: Liar ---------- */
.scene-liar {
    min-height: 150vh;
    padding: 15vh 5vw;
}

.scene-bg-liar {
    background: linear-gradient(180deg, #0d0b2e 0%, #12103a 40%, #0d0b2e 100%);
}

/* ---------- Scene 5: Paths ---------- */
.scene-paths {
    min-height: 150vh;
    padding: 15vh 5vw;
}

.scene-bg-paths {
    background: linear-gradient(180deg, #0a1420 0%, #0c1c28 50%, #0a1420 100%);
}

/* ---------- Scene 6: Closing ---------- */
.scene-closing {
    min-height: 100vh;
    align-items: center;
    padding: 10vh 5vw;
}

.scene-bg-closing {
    background: linear-gradient(180deg, #0d0b2e 0%, #0d0b2e 100%);
}

.closing-title {
    position: relative;
    z-index: 5;
    text-align: center;
    margin-top: 15vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    animation: fadeInDrift 1.5s ease-out both;
}

.closing-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    font-style: italic;
    color: var(--mist-lavender);
    opacity: 0.6;
    letter-spacing: 0.08em;
}

/* ---------- Scene Transitions ---------- */
.scene-transition {
    height: 200px;
    background: linear-gradient(to bottom, var(--color-a), var(--color-b));
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* ---------- Floating Content Cards ---------- */
.floating-card {
    position: relative;
    max-width: 480px;
    padding: 2rem 2.2rem;
    background: rgba(232, 224, 240, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 12px;
    z-index: 5;
    transition: transform 0.1s linear;
    will-change: transform;
}

.floating-card.card-left {
    align-self: flex-start;
    margin-left: 5vw;
}

.floating-card.card-right {
    align-self: flex-end;
    margin-right: 5vw;
}

.floating-card.card-center {
    align-self: center;
}

.floating-card:hover {
    border-color: rgba(218, 165, 32, 0.45);
    background: rgba(232, 224, 240, 0.09);
}

.paradox-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    color: var(--paradox-amber);
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    opacity: 0.85;
}

.card-heading {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 600;
    color: var(--fog-white);
    line-height: 1.2;
    margin-bottom: 0.9rem;
}

.card-body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(232, 224, 240, 0.85);
}

.italic-text {
    font-style: italic;
    color: var(--mist-lavender);
}

/* ---------- Impossible Geometry SVGs ---------- */
.impossible-geo {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    opacity: 0.65;
}

.impossible-svg {
    display: block;
    filter: drop-shadow(0 0 20px rgba(184, 169, 201, 0.15));
}

/* Position each geometry element */
.geo-penrose {
    top: 15vh;
    right: 8vw;
    width: clamp(160px, 20vw, 260px);
    height: clamp(160px, 20vw, 260px);
    animation: slowRotate 120s linear infinite;
}

.geo-stairs {
    top: 20vh;
    left: 6vw;
    width: clamp(180px, 22vw, 280px);
    height: clamp(180px, 22vw, 280px);
    animation: gentleOscillate 8s ease-in-out infinite;
}

.geo-necker {
    top: 15vh;
    right: 10vw;
    width: clamp(150px, 18vw, 240px);
    height: clamp(140px, 16vw, 220px);
    animation: neckerFlicker 5s ease-in-out infinite;
}

.geo-moebius {
    top: 20vh;
    left: 8vw;
    width: clamp(160px, 20vw, 260px);
    height: clamp(100px, 12vw, 160px);
    animation: slowRotate 90s linear infinite;
}

.geo-branching {
    top: 10vh;
    right: 5vw;
    width: clamp(160px, 20vw, 240px);
    height: clamp(175px, 22vw, 264px);
    animation: gentleOscillate 12s ease-in-out infinite;
}

.geo-ouroboros {
    top: 8vh;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(160px, 20vw, 240px);
    height: clamp(160px, 20vw, 240px);
    animation: slowRotate 150s linear infinite;
    opacity: 0.5;
}

/* ---------- Geometry Animations ---------- */
@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.geo-ouroboros {
    /* override rotate to preserve translateX center alignment */
    animation: none;
}

.geo-ouroboros .impossible-svg {
    animation: slowRotate 150s linear infinite;
    transform-origin: center;
}

@keyframes gentleOscillate {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    25% { transform: translateY(-12px) rotate(1deg); }
    75% { transform: translateY(8px) rotate(-1deg); }
}

@keyframes neckerFlicker {
    0%, 45%, 55%, 100% { opacity: 0.65; }
    48%, 52% { opacity: 0.45; }
}

/* ---------- Scene Glyphs ---------- */
.scene-glyph {
    position: absolute;
    bottom: 10vh;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: clamp(6rem, 15vw, 12rem);
    font-weight: 300;
    color: rgba(184, 169, 201, 0.08);
    pointer-events: none;
    z-index: 2;
    user-select: none;
    letter-spacing: -0.05em;
}

.amber-glyph {
    color: rgba(218, 165, 32, 0.06);
}

/* ---------- Fade-in Animation ---------- */
@keyframes fadeInDrift {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card reveal animation */
.floating-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease, border-color 0.3s ease, background 0.3s ease;
}

.floating-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .geo-penrose,
    .geo-moebius,
    .impossible-svg {
        animation: none;
    }

    .geo-stairs,
    .geo-branching,
    .geo-necker {
        animation: none;
    }

    .scroll-line {
        animation: none;
    }

    .fog-layer {
        transform: none !important;
    }

    .floating-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
    .floating-card.card-left,
    .floating-card.card-right,
    .floating-card.card-center {
        align-self: center;
        margin-left: auto;
        margin-right: auto;
        max-width: 90vw;
    }

    .impossible-geo {
        width: clamp(100px, 30vw, 180px) !important;
        height: clamp(100px, 30vw, 180px) !important;
        opacity: 0.45;
    }

    .geo-penrose,
    .geo-stairs,
    .geo-moebius,
    .geo-branching {
        top: 5vh;
    }

    .scene {
        padding: 8vh 4vw;
    }
}
