/* =============================================
   a6c.xyz — Spacecraft HUD / Signal Decoder
   Deep space cockpit interface
   ============================================= */

:root {
    --void: #050510;
    --deep-space: #0a0a1f;
    --signal-cyan: #00e5ff;
    --phosphor: #39ff85;
    --magenta: #ff2d7b;
    --starlight: #e0e8f0;
    --nebula: #7a8b9e;
    --ice-faint: #1a3a5c;

    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Share Tech Mono', monospace;
    --font-accent: 'Exo 2', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--void);
    color: var(--starlight);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* Orbital grid background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 50%, transparent 200px, transparent 201px),
        radial-gradient(circle at 50% 50%, var(--ice-faint) 200px, transparent 201px),
        radial-gradient(circle at 50% 50%, var(--ice-faint) 400px, transparent 401px),
        radial-gradient(circle at 50% 50%, var(--ice-faint) 600px, transparent 601px);
    background-size: 100% 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    animation: orbitalSpin 120s linear infinite;
}

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

/* --- Scanline Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 229, 255, 0.02) 2px,
        rgba(0, 229, 255, 0.02) 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* --- Particle Canvas --- */
#particleField {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* --- Viewport Frame --- */
.viewport-frame {
    position: fixed;
    inset: 2vw;
    border: 1px solid rgba(0, 229, 255, 0.12);
    pointer-events: none;
    z-index: 100;
}

.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    animation: bracketFadeIn 1.2s ease forwards;
    animation-delay: 0.5s;
}

@keyframes bracketFadeIn {
    to { opacity: 0.6; }
}

.corner-bracket.tl { top: -1px; left: -1px; }
.corner-bracket.tr { top: -1px; right: -1px; }
.corner-bracket.bl { bottom: -1px; left: -1px; }
.corner-bracket.br { bottom: -1px; right: -1px; }

/* --- Decode Strip --- */
.decode-strip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2rem;
    background: rgba(5, 5, 16, 0.9);
    overflow: hidden;
    z-index: 200;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 229, 255, 0.1);
}

.decode-ticker {
    font-family: var(--font-accent);
    font-size: 11px;
    font-weight: 400;
    color: var(--signal-cyan);
    letter-spacing: 0.15em;
    white-space: nowrap;
    animation: tickerScroll 25s linear infinite;
    opacity: 0.6;
}

@keyframes tickerScroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* --- Navigation Spine --- */
.nav-spine {
    position: fixed;
    left: 4vw;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 150;
}

.spine-line {
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--ice-faint);
}

.waypoint {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.waypoint-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid var(--ice-faint);
    background: var(--void);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.waypoint.active .waypoint-dot {
    border-color: var(--signal-cyan);
    background: var(--signal-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(0, 229, 255, 0.3); }
    50% { box-shadow: 0 0 12px rgba(0, 229, 255, 0.6); }
}

.waypoint-label {
    font-family: var(--font-accent);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--nebula);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.waypoint:hover .waypoint-label {
    opacity: 1;
    transform: translateX(0);
    color: var(--starlight);
}

.waypoint:hover .waypoint-dot {
    transform: scale(1.12);
    border-color: var(--signal-cyan);
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    position: relative;
    z-index: 5;
    padding: 6rem 8vw;
}

/* --- Signal Section (Hero) --- */
.signal-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.hero-module {
    text-align: center;
    position: relative;
    padding: 4rem;
}

.module-brackets {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mb { position: absolute; width: 20px; height: 20px; }
.mb.tl { top: 0; left: 0; }
.mb.tr { top: 0; right: 0; }
.mb.bl { bottom: 0; left: 0; }
.mb.br { bottom: 0; right: 0; }

.site-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--starlight);
}

.title-char {
    display: inline-block;
    opacity: 0;
    animation: typeIn 0.15s ease forwards;
}

.title-char:nth-child(1) { animation-delay: 0.8s; }
.title-char:nth-child(2) { animation-delay: 0.92s; }
.title-char:nth-child(3) { animation-delay: 1.04s; }
.title-char:nth-child(4) { animation-delay: 1.16s; }
.title-char:nth-child(5) { animation-delay: 1.28s; }
.title-char:nth-child(6) { animation-delay: 1.4s; }
.title-char:nth-child(7) { animation-delay: 1.52s; }

@keyframes typeIn {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.title-six {
    color: var(--magenta);
}

.tagline {
    font-family: var(--font-accent);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nebula);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 2s;
}

@keyframes fadeIn {
    to { opacity: 0.7; }
}

/* --- Signal Line Dividers --- */
.signal-divider {
    padding: 1rem 8vw;
    position: relative;
    z-index: 5;
}

.signal-divider svg {
    width: 100%;
    height: 20px;
    overflow: visible;
}

.divider-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 0.6s ease;
}

.signal-divider.visible .divider-line {
    stroke-dashoffset: 0;
}

/* --- Module Grid --- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hud-module {
    background: rgba(10, 10, 31, 0.85);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    padding: 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease;
}

.hud-module.visible {
    opacity: 1;
    transform: translateY(0);
}

.hud-module:hover {
    border-color: rgba(0, 229, 255, 0.5);
}

.module-identity { grid-column: span 7; }
.module-coords { grid-column: span 5; margin-top: 2rem; }
.module-wide { grid-column: span 8; }
.module-narrow { grid-column: span 4; }
.module-mid { grid-column: span 6; margin-top: 1rem; }

.module-header {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--signal-cyan);
    margin-bottom: 1.5rem;
}

.module-body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    color: var(--starlight);
    margin-bottom: 1rem;
}

.data-field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(26, 58, 92, 0.3);
}

.field-key {
    font-family: var(--font-accent);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nebula);
}

.field-val {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--starlight);
}

.mono-green {
    color: var(--phosphor);
}

.status-active {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--phosphor);
    display: inline-block;
    animation: dotPulse 2s ease-in-out infinite;
}

/* --- Terminal Footer --- */
.decode-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-footer {
    text-align: center;
    width: 100%;
    max-width: 800px;
}

.terminal-prompt {
    font-family: var(--font-body);
    font-size: 18px;
    color: var(--starlight);
    margin-bottom: 3rem;
}

.prompt-prefix {
    color: var(--signal-cyan);
}

.prompt-cursor {
    color: var(--magenta);
    animation: cursorBlink 1s step-end infinite;
}

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

.status-readouts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    border-top: 1px solid var(--ice-faint);
    padding-top: 2rem;
}

.readout {
    text-align: center;
}

.readout-label {
    font-family: var(--font-accent);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--nebula);
    display: block;
    margin-bottom: 0.5rem;
}

.readout-value {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--starlight);
    animation: pulseAttention 4s ease-in-out infinite;
}

@keyframes pulseAttention {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-spine { display: none; }
    .viewport-frame { inset: 1vw; }
    .section { padding: 4rem 4vw; }

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

    .module-identity,
    .module-coords,
    .module-wide,
    .module-narrow,
    .module-mid {
        grid-column: span 1;
        margin-top: 0;
    }

    .status-readouts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .site-title {
        letter-spacing: 0.15em;
    }
}
