/* ============================================
   gamelicens.ing — Bureaucratic Astronomy
   ============================================ */

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

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

body {
    background-color: #F0E6D3;
    color: #2C2018;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
}

/* --- Opening Overlay --- */
#opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #3B2F2F;
    z-index: 1000;
    pointer-events: none;
    animation: overlayFade 2s ease-out forwards;
}

@keyframes overlayFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* --- Fixed Background Constellation --- */
#constellation-bg {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    animation: constellationFadeIn 2s ease-out 0.5s forwards, constellationRotate 180s linear infinite;
}

#constellation-svg {
    width: 100%;
    height: 100%;
}

@keyframes constellationFadeIn {
    0% { opacity: 0; }
    100% { opacity: 0.06; }
}

@keyframes constellationRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Fixed Left Navigation --- */
#section-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 100;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid #8B7355;
    opacity: 0.4;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
}

.nav-dot.active {
    background-color: #C4A97D;
    border-color: #C4A97D;
    opacity: 1;
}

.nav-dot:hover {
    opacity: 0.8;
    border-color: #C4A97D;
}

/* --- Sections General --- */
.section {
    position: relative;
    z-index: 1;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 6vw, 5.5rem);
    letter-spacing: 0.12em;
    line-height: 1.1;
    text-transform: uppercase;
    color: #2C2018;
    margin-bottom: 3rem;
}

/* --- Body Text --- */
.body-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #2C2018;
    margin-bottom: 1.5rem;
    max-width: 65ch;
}

/* --- Fade In Animation --- */
.fade-in {
    opacity: 0;
    transition: opacity 600ms ease;
}

.fade-in.visible {
    opacity: 1;
}

/* --- Section 1: Observation Deck --- */
#observation-deck {
    height: 100vh;
    display: flex;
    align-items: flex-start;
    padding: 8vh 6vw 6vh 6vw;
    padding-left: calc(48px + 6vw);
    position: relative;
}

.observation-content {
    flex: 0 0 45%;
    padding-top: 0;
}

.site-identity {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 7vw;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1.1;
    color: #2C2018;
    margin-bottom: 2rem;
    opacity: 0;
    animation: identityFadeIn 1s ease-out 2s forwards;
}

@keyframes identityFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.tagline-container {
    opacity: 0;
    animation: taglineFadeIn 0.5s ease-out 3.5s forwards;
}

@keyframes taglineFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    line-height: 1.7;
    color: #2C2018;
    max-width: 50ch;
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #C4A97D;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 530ms step-end infinite;
}

.typewriter-cursor.hidden {
    animation: none;
    opacity: 0;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.observation-constellation {
    flex: 0 0 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-left: 2vw;
}

.deck-constellation {
    width: 100%;
    max-width: 550px;
    height: auto;
    opacity: 0;
    animation: deckConstellationIn 2s ease-out 1s forwards;
}

@keyframes deckConstellationIn {
    0% { opacity: 0; }
    100% { opacity: 0.7; }
}

.constellation-node {
    transition: all 0.3s ease;
}

/* --- Section Dividers --- */
.section-divider {
    height: 16vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background-color: #C4A97D;
    opacity: 0.15;
}

.divider-constellation {
    width: 160px;
    height: auto;
    position: relative;
    z-index: 1;
}

/* --- Section 2: Registry Band --- */
#registry-band {
    min-height: 80vh;
    padding: 6vh 6vw;
    padding-left: calc(48px + 6vw);
}

.registry-content {
    display: flex;
    gap: 4vw;
}

.registry-text {
    flex: 0 0 62%;
    padding-left: 0;
}

.registry-text .section-heading {
    font-size: clamp(1.8rem, 4vw, 4rem);
}

.registry-cards {
    flex: 0 0 34%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.data-card {
    width: 280px;
    max-width: 100%;
    padding: 1.5rem;
    background-color: #FAF4E8;
    border: 1px solid #A68B6B;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 300ms ease, box-shadow 300ms ease;
}

.data-card:hover {
    border-color: #C4A97D;
    box-shadow: 0 2px 8px rgba(59, 47, 47, 0.08);
}

.card-header {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8B7355;
}

.card-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #2C2018;
    letter-spacing: 0.06em;
}

.status-active {
    color: #7A8B6F;
}

/* --- Section 3: Cartography Band --- */
#cartography-band {
    min-height: 80vh;
    padding: 6vh 6vw;
    padding-left: calc(48px + 6vw);
}

.cartography-heading {
    font-size: clamp(1.8rem, 4vw, 4rem);
    margin-bottom: 3rem;
}

.cartography-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.cartography-annotations {
    max-width: 55ch;
}

.world-map-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
}

.world-map {
    width: 100%;
    height: auto;
    background-color: #F0E6D3;
}

/* Clay Wash #E5D5BC used for landmass fills in SVG and secondary backgrounds */
.cartography-content {
    background-color: #E5D5BC;
    padding: 3rem;
    border-radius: 0;
}

.jurisdiction-star {
    cursor: pointer;
    transform-origin: center;
    animation: starPulse 3s ease-in-out infinite;
}

.jurisdiction-star:hover {
    animation-play-state: paused;
}

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

.map-tooltip {
    position: absolute;
    background-color: #FAF4E8;
    border: 1px solid #A68B6B;
    padding: 1rem 1.2rem;
    display: none;
    flex-direction: column;
    gap: 0.35rem;
    pointer-events: none;
    z-index: 50;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(59, 47, 47, 0.1);
}

.map-tooltip.visible {
    display: flex;
}

.tooltip-jurisdiction {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8B7355;
}

.tooltip-framework {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    color: #2C2018;
    letter-spacing: 0.06em;
}

.tooltip-status {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.tooltip-status.status-active-text {
    color: #7A8B6F;
}

.tooltip-status.status-restricted-text {
    color: #B8860B;
}

/* --- Section 4: Archive Band --- */
#archive-band {
    min-height: 80vh;
    padding: 6vh 6vw;
    padding-left: calc(48px + 6vw);
    padding-bottom: 12vh;
}

.archive-content {
    display: flex;
    gap: 4vw;
}

.archive-timeline {
    flex: 0 0 38%;
}

.archive-timeline .section-heading {
    font-size: clamp(1.8rem, 4vw, 4rem);
}

.archive-closing {
    flex: 0 0 58%;
}

.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 1rem;
}

.timeline-line {
    position: absolute;
    left: 3px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #A68B6B;
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 1rem;
}

.timeline-node {
    position: absolute;
    left: -30px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #C4A97D;
}

.timeline-year {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    color: #8B7355;
    display: block;
    margin-bottom: 0.3rem;
}

.timeline-desc {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #2C2018;
    max-width: 35ch;
}

/* --- Rubber Stamps --- */
.rubber-stamp {
    position: fixed;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

.rubber-stamp.visible {
    opacity: 1;
}

.stamp-1 {
    width: 90px;
    height: 90px;
    right: 5vw;
    top: 15vh;
    transform: rotate(-12deg);
}

.stamp-2 {
    width: 110px;
    height: 50px;
    right: 8vw;
    bottom: 30vh;
    transform: rotate(5deg);
}

.stamp-3 {
    width: 80px;
    height: 80px;
    right: 3vw;
    bottom: 10vh;
    transform: rotate(-8deg);
}

/* --- Typewriter Text (before JS processes it) --- */
.typewriter-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    line-height: 1.7;
    color: #2C2018;
    min-height: 1.5em;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    #section-nav {
        display: none;
    }

    #observation-deck {
        flex-direction: column;
        padding-left: 6vw;
        height: auto;
        min-height: 100vh;
        padding-top: 6vh;
    }

    .observation-content {
        flex: none;
        width: 100%;
    }

    .observation-constellation {
        flex: none;
        width: 100%;
        padding-left: 0;
        padding-top: 4vh;
        justify-content: flex-start;
    }

    .deck-constellation {
        max-width: 350px;
    }

    .site-identity {
        font-size: 10vw;
    }

    #registry-band,
    #cartography-band,
    #archive-band {
        padding-left: 6vw;
    }

    .registry-content {
        flex-direction: column;
    }

    .registry-text {
        flex: none;
    }

    .registry-cards {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .data-card {
        width: 100%;
        max-width: 300px;
    }

    .archive-content {
        flex-direction: column;
    }

    .archive-timeline {
        flex: none;
    }

    .archive-closing {
        flex: none;
    }

    .timeline-desc {
        max-width: none;
    }

    .stamp-1, .stamp-2, .stamp-3 {
        display: none;
    }
}

@media (max-width: 600px) {
    .section-heading {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .registry-text .section-heading,
    .cartography-heading,
    .archive-timeline .section-heading {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .body-text {
        max-width: none;
    }
}
