:root {
    --bg-deep: #030816;
    --accent: #00f0ff;
    --accent-2: #2f6bff;
    --accent-rgb: 0, 240, 255;
    --accent-2-rgb: 47, 107, 255;
    --text-main: #edf6ff;
    --text-muted: #92adc9;
    --panel-bg: rgba(6, 15, 34, 0.64);
    --panel-border: rgba(var(--accent-rgb), 0.26);
    --font-display: 'Roboto', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.45) rgba(3, 8, 22, 0.8);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body.zen-mode {
    overflow: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

a:hover {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.75);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   FULLSCREEN 3D CANVAS & ATMOSPHERE
   ========================================================================== */

#webgl-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 0;
    cursor: crosshair;
}

body.zen-mode #webgl-canvas {
    cursor: grab;
}

body.zen-mode #webgl-canvas:active {
    cursor: grabbing;
}

.digital-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 50%, transparent 48%, rgba(2, 5, 14, 0.65) 100%),
        linear-gradient(180deg, rgba(2, 6, 18, 0.45) 0%, transparent 18%, transparent 82%, rgba(2, 6, 18, 0.65) 100%);
    transition: opacity 0.6s ease;
}

.digital-scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.16;
    background-image: repeating-linear-gradient(0deg,
            rgba(255, 255, 255, 0.03) 0px,
            rgba(255, 255, 255, 0.03) 1px,
            transparent 1px,
            transparent 4px);
}

body.zen-mode .digital-vignette {
    opacity: 0.35;
}

/* ==========================================================================
   PRELOADER
   ========================================================================== */

#preloader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at center, #07142b 0%, #02050f 100%);
    transition: opacity 0.65s ease, visibility 0.65s ease;
}

#preloader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    padding: 24px;
}

.preloader-ring {
    width: 96px;
    height: 96px;
}

.boot-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.7));
}

.boot-hex-outer {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-dasharray: 290;
    stroke-dashoffset: 290;
    animation: hexTrace 1.6s ease forwards infinite alternate;
    transform-origin: center;
}

.boot-hex-inner {
    fill: rgba(var(--accent-rgb), 0.08);
    stroke: var(--accent-2);
    stroke-width: 2;
    animation: spinSlow 4s linear infinite;
    transform-origin: center;
}

.boot-core {
    fill: #ffffff;
    animation: pulseCore 1.2s ease-in-out infinite alternate;
}

.preloader-brand {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.28em;
}

.preloader-brand span {
    color: var(--accent);
}

.preloader-sub {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.preloader-bar {
    width: 240px;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.preloader-bar span {
    display: block;
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    animation: loadSlide 1.1s ease-in-out infinite alternate;
}

/* ==========================================================================
   GLASSMORPHISM & HUD CORNERS
   ========================================================================== */

.glass-panel {
    position: relative;
    background: var(--panel-bg);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--panel-border);
    box-shadow:
        0 20px 55px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 28px rgba(var(--accent-rgb), 0.08);
    transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}

.tech-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.tech-corner.tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.tech-corner.br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

/* ==========================================================================
   FLOATING TOP HEADER BAR
   ========================================================================== */

.top-hud {
    position: fixed;
    top: 16px;
    left: 22px;
    right: 22px;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-radius: 14px;
    background: rgba(5, 12, 28, 0.62);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s ease, opacity 0.4s ease;
}

body.zen-mode .top-hud,
body.zen-mode .chapter-rail,
body.zen-mode .control-dock,
body.zen-mode #scroll-container,
body.zen-mode #scroll-container * {
    opacity: 0;
    pointer-events: none !important;
}

body.zen-mode .top-hud {
    transform: translateY(-28px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    flex-shrink: 0;
}

.brand-emblem {
    width: 38px;
    height: 38px;
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.55));
}

.emblem-hex {
    fill: rgba(var(--accent-rgb), 0.08);
    stroke: var(--accent);
    stroke-width: 1.8;
}

.emblem-cube-top {
    fill: var(--accent);
    opacity: 0.92;
}

.emblem-cube-left {
    fill: var(--accent-2);
    opacity: 0.85;
}

.emblem-cube-right {
    fill: #ffffff;
    opacity: 0.88;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.brand-name strong {
    color: var(--accent);
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.hud-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.nav-pill .nav-num {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.7;
}

.nav-pill:hover,
.nav-pill.is-active {
    color: #ffffff;
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.38);
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.16);
}

.nav-pill.is-active .nav-num {
    opacity: 1;
}

.hud-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.telemetry-wrap {
    position: relative;
}

.telemetry-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    transition: background 0.25s ease, border-color 0.25s ease;
}

.telemetry-pill:hover {
    background: rgba(var(--accent-rgb), 0.16);
    border-color: var(--accent);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10ff9c;
    box-shadow: 0 0 10px #10ff9c;
    animation: pulseBeacon 1.8s ease-in-out infinite;
}

.telemetry-ping {
    color: var(--accent);
    font-weight: 600;
}

.telemetry-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 295px;
    padding: 14px 16px;
    border-radius: 12px;
    z-index: 60;
}

.pop-header {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.pop-grid {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 6px 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.pop-grid dt {
    color: var(--text-muted);
}

.pop-grid dd {
    color: var(--text-main);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-switch {
    display: inline-flex;
    padding: 3px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lang-btn {
    padding: 4px 9px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.lang-btn.is-active {
    background: var(--accent);
    color: #020814;
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55);
}

/* ==========================================================================
   RIGHT-EDGE VERTICAL CHAPTER RAIL
   ========================================================================== */

.chapter-rail {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 12px 6px;
    transition: opacity 0.4s ease;
}

.rail-track {
    position: absolute;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: rgba(255, 255, 255, 0.12);
    z-index: 0;
}

.rail-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 10px var(--accent);
    transition: height 0.2s linear;
}

.rail-dot {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(5, 13, 30, 0.92);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    transition: all 0.25s ease;
}

.rail-code {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.rail-dot.is-active,
.rail-dot:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.2);
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.6);
    transform: scale(1.12);
}

.rail-dot.is-active .rail-code,
.rail-dot:hover .rail-code {
    color: #ffffff;
    font-weight: 600;
}

.rail-tip {
    position: absolute;
    right: 38px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(4, 12, 28, 0.92);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rail-dot:hover .rail-tip {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   BOTTOM-LEFT DIGITAL WALLPAPER & 3D DOCK
   ========================================================================== */

.control-dock {
    position: fixed;
    left: 22px;
    bottom: 20px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 9px 14px;
    border-radius: 14px;
    max-width: calc(100vw - 44px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.dock-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dock-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    white-space: nowrap;
}

.theme-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
}

.swatch-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.25s ease;
}

.swatch-orb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sw-1), var(--sw-2));
    box-shadow: 0 0 10px var(--sw-1);
}

.swatch-btn:hover,
.swatch-btn.is-active {
    border-color: var(--sw-1);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.22);
}

.dock-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.14);
}

.dock-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 500;
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    background: rgba(var(--accent-rgb), 0.07);
    transition: all 0.25s ease;
    white-space: nowrap;
}

.dock-btn:hover,
.dock-btn.is-active {
    background: rgba(var(--accent-rgb), 0.22);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.35);
}

.dock-btn-mono {
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.dock-btn-mono strong {
    color: var(--accent);
}

.dock-ico {
    width: 14px;
    height: 14px;
}

/* Soundtrack Controls & Equalizer */
.music-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.eq-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.eq-bars i {
    display: block;
    width: 2.5px;
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
    transition: height 0.2s ease;
}

.dock-btn.is-playing .eq-bars i {
    animation: eqBounce 0.72s ease-in-out infinite alternate;
}

.dock-btn.is-playing .eq-bars i:nth-child(2) { animation-delay: 0.14s; }
.dock-btn.is-playing .eq-bars i:nth-child(3) { animation-delay: 0.28s; }
.dock-btn.is-playing .eq-bars i:nth-child(4) { animation-delay: 0.08s; }
.dock-btn.is-playing .eq-bars i:nth-child(5) { animation-delay: 0.22s; }

.dock-btn.needs-gesture {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35);
    animation: pulseGlow 1.8s ease-in-out infinite;
}

.music-slider {
    width: 64px;
    height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.music-slider:hover {
    opacity: 1;
}

/* Floating YouTube Audio/Video Mini Card */
.yt-mini-card {
    position: fixed;
    right: 22px;
    bottom: 20px;
    z-index: 42;
    width: 264px;
    border-radius: 12px;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.yt-mini-card.is-minimized {
    opacity: 0.01;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
}

.yt-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
}

.yt-mini-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.yt-mini-close {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
}

.yt-mini-close:hover {
    color: #ffffff;
    background: rgba(var(--accent-rgb), 0.25);
}

.yt-frame-wrap {
    width: 240px;
    height: 135px;
    margin: 10px auto 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #02050f;
}

#yt-audio-player,
.yt-frame-wrap iframe {
    width: 240px;
    height: 135px;
    border: 0;
    display: block;
}

/* ==========================================================================
   ZEN / LIVE WALLPAPER OVERLAY
   ========================================================================== */

.zen-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px 30px;
}

.zen-overlay[hidden] {
    display: none;
}

.zen-watermark {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
}

.zen-brand {
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.88);
    text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.65);
}

.zen-coords {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--accent);
}

.zen-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.zen-hint {
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(3, 9, 22, 0.58);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-main);
}

.zen-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#btn-zen-music,
#btn-zen-exit {
    pointer-events: auto;
}

/* ==========================================================================
   STORY CHAPTERS & ASYMMETRIC HUD LAYOUT
   ========================================================================== */

#scroll-container {
    position: relative;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.chapter-section {
    position: relative;
    min-height: 100vh;
    padding: 104px 74px 96px 52px;
    display: flex;
    align-items: center;
}

.chapter-section.layout-left {
    justify-content: flex-start;
}

.chapter-section.layout-right {
    justify-content: flex-end;
}

.chapter-section.layout-bottom {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 84px;
}

.hud-card {
    pointer-events: auto;
    width: min(520px, 44vw);
    padding: 28px 30px;
    border-radius: 16px;
    opacity: 0;
    transform: translateY(28px) scale(0.985);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-section.is-visible .hud-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hero-card {
    width: min(560px, 46vw);
}

.kicker-badge,
.kicker-mono {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 12px;
}

.kicker-badge {
    padding: 5px 11px;
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.display-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.2vw, 3.05rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0.02em;
    margin-bottom: 14px;
    background: linear-gradient(125deg, #ffffff 25%, var(--accent) 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.25vw, 2.1rem);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 12px;
    color: #ffffff;
}

.lead-copy,
.section-copy {
    font-size: 0.94rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Hero KPIs */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.kpi-cell {
    padding: 11px 10px;
    border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kpi-val {
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.1;
}

.kpi-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.25;
}

/* Cyber Buttons */
.cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-cyber {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.28s ease;
}

.btn-primary-cyber {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #020814;
    box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.36);
}

.btn-primary-cyber:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 34px rgba(var(--accent-rgb), 0.68);
}

.btn-ghost-cyber {
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.38);
    color: #ffffff;
}

.btn-ghost-cyber:hover {
    background: rgba(var(--accent-rgb), 0.18);
    border-color: var(--accent);
}

.scroll-cue {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.55);
}

.scroll-line {
    width: 1px;
    height: 30px;
    background: linear-gradient(180deg, var(--accent), transparent);
    animation: scrollBob 1.7s ease-in-out infinite;
}

/* Feature Stack */
.feature-stack {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 18px;
}

.feature-stack li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.feature-stack li:hover {
    background: rgba(var(--accent-rgb), 0.07);
    border-color: rgba(var(--accent-rgb), 0.28);
}

.feat-index {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    padding-top: 2px;
}

.feature-stack h3 {
    font-family: var(--font-display);
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

.feature-stack p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Live Bars & Chips */
.live-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.bar-head {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    margin-bottom: 5px;
}

.bar-head span {
    color: var(--text-muted);
}

.bar-head strong {
    color: var(--accent);
}

.bar-track {
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.6);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tech-chip {
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
}

/* Threat Sim Row */
.interactive-sim-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.sim-counter {
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.sim-counter strong {
    font-size: 1.15rem;
    color: var(--accent);
}

/* Global Network Hub Selector */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.hub-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 13px;
    border-radius: 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.11);
    transition: all 0.25s ease;
}

.hub-btn span:not(.hub-dot) {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.hub-btn small {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
}

.hub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    margin-bottom: 2px;
}

.hub-dot.hq {
    background: #10ff9c;
    box-shadow: 0 0 12px #10ff9c;
}

.hub-btn:hover,
.hub-btn.is-active {
    background: rgba(var(--accent-rgb), 0.13);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2);
}

.sub-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Contact Overlook Card */
.contact-card {
    width: min(1040px, 88vw);
}

.contact-top {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 28px;
    margin-bottom: 22px;
    align-items: start;
}

.contact-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-item span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.detail-item strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
}

.portal-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.portal-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 15px;
    border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    transition: all 0.25s ease;
}

.portal-tile:hover {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.portal-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent);
}

.portal-tile h3 {
    font-family: var(--font-display);
    font-size: 0.96rem;
    color: #ffffff;
}

.portal-tile p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.footer-ver {
    color: var(--accent);
}

/* WebGL Fallback */
.webgl-fallback {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, #081838 0%, #030816 100%);
}

.webgl-fallback[hidden] {
    display: none;
}

.fallback-card {
    max-width: 480px;
    padding: 28px;
    border-radius: 14px;
    text-align: center;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes hexTrace {
    0% {
        stroke-dashoffset: 290;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseCore {
    from {
        r: 7;
        opacity: 0.7;
    }

    to {
        r: 12;
        opacity: 1;
    }
}

@keyframes loadSlide {
    from {
        transform: translateX(-15%);
    }

    to {
        transform: translateX(130%);
    }
}

@keyframes pulseBeacon {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.45);
        opacity: 0.65;
    }
}

@keyframes scrollBob {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    50% {
        transform: translateY(7px);
        opacity: 1;
    }
}

@keyframes eqBounce {
    0%   { height: 3px; }
    50%  { height: 12px; }
    100% { height: 6px; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.28); }
    50%      { box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.65); }
}

.btn-cyber.is-playing .eq-bars i {
    animation: eqBounce 0.72s ease-in-out infinite alternate;
}

.btn-cyber.is-playing .eq-bars i:nth-child(2) { animation-delay: 0.14s; }
.btn-cyber.is-playing .eq-bars i:nth-child(3) { animation-delay: 0.28s; }
.btn-cyber.is-playing .eq-bars i:nth-child(4) { animation-delay: 0.08s; }
.btn-cyber.is-playing .eq-bars i:nth-child(5) { animation-delay: 0.22s; }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1180px) {
    .hud-nav .nav-label {
        display: none;
    }

    .dock-label {
        display: none;
    }

    .swatch-name {
        display: none;
    }
}

@media (max-width: 960px) {
    .top-hud {
        left: 12px;
        right: 12px;
        top: 10px;
        padding: 8px 12px;
    }

    .hud-nav {
        display: none;
    }

    .chapter-rail {
        display: none;
    }

    .chapter-section,
    .chapter-section.layout-left,
    .chapter-section.layout-right,
    .chapter-section.layout-bottom {
        align-items: flex-end;
        justify-content: center;
        padding: 36vh 14px 92px 14px;
    }

    .hud-card,
    .hero-card,
    .contact-card {
        width: 100%;
        padding: 20px 18px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-top,
    .contact-details,
    .portal-cards,
    .hub-grid {
        grid-template-columns: 1fr;
    }

    .control-dock {
        left: 12px;
        right: 12px;
        bottom: 12px;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
    }

    .dock-controls {
        flex-wrap: wrap;
    }

    .music-slider {
        display: none;
    }

    .yt-mini-card {
        right: 12px;
        bottom: 72px;
    }

    .dock-divider {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}