/* =============================================
   rriddl.dev - Surreal Dreamscape Developer Portal
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --deep-indigo: #1b1340;
    --phantom-violet: #4a2f8a;
    --oracle-gold: #d4a843;
    --mist-silver: #c8c5d4;
    --cipher-green: #3dd68c;
    --paradox-rose: #b84c7e;
    --fog-white: #eee8f5;
    --obsidian: #0c0a14;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Outfit', 'Segoe UI', sans-serif;
    --font-accent: 'Caveat', cursive;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --spring-ease: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --smooth-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --golden-ratio: 1.618;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    background-color: var(--obsidian);
    color: var(--mist-silver);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Typography --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 7vw, 7rem);
    letter-spacing: -0.03em;
    color: var(--fog-white);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.section-heading em {
    font-style: italic;
    color: var(--oracle-gold);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--mist-silver);
    margin-bottom: 1.25rem;
    max-width: 620px;
}

.body-text.accent-gold {
    color: var(--oracle-gold);
    font-weight: 500;
}

.caveat-text {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 1.5rem;
    transform: rotate(-1deg);
    color: var(--fog-white);
}

.cipher-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--cipher-green);
    letter-spacing: 0.05em;
}

/* --- Gradient Mesh Backgrounds --- */
.gradient-mesh-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.mesh-hero {
    background:
        radial-gradient(ellipse at 15% 45%, rgba(74, 47, 138, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 25%, rgba(27, 19, 64, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 55% 85%, rgba(74, 47, 138, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse at 40% 15%, rgba(184, 76, 126, 0.1) 0%, transparent 40%),
        var(--obsidian);
    animation: meshDrift 30s ease-in-out infinite alternate;
}

.mesh-purpose-front {
    background:
        radial-gradient(ellipse at 25% 35%, rgba(74, 47, 138, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 65%, rgba(27, 19, 64, 0.6) 0%, transparent 50%),
        var(--deep-indigo);
}

.mesh-purpose-back {
    background:
        radial-gradient(ellipse at 65% 25%, rgba(74, 47, 138, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 75%, rgba(12, 10, 20, 0.7) 0%, transparent 50%),
        var(--deep-indigo);
}

.mesh-paradox {
    background:
        radial-gradient(ellipse at 75% 35%, rgba(74, 47, 138, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 15% 65%, rgba(27, 19, 64, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse at 90% 85%, rgba(184, 76, 126, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 10%, rgba(61, 214, 140, 0.05) 0%, transparent 30%),
        var(--obsidian);
    animation: meshDrift2 30s ease-in-out infinite alternate;
}

.mesh-cipher {
    background:
        radial-gradient(ellipse at 35% 25%, rgba(74, 47, 138, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 55%, rgba(27, 19, 64, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(184, 76, 126, 0.08) 0%, transparent 35%),
        var(--deep-indigo);
}

.mesh-labyrinth-front {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(74, 47, 138, 0.5) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 80%, rgba(12, 10, 20, 0.6) 0%, transparent 50%),
        var(--deep-indigo);
}

.mesh-labyrinth-back {
    background:
        radial-gradient(ellipse at 40% 60%, rgba(74, 47, 138, 0.4) 0%, transparent 55%),
        radial-gradient(ellipse at 90% 20%, rgba(12, 10, 20, 0.7) 0%, transparent 50%),
        var(--obsidian);
}

.mesh-terminus {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(74, 47, 138, 0.25) 0%, transparent 65%),
        radial-gradient(ellipse at 10% 10%, rgba(27, 19, 64, 0.7) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 90%, rgba(12, 10, 20, 0.8) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 30%, rgba(184, 76, 126, 0.06) 0%, transparent 30%),
        var(--obsidian);
}

@keyframes meshDrift {
    0% { background-position: 0% 0%, 100% 0%, 50% 100%, 40% 0%; }
    50% { background-position: 8% 8%, 92% 8%, 42% 92%, 48% 8%; }
    100% { background-position: 4% 4%, 96% 4%, 54% 96%, 36% 4%; }
}

@keyframes meshDrift2 {
    0% { background-position: 0% 0%, 100% 100%, 50% 50%, 50% 0%; }
    100% { background-position: 10% 10%, 90% 90%, 60% 40%, 40% 10%; }
}

/* --- Question Mark Constellation --- */
.question-mark-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.question-mark-field::before {
    content: '? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    font-family: var(--font-body);
    font-size: 3px;
    color: var(--mist-silver);
    opacity: 0.06;
    word-spacing: 28px;
    line-height: 38px;
    letter-spacing: 22px;
    overflow: hidden;
    transform: rotate(12deg);
}

body.dreaming .question-mark-field::before {
    animation: constellationSpin 60s linear infinite;
}

@keyframes constellationSpin {
    from { transform: rotate(12deg); }
    to { transform: rotate(372deg); }
}

/* --- Scenes / Sections --- */
.scene {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    transition: background-color 400ms ease-in-out;
}

/* Zoom-focus scroll reveal */
.scene.zoom-reveal {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.85s var(--spring-ease), transform 0.85s var(--spring-ease);
}

.scene.zoom-reveal.in-view {
    opacity: 1;
    transform: scale(1);
}

/* --- Scene 1: Hero --- */
.scene-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--obsidian);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Penrose Triangle SVG */
.penrose-triangle {
    width: clamp(200px, 32vw, 340px);
    height: auto;
    margin-bottom: 2rem;
    animation: penroseSpin 60s linear infinite;
}

.penrose-terminus {
    width: clamp(100px, 14vw, 170px);
    animation-duration: 80s;
}

.penrose-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: strokeDraw 3s ease-out forwards;
    filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3));
}

.penrose-mid { animation-delay: 0.4s; }
.penrose-inner { animation-delay: 0.8s; }
.penrose-connector-1 { animation-delay: 1.2s; }
.penrose-connector-2 { animation-delay: 1.5s; }
.penrose-connector-3 { animation-delay: 1.8s; }
.penrose-eye { animation-delay: 2.2s; stroke-dasharray: 200; stroke-dashoffset: 200; }
.penrose-pupil { animation-delay: 2.6s; stroke-dasharray: 100; stroke-dashoffset: 100; }

@keyframes strokeDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes penroseSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hero Title */
.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3.5rem, 8vw, 9rem);
    letter-spacing: 0.05em;
    color: var(--fog-white);
    line-height: 1;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(45deg);
    animation: letterAppear 0.6s var(--spring-ease) forwards;
    text-shadow: 0 0 25px rgba(238, 232, 245, 0.12);
    color: var(--fog-white);
}

.hero-title .letter-dot {
    color: var(--oracle-gold);
    text-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.hero-title .letter-tld {
    color: var(--cipher-green);
    text-shadow: 0 0 20px rgba(61, 214, 140, 0.25);
}

.hero-title .letter[data-delay="0"] { animation-delay: 3.0s; }
.hero-title .letter[data-delay="1"] { animation-delay: 3.15s; }
.hero-title .letter[data-delay="2"] { animation-delay: 3.3s; }
.hero-title .letter[data-delay="3"] { animation-delay: 3.45s; }
.hero-title .letter[data-delay="4"] { animation-delay: 3.6s; }
.hero-title .letter[data-delay="5"] { animation-delay: 3.75s; }
.hero-title .letter[data-delay="6"] { animation-delay: 4.1s; }
.hero-title .letter[data-delay="7"] { animation-delay: 4.3s; }
.hero-title .letter[data-delay="8"] { animation-delay: 4.45s; }
.hero-title .letter[data-delay="9"] { animation-delay: 4.6s; }

@keyframes letterAppear {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* Hero Tagline */
.hero-tagline {
    opacity: 0;
    animation: taglineFadeIn 1s ease-out 5.2s forwards;
    transform: translateY(20px) rotate(-1deg);
}

@keyframes taglineFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) rotate(-1deg);
    }
}

/* --- Hidden Riddle Fragments --- */
.hidden-riddle {
    position: absolute;
    z-index: 5;
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--fog-white);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 12px rgba(238, 232, 245, 0.5);
    white-space: nowrap;
}

.hidden-riddle.revealed {
    opacity: 0.85;
}

/* --- Scene 2: Card Flip (Purpose) --- */
.scene-purpose {
    min-height: 100vh;
    perspective: 1200px;
}

.card-flip-container {
    width: 100%;
    height: 100vh;
    position: relative;
}

.card-flip-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 1.2s var(--spring-ease);
    transform-style: preserve-3d;
}

.card-flip-inner.flipped {
    transform: rotateX(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-front {
    background-color: var(--deep-indigo);
}

.card-back {
    background-color: var(--deep-indigo);
    transform: rotateX(180deg);
}

.card-front-content,
.card-back-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    text-align: center;
    max-width: 820px;
}

.card-front-content .section-heading {
    font-size: clamp(2.5rem, 6vw, 5rem);
}

.card-back-content .section-heading {
    margin-bottom: 2rem;
}

/* --- Scene 3: Diagonal Slide (Paradox) --- */
.scene-paradox {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--obsidian);
}

.paradox-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 4rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 3rem;
    align-items: center;
}

.paradox-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Diagonal slide-in */
.paradox-grid {
    opacity: 0;
    transform: translate(40px, 40px);
    transition: opacity 0.9s var(--spring-ease), transform 0.9s var(--spring-ease);
}

.scene-paradox.in-view .paradox-grid {
    opacity: 1;
    transform: translate(0, 0);
}

/* Infinite Nested Squares */
.infinite-squares {
    position: relative;
    width: clamp(260px, 32vw, 440px);
    height: clamp(260px, 32vw, 440px);
}

.inf-square {
    position: absolute;
    border: 1.5px solid var(--oracle-gold);
    top: 50%;
    left: 50%;
    animation: squareSpin 20s linear infinite;
    filter: drop-shadow(0 0 4px rgba(212, 168, 67, 0.2));
}

.sq-1  { width: 100%; height: 100%; margin-top: -50%; margin-left: -50%; animation-delay: 0s; }
.sq-2  { width: 87%; height: 87%; margin-top: -43.5%; margin-left: -43.5%; animation-delay: -2s; animation-direction: reverse; }
.sq-3  { width: 75%; height: 75%; margin-top: -37.5%; margin-left: -37.5%; animation-delay: -4s; }
.sq-4  { width: 65%; height: 65%; margin-top: -32.5%; margin-left: -32.5%; animation-delay: -6s; animation-direction: reverse; }
.sq-5  { width: 56%; height: 56%; margin-top: -28%; margin-left: -28%; animation-delay: -8s; }
.sq-6  { width: 48%; height: 48%; margin-top: -24%; margin-left: -24%; animation-delay: -10s; animation-direction: reverse; }
.sq-7  { width: 41%; height: 41%; margin-top: -20.5%; margin-left: -20.5%; animation-delay: -12s; }
.sq-8  { width: 35%; height: 35%; margin-top: -17.5%; margin-left: -17.5%; animation-delay: -14s; animation-direction: reverse; }
.sq-9  { width: 30%; height: 30%; margin-top: -15%; margin-left: -15%; animation-delay: -16s; border-color: var(--paradox-rose); }
.sq-10 { width: 26%; height: 26%; margin-top: -13%; margin-left: -13%; animation-delay: -18s; animation-direction: reverse; border-color: var(--paradox-rose); }

@keyframes squareSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.paradox-text {
    position: relative;
}

.paradox-text .section-heading {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

/* Lens Flare */
.lens-flare {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    pointer-events: none;
    animation: flarePulse 3s ease-in-out infinite;
}

.flare-1 {
    top: -35px;
    right: -45px;
    background:
        radial-gradient(circle, rgba(212, 168, 67, 0.25) 0%, transparent 60%),
        radial-gradient(circle at 30% 30%, rgba(61, 214, 140, 0.15) 0%, transparent 40%);
}

.flare-2 {
    bottom: -20px;
    left: -30px;
    width: 60px;
    height: 60px;
    background:
        radial-gradient(circle, rgba(61, 214, 140, 0.2) 0%, transparent 55%),
        radial-gradient(circle at 60% 60%, rgba(212, 168, 67, 0.1) 0%, transparent 40%);
    animation-delay: 1.5s;
}

@keyframes flarePulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* --- Scene 4: Interactive Cipher --- */
.scene-cipher {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-indigo);
}

.cipher-container {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem;
    max-width: 800px;
}

.cipher-instruction {
    margin-bottom: 3rem;
    font-size: 1.6rem;
    color: var(--mist-silver);
}

.scramble-box {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 2.5rem 3rem;
    background: rgba(12, 10, 20, 0.5);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.scramble-box:hover {
    border-color: var(--oracle-gold);
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.1);
}

.scramble-letter {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 400;
    color: var(--paradox-rose);
    transition: color 0.5s ease, transform 0.5s var(--spring-ease);
    min-width: 0.7em;
    text-align: center;
}

.scramble-letter.space-after {
    min-width: 0.4em;
}

.scramble-box.solved .scramble-letter {
    color: var(--cipher-green);
    text-shadow: 0 0 10px rgba(61, 214, 140, 0.4);
}

.cipher-result {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s var(--spring-ease);
    position: relative;
}

.cipher-result.visible {
    opacity: 1;
    transform: translateY(0);
}

.solved-text {
    font-size: 1.1rem;
}

/* Particle burst */
.particle-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--oracle-gold);
    opacity: 0;
    animation: particleExplode 1.5s var(--spring-ease) forwards;
}

@keyframes particleExplode {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3) rotate(360deg);
    }
}

/* Penrose decorations */
.penrose-decoration {
    position: absolute;
    z-index: 1;
    opacity: 0.12;
    animation: penroseSpin 80s linear infinite;
}

.penrose-dec-left {
    bottom: 10%;
    left: 5%;
    width: 120px;
}

.penrose-dec-right {
    top: 10%;
    right: 5%;
    width: 100px;
    animation-direction: reverse;
}

/* --- Scene 5: Labyrinth Card Flip --- */
.scene-labyrinth {
    min-height: 100vh;
    perspective: 1200px;
}

.labyrinth-svg-container {
    margin-bottom: 2rem;
}

.labyrinth-svg {
    width: clamp(120px, 18vw, 200px);
    height: auto;
    animation: penroseSpin 40s linear infinite;
}

.labyrinth-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: strokeDraw 2.5s ease-out forwards;
    filter: drop-shadow(0 0 6px rgba(212, 168, 67, 0.3));
}

.labyrinth-path:nth-child(2) { animation-delay: 0.3s; stroke-dasharray: 600; stroke-dashoffset: 600; }
.labyrinth-path:nth-child(3) { animation-delay: 0.6s; stroke-dasharray: 420; stroke-dashoffset: 420; }
.labyrinth-path:nth-child(4) { animation-delay: 0.9s; stroke-dasharray: 260; stroke-dashoffset: 260; }
.labyrinth-center { animation-delay: 1.2s; stroke-dasharray: 60; stroke-dashoffset: 60; }

.labyrinth-quote {
    color: var(--oracle-gold);
    font-size: 1.8rem;
    margin-top: 2rem;
}

/* --- Scene 6: Terminus / Closing --- */
.scene-terminus {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--obsidian);
}

.terminus-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem;
}

.terminus-heading {
    font-size: clamp(2.5rem, 6vw, 6rem);
    margin-bottom: 1.5rem;
}

.terminus-quote {
    font-size: 2rem;
    color: var(--oracle-gold);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.terminus-penrose {
    margin: 3rem auto;
}

.dev-signature {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    background: rgba(12, 10, 20, 0.6);
    border-left: 2px solid var(--cipher-green);
    display: inline-block;
    text-align: left;
    border-radius: 0 6px 6px 0;
}

.dev-signature .cipher-text {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.dev-signature .cipher-text:last-child {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 197, 212, 0.12);
}

.footer-text {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--mist-silver);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.footer-cipher {
    font-size: 0.8rem;
    opacity: 0.4;
}

/* --- Mobius Strip Divider --- */
.mobius-divider {
    width: clamp(200px, 40vw, 400px);
    height: auto;
    margin-bottom: 2rem;
}

.mobius-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    filter: drop-shadow(0 0 12px rgba(212, 168, 67, 0.4));
}

.mobius-divider.animate-in .mobius-path {
    animation: mobiusDraw 2s ease-out forwards;
}

@keyframes mobiusDraw {
    to { stroke-dashoffset: 0; }
}

/* --- Radial Navigation --- */
.radial-nav {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
}

.nav-trigger {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 101;
}

.nav-circles {
    position: relative;
    width: 28px;
    height: 28px;
}

.circle {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid var(--oracle-gold);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.circle-outer {
    width: 28px;
    height: 28px;
}

.circle-mid {
    width: 18px;
    height: 18px;
}

.circle-inner {
    width: 8px;
    height: 8px;
    background-color: var(--oracle-gold);
}

.nav-trigger:hover .circle-outer { transform: translate(-50%, -50%) scale(1.15); }
.nav-trigger:hover .circle-mid { transform: translate(-50%, -50%) scale(1.1); }

.nav-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    height: 220px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.radial-nav.open .nav-menu {
    pointer-events: auto;
    opacity: 1;
}

.nav-item {
    position: absolute;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fog-white);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid rgba(212, 168, 67, 0.3);
    border-radius: 20px;
    background: rgba(12, 10, 20, 0.85);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 0.4s var(--spring-ease);
}

.radial-nav.open .nav-item {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.nav-item:hover {
    background: var(--oracle-gold);
    color: var(--obsidian);
    border-color: var(--oracle-gold);
}

/* Nav item orbital positions (6 items in a circle) */
.nav-item[data-angle="0"]   { top: -60px; left: 22px; transition-delay: 0s; }
.nav-item[data-angle="60"]  { top: -20px; left: 130px; transition-delay: 0.04s; }
.nav-item[data-angle="120"] { top: 60px; left: 130px; transition-delay: 0.08s; }
.nav-item[data-angle="180"] { top: 100px; left: 22px; transition-delay: 0.12s; }
.nav-item[data-angle="240"] { top: 60px; left: -80px; transition-delay: 0.16s; }
.nav-item[data-angle="300"] { top: -20px; left: -80px; transition-delay: 0.2s; }

/* --- Flashlight Overlay --- */
.flashlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(circle 300px at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(238, 232, 245, 0.025) 0%, transparent 100%);
}

.flashlight-overlay.active {
    opacity: 1;
}

/* --- Dreaming State --- */
body.dreaming .gradient-mesh-bg {
    animation-duration: 10s !important;
}

/* --- Diagonal Section Tilts --- */
.scene-paradox::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--obsidian);
    transform: skewY(-2deg);
    z-index: 1;
}

.scene-cipher::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--deep-indigo);
    transform: skewY(2.5deg);
    z-index: 1;
}

.scene-terminus::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--obsidian);
    transform: skewY(-1.5deg);
    z-index: 1;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .paradox-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 3rem 1.5rem;
    }

    .paradox-visual {
        order: -1;
    }

    .infinite-squares {
        width: 220px;
        height: 220px;
    }

    .scramble-box {
        padding: 1.5rem 2rem;
    }

    .scramble-letter {
        font-size: 1.5rem;
    }

    .dev-signature {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: clamp(2.5rem, 11vw, 4.5rem);
        letter-spacing: 0.02em;
    }

    .section-heading {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .radial-nav {
        top: 15px;
        left: 15px;
    }

    .paradox-grid {
        padding: 2rem 1rem;
    }

    .cipher-container {
        padding: 2rem 1rem;
    }

    .terminus-content {
        padding: 2rem 1rem;
    }

    .dev-signature .cipher-text {
        font-size: 0.75rem;
    }
}
