/* ============================================
   gabs.boo - Surreal Aquatic HUD
   ============================================ */

:root {
    --abyss: #060D18;
    --trench: #0A1628;
    --sonar: #3D6E8E;
    --signal: #6FB4E2;
    --beacon: #A8E0FF;
    --foam: #B8D4E8;
    --surface: #E2EFF7;
    --phosphor: #4ADFB5;
    --drift-ease: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: var(--abyss);
    color: var(--foam);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.65;
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

/* --- Noise Texture Overlay --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.04;
    mix-blend-mode: screen;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- HUD Frame --- */
.hud-frame {
    position: fixed;
    inset: 24px;
    border: 1px solid rgba(74, 127, 165, 0.4);
    z-index: 50;
    pointer-events: none;
}

.corner-mark {
    position: absolute;
    width: 20px;
    height: 20px;
    animation: cornerPulse 4s ease-in-out infinite;
}

.corner-tl { top: -1px; left: -1px; border-top: 2px solid var(--signal); border-left: 2px solid var(--signal); }
.corner-tr { top: -1px; right: -1px; border-top: 2px solid var(--signal); border-right: 2px solid var(--signal); }
.corner-bl { bottom: -1px; left: -1px; border-bottom: 2px solid var(--signal); border-left: 2px solid var(--signal); }
.corner-br { bottom: -1px; right: -1px; border-bottom: 2px solid var(--signal); border-right: 2px solid var(--signal); }

@keyframes cornerPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.coord-label {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--signal);
    opacity: 0.2;
}

.coord-top-left { top: 28px; left: 8px; }
.coord-bottom-right { bottom: 8px; right: 8px; }

/* --- Sonar Register --- */
.sonar-register {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wave-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.sonar-content {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 0 48px;
}

.hud-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
    opacity: 0.7;
    display: block;
    margin-bottom: 16px;
}

.hero-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: var(--surface);
}

.hero-sub {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--foam);
    margin-top: 16px;
    opacity: 0.7;
}

/* --- Instrument Cluster --- */
.instrument-cluster {
    position: relative;
    padding: clamp(48px, 6vw, 80px) clamp(48px, 5vw, 120px);
    display: flex;
    gap: 32px;
    min-height: 100vh;
}

.scanlines-bg {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(61, 110, 142, 0.03) 3px,
        rgba(61, 110, 142, 0.03) 4px
    );
    pointer-events: none;
    z-index: 0;
}

.cluster-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    z-index: 5;
}

.cluster-right {
    margin-top: 15vh;
}

/* --- HUD Panels --- */
.hud-panel {
    background: rgba(10, 22, 40, 0.85);
    border: 1px solid rgba(61, 110, 142, 0.5);
    border-radius: 6px;
    overflow: hidden;
}

.panel-header {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid rgba(61, 110, 142, 0.2);
}

.panel-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.6rem, 0.9vw, 0.7rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--signal);
    opacity: 0.7;
}

.status-pips {
    display: flex;
    gap: 4px;
}

.pip {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--sonar);
    opacity: 0.2;
}

.pip.lit {
    background: var(--phosphor);
    opacity: 1;
    box-shadow: 0 0 6px var(--phosphor);
}

.panel-content {
    padding: 24px;
    position: relative;
}

.panel-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    letter-spacing: 0.02em;
    color: var(--surface);
    margin-bottom: 12px;
}

.panel-body {
    color: var(--foam);
    margin-bottom: 12px;
}

.panel-body.secondary {
    color: #7A9BB5;
    font-size: 0.9em;
}

.wave-divider {
    width: clamp(200px, 60%, 300px);
    height: 20px;
    margin: 8px 0 12px;
}

/* --- Skeleton Loading --- */
.skeleton-block {
    height: 100%;
    width: 100%;
    position: absolute;
    inset: 0;
    z-index: 10;
    opacity: 1;
    transition: opacity 500ms var(--drift-ease);
    background: var(--trench);
}

.skeleton-panel.revealed .skeleton-block {
    opacity: 0;
    pointer-events: none;
}

.skeleton-panel {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms var(--drift-ease), transform 800ms var(--drift-ease), border-color 400ms ease;
}

.skeleton-panel.revealed {
    opacity: 1;
    transform: translateY(0);
    border-color: rgba(61, 110, 142, 0.5);
}

.skeleton-shimmer {
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--trench) 25%, #1A2E45 50%, var(--trench) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}

.skeleton-line {
    height: 12px;
    border-radius: 3px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Ghost Panel --- */
.ghost-panel {
    opacity: 0.4;
}

.ghost-panel .panel-content {
    padding: 24px;
}

/* --- Crosshair --- */
.crosshair {
    position: absolute;
    width: 20px;
    height: 20px;
    z-index: 2;
    transform: translate(-50%, -50%);
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: var(--signal);
    opacity: 0.3;
}

.crosshair::before {
    width: 1px;
    height: 100%;
    left: 50%;
}

.crosshair::after {
    height: 1px;
    width: 100%;
    top: 50%;
}

/* --- Deep Field --- */
.deep-field {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(48px, 6vw, 80px);
}

.deep-panel {
    width: 100%;
    max-width: 900px;
    background: radial-gradient(ellipse at center, var(--trench), var(--abyss));
    border: 1px solid rgba(61, 110, 142, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.deep-content {
    padding: 48px;
    text-align: center;
}

.deep-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--foam);
    line-height: 1.6;
    margin-bottom: 32px;
}

.deep-domain {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--signal);
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hud-frame {
        inset: 12px;
    }

    .instrument-cluster {
        flex-direction: column;
        padding: 48px 36px;
    }

    .cluster-right {
        margin-top: 0;
    }

    .coord-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .hud-frame {
        inset: 8px;
    }

    .sonar-content {
        padding: 0 24px;
    }
}
