/* ==========================================================================
   gamelicensor.com - Galactic Game Licensing Authority
   Forest-Green Cosmic Authority Palette
   ========================================================================== */

:root {
    --deep-void: #0B1A0F;
    --imperial-jade: #1A3A2A;
    --stellar-emerald: #2ECC71;
    --cosmic-gold: #C9A84C;
    --pale-starlight: #E8F0E4;
    --nebula-mist: #8BAF8B;
    --supernova-crimson: #A83232;
    --plasma-teal: #3AAFA9;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

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

body {
    background-color: var(--deep-void);
    color: var(--pale-starlight);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

::selection {
    background-color: var(--cosmic-gold);
    color: var(--deep-void);
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pale-starlight);
}

h2 {
    font-family: 'Jost', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.08em;
    line-height: 1.1;
}

.section-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 2rem;
    position: relative;
}

.license-code {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--nebula-mist);
    display: block;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

/* ==========================================================================
   Navigation - Vertical Star Indicators
   ========================================================================== */

#scene-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
}

.nav-star {
    color: var(--nebula-mist);
    opacity: 0.3;
    cursor: pointer;
    transition: opacity 0.6s ease, color 0.6s ease, transform 0.3s ease;
}

.nav-star:hover {
    color: var(--plasma-teal);
    opacity: 0.8;
    transform: scale(1.3);
}

.nav-star.active {
    color: var(--cosmic-gold);
    opacity: 1;
}

/* ==========================================================================
   Scenes - General
   ========================================================================== */

.scene {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scene-content {
    position: relative;
    z-index: 10;
    max-width: 640px;
    padding: 2rem;
    text-align: center;
}

.text-block {
    margin: 0 auto;
    max-width: 640px;
}

.text-block p {
    color: var(--pale-starlight);
    opacity: 0.9;
}

.text-block-narrow {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.text-block-core {
    max-width: 580px;
}

/* ==========================================================================
   Starfield Layer
   ========================================================================== */

.starfield-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 10% 15%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 25% 40%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 40% 10%, var(--cosmic-gold) 50%, transparent 100%),
        radial-gradient(1px 1px at 55% 75%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 70% 20%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 80% 60%, var(--cosmic-gold) 50%, transparent 100%),
        radial-gradient(1px 1px at 90% 35%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 15% 85%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 35% 55%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 50% 90%, var(--cosmic-gold) 50%, transparent 100%),
        radial-gradient(1px 1px at 65% 45%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 85% 80%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 5% 50%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 45% 30%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 75% 65%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 20% 70%, var(--cosmic-gold) 50%, transparent 100%),
        radial-gradient(1px 1px at 60% 5%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 95% 50%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 30% 95%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 8% 30%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 52% 52%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 78% 12%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 42% 68%, var(--cosmic-gold) 50%, transparent 100%),
        radial-gradient(1px 1px at 18% 22%, var(--pale-starlight) 50%, transparent 100%),
        radial-gradient(1px 1px at 88% 92%, var(--pale-starlight) 50%, transparent 100%);
    opacity: 0.2;
    mix-blend-mode: screen;
}

.starfield-dense {
    opacity: 0.35;
}

/* ==========================================================================
   Diagonal Lines Overlay
   ========================================================================== */

.diagonal-lines-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 20px,
        rgba(46, 204, 113, 0.02) 20px,
        rgba(46, 204, 113, 0.02) 20.5px
    );
}

/* ==========================================================================
   Scene 1: The Void Approach
   ========================================================================== */

#scene-void {
    background: linear-gradient(180deg, var(--deep-void) 0%, #0E2215 100%);
    flex-direction: column;
}

.station-silhouette {
    margin-bottom: 3rem;
}

.station-svg {
    width: clamp(280px, 50vw, 500px);
    height: auto;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.station-svg.revealed {
    opacity: 1;
}

.domain-title {
    font-family: 'Jost', sans-serif;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    margin-bottom: 1rem;
}

.letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.4s ease, text-shadow 0.6s ease;
}

.letter.visible {
    opacity: 1;
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.4), 0 0 40px rgba(46, 204, 113, 0.15);
}

.letter.dot {
    color: var(--cosmic-gold);
}

.tagline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 3vw, 1.75rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--nebula-mist);
    opacity: 0;
    transition: opacity 1.2s ease 0.5s;
}

.tagline.visible {
    opacity: 0.8;
}

#scene-void .license-code {
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1.5s ease 1s;
}

#scene-void .license-code.visible {
    opacity: 0.5;
}

/* ==========================================================================
   Scene 2: The Grand Atrium
   ========================================================================== */

#scene-atrium {
    background: linear-gradient(180deg, #0E2215 0%, var(--imperial-jade) 30%, var(--imperial-jade) 70%, #142E20 100%);
}

.scene-clip-top {
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 120px;
    background: var(--deep-void);
    clip-path: ellipse(55% 100% at 50% 0%);
    z-index: 5;
}

.pillar {
    position: absolute;
    top: 0;
    height: 100%;
    width: 80px;
    z-index: 3;
    opacity: 0.6;
}

.pillar-left {
    left: 5%;
}

.pillar-right {
    right: 5%;
}

.star-seal {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.star-seal-atrium {
    width: clamp(200px, 30vw, 350px);
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: seal-rotate 25s linear infinite;
    opacity: 0.4;
}

@keyframes seal-rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

#scene-atrium .section-title {
    color: var(--cosmic-gold);
}

/* ==========================================================================
   Scene 3: The Tribunal Chamber
   ========================================================================== */

#scene-tribunal {
    background: linear-gradient(180deg, #142E20 0%, var(--imperial-jade) 20%, #1E4432 50%, var(--imperial-jade) 80%, #142E20 100%);
}

.concentric-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 800px;
    pointer-events: none;
    z-index: 1;
}

.tribunal-thrones {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(300px, 60vw, 700px);
    z-index: 2;
    pointer-events: none;
}

#scene-tribunal .scene-content {
    margin-top: 8rem;
}

#scene-tribunal .section-title {
    color: var(--cosmic-gold);
}

/* Orbiting star accent */
.orbiting-star {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.orbiting-star-tribunal {
    top: 50%;
    left: 50%;
    animation: orbit-tribunal 10s linear infinite;
}

@keyframes orbit-tribunal {
    from {
        transform: translate(-50%, -50%) rotate(0deg) translateX(40px) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg) translateX(40px) rotate(-360deg);
    }
}

/* ==========================================================================
   Scene 4: The Archive Vault
   ========================================================================== */

#scene-archive {
    background: linear-gradient(180deg, #142E20 0%, var(--deep-void) 30%, #0D1F14 70%, var(--deep-void) 100%);
}

.archive-shelves {
    position: absolute;
    top: 10%;
    height: 80%;
    width: clamp(100px, 15vw, 180px);
    z-index: 2;
    pointer-events: none;
}

.archive-shelves-left {
    left: 3%;
}

.archive-shelves-right {
    right: 3%;
}

.archive-fragments {
    margin: 0 auto;
    max-width: 640px;
}

.archive-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    letter-spacing: 0.1em;
    color: var(--pale-starlight);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    text-align: center;
}

#scene-archive .section-title {
    color: var(--nebula-mist);
    margin-bottom: 4rem;
}

/* ==========================================================================
   Scene 5: The Core Singularity
   ========================================================================== */

#scene-core {
    background: linear-gradient(180deg, var(--deep-void) 0%, #0D1F14 40%, var(--deep-void) 100%);
}

.core-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.18) 0%, rgba(46, 204, 113, 0.06) 40%, transparent 70%);
    animation: core-pulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes core-pulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.star-seal-core {
    width: clamp(250px, 40vw, 400px);
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: seal-rotate-core 30s linear infinite;
    opacity: 0.3;
}

@keyframes seal-rotate-core {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.section-title-core {
    color: var(--stellar-emerald);
    text-shadow: 0 0 30px rgba(46, 204, 113, 0.3);
}

.closing-proclamation {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cosmic-gold);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
}

/* Orbiting stars for core */
.orbiting-star-core-1 {
    top: 50%;
    left: 50%;
    animation: orbit-core-1 8s linear infinite;
}

.orbiting-star-core-2 {
    top: 50%;
    left: 50%;
    animation: orbit-core-2 12s linear infinite;
}

.orbiting-star-core-3 {
    top: 50%;
    left: 50%;
    animation: orbit-core-3 10s linear infinite;
}

@keyframes orbit-core-1 {
    from { transform: translate(-50%, -50%) rotate(0deg) translateX(40px) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg) translateX(40px) rotate(-360deg); }
}

@keyframes orbit-core-2 {
    from { transform: translate(-50%, -50%) rotate(90deg) translateX(60px) rotate(-90deg); }
    to { transform: translate(-50%, -50%) rotate(450deg) translateX(60px) rotate(-450deg); }
}

@keyframes orbit-core-3 {
    from { transform: translate(-50%, -50%) rotate(200deg) translateX(50px) rotate(-200deg); }
    to { transform: translate(-50%, -50%) rotate(560deg) translateX(50px) rotate(-560deg); }
}

/* ==========================================================================
   Constellations
   ========================================================================== */

.constellation {
    position: absolute;
    pointer-events: none;
    z-index: 3;
}

.constellation-void {
    top: 10%;
    right: 8%;
    width: clamp(150px, 25vw, 300px);
}

.constellation-atrium {
    bottom: 15%;
    left: 10%;
    width: clamp(120px, 20vw, 250px);
}

.constellation-archive {
    top: 20%;
    right: 15%;
    width: clamp(80px, 12vw, 160px);
}

.constellation-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s ease;
}

.constellation-line.drawn {
    stroke-dashoffset: 0;
}

/* ==========================================================================
   Zoom-Focus Animation
   ========================================================================== */

.zoom-focus {
    opacity: 0;
    transform: scale(1.08);
    filter: blur(4px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 0.8s ease-out;
    will-change: transform, opacity, filter;
}

.zoom-focus.in-view {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* ==========================================================================
   Animated Stars (SVG overlays for twinkle)
   ========================================================================== */

.twinkle-star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--pale-starlight);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 4;
}

@keyframes twinkle {
    0%, 100% { opacity: var(--star-base-opacity, 0.2); }
    50% { opacity: 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    #scene-nav {
        right: 1rem;
        gap: 1rem;
    }

    .pillar {
        width: 50px;
    }

    .pillar-left {
        left: 1%;
    }

    .pillar-right {
        right: 1%;
    }

    .archive-shelves {
        width: 80px;
    }

    .archive-shelves-left {
        left: 0;
    }

    .archive-shelves-right {
        right: 0;
    }

    .tribunal-thrones {
        top: 2%;
        width: 90vw;
    }

    #scene-tribunal .scene-content {
        margin-top: 6rem;
    }

    .core-glow {
        width: 350px;
        height: 350px;
    }

    .scene-content {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .pillar {
        display: none;
    }

    .archive-shelves {
        display: none;
    }

    .star-seal-atrium {
        width: 180px;
    }

    .star-seal-core {
        width: 200px;
    }
}
