:root {
    --bg: #020202;
    --bg-soft: #0a0a0a;
    --white: #f4f4f4;
    --white-soft: rgba(244, 244, 244, 0.72);
    --line: rgba(244, 244, 244, 0.2);
    --line-soft: rgba(244, 244, 244, 0.08);
    --danger: #ff8b8b;
    --ok: #8bffbf;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--white);
    overflow-x: hidden;
}

body {
    font-family: "Sora", sans-serif;
    position: relative;
}

.background-grid,
.background-glow,
.scanline,
#signal-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.background-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 20%, transparent 70%);
    opacity: 0.45;
}

.background-glow {
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.13), transparent 45%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.08), transparent 40%);
    animation: pulse 8s ease-in-out infinite alternate;
}

.scanline {
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    height: 20%;
    transform: translateY(-120%);
    animation: scan 6s linear infinite;
    mix-blend-mode: screen;
}

#signal-canvas {
    opacity: 0.22;
}

.app-shell {
    position: relative;
    z-index: 3;
    min-height: 100vh;
    padding: clamp(1.2rem, 4vw, 2.5rem);
    display: grid;
    place-content: center;
    gap: clamp(1.5rem, 4vw, 3rem);
}

.hero {
    text-align: center;
}

.hero-tag {
    margin: 0;
    font-family: "Space Mono", monospace;
    letter-spacing: 0.35rem;
    font-size: clamp(0.55rem, 2vw, 0.72rem);
    color: var(--white-soft);
}

.hero-title {
    margin: clamp(0.5rem, 2vw, 1rem) 0;
    font-size: clamp(3rem, 18vw, 12rem);
    line-height: 0.95;
    letter-spacing: clamp(0.35rem, 1vw, 1.2rem);
    font-weight: 800;
    color: var(--white);
    position: relative;
    text-transform: uppercase;
    text-shadow:
        0 0 6px rgba(255, 255, 255, 0.9),
        0 0 35px rgba(255, 255, 255, 0.28);
    animation: flicker 3.2s infinite linear;
}

.hero-title::before,
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    opacity: 0.8;
    pointer-events: none;
}

.hero-title::before {
    transform: translate(2px, -2px);
    clip-path: polygon(0 0, 100% 0, 100% 38%, 0 42%);
    animation: glitch-a 1.8s infinite steps(2, end);
}

.hero-title::after {
    transform: translate(-2px, 2px);
    clip-path: polygon(0 60%, 100% 57%, 100% 100%, 0 100%);
    animation: glitch-b 1.3s infinite steps(2, end);
}

.hero-subtitle {
    margin: 0;
    color: var(--white-soft);
    font-size: clamp(0.88rem, 2vw, 1rem);
}

.investigation-panel {
    width: min(760px, 92vw);
    margin-inline: auto;
    background: linear-gradient(145deg, rgba(10, 10, 10, 0.92), rgba(5, 5, 5, 0.85));
    border: 1px solid var(--line-soft);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.5rem);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 20px 60px rgba(0, 0, 0, 0.45);
}

#osint-form {
    display: grid;
    gap: 0.85rem;
}

.field-row {
    display: grid;
    gap: 0.35rem;
}

.field-row label {
    font-size: 0.78rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    color: var(--white-soft);
}

input,
select,
button {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: rgba(7, 7, 7, 0.92);
    color: var(--white);
    font-family: "Space Mono", monospace;
    font-size: 0.92rem;
}

input,
select {
    padding: 0.75rem 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.09);
}

button {
    margin-top: 0.25rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.2s ease;
}

button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
    transform: translateX(-130%);
    transition: transform 0.4s ease;
}

button:hover::before {
    transform: translateX(130%);
}

button:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.7);
}

small {
    color: var(--white-soft);
    font-family: "Space Mono", monospace;
    font-size: 0.72rem;
}

code {
    font-family: "Space Mono", monospace;
}

.status {
    font-family: "Space Mono", monospace;
    font-size: 0.84rem;
    color: var(--white-soft);
    margin: 0.9rem 0;
}

.status.ok {
    color: var(--ok);
}

.status.error {
    color: var(--danger);
}

.result-shell {
    border: 1px solid var(--line-soft);
    background: rgba(3, 3, 3, 0.9);
    border-radius: 0.72rem;
    padding: 0.95rem;
    max-height: 340px;
    overflow: auto;
}

#result {
    margin: 0;
    font-family: "Space Mono", monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--white);
    white-space: pre-wrap;
    word-break: break-word;
}

.is-hidden {
    display: none;
}

@keyframes pulse {
    from {
        opacity: 0.55;
        transform: scale(1);
    }
    to {
        opacity: 0.82;
        transform: scale(1.02);
    }
}

@keyframes scan {
    to {
        transform: translateY(620%);
    }
}

@keyframes flicker {
    0%,
    16%,
    48%,
    100% {
        opacity: 1;
    }
    22%,
    56% {
        opacity: 0.84;
    }
    24% {
        opacity: 0.45;
    }
}

@keyframes glitch-a {
    0%,
    100% {
        transform: translate(1px, -1px);
    }
    33% {
        transform: translate(-1px, 1px);
    }
    66% {
        transform: translate(2px, 0);
    }
}

@keyframes glitch-b {
    0%,
    100% {
        transform: translate(-1px, 1px);
    }
    25% {
        transform: translate(2px, -1px);
    }
    55% {
        transform: translate(-2px, 0);
    }
}

@media (max-width: 700px) {
    .hero-title {
        letter-spacing: 0.22rem;
    }
}
