/* ==========================================================================
   darkweb.cloud — Palantir-inspired dark theme
   ========================================================================== */

/* --- Design tokens --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --accent: #00d4ff;
    --accent-dim: #0088aa;
    --accent-glow: rgba(0, 212, 255, 0.15);
    --text-primary: #e0e6ed;
    --text-secondary: #6b7a8d;
    --grid-color: rgba(0, 212, 255, 0.03);
    --border-color: rgba(0, 212, 255, 0.1);
}

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

body {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* --- Ambient background layers --- */

/* Subtle grid overlay */
.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* CRT-style scanline texture */
.scanline {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 100;
}

/* Floating particle container (particles injected by JS) */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: float-up linear infinite;
}

/* --- Main content --- */

.container {
    text-align: center;
    z-index: 10;
    position: relative;
}

/* --- Logo: concentric spinning rings + hex icon --- */

.logo-ring {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 3rem;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.ring-outer {
    inset: 0;
    animation: spin 20s linear infinite;
    border-style: dashed;
}

.ring-middle {
    inset: 20px;
    animation: spin 15s linear infinite reverse;
    border-color: var(--accent-dim);
}

.ring-inner {
    inset: 40px;
    animation: spin 10s linear infinite;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow), inset 0 0 20px var(--accent-glow);
}

.logo-core {
    position: absolute;
    inset: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-icon {
    width: 70px;
    height: 70px;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent));
    animation: pulse-glow 3s ease-in-out infinite;
}

/* --- Title with glitch effect --- */

h1.glitch {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    color: var(--text-primary);
    position: relative;
    margin-bottom: 0.5rem;
}

h1.glitch::before,
h1.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Cyan glitch layer (top half) */
h1.glitch::before {
    color: var(--accent);
    animation: glitch-1 4s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-2px);
    opacity: 0.8;
}

/* Magenta glitch layer (bottom half) */
h1.glitch::after {
    color: #ff0066;
    animation: glitch-2 3s infinite linear alternate-reverse;
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    transform: translate(2px);
    opacity: 0.8;
}

/* --- Tagline --- */

.tagline {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    margin-bottom: 0;
    opacity: 0;
    animation: fade-in 1s 0.5s forwards;
}

/* --- Status bar with beacon --- */

.status-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: rgba(0, 212, 255, 0.02);
    margin-top: 3rem;
    opacity: 0;
    animation: fade-in 1s 1s forwards;
}

/* Steady glowing dot */
.beacon {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.status-text {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--accent);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; filter: drop-shadow(0 0 10px var(--accent)); }
    50%      { opacity: 0.7; filter: drop-shadow(0 0 20px var(--accent)); }
}

@keyframes glitch-1 {
    0%, 95%  { transform: translate(0); }
    96%      { transform: translate(-3px, 1px); }
    97%      { transform: translate(2px, -1px); }
    98%      { transform: translate(-1px, 2px); }
    99%      { transform: translate(1px, -1px); }
    100%     { transform: translate(0); }
}

@keyframes glitch-2 {
    0%, 93%  { transform: translate(0); }
    94%      { transform: translate(2px, 1px); }
    95%      { transform: translate(-3px, -1px); }
    96%      { transform: translate(1px, 2px); }
    97%      { transform: translate(-2px, -1px); }
    100%     { transform: translate(0); }
}

@keyframes fade-in {
    to { opacity: 1; }
}

@keyframes float-up {
    0%   { transform: translateY(100vh) translateX(0);    opacity: 0;   }
    10%  {                                                 opacity: 0.6; }
    90%  {                                                 opacity: 0.6; }
    100% { transform: translateY(-10vh) translateX(20px); opacity: 0;   }
}
