/*
 * NGINX SECURE NODE - OUT OF BOUNDS DORMANT GATEWAY
 * Pixel-perfect reproduction of the reference image visual system.
 * Deep charcoal slate base, volumetric haze, dual orbital rings, fixed star nodes.
 */

:root {
    /* Color Palette */
    --bg-dark: #050608;
    --text-primary: #cbd2db;
    --text-muted: #6b7380;
    --text-dim: #262a31;
    
    /* Perfect tactical amber from reference image */
    --accent-amber: #d18c4b;
    --accent-amber-dim: rgba(209, 140, 75, 0.07);
    
    /* Lines & Frames */
    --line-faint: rgba(255, 255, 255, 0.015);
    --line-subtle: rgba(255, 255, 255, 0.035);
    --line-accent: rgba(209, 140, 75, 0.18);
    
    /* Typography */
    --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Cinematic Transitions */
    --transition-cinematic: 0.9s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow: hidden;
    position: relative;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* 1. Cinematic Background Volumetric Haze & Nebulae */
.volumetric-haze {
    position: fixed;
    left: -10%;
    bottom: -20%;
    width: 120%;
    height: 65%;
    background: 
        radial-gradient(ellipse at 20% 90%, rgba(209, 140, 75, 0.016) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 90%, rgba(255, 255, 255, 0.006) 0%, transparent 50%);
    pointer-events: none;
    z-index: 2;
    filter: blur(25px);
    animation: haze-drift 24s infinite ease-in-out alternate;
}

@keyframes haze-drift {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-12px) scale(1.05); }
}

/* Grid Overlay */
.cinematic-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, var(--line-faint) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line-faint) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: center center;
    pointer-events: none;
    z-index: 1;
    opacity: 0.8;
}

/* Layered Screen Vignette */
.screen-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 50% 50%, 
        rgba(5, 6, 8, 0) 20%, 
        rgba(3, 4, 5, 0.96) 100%
    );
    pointer-events: none;
    z-index: 3;
}

/* Film Grain Noise */
.viewport-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 4;
}

/* Subtle CRT scanline filter */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(255, 255, 255, 0) 50%, 
        rgba(0, 0, 0, 0.14) 50%
    );
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 5;
    opacity: 0.2;
}

/* 2. Soft Drifting Particles/Stars */
.particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 6;
}

.drifting-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: var(--accent-amber);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.particle-1 { left: 22%; bottom: -5%; animation: particle-drift 20s infinite linear; }
.particle-2 { left: 48%; bottom: -5%; animation: particle-drift 26s infinite linear; animation-delay: 4s; width: 3px; height: 3px; }
.particle-3 { left: 74%; bottom: -5%; animation: particle-drift 24s infinite linear; animation-delay: 10s; }
.particle-4 { left: 90%; bottom: -5%; animation: particle-drift 30s infinite linear; animation-delay: 1s; }

@keyframes particle-drift {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    12% { opacity: 0.3; }
    55% { transform: translateY(-50vh) translateX(35px) scale(1.15); opacity: 0.18; }
    100% { transform: translateY(-110vh) translateX(-15px) scale(0.85); opacity: 0; }
}

/* 3. Outer HUD Framework Layout */
.viewport-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 3rem 4rem;
    z-index: 10;
    justify-content: space-between;
}

/* Corner HUD Brackets */
.hud-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 0.5px solid transparent;
    pointer-events: none;
}

.bracket-tl { top: 2rem; left: 2rem; border-top-color: var(--line-accent); border-left-color: var(--line-accent); }
.bracket-tr { top: 2rem; right: 2rem; border-top-color: var(--line-accent); border-right-color: var(--line-accent); }
.bracket-bl { bottom: 2rem; left: 2rem; border-bottom-color: var(--line-accent); border-left-color: var(--line-accent); }
.bracket-br { bottom: 2rem; right: 2rem; border-bottom-color: var(--line-accent); border-right-color: var(--line-accent); }

/* Top HUD Banner */
.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 0.5px solid var(--line-subtle);
    padding-bottom: 1.5rem;
    font-family: var(--font-mono);
}

.hud-top-left {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.hud-square {
    width: 10px;
    height: 10px;
    border: 0.5px solid var(--text-primary);
    opacity: 0.8;
    margin-top: 2px;
}

.hud-text-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hud-title {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--text-primary);
}

.hud-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.hud-tag {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

/* Asymmetric rotators along viewport edges (Exact spacing matching reference image) */
.hud-sidebar-left, .hud-sidebar-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: var(--text-dim);
    pointer-events: none;
    z-index: 12;
}

.hud-sidebar-left {
    left: 2.25rem;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
}

.hud-sidebar-right {
    right: 1.5rem;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
}

.rotated-label {
    display: inline-block;
}

/* 4. Center Concentric HUD Geometry Circle & Focus Elements */
.viewport-body {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.central-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 580px;
    height: 580px;
}

/* Circular Orbit Lines (Reference Image) */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 0.5px solid var(--line-subtle);
    pointer-events: none;
}

.ring-outer {
    width: 580px;
    height: 580px;
    border-color: rgba(255, 255, 255, 0.015);
    animation: orbit-rotate-cw 90s infinite linear;
}

.ring-inner {
    width: 520px;
    height: 520px;
    border-color: rgba(255, 255, 255, 0.025);
    border-style: dashed;
    animation: orbit-rotate-ccw 110s infinite linear;
}

@keyframes orbit-rotate-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orbit-rotate-ccw {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* Fixed compass nodes exactly along the circular perimeter (Reference Image layout) */
.star-node {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    z-index: 15;
    pointer-events: none;
}

.node-top {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    opacity: 0.7;
}

.node-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background-color: var(--accent-amber);
    opacity: 0.8;
}

.node-bottom {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    opacity: 0.7;
}

.node-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background-color: var(--accent-amber);
    opacity: 0.8;
}

/* Content Container Card */
.cinematic-box {
    text-align: center;
    max-width: 480px;
    z-index: 20;
    position: relative;
}

/* Aemeath Astrolabe Constellation Star (Wuthering Waves Character tribute) */
.aemeath-astrolabe-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
}

.aemeath-astrolabe {
    width: 100%;
    height: 100%;
    display: block;
}

/* Intersecting Orbit Rings rotate gracefully in opposite directions */
.aemeath-astrolabe ellipse {
    transform-origin: 50% 50%;
}

.aemeath-astrolabe ellipse:nth-of-type(1) {
    animation: astrolabe-orbit 28s infinite linear;
}
.aemeath-astrolabe ellipse:nth-of-type(2) {
    animation: astrolabe-orbit-reverse 24s infinite linear;
}
.aemeath-astrolabe ellipse:nth-of-type(3) {
    animation: astrolabe-orbit 20s infinite linear;
}

@keyframes astrolabe-orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes astrolabe-orbit-reverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

/* Aemeath core 8-pointed star breathing animation */
.aemeath-astrolabe path {
    transform-origin: 50% 50%;
    animation: aemeath-star-breathe 4s infinite ease-in-out;
}

.aemeath-astrolabe path:nth-of-type(2) {
    animation: aemeath-star-breathe-rotated 4s infinite ease-in-out;
    animation-delay: 2s;
}

@keyframes aemeath-star-breathe {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 3px rgba(209, 140, 75, 0.4)); opacity: 0.8; }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(209, 140, 75, 0.7)); opacity: 1; }
}

@keyframes aemeath-star-breathe-rotated {
    0%, 100% { transform: rotate(45deg) scale(0.95); filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3)); opacity: 0.8; }
    50% { transform: rotate(45deg) scale(1.05); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)); opacity: 1; }
}

.aemeath-glow-halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(209, 140, 75, 0.08) 0%, transparent 75%);
    pointer-events: none;
}

/* Dark Eclipse Moon (Wuthering Waves Resonance Theme) */
.dark-eclipse-moon {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background-color: var(--bg-dark);
    z-index: 3; /* Placed in front of grid, but behind foreground container */
    box-shadow: 
        0 0 65px 4px rgba(209, 140, 75, 0.035), /* Faint Amber Corona Glow */
        inset 0 0 45px rgba(0, 0, 0, 0.96);      /* Dark Inner Sphere Depth Shadow */
    border: 0.5px solid rgba(255, 255, 255, 0.015);
    pointer-events: none;
    transition: transform 0.1s ease-out; /* Super smooth parallax transition */
}

.moon-inner-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, transparent 35%, rgba(0, 0, 0, 0.85) 80%);
    pointer-events: none;
}

/* Twinkling Stars (Hardware Accelerated, GPU thread, extremely lightweight) */
.shimmering-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1; /* Sits in background behind the dark moon */
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 50%;
    opacity: 0;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    animation: star-twinkle 6s infinite ease-in-out;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.05; transform: translate3d(0, 0, 0) scale(0.9); }
    50% { opacity: 0.5; transform: translate3d(0, 0, 0) scale(1.15); }
}

.star-1 { top: 15%; left: 12%; animation-delay: 0s; }
.star-2 { top: 25%; left: 80%; animation-delay: 1.5s; width: 3px; height: 3px; }
.star-3 { top: 70%; left: 20%; animation-delay: 3.8s; }
.star-4 { top: 82%; left: 78%; animation-delay: 5.2s; }
.star-5 { top: 40%; left: 88%; animation-delay: 0.9s; }
.star-6 { top: 12%; left: 60%; animation-delay: 2.4s; width: 3px; height: 3px; }
.star-7 { top: 62%; left: 9%; animation-delay: 3.1s; }
.star-8 { top: 86%; left: 38%; animation-delay: 4.7s; }
.star-9 { top: 34%; left: 32%; animation-delay: 1.8s; }
.star-10 { top: 52%; left: 74%; animation-delay: 5.9s; }

/* Category indicator */
.category-header {
    margin-bottom: 2rem;
}

.category-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    color: var(--accent-amber);
    font-weight: 500;
}

/* Primary Poetic Scenario Text */
.dialogue-container {
    margin-bottom: 3.5rem;
}

.dialogue-title {
    font-size: 2.25rem;
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.02);
    animation: text-load 1.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.amber-highlight {
    color: var(--accent-amber);
    font-weight: 400;
}

.dialogue-desc {
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.8;
    letter-spacing: 0.02em;
    animation: text-load 2.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes text-load {
    from { opacity: 0; transform: translateY(6px); filter: blur(0.5px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* Flat bracketed link button (Leave Anytime) */
.interaction-zone {
    display: flex;
    justify-content: center;
}

.leave-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-normal);
}

.bracket {
    color: var(--text-dim);
    transition: transform var(--transition-normal), color var(--transition-normal);
}

.leave-btn:hover {
    color: var(--accent-amber);
}

.leave-btn:hover .bracket {
    color: var(--accent-amber);
}

.leave-btn:hover .bracket-l { transform: translateX(-4px); }
.leave-btn:hover .bracket-r { transform: translateX(4px); }

/* Left aligned decorative dot grid */
.hud-dot-grid {
    position: absolute;
    left: 8.5rem;
    bottom: 8rem;
    width: 48px;
    height: 24px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 6px 6px;
    pointer-events: none;
    opacity: 0.6;
}

/* Right aligned decorative big N logo block */
.hud-brand-monogram {
    position: absolute;
    right: 8.5rem;
    bottom: 7.5rem;
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    pointer-events: none;
}

.brand-letter {
    font-size: 1.75rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.12);
    font-family: var(--font-sans);
}

.brand-dots {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
}

.b-dot {
    width: 2px;
    height: 2px;
    background-color: var(--accent-amber);
    opacity: 0.25;
}

/* Cinematic Footer */
.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 0.5px solid var(--line-subtle);
    padding-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

.hud-footer-left, .hud-footer-right {
    font-weight: 400;
}

.hud-footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

/* Calibration scale lines (Bottom Center) */
.hud-calibration-bar {
    width: 140px;
    height: 2px;
    background-color: var(--line-subtle);
    position: relative;
}

.calibration-ticks {
    position: absolute;
    top: 0;
    left: 30%;
    width: 40%;
    height: 100%;
    background-color: var(--accent-amber);
    opacity: 0.5;
}

/* Adaptive viewport controls */
@media (max-width: 1024px) {
    .ring-outer, .ring-inner { display: none; }
    .star-node { display: none; }
    .hud-sidebar-left, .hud-sidebar-right { display: none; }
    .hud-dot-grid, .hud-brand-monogram { display: none; }
    .resonance-micro-graph { display: none; }
    
    .viewport-container {
        padding: 2.5rem 2rem;
    }
    
    .dialogue-title {
        font-size: 1.85rem;
    }
    
    .dialogue-desc {
        font-size: 0.85rem;
    }
}

/* Top Left Resonance Micro Graph Widget (Wuthering Waves style) */
.resonance-micro-graph {
    width: 60px;
    height: 30px;
    display: flex;
    align-items: center;
    border-right: 0.5px solid var(--line-subtle);
    padding-right: 0.75rem;
    margin-right: 0.75rem;
}

.micro-wave-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.micro-wave-svg path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: micro-wave-draw 8s infinite linear;
}

@keyframes micro-wave-draw {
    0% { stroke-dashoffset: 240; }
    100% { stroke-dashoffset: 0; }
}

/* Constellations astrolabe overlay (highly optimized vector container) */
.constellations-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Positioned in front of the base background, behind the eclipse moon */
    transition: transform 0.1s ease-out; /* Sub-pixel parallax lag smoothness */
}

.constellation-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Custom individual star node twinkles */
.c-star {
    transform-origin: center;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

.pulse-slow {
    animation: c-star-pulse 7s infinite ease-in-out;
}

.pulse-mid {
    animation: c-star-pulse 4.5s infinite ease-in-out;
    animation-delay: 1.8s;
}

.pulse-fast {
    animation: c-star-pulse 3s infinite ease-in-out;
    animation-delay: 0.8s;
}

@keyframes c-star-pulse {
    0%, 100% {
        opacity: 0.15;
        transform: scale(0.9) translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.15) translate3d(0, 0, 0);
    }
}

