/* ============================================
   interplanetary.quest - Styles
   Colors: #00FF88, #384B5E, #C8D6E5, #00D4FF, #060B14, #0D1B2A, #FF0080
   Fonts: Chakra Petch, Libre Baskerville, Share Tech Mono
   ============================================ */

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

:root {
    --color-neon-primary: #00FF88;
    --color-neon-secondary: #FF0080;
    --color-neon-tertiary: #00D4FF;
    --color-void: #060B14;
    --color-nebula: #0D1B2A;
    --color-text: #C8D6E5;
    --color-dim: #384B5E;
    --glow-intensity: 1;
    --shake-magnitude: 2px;
    --transition-speed: 600ms;
    --neon-green: #00FF88;
    --slate: #384B5E;
    --light-grey: #C8D6E5;
    --cyan: #00D4FF;
    --deep-black: #060B14;
    --dark-navy: #0D1B2A;
    --hot-pink: #FF0080;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--slate) var(--deep-black);
}

body {
    background-color: var(--deep-black);
    color: var(--light-grey);
    font-family: 'Libre Baskerville', serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   Constellation Field Background
   ============================================ */

.constellation-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: var(--light-grey);
}

.star.bright {
    background: var(--neon-green);
    box-shadow: 0 0 12px var(--neon-green);
}

.constellation-line {
    position: absolute;
    background: var(--slate);
    opacity: 0.15;
    transform-origin: 0 0;
}

/* ============================================
   Mission HUD Navigation
   ============================================ */

.mission-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: linear-gradient(180deg, rgba(6, 11, 20, 0.95) 0%, rgba(6, 11, 20, 0) 100%);
    pointer-events: none;
}

.mission-hud > * {
    pointer-events: auto;
}

.hud-designation {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2em;
    color: var(--neon-green);
    text-transform: uppercase;
}

.hud-nav {
    display: flex;
    gap: 4px;
}

.hud-btn {
    background: transparent;
    border: 1px solid var(--slate);
    color: var(--slate);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
}

.hud-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.hud-btn.active {
    border-color: var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 136, 0.05);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.15);
}

.hud-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--slate);
    text-transform: uppercase;
}

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

/* ============================================
   Voyage Sections (full viewport)
   ============================================ */

.voyage-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 80px 32px;
}

.section-content {
    max-width: 900px;
    width: 100%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--slate);
    margin-bottom: 24px;
    text-transform: uppercase;
}

.section-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon-green);
    line-height: 0.95;
    margin-bottom: 48px;
}

.section-title.arrival-glow {
    color: var(--hot-pink);
    text-shadow: 0 0 40px rgba(255, 0, 128, 0.3);
}

/* ============================================
   Glitch Text Effect
   ============================================ */

.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text.glitching::before {
    color: var(--cyan);
    animation: glitch1 0.3s ease;
    opacity: 0.7;
}

.glitch-text.glitching::after {
    color: var(--hot-pink);
    animation: glitch2 0.3s ease;
    opacity: 0.7;
}

@keyframes glitch1 {
    0% { transform: translate(0); opacity: 0; }
    20% { transform: translate(-3px, 2px); opacity: 0.7; }
    40% { transform: translate(3px, -2px); opacity: 0.7; }
    60% { transform: translate(-2px, -1px); opacity: 0.7; }
    80% { transform: translate(2px, 1px); opacity: 0.7; }
    100% { transform: translate(0); opacity: 0; }
}

@keyframes glitch2 {
    0% { transform: translate(0); opacity: 0; }
    20% { transform: translate(3px, -2px); opacity: 0.7; }
    40% { transform: translate(-3px, 2px); opacity: 0.7; }
    60% { transform: translate(2px, 1px); opacity: 0.7; }
    80% { transform: translate(-2px, -1px); opacity: 0.7; }
    100% { transform: translate(0); opacity: 0; }
}

/* ============================================
   Telemetry Block
   ============================================ */

.telemetry-block {
    border-left: 2px solid var(--slate);
    padding-left: 24px;
    margin-bottom: 64px;
}

.telemetry-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(56, 75, 94, 0.3);
}

.telemetry-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--slate);
    min-width: 80px;
    text-transform: uppercase;
}

.telemetry-value {
    font-family: 'Libre Baskerville', serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--light-grey);
    letter-spacing: 0.05em;
}

.neon-pulse {
    color: var(--neon-green);
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(0, 255, 136, 0.5); }
    50% { opacity: 0.6; text-shadow: none; }
}

/* ============================================
   Scroll Indicator
   ============================================ */

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--neon-green), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

.scroll-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.3em;
    color: var(--slate);
    text-transform: uppercase;
}

/* ============================================
   Airlock Dividers
   ============================================ */

.airlock-divider {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px;
    height: 120px;
}

.airlock-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--slate), transparent);
    opacity: 0;
    transform: scaleX(0);
    transition: opacity 0.6s ease, transform 0.8s ease;
}

.airlock-divider.activated .airlock-line {
    opacity: 0.6;
    transform: scaleX(1);
}

.airlock-icon {
    opacity: 0;
    transform: rotate(0deg) scale(0.5);
    transition: opacity 0.4s ease 0.3s, transform 0.6s ease 0.3s;
}

.airlock-divider.activated .airlock-icon {
    opacity: 1;
    transform: rotate(90deg) scale(1);
}

.airlock-divider.shake {
    animation: airlockShake 0.3s ease;
}

@keyframes airlockShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(1px); }
}

/* ============================================
   Void Section
   ============================================ */

.void-counter {
    text-align: center;
    margin-bottom: 40px;
}

.counter-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--slate);
    margin-bottom: 8px;
}

.counter-value {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 6vw, 96px);
    color: var(--cyan);
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.narrative-text {
    font-family: 'Libre Baskerville', serif;
    font-size: clamp(16px, 1.8vw, 20px);
    font-weight: 400;
    line-height: 1.72;
    color: var(--light-grey);
    max-width: 640px;
    margin: 0 auto 40px;
    text-align: center;
    opacity: 0.85;
}

.signal-wave {
    width: 100%;
    height: 120px;
    margin: 32px 0;
    overflow: hidden;
}

.wave-svg {
    width: 100%;
    height: 100%;
}

.wave-path {
    stroke: var(--cyan);
    stroke-width: 1.5;
    fill: none;
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5));
}

.void-stats {
    display: flex;
    justify-content: center;
    gap: 64px;
    margin-top: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 36px;
    color: var(--cyan);
    letter-spacing: 0.05em;
}

.stat-unit {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--slate);
    margin-top: 4px;
    text-transform: uppercase;
}

/* ============================================
   Signal Degradation Section
   ============================================ */

.degradation-container {
    position: relative;
    margin-bottom: 48px;
}

.narrative-text.degrading {
    transition: filter 0.5s ease, opacity 0.5s ease;
}

.static-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(200, 214, 229, 0.03) 0px,
        rgba(200, 214, 229, 0.03) 1px,
        transparent 1px,
        transparent 3px
    );
    animation: staticFlicker 0.15s infinite;
}

@keyframes staticFlicker {
    0% { background-position: 0 0; }
    50% { background-position: 0 2px; }
    100% { background-position: 0 -1px; }
}

.frequency-display {
    text-align: center;
}

.freq-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.3em;
    color: var(--slate);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.freq-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 80px;
    margin-bottom: 12px;
}

.freq-bar {
    width: 8px;
    height: var(--bar-height);
    background: var(--neon-green);
    border-radius: 2px;
    transition: height 0.5s ease, background-color 0.5s ease, opacity 0.5s ease;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.3);
}

.freq-bar.low {
    background: var(--hot-pink);
    box-shadow: 0 0 6px rgba(255, 0, 128, 0.3);
}

.freq-bar.dead {
    background: var(--slate);
    box-shadow: none;
    opacity: 0.3;
}

.freq-percentage {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--neon-green);
    transition: color 0.5s ease;
}

.freq-percentage.low {
    color: var(--hot-pink);
}

/* ============================================
   Arrival Section
   ============================================ */

.orbital-diagram {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.orbital-svg {
    width: 300px;
    height: 300px;
}

.orbit-ring {
    animation: orbitSpin 20s linear infinite;
    transform-origin: 200px 200px;
}

.orbit-ring-2 {
    animation-duration: 15s;
    animation-direction: reverse;
}

.orbit-ring-3 {
    animation-duration: 10s;
}

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

.planet-core {
    filter: drop-shadow(0 0 20px rgba(255, 0, 128, 0.6));
}

.planet-glow {
    animation: planetPulse 3s ease-in-out infinite;
}

@keyframes planetPulse {
    0%, 100% { r: 12; opacity: 1; }
    50% { r: 18; opacity: 0.3; }
}

.ship-dot {
    animation: shipOrbit 8s linear infinite;
    transform-origin: 200px 200px;
}

.ship-pulse {
    animation: shipOrbit 8s linear infinite, shipPulseAnim 1.5s ease-in-out infinite;
    transform-origin: 200px 200px;
}

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

@keyframes shipPulseAnim {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.arrival-data {
    border-left: 2px solid var(--hot-pink);
    padding-left: 24px;
}

.data-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(56, 75, 94, 0.3);
}

.data-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--slate);
    min-width: 120px;
    text-transform: uppercase;
}

.data-value {
    font-family: 'Libre Baskerville', serif;
    font-size: 14px;
    color: var(--light-grey);
    letter-spacing: 0.05em;
}

/* ============================================
   Settlement Section
   ============================================ */

.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.grid-cell {
    border: 1px solid var(--slate);
    padding: 32px;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    background: rgba(13, 27, 42, 0.5);
}

.grid-cell:hover {
    border-color: var(--neon-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

.cell-icon {
    margin-bottom: 16px;
}

.cell-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--slate);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cell-value {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--light-grey);
    letter-spacing: 0.05em;
}

/* ============================================
   Terminal Section
   ============================================ */

.transmission-terminal {
    background: rgba(13, 27, 42, 0.8);
    border: 1px solid var(--slate);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 64px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(56, 75, 94, 0.3);
    border-bottom: 1px solid var(--slate);
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.terminal-dot.red { background: #FF5F56; }
.terminal-dot.yellow { background: #FFBD2E; }
.terminal-dot.green { background: var(--neon-green); }

.terminal-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--slate);
    margin-left: 8px;
    text-transform: uppercase;
}

.terminal-body {
    padding: 24px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    line-height: 2;
}

.terminal-line {
    color: var(--slate);
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.terminal-line.revealed {
    opacity: 1;
    transform: translateX(0);
}

.terminal-line.highlight {
    color: var(--cyan);
}

.terminal-line.message {
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.terminal-cursor {
    color: var(--neon-green);
    animation: cursorBlink 1s step-end infinite;
    display: inline-block;
}

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

/* ============================================
   Mission Complete
   ============================================ */

.mission-complete {
    text-align: center;
    padding-top: 32px;
}

.complete-text {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 48px);
    letter-spacing: 0.15em;
    color: var(--neon-green);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.complete-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--slate);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.complete-year {
    font-family: 'Libre Baskerville', serif;
    font-size: 14px;
    color: var(--light-grey);
    opacity: 0.5;
    letter-spacing: 0.1em;
}

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

@media (max-width: 768px) {
    .mission-hud {
        padding: 12px 16px;
    }

    .hud-designation {
        font-size: 11px;
    }

    .hud-btn {
        padding: 4px 8px;
        font-size: 9px;
    }

    .voyage-section {
        padding: 60px 20px;
    }

    .telemetry-row {
        flex-direction: column;
        gap: 4px;
    }

    .void-stats {
        gap: 32px;
    }

    .grid-layout {
        grid-template-columns: 1fr;
    }

    .data-row {
        flex-direction: column;
        gap: 4px;
    }

    .orbital-svg {
        width: 220px;
        height: 220px;
    }

    .terminal-body {
        padding: 16px;
        font-size: 11px;
    }
}

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

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

    .void-stats {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
}

/* ============================================
   Hexagonal Grid Overlay
   ============================================ */

.hex-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.04;
}

/* ============================================
   Neon Breathe Animation
   ============================================ */

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

.neon-breathe {
    animation: neonBreathe 4s ease-in-out infinite;
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
