/* ============================
   OCTANE MOUNTAIN — STYLE
   Color Palette:
     Dark:  #0a0908
     Gold:  #c4b49a
     Dim:   #5a5347
     Light: #e4d9c8
   ============================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --c-dark: #0a0908;
    --c-dark-mid: #141210;
    --c-gold: #c4b49a;
    --c-gold-dim: #5a5347;
    --c-gold-light: #e4d9c8;
    --c-red: #c0392b;
    --c-green: #27ae60;
    --font-body: 'Inter', sans-serif;
    --font-display: 'Orbitron', sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--c-dark);
    color: var(--c-gold);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--c-gold);
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-family: inherit;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--c-gold);
    color: var(--c-dark);
    padding: 8px 16px;
    z-index: 10000;
    font-size: 14px;
}

.skip-link:focus {
    top: 0;
}

/* ============================
   LOADING SCREEN
   ============================ */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: var(--c-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border: 2px solid var(--c-gold-dim);
    border-top-color: var(--c-gold);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 6px;
    color: var(--c-gold-dim);
    margin-bottom: 16px;
}

.loader-bar-container {
    width: 200px;
    height: 2px;
    background: var(--c-gold-dim);
    border-radius: 1px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: var(--c-gold);
    transition: width 0.3s ease;
}

/* ============================
   INTRO / OPENING SEQUENCE
   ============================ */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: var(--c-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s ease, visibility 1.2s ease;
}

#intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    margin-bottom: 48px;
}

.intro-line {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.5vw, 24px);
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--c-gold-dim);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    margin-bottom: 8px;
}

.intro-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.intro-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 6vw, 72px);
    font-weight: 900;
    letter-spacing: 12px;
    color: var(--c-gold);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.5s ease, transform 1.5s ease;
    margin-top: 24px;
    text-shadow: 0 0 40px rgba(196, 180, 154, 0.3), 0 0 80px rgba(196, 180, 154, 0.1);
}

.intro-title.visible {
    opacity: 1;
    transform: scale(1);
}

#intro-enter-btn {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#intro-enter-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

#intro-skip-btn {
    position: absolute;
    bottom: 32px;
    right: 32px;
    font-size: 12px;
    letter-spacing: 3px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#intro-skip-btn.visible {
    opacity: 0.5;
}

#intro-skip-btn:hover {
    opacity: 1;
}

/* ============================
   BUTTONS
   ============================ */
.btn-gold {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 4px;
    padding: 14px 40px;
    border: 1px solid var(--c-gold);
    color: var(--c-gold);
    background: transparent;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.btn-gold:hover {
    background: var(--c-gold);
    color: var(--c-dark);
    box-shadow: 0 0 30px rgba(196, 180, 154, 0.3);
}

.btn-full {
    width: 100%;
}

.btn-ghost {
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--c-gold-dim);
    background: transparent;
    border: none;
    padding: 8px 16px;
    transition: color 0.3s;
}

.btn-ghost:hover {
    color: var(--c-gold);
}

.btn-close {
    font-size: 28px;
    line-height: 1;
    color: var(--c-gold-dim);
    transition: color 0.3s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--c-gold);
}

/* ============================
   NAVIGATION HINT MODAL
   ============================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 7000;
    background: rgba(10, 9, 8, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-panel {
    background: rgba(20, 18, 16, 0.95);
    border: 1px solid rgba(196, 180, 154, 0.15);
    border-radius: 2px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 6px;
    color: var(--c-gold);
}

.modal-body {
    margin-bottom: 28px;
}

.hint-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(196, 180, 154, 0.08);
}

.hint-row:last-child {
    border-bottom: none;
}

.hint-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.hint-text h3 {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--c-gold);
    margin-bottom: 4px;
}

.hint-text p {
    font-size: 13px;
    color: var(--c-gold-dim);
    line-height: 1.5;
}

/* ============================
   CAMERA FEED PANEL
   ============================ */
.feed-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6000;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    background: rgba(10, 9, 8, 0.95);
    border: 1px solid rgba(196, 180, 154, 0.2);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: panelIn 0.5s ease;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(196, 180, 154, 0.1);
}

.feed-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-red);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

#feed-label {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--c-gold-dim);
}

.feed-content {
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.feed-content img,
.feed-content canvas {
    max-width: 100%;
    border-radius: 2px;
}

/* Scanline overlay for camera feeds */
.feed-content::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(196, 180, 154, 0.02) 2px,
            rgba(196, 180, 154, 0.02) 4px);
    pointer-events: none;
}

.feed-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(196, 180, 154, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feed-static-line {
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, var(--c-gold-dim), transparent);
}

.feed-timestamp {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--c-gold-dim);
}

/* Feed content specific */
.feed-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--c-dark-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(196, 180, 154, 0.1);
}

.feed-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-description {
    margin-top: 16px;
    text-align: center;
}

.feed-description h3 {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--c-gold);
    margin-bottom: 8px;
}

.feed-description p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--c-gold-dim);
}

/* ============================
   MAIN CANVAS
   ============================ */
#main-content {
    position: fixed;
    inset: 0;
    z-index: 1;
}

#scene-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ============================
   HUD OVERLAY
   ============================ */
#hud {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#hud.visible {
    opacity: 1;
}

.hud-top-left {
    position: absolute;
    top: 24px;
    left: 28px;
}

.hud-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 6px;
    line-height: 1.6;
    color: var(--c-gold);
    text-shadow: 0 0 20px rgba(196, 180, 154, 0.2);
}

.hud-top-right {
    position: absolute;
    top: 24px;
    right: 28px;
    display: flex;
    gap: 12px;
}

.hud-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(196, 180, 154, 0.2);
    border-radius: 2px;
    pointer-events: auto;
    transition: border-color 0.3s, background 0.3s;
}

.hud-btn:hover {
    border-color: var(--c-gold);
    background: rgba(196, 180, 154, 0.05);
}

.hud-bottom-center {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.hud-coords {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--c-gold-dim);
    white-space: nowrap;
}

.coord-label {
    color: var(--c-gold);
    margin-right: 4px;
}

.coord-sep {
    margin: 0 12px;
    opacity: 0.3;
}

.coord-unit {
    font-size: 8px;
    opacity: 0.5;
}

.hud-bottom-right {
    position: absolute;
    bottom: 24px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hud-signal {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.signal-bar {
    width: 3px;
    background: var(--c-gold);
    border-radius: 1px;
    animation: signal-pulse 2s ease-in-out infinite;
}

.sb1 {
    height: 4px;
    animation-delay: 0s;
}

.sb2 {
    height: 8px;
    animation-delay: 0.2s;
}

.sb3 {
    height: 12px;
    animation-delay: 0.4s;
}

.sb4 {
    height: 16px;
    animation-delay: 0.6s;
}

@keyframes signal-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.hud-status {
    font-family: var(--font-display);
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--c-green);
}

/* ============================
   VIGNETTE / POST OVERLAYS
   ============================ */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(10, 9, 8, 0.6) 100%);
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 51;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* ============================
   CUSTOM CURSOR
   ============================ */
.cursor-pointer {
    cursor: pointer;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .hud-title {
        font-size: 11px;
        letter-spacing: 4px;
    }

    .hud-bottom-center {
        display: none;
    }

    .hud-bottom-right {
        display: none;
    }

    .modal-panel {
        padding: 24px;
    }

    .feed-panel {
        max-width: 95%;
        max-height: 85vh;
    }

    #intro-skip-btn {
        bottom: 20px;
        right: 20px;
    }

    .intro-title {
        letter-spacing: 6px !important;
    }
}

@media (max-width: 480px) {
    .hud-top-left {
        top: 16px;
        left: 16px;
    }

    .hud-top-right {
        top: 16px;
        right: 16px;
    }

    .hud-btn {
        width: 36px;
        height: 36px;
    }
}

/* ============================
   SCROLLBAR (for panels)
   ============================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--c-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--c-gold-dim);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--c-gold);
}