/* === RESET & BASE === */
/* Typography/design compliance lexicon: creates sense progression traditional indicators. Mono" (Google Fonts Interaction:** Interaction: Interaction* Intersection Observer trigger animations. Interstitial Zones:** Zones: Zones* major sections italic: "Your chapter." immediate gravitas. Grotesk" Secondary panels */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navy: #0b1528;
    --teal: #1a3a4a;
    --gold: #c0974f;
    --coral: #e8553d;
    --cyan: #3dd8c5;
    --cream: #d4cfc3;
    --dust: #6b7280;
    --pink: #e891a8;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--navy);
    color: var(--cream);
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    overflow-x: hidden;
}

/* === MISSION HEADER === */
.mission-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: clamp(48px, 6vh, 72px);
    background: var(--navy);
    border-bottom: 1px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 clamp(72px, 6vw, 96px);
    z-index: 100;
}

.header-wordmark {
    font-family: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    letter-spacing: 0.12em;
    color: var(--cream);
    white-space: nowrap;
}

.header-ticker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: var(--gold);
    white-space: nowrap;
    overflow: hidden;
    max-width: min(48vw, 720px);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: max-content;
    animation: ticker-drift 22s linear infinite;
}

@keyframes ticker-drift {
    0% { transform: translateX(18%); }
    100% { transform: translateX(-42%); }
}

.ticker-sep { color: var(--dust); }
.ticker-data { color: var(--dust); }
.mission-clock { color: var(--gold); }

.mission-menu-toggle {
    background: none;
    border: 1px solid var(--teal);
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--cream);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.mission-menu-toggle:hover {
    border-color: var(--gold);
    background: rgba(192, 151, 79, 0.12);
}

.mission-menu-toggle span:not(.menu-label) {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--cream);
}

.mission-menu-toggle span:not(.menu-label):first-child { transform: translateY(-5px); }
.mission-menu-toggle span:not(.menu-label):nth-child(2) { transform: translateX(-26px); }
.mission-menu-toggle span:not(.menu-label):nth-child(3) { transform: translate(-52px, 5px); }

.menu-label {
    font-family: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
    font-weight: 500;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--cream);
}

/* === NAVIGATION COLUMN === */
.nav-column {
    position: fixed;
    top: clamp(48px, 6vh, 72px);
    left: 0;
    width: clamp(56px, 5vw, 80px);
    height: calc(100vh - clamp(48px, 6vh, 72px));
    background: repeating-linear-gradient(45deg, var(--navy) 0px, var(--navy) 3px, var(--teal) 3px, var(--teal) 6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 1.5rem;
    z-index: 99;
    border-right: 1px solid var(--teal);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    text-decoration: none;
    position: relative;
    transition: background 0.3s;
    border-radius: 4px;
}

.nav-icon:hover { background: rgba(192, 151, 79, 0.15); }
.nav-icon.active { background: rgba(192, 151, 79, 0.2); }

.nav-icon .icon-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.6s ease;
}

.nav-icon:hover .icon-path {
    stroke-dashoffset: 0;
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: clamp(56px, 5vw, 80px);
    margin-top: clamp(48px, 6vh, 72px);
}

/* === HERO SECTION === */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(2rem, 6vw, 6rem);
    overflow: hidden;
    background-image:
        linear-gradient(var(--teal) 1px, transparent 1px),
        linear-gradient(90deg, var(--teal) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: center;
    box-shadow: inset 0 -22vh 0 rgba(26, 58, 74, 0.16);
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--navy);
    opacity: 0.92;
}

.hero-headline-wrapper {
    position: relative;
    overflow: hidden;
    max-height: 34vh;
}

.hero-headline {
    font-family: 'Archivo Black', Impact, Haettenschweiler, 'Arial Black', sans-serif;
    font-size: clamp(4.5rem, 10.6vw, 11rem);
    letter-spacing: 0.08em;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--cream);
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    color: var(--dust);
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

/* === MEMPHIS DECORATIONS === */
.memphis-deco {
    position: absolute;
    width: var(--size);
    height: var(--size);
    transform: rotate(var(--rotation));
    pointer-events: none;
    z-index: 2;
}

/* === TRANSIT ZONES === */
.transit-zone {
    padding: 3rem clamp(2rem, 6vw, 6rem);
    position: relative;
    overflow: hidden;
}

.trajectory-map {
    width: 100%;
    max-height: 200px;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.22));
}

.planet-label {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px;
    fill: var(--gold);
    letter-spacing: 0.1em;
}

.trajectory-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.trajectory-path.drawing {
    stroke-dashoffset: 0;
}

.waypoint {
    transform-origin: center;
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.waypoint.visible {
    transform: scale(1);
}

/* === DOSSIER GRID === */
.dossier-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1.5rem;
    padding: 2rem clamp(1.5rem, 4vw, 4rem);
}

/* === DOSSIER MODULES === */
.dossier-module {
    position: relative;
    border: 1px solid var(--gold);
    background: var(--navy);
    background-image:
        linear-gradient(var(--teal) 1px, transparent 1px),
        linear-gradient(90deg, var(--teal) 1px, transparent 1px);
    background-size: 24px 24px;
    padding: 2.5rem 2rem 2rem;
    overflow: hidden;
    box-shadow: 12px 14px 0 rgba(26, 58, 74, 0.55), 0 24px 40px rgba(0, 0, 0, 0.28);
    margin-bottom: 1rem;
}

.dossier-module:nth-of-type(2n) { margin-top: -0.6rem; }
.dossier-module:nth-of-type(3n) { margin-left: -0.5rem; }

.dossier-module::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--navy);
    opacity: 0.92;
    z-index: 0;
}

.dossier-module > * { position: relative; z-index: 1; }

.module-left { grid-column: 1 / 6; }
.module-right { grid-column: 4 / 9; }
.module-full { grid-column: 1 / 9; }

.transit-inline { grid-column: 1 / 9; border: none; background: transparent; padding: 1rem 0; }
.transit-inline::before { display: none; }

.module-tab {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--navy);
    border-bottom: 1px solid var(--gold);
    border-right: 1px solid var(--gold);
    padding: 0.35rem 1rem;
    font-family: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    text-transform: uppercase;
    z-index: 2;
}

.module-heading {
    font-family: 'Archivo Black', Impact, Haettenschweiler, 'Arial Black', sans-serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.08em;
    line-height: 0.95;
    color: var(--cream);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.module-body p {
    margin-bottom: 1rem;
    color: var(--cream);
}

.module-body p:last-child { margin-bottom: 0; }

/* === WORLD HEADERS === */
.world-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.world-coords {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: clamp(0.75rem, 0.9vw, 0.875rem);
    color: var(--gold);
    margin-top: 0.5rem;
}

/* === MISSION PATCHES === */
.mission-patch {
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(8px 10px 0 rgba(26, 58, 74, 0.62));
}

.mission-patch:hover {
    transform: rotate(15deg);
}

.patch-text {
    font-family: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
    font-size: 10px;
    fill: var(--gold);
    letter-spacing: 0.15em;
    font-weight: 700;
}

.patch-shape {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}

.patch-shape.drawn {
    stroke-dashoffset: 0;
}

/* === TERRAIN SILHOUETTES === */
.terrain--mars {
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 85%,
        97% 92%, 93% 86%, 88% 95%, 83% 87%,
        78% 93%, 72% 85%, 67% 94%, 62% 86%,
        57% 92%, 52% 85%, 47% 95%, 42% 87%,
        37% 93%, 32% 86%, 27% 94%, 22% 87%,
        17% 92%, 12% 86%, 7% 93%, 3% 88%, 0% 92%
    );
}

.terrain--europa {
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 88%,
        95% 90%, 90% 89%, 85% 91%, 80% 90%,
        75% 92%, 70% 90%, 65% 91%, 60% 89%,
        55% 91%, 50% 90%, 45% 92%, 40% 90%,
        35% 91%, 30% 89%, 25% 91%, 20% 90%,
        15% 92%, 10% 90%, 5% 91%, 0% 89%
    );
}

.terrain--titan {
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 88%,
        95% 88%, 95% 92%, 85% 92%, 85% 88%,
        75% 88%, 75% 93%, 65% 93%, 65% 89%,
        55% 89%, 55% 92%, 45% 92%, 45% 88%,
        35% 88%, 35% 93%, 25% 93%, 25% 89%,
        15% 89%, 15% 92%, 5% 92%, 5% 88%, 0% 88%
    );
}

/* === STATUS GRID === */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label {
    font-family: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--dust);
    text-transform: uppercase;
}

.status-value {
    font-family: 'Archivo Black', Impact, Haettenschweiler, 'Arial Black', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--cyan);
    line-height: 1;
}

/* === ROLE TAGS === */
.role-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.role-tag {
    font-family: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--cream);
    border: 1px solid var(--coral);
    padding: 0.35rem 0.75rem;
    transition: background 0.3s, color 0.3s;
}

.role-tag:hover {
    background: var(--coral);
    color: var(--navy);
}

/* === ARCHIVE === */
.archive-entries {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.archive-entry {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(192, 151, 79, 0.2);
    align-items: baseline;
}

.archive-date {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--gold);
    white-space: nowrap;
    flex-shrink: 0;
}

.archive-text {
    color: var(--cream);
    font-size: 0.95rem;
}

/* === FOOTER === */
.footer-terrain {
    position: relative;
    margin-top: 4rem;
    padding-top: 6rem;
}

.terrain-silhouette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--teal);
    clip-path: polygon(
        0% 100%, 0% 60%,
        3% 45%, 7% 55%, 12% 30%, 17% 50%, 22% 25%,
        27% 45%, 32% 20%, 37% 40%, 42% 15%, 47% 35%,
        52% 28%, 57% 50%, 62% 22%, 67% 42%, 72% 18%,
        77% 38%, 82% 25%, 87% 48%, 92% 30%, 97% 45%,
        100% 35%, 100% 100%
    );
    opacity: 0.3;
}

.footer-content {
    background: var(--navy);
    border-top: 1px solid var(--teal);
    padding: 2rem clamp(2rem, 6vw, 6rem);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-coords, .footer-legal {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
    color: var(--dust);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-column { display: none; }
    .main-content { margin-left: 0; }
    .mission-header { padding-left: 1rem; }
    .header-ticker { display: none; }
    .hero-headline-wrapper { max-height: 42vh; }
    .hero-headline { font-size: clamp(3.6rem, 18vw, 6.8rem); }

    .dossier-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .module-left,
    .module-right,
    .module-full,
    .transit-inline {
        grid-column: 1 / -1;
    }

    .world-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .status-grid { grid-template-columns: 1fr 1fr; }
    .footer-content { flex-direction: column; }
}
