/* prototype.quest - Sci-Fi HUD Quest Terminal */

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

:root {
    --deep-space: #060818;
    --panel-surface: rgba(12, 16, 40, 0.85);
    --hud-cyan: #00E5FF;
    --hud-amber: #FFB300;
    --hud-green: #00E676;
    --hud-red: #FF1744;
    --ghost-white: #C8D0E0;
    --wireframe-blue: #2962FF;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-space);
    color: var(--ghost-white);
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Hexagonal grid background */
.hex-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            rgba(41, 98, 255, 0.03) 28px,
            rgba(41, 98, 255, 0.03) 29px
        ),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 28px,
            rgba(41, 98, 255, 0.03) 28px,
            rgba(41, 98, 255, 0.03) 29px
        ),
        repeating-linear-gradient(
            120deg,
            transparent,
            transparent 28px,
            rgba(41, 98, 255, 0.03) 28px,
            rgba(41, 98, 255, 0.03) 29px
        );
}

.hex-grid-bg.visible {
    opacity: 1;
}

/* Scanning line */
@keyframes scanLine {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Status dot pulse */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 6px currentColor; }
    50% { box-shadow: 0 0 12px currentColor, 0 0 20px currentColor; }
}

/* Wireframe rotation */
@keyframes rotateHex {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* Typewriter cursor blink */
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* =====================
   SECTION 1: MISSION BRIEFING
   ===================== */
.section-briefing {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    overflow: hidden;
    z-index: 1;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(0, 229, 255, 0.3);
    z-index: 10;
    animation: scanLine 4s linear infinite;
    pointer-events: none;
}

.wireframe-hex {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 340px;
    perspective: 800px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.wireframe-hex.visible {
    opacity: 0.4;
}

.hex-wireframe-svg {
    width: 100%;
    height: 100%;
    animation: rotateHex 30s linear infinite;
}

.briefing-header {
    z-index: 5;
    max-width: 600px;
}

.title-typewriter {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--hud-cyan);
    text-shadow: 0 0 8px var(--hud-cyan);
    min-height: 1.2em;
    position: relative;
}

.title-typewriter .cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--hud-cyan);
    margin-left: 4px;
    animation: cursorBlink 0.8s step-end infinite;
    vertical-align: text-bottom;
}

.mission-params {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.param-line {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--hud-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.param-line.visible {
    opacity: 1;
    transform: translateX(0);
}

/* =====================
   SECTION 2: QUEST LOG
   ===================== */
.section-questlog {
    position: relative;
    min-height: 250vh;
    padding: 80px 60px;
    display: flex;
    gap: 40px;
    z-index: 1;
}

.quest-entries {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.quest-entry {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.quest-entry.revealed {
    opacity: 1;
    transform: translateX(0);
}

.entry-panel {
    background: var(--panel-surface);
    padding: 28px 32px;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
    border: none;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05);
}

.entry-panel::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(41, 98, 255, 0.15));
    z-index: -1;
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s ease-in-out infinite;
}

.status-green {
    background: var(--hud-green);
    color: var(--hud-green);
    box-shadow: 0 0 6px var(--hud-green);
}

.status-amber {
    background: var(--hud-amber);
    color: var(--hud-amber);
    box-shadow: 0 0 6px var(--hud-amber);
}

.status-red {
    background: var(--hud-red);
    color: var(--hud-red);
    box-shadow: 0 0 6px var(--hud-red);
}

.entry-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--ghost-white);
    flex: 1;
}

.entry-id {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--hud-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.entry-desc {
    font-family: 'Exo 2', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.7;
    color: var(--ghost-white);
    margin-bottom: 16px;
}

.entry-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-coord,
.meta-status {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--hud-amber);
    letter-spacing: 0.05em;
}

/* Status panel sidebar */
.status-panel {
    flex: 0 0 35%;
    position: sticky;
    top: 80px;
    height: fit-content;
    background: var(--panel-surface);
    padding: 32px;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05);
}

.panel-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.15em;
    color: var(--hud-cyan);
    text-shadow: 0 0 8px var(--hud-cyan);
    margin-bottom: 24px;
    text-align: center;
}

.panel-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-label {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: var(--ghost-white);
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--hud-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.stat-green { color: var(--hud-green); text-shadow: 0 0 8px rgba(0, 230, 118, 0.5); }
.stat-amber { color: var(--hud-amber); text-shadow: 0 0 8px rgba(255, 179, 0, 0.5); }
.stat-red { color: var(--hud-red); text-shadow: 0 0 8px rgba(255, 23, 68, 0.5); }

.panel-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hud-cyan), transparent);
    opacity: 0.3;
    margin: 20px 0;
}

.panel-readout {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.readout-line {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--hud-cyan);
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* =====================
   SECTION 3: SCHEMATIC VIEW
   ===================== */
.section-schematic {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    z-index: 1;
}

.schematic-container {
    position: relative;
    width: 100%;
    max-width: 700px;
}

.schematic-svg {
    width: 100%;
    height: auto;
}

.sch-draw {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 0.8s ease;
}

.sch-draw.drawn {
    stroke-dashoffset: 0;
}

.sch-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sch-label {
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.sch-label.revealed {
    opacity: 1;
}

.label-text {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--hud-cyan);
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.4);
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.label-line {
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--hud-cyan);
    opacity: 0.5;
    vertical-align: middle;
    margin-right: 8px;
}

/* =====================
   SECTION 4: MISSION TERMINAL
   ===================== */
.section-terminal {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    z-index: 1;
}

.terminal-box {
    background: var(--panel-surface);
    padding: 40px;
    max-width: 700px;
    width: 100%;
    clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.05);
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 250px;
}

.term-line {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.8;
    min-height: 1.5em;
}

.term-line .typed {
    color: var(--hud-cyan);
    text-shadow: 0 0 6px rgba(0, 229, 255, 0.3);
}

.term-line .timestamp {
    color: var(--hud-amber);
}

.term-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--hud-cyan);
    animation: cursorBlink 0.8s step-end infinite;
    margin-top: 8px;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
    .section-questlog {
        flex-direction: column;
        padding: 60px 30px;
    }

    .quest-entries {
        flex: 1;
    }

    .status-panel {
        position: relative;
        top: 0;
        flex: 1;
        order: -1;
    }

    .section-briefing {
        padding: 40px;
    }
}

@media (max-width: 600px) {
    .entry-header {
        flex-wrap: wrap;
    }

    .entry-id {
        width: 100%;
    }
}
