/* Phantom Noir — shared styles for all pages */

:root {
    --black: #0a0a0a;
    --dark-gray: #1a1a1a;
    --charcoal: #2a2a2a;
    --blood: #5a0a1a;
    --neon-blue: #00f0ff;
    --text-light: #e0e0e0;
    --grain-opacity: 0.15;
}

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

/* Reserve the scrollbar gutter so locking scroll for modals doesn't shift layout */
html {
    scrollbar-gutter: stable;
}

body {
    font-family: 'Cinzel', serif;
    background-color: var(--black);
    color: var(--text-light);
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Film grain overlay */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: var(--grain-opacity);
    pointer-events: none;
    z-index: 10;
}

/* Parallax background — the initial transform matches what script.js writes,
   so the first mousemove doesn't make the background jump */
.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 20% 30%, rgba(0, 240, 255, 0.03) 0%, transparent 40%),
            radial-gradient(circle at 80% 70%, rgba(90, 10, 26, 0.1) 0%, transparent 50%),
            linear-gradient(to bottom, var(--black), var(--dark-gray));
    z-index: 0;
    transform: translate(0, 0) scale(1.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    padding: 0.8rem 2rem;
    font-family: 'Special Elite', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.btn:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 3px;
}

/* Content is hidden for fade-in only when JS is available;
   without JS everything stays visible */
.js .fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Dossier panels (404 riddle, index accusation) ---------- */

.case-panel {
    position: relative;
    margin: 1.8rem auto 0;
    max-width: 640px;
    text-align: left;
    background: var(--dark-gray);
    border: 1px solid var(--blood);
    box-shadow: 0 0 30px rgba(90, 10, 26, 0.5);
    padding: 1.8rem 2rem;
    font-family: 'Special Elite', cursive;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
}

.case-panel.solved {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
}

.case-title {
    color: var(--neon-blue);
    text-align: center;
    font-size: 1.3rem;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    margin-bottom: 0.5rem;
}

.case-note {
    text-align: center;
    font-size: 0.9rem;
    color: rgba(224, 224, 224, 0.6);
    margin-bottom: 1.2rem;
}

.case-label {
    display: block;
    font-size: 0.9rem;
    letter-spacing: 1px;
    color: rgba(224, 224, 224, 0.7);
    margin-bottom: 0.6rem;
}

.case-row {
    display: flex;
    gap: 0.75rem;
}

.case-input {
    flex: 1;
    min-width: 0;
    background: #111;
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    padding: 0.7rem 1rem;
}

.case-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.case-input:disabled {
    opacity: 0.5;
}

.case-feedback {
    min-height: 1.6em;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: rgba(224, 224, 224, 0.8);
}

.case-hint {
    margin-top: 0.6rem;
    font-size: 0.88rem;
    font-style: italic;
    color: rgba(0, 240, 255, 0.65);
}

.case-secret {
    margin-top: 1.2rem;
    font-style: italic;
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.stamp {
    position: absolute;
    top: 1.1rem;
    right: 1.4rem;
    padding: 0.3rem 0.8rem;
    border: 3px solid #d0364b;
    border-radius: 4px;
    color: #d0364b;
    font-size: 1.25rem;
    letter-spacing: 4px;
    transform: rotate(-12deg);
    opacity: 0.95;
    text-shadow: 0 0 10px rgba(208, 54, 75, 0.5);
    box-shadow: 0 0 14px rgba(208, 54, 75, 0.25), inset 0 0 10px rgba(208, 54, 75, 0.15);
    animation: stamp-in 0.45s cubic-bezier(0.2, 2, 0.4, 1);
}

@keyframes stamp-in {
    from {
        transform: rotate(-12deg) scale(2.4);
        opacity: 0;
    }
    to {
        transform: rotate(-12deg) scale(1);
        opacity: 0.95;
    }
}

body.case-closed .btn {
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.8);
}
