/* ============================================================
   DDAZZL.com v2 — Surreal Gemstone Dreamscape
   Palette: Obsidian #0d0221, Amethyst #6b21a8, Sapphire #1e3a8a,
            Emerald #047857, Ruby #be123c, Topaz #d4a017,
            Opal Mist #e2e0f0, Crystal Clear #f5f3ff
   ============================================================ */

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

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

body {
    background: #0d0221;
    color: #e2e0f0;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    line-height: 1.8;
    font-size: clamp(16px, 1.2vw, 20px);
    overflow-x: hidden;
    cursor: none;
}

::selection {
    background: #6b21a8;
    color: #f5f3ff;
}

/* --- Custom Cursor --- */
#gem-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #d4a017;
    background: rgba(107, 33, 168, 0.2);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: background 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    mix-blend-mode: screen;
}

/* --- Stardust Particle Field --- */
#stardust-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.stardust-particle {
    position: absolute;
    border-radius: 50%;
    background: #e2e0f0;
    animation: starPulse var(--pulse-dur) ease-in-out infinite;
    animation-delay: var(--pulse-delay);
    opacity: 0.3;
}

@keyframes starPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* --- Navigation: Vertical Pill Menu --- */
#gem-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

#gem-nav.visible {
    opacity: 1;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dot-color);
    border: none;
    cursor: none;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.nav-dot.active {
    width: 12px;
    height: 12px;
    box-shadow: 0 0 12px 3px var(--dot-color), 0 0 24px 6px var(--dot-color);
    margin-left: -2px;
}

/* --- Depth Layers --- */
.depth-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.depth-layer.bg-deep {
    z-index: 0;
    transform: scale(0.95);
    opacity: 0.6;
}

.depth-layer.bg-mid {
    z-index: 1;
    opacity: 0.8;
}

.depth-layer.fg-content {
    z-index: 2;
    opacity: 1;
}

/* --- Gem Panels (Diagonal Sections) --- */
.gem-panel {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

.panel-opening {
    min-height: 100vh;
    background: #0d0221;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Diagonal clip panels */
.panel-clip {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--clip-from) 0%, var(--clip-to) 100%);
    clip-path: polygon(0 4%, 100% 0%, 100% 96%, 0 100%);
}

.panel-amethyst .panel-clip {
    margin-top: -60px;
}

.panel-sapphire .panel-clip {
    clip-path: polygon(0 0%, 100% 5%, 100% 100%, 0 95%);
    margin-top: -60px;
}

.panel-emerald .panel-clip {
    clip-path: polygon(0 3%, 100% 0%, 100% 97%, 0 100%);
    margin-top: -60px;
}

.panel-ruby .panel-clip {
    clip-path: polygon(0 0%, 100% 4%, 100% 100%, 0 96%);
    margin-top: -60px;
}

.panel-terminal {
    background: #0d0221;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* --- Title: DDAZZL --- */
.title-ddazzl {
    font-family: 'Bodoni Moda', serif;
    font-weight: 900;
    font-size: clamp(15vw, 20vw, 25vw);
    letter-spacing: -0.03em;
    line-height: 0.85;
    text-align: center;
    position: relative;
    z-index: 2;
}

.title-letter {
    display: inline-block;
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.title-letter.revealed {
    opacity: 1;
    transform: translateY(0);
}

.opening-whisper {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #e2e0f0;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
}

.opening-whisper.revealed {
    opacity: 0.6;
}

/* --- Content Islands --- */
.content-island {
    position: absolute;
    max-width: 520px;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.content-island.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Z-pattern floating positions — deliberately off-grid */
.island-amethyst {
    left: 30%;
    top: 22%;
}

.island-sapphire {
    right: 15%;
    top: 35%;
    left: auto;
    text-align: right;
}

.island-emerald {
    left: 18%;
    top: 28%;
}

.island-ruby {
    right: 20%;
    top: 25%;
    left: auto;
    text-align: right;
}

.section-label {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #d4a017;
    display: block;
    margin-bottom: 20px;
}

.section-heading {
    font-family: 'Bodoni Moda', serif;
    font-weight: 700;
    font-size: clamp(36px, 8vw, 120px);
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: #f5f3ff;
    margin-bottom: 28px;
}

.section-body {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    line-height: 1.8;
    color: #e2e0f0;
    font-size: clamp(16px, 1.2vw, 20px);
}

/* --- Faceted Light Refractions --- */
.facet-cluster {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.facet-triangle {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--left);
    top: var(--top);
    background: var(--fc);
    opacity: 0.12;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: facetSpin var(--dur) linear infinite;
}

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

/* --- Liquid Gem Blobs --- */
.liquid-blob {
    position: absolute;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    filter: blur(40px);
    opacity: 0.35;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
}

.blob-opening-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at 40% 40%, #6b21a8, #1e3a8a);
    left: 60%;
    top: 20%;
    animation: blobDrift1 35s ease-in-out infinite alternate;
}

.blob-opening-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 60% 30%, #047857, #6b21a8);
    left: 15%;
    top: 55%;
    animation: blobDrift2 40s ease-in-out infinite alternate;
}

.blob-amethyst-1 {
    width: 450px;
    height: 350px;
    background: radial-gradient(circle at 30% 50%, #6b21a8, #1e3a8a);
    right: 10%;
    top: 30%;
    animation: blobDrift3 38s ease-in-out infinite alternate;
}

.blob-sapphire-1 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle at 50% 40%, #1e3a8a, #047857);
    left: 5%;
    top: 25%;
    animation: blobDrift1 32s ease-in-out infinite alternate;
}

.blob-sapphire-2 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle at 40% 60%, #6b21a8, #1e3a8a);
    right: 20%;
    top: 55%;
    animation: blobDrift2 36s ease-in-out infinite alternate;
}

.blob-emerald-1 {
    width: 420px;
    height: 350px;
    background: radial-gradient(circle at 60% 40%, #047857, #1e3a8a);
    right: 15%;
    top: 20%;
    animation: blobDrift3 34s ease-in-out infinite alternate;
}

.blob-emerald-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at 30% 70%, #be123c, #047857);
    left: 8%;
    top: 50%;
    animation: blobDrift1 42s ease-in-out infinite alternate;
}

.blob-emerald-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle at 50% 50%, #d4a017, #047857);
    left: 50%;
    top: 65%;
    animation: blobDrift2 30s ease-in-out infinite alternate;
}

.blob-ruby-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at 40% 40%, #be123c, #d4a017);
    left: 10%;
    top: 30%;
    animation: blobDrift3 37s ease-in-out infinite alternate;
}

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

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

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

/* --- Terminal Section --- */
.orbiting-lights {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform-origin: center center;
}

.orbit-ring-1 {
    width: 300px;
    height: 300px;
    margin-left: -150px;
    margin-top: -150px;
    animation: orbitSlow 60s linear infinite;
}

.orbit-ring-2 {
    width: 500px;
    height: 500px;
    margin-left: -250px;
    margin-top: -250px;
    animation: orbitSlow 90s linear infinite reverse;
}

.orbit-ring-3 {
    width: 700px;
    height: 700px;
    margin-left: -350px;
    margin-top: -350px;
    animation: orbitSlow 120s linear infinite;
}

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

.orbit-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--od-color);
    box-shadow: 0 0 6px 2px var(--od-color);
    animation: starPulse 5s ease-in-out infinite;
}

/* Distribute dots around orbit rings */
.orbit-ring-1 .orbit-dot:nth-child(1) { top: 0; left: 50%; }
.orbit-ring-1 .orbit-dot:nth-child(2) { bottom: 15%; right: 0; }
.orbit-ring-1 .orbit-dot:nth-child(3) { bottom: 0; left: 25%; }

.orbit-ring-2 .orbit-dot:nth-child(1) { top: 10%; right: 10%; }
.orbit-ring-2 .orbit-dot:nth-child(2) { bottom: 5%; right: 20%; }
.orbit-ring-2 .orbit-dot:nth-child(3) { top: 50%; left: 0; }
.orbit-ring-2 .orbit-dot:nth-child(4) { bottom: 20%; left: 15%; }

.orbit-ring-3 .orbit-dot:nth-child(1) { top: 0; left: 40%; }
.orbit-ring-3 .orbit-dot:nth-child(2) { bottom: 10%; right: 5%; }

.terminal-sentence {
    font-family: 'Bodoni Moda', serif;
    font-weight: 700;
    font-style: normal;
    font-size: clamp(20px, 3vw, 42px);
    color: #f5f3ff;
    text-align: center;
    line-height: 1.6;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
                transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.terminal-sentence.revealed {
    opacity: 1;
    transform: scale(1);
}

.terminal-sentence em {
    font-style: italic;
    color: #d4a017;
}

/* --- Gem-Cut Dividers --- */
.gem-divider {
    position: absolute;
    width: 100%;
    height: 60px;
    z-index: 10;
    pointer-events: none;
}

.divider-1 {
    top: calc(100vh - 30px);
}

.divider-2 {
    top: calc(200vh - 90px);
}

.divider-3 {
    top: calc(300vh - 90px);
}

.divider-4 {
    top: calc(400vh - 90px);
}

/* --- Scroll Reveal Utility --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
    .content-island {
        left: 8% !important;
        right: 8% !important;
        top: 20% !important;
        max-width: 84%;
        text-align: left !important;
    }

    .section-heading {
        font-size: clamp(32px, 10vw, 64px);
    }

    .title-ddazzl {
        font-size: clamp(12vw, 18vw, 22vw);
    }

    #gem-nav {
        right: 12px;
    }

    .orbit-ring-3 {
        width: 400px;
        height: 400px;
        margin-left: -200px;
        margin-top: -200px;
    }

    .orbit-ring-2 {
        width: 280px;
        height: 280px;
        margin-left: -140px;
        margin-top: -140px;
    }

    .orbit-ring-1 {
        width: 160px;
        height: 160px;
        margin-left: -80px;
        margin-top: -80px;
    }

    .liquid-blob {
        width: 200px !important;
        height: 200px !important;
    }

    .facet-triangle {
        width: calc(var(--size) * 0.5) !important;
        height: calc(var(--size) * 0.5) !important;
    }
}

@media (max-width: 480px) {
    .section-heading {
        font-size: clamp(28px, 8vw, 48px);
    }

    .title-ddazzl {
        font-size: clamp(14vw, 20vw, 25vw);
    }

    body {
        cursor: auto;
    }

    #gem-cursor {
        display: none;
    }
}
