/* ============================================
   continuum.quest - Styles
   HUD Overlay Sci-Fi Journey
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-space: #060610;
    --hud-green: #00ff88;
    --hud-amber: #ffaa00;
    --scan-blue: #00aaff;
    --grid: #1a1a30;
    --surface: #0d0d1a;
    --text: #c8d8e8;
    --dim: #4a5a6a;
    --scale: 0;
    --font-display: 'Saira', sans-serif;
    --font-body: 'Saira', sans-serif;
    --font-data: 'Saira Condensed', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-space);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Background Canvas --- */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- HUD Corner Brackets --- */
.corner-bracket {
    position: fixed;
    z-index: 1000;
    opacity: 0.7;
    pointer-events: none;
}

.corner-tl {
    top: 12px;
    left: 12px;
}

.corner-tr {
    top: 12px;
    right: 12px;
}

.corner-bl {
    bottom: 12px;
    left: 12px;
}

.corner-br {
    bottom: 12px;
    right: 12px;
}

/* --- Scale Indicator --- */
#scale-indicator {
    position: fixed;
    top: 20px;
    right: 60px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    pointer-events: none;
}

.scale-label {
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--dim);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.scale-value {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--hud-green);
    animation: blink-scale 3s ease-in-out infinite;
}

@keyframes blink-scale {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Mission Control Sidebar --- */
#mission-control {
    position: fixed;
    left: 0;
    top: 0;
    width: 200px;
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--grid);
    z-index: 900;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    gap: 20px;
    overflow: hidden;
}

.mission-header {
    font-family: var(--font-data);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--hud-amber);
    letter-spacing: 3px;
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--grid);
}

.mission-data {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.data-label {
    font-family: var(--font-data);
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.data-value {
    font-family: var(--font-data);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--scan-blue);
    transition: color 0.3s ease;
}

/* --- Minimap --- */
.minimap-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.minimap-label {
    font-family: var(--font-data);
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.minimap-track {
    position: relative;
    width: 4px;
    flex: 1;
    max-height: 60vh;
    background: var(--grid);
    border-radius: 2px;
    align-self: center;
}

.minimap-marker {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dim);
    border: 1px solid var(--grid);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.minimap-marker.active {
    background: var(--hud-amber);
    border-color: var(--hud-amber);
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
}

.minimap-indicator {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--hud-green);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.6);
    transition: top 0.1s linear;
    top: 0%;
    z-index: 2;
}

/* --- Main Content --- */
#main-content {
    margin-left: 200px;
    position: relative;
    z-index: 1;
}

/* --- Quest Sections --- */
.quest-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 40px;
}

.section-inner {
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

/* --- Hero / Reticle --- */
.reticle {
    width: clamp(250px, 40vw, 400px);
    height: clamp(250px, 40vw, 400px);
    animation: pulse 3s ease-in-out infinite;
}

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

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--hud-green);
    letter-spacing: 6px;
    text-transform: uppercase;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--dim);
    letter-spacing: 2px;
}

.scroll-cue {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: cue-pulse 2s ease-in-out infinite;
}

.scroll-cue span {
    font-family: var(--font-data);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--dim);
    letter-spacing: 3px;
}

@keyframes cue-pulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(4px); }
}

/* --- Section HUD Tags --- */
.section-hud-tag {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.hud-tag-scale {
    font-family: var(--font-data);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hud-amber);
    letter-spacing: 2px;
    white-space: nowrap;
}

.hud-tag-scale sup {
    font-size: 0.65em;
}

.hud-tag-line {
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, var(--hud-amber), transparent);
}

/* --- Section Titles --- */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--text);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.section-description {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text);
    line-height: 1.7;
    max-width: 580px;
    opacity: 0.85;
}

/* --- Data Panels --- */
.data-panel {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--grid);
    background: rgba(13, 13, 26, 0.7);
    margin-top: 12px;
}

.data-panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--grid);
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dim);
    letter-spacing: 1px;
}

.data-panel-row:last-child {
    border-bottom: none;
}

.data-highlight {
    color: var(--scan-blue);
    font-weight: 600;
}

/* --- Return to Origin --- */
.return-origin {
    margin-top: 30px;
}

.return-origin a {
    font-family: var(--font-data);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hud-green);
    letter-spacing: 3px;
    text-decoration: none;
    padding: 12px 24px;
    border: 1px solid var(--hud-green);
    transition: background 0.3s ease, color 0.3s ease;
    display: inline-block;
}

.return-origin a:hover {
    background: var(--hud-green);
    color: var(--deep-space);
}

/* --- Section Reveal Animations --- */
.quest-section .section-inner {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* First section visible by default */
#section-origin .section-inner {
    opacity: 1;
    transform: translateY(0);
}

/* --- Scan Line Effect --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--hud-green), transparent);
    opacity: 0.15;
    z-index: 999;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { top: -2px; }
    100% { top: 100vh; }
}

/* --- Grid Overlay (subtle) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 200px;
    width: calc(100% - 200px);
    height: 100%;
    background-image:
        linear-gradient(rgba(26, 26, 48, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 26, 48, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #mission-control {
        display: none;
    }

    #main-content {
        margin-left: 0;
    }

    body::before {
        left: 0;
        width: 100%;
    }

    .quest-section {
        padding: 40px 20px;
    }

    .section-inner {
        max-width: 100%;
    }

    #scale-indicator {
        right: 50px;
    }
}

@media (max-width: 480px) {
    .reticle {
        width: 220px;
        height: 220px;
    }

    .hero-title {
        font-size: 1.3rem;
        letter-spacing: 3px;
    }

    .section-title {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
}
