/* ==========================================================================
   Fonts
   ========================================================================== */

@font-face {
    font-family: "Anton";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/anton.woff2") format("woff2");
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/jetbrains-mono.woff2") format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/montserrat-400.woff2") format("woff2");
}

@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/montserrat-700.woff2") format("woff2");
}

:root {
    --st-red: #ff4d4d;
    --st-dark-red: #b22222;
    --st-black: #050505;
    --st-dark: #0b0b0b;
    --st-blue: #6ecbff;
    --st-fog: rgba(255, 77, 77, 0.35);
    --st-red-glow: rgba(255, 77, 77, 0.5);
    --st-red-shadow: rgba(255, 77, 77, 0.3);
    --st-blue-glow: rgba(110, 203, 255, 0.6);
    --text-main: #f5f5f5;
    --text-muted: #d3d3d3;

    --font-title: "Anton", sans-serif;
    --font-text: "Montserrat", sans-serif;
    --font-code: "JetBrains Mono", monospace;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

[hidden] {
    display: none !important;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-text);
    background: radial-gradient(circle at top, #111 0, #000 70%);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* CRT scanlines + red fog */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.03) 0,
            transparent 2px,
            transparent 4px
        ),
        radial-gradient(circle at center, rgba(229, 9, 20, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 1;
}

body > * {
    position: relative;
    z-index: 2;
}

a {
    color: var(--st-red);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main {
    flex: 1;
}

/* ==========================================================================
   Header
   ========================================================================== */

.header {
    border-bottom: 2px solid var(--st-red);
    box-shadow: 0 0 30px var(--st-fog);
}

.header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 80px;
    padding: 20px 0;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--st-red-glow));
}

.logo-img {
    height: 40px;
    width: auto;
}

.header-wave,
.footer-wave {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--st-red-glow) 50%, transparent 100%);
    animation: scan 3s linear infinite;
}

.header-wave {
    bottom: 0;
}

.footer-wave {
    top: 0;
}

@keyframes scan {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    text-align: center;
    padding: 50px 20px 24px;
}

.hero-title {
    font-family: var(--font-title);
    font-size: 4rem;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--st-red);
    text-shadow: 0 0 0.2vw var(--st-red), 0 0 0.8vw var(--st-dark-red);
    animation: flicker 4s infinite;
}

.hero-title .yr {
    display: block;
    margin-top: 6px;
    font-size: 0.45em;
    letter-spacing: 0.3em;
    color: var(--text-main);
    text-shadow: none;
}

.hero-title::after {
    content: "";
    display: block;
    height: 0.06em;
    margin: 0.3em auto 0.4em;
    background: linear-gradient(90deg, transparent, #e50914, transparent);
    box-shadow: 0 0 0.6em rgba(229, 9, 20, 0.8);
}

.hero-sub {
    color: var(--text-muted);
    line-height: 1.9;
}

.hero-sub strong {
    color: var(--st-red);
}

@keyframes flicker {
    0%,
    98%,
    100% {
        opacity: 1;
    }
    96% {
        opacity: 0.85;
    }
    97% {
        opacity: 0.4;
    }
}

/* ==========================================================================
   Security gateway form
   ========================================================================== */

.gateway {
    display: flex;
    justify-content: center;
    padding: 20px 0 40px;
}

.gateway-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 520px;
    padding: 32px 24px;
    background: rgba(13, 2, 8, 0.95);
    border: 1px solid rgba(255, 77, 77, 0.35);
    border-radius: 4px;
    box-shadow: inset 0 0 30px rgba(255, 77, 77, 0.04);
}

.gateway-label {
    font-size: 0.62rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--st-red);
}

.gateway-input {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-code);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    text-align: center;
    color: var(--text-main);
    background: #000;
    border: 2px solid var(--st-dark-red);
    border-radius: 2px;
    outline: none;
    box-shadow: inset 0 0 10px rgba(234, 21, 47, 0.5);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gateway-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
}

.gateway-input:focus {
    border-color: var(--st-red);
    box-shadow: inset 0 0 20px #d00, 0 0 20px var(--st-red-glow);
}

.gateway-button {
    padding: 10px 28px;
    font-family: var(--font-title);
    font-size: 1rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--st-red);
    background: rgba(255, 77, 77, 0.05);
    border: 1px solid rgba(255, 77, 77, 0.35);
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.gateway-button:hover,
.gateway-button:focus-visible {
    color: #fff;
    background: rgba(255, 77, 77, 0.12);
    border-color: var(--st-red);
    box-shadow: 0 0 14px var(--st-fog);
}

.gateway-button:focus-visible {
    outline: 2px solid var(--st-red);
    outline-offset: 2px;
}

.gateway-message {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-code);
    font-size: 0.85rem;
    text-align: center;
    border-left: 4px solid currentColor;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.45);
    animation: messageIn 0.3s ease;
}

.gateway-message--error {
    color: var(--st-red);
    box-shadow: 0 6px 30px rgba(234, 21, 47, 0.5), 0 0 18px #d00;
    animation: messageIn 0.3s ease, shake 0.4s ease;
}

.gateway-message--success {
    color: var(--st-blue);
    box-shadow: 0 6px 30px var(--st-blue-glow), 0 0 18px var(--st-blue-glow);
}

@keyframes messageIn {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-6px);
    }
    40%,
    80% {
        transform: translateX(6px);
    }
}

/* ==========================================================================
   Floating spores
   ========================================================================== */

#particles {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.spore {
    position: absolute;
    bottom: 0;
    border-radius: 50%;
    background: #c8c0b8;
    opacity: 0;
    filter: blur(0.6px);
    animation: floatSpore linear infinite;
}

@keyframes floatSpore {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    92% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(30px);
        opacity: 0;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
    position: relative;
    flex-shrink: 0;
    margin-top: 40px;
    padding: 32px 20px;
    border-top: 2px solid var(--st-red);
    background: linear-gradient(180deg, transparent, rgba(13, 2, 8, 0.8));
    box-shadow: 0 0 20px var(--st-red-shadow);
    overflow: hidden;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-copy {
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    line-height: 1.9;
    color: var(--text-muted);
}

/* ==========================================================================
   Upside Down (access granted - same effect as the advent calendar Konami code)
   ========================================================================== */

body.world-shift {
    animation: worldDistortion 0.4s ease-in-out;
}

@keyframes worldDistortion {
    0% {
        filter: blur(0) contrast(1);
        transform: skew(0deg);
    }
    30% {
        filter: blur(2px) contrast(1.2);
        transform: skew(0.5deg);
    }
    60% {
        filter: blur(1px);
        transform: skew(-0.3deg);
    }
    100% {
        filter: none;
        transform: none;
    }
}

@keyframes upsideFloat {
    0%,
    100% {
        transform: rotate(180deg) translateY(0);
    }
    50% {
        transform: rotate(180deg) translateY(-3px);
    }
}

body.upside-down {
    --st-dark-blue: #1e4f7a;
    --text-main: #e6f6ff;
    background: radial-gradient(circle at center, #06131f 0, #020814 70%);
    color: var(--text-main);
}

body.upside-down::before {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(110, 203, 255, 0.03) 0,
            transparent 3px,
            transparent 6px
        ),
        radial-gradient(circle at center, rgba(110, 203, 255, 0.12), transparent 65%);
}

body.upside-down .header .container {
    transform: rotate(180deg);
}

body.upside-down .header,
body.upside-down .footer {
    border-color: var(--st-blue);
    box-shadow: 0 0 30px var(--st-blue-glow);
}

body.upside-down .header-wave,
body.upside-down .footer-wave {
    background: linear-gradient(90deg, transparent 0%, var(--st-blue-glow) 50%, transparent 100%);
}

body.upside-down .hero-title {
    color: var(--st-blue);
    text-shadow: 0 0 0.2vw var(--st-blue), 0 0 0.8vw var(--st-dark-blue);
}

body.upside-down .hero-title .yr {
    animation: upsideFloat 3s ease-in-out infinite;
}

body.upside-down .hero-title::after {
    background: linear-gradient(90deg, transparent, var(--st-dark-blue), transparent);
    box-shadow: 0 0 0.6em var(--st-blue-glow);
}

body.upside-down .hero-sub strong,
body.upside-down .gateway-label,
body.upside-down .gateway-button,
body.upside-down .footer-copy a {
    color: var(--st-blue);
}

body.upside-down .gateway-form {
    background: rgba(5, 15, 30, 0.95);
    border-color: var(--st-blue);
    box-shadow: inset 0 0 25px var(--st-blue-glow), 0 0 45px var(--st-blue-glow);
}

body.upside-down .gateway-input {
    background: #020814;
    border-color: var(--st-blue);
    box-shadow: inset 0 0 15px var(--st-blue-glow);
}

body.upside-down .gateway-button {
    background: rgba(110, 203, 255, 0.08);
    border-color: rgba(110, 203, 255, 0.35);
}

body.upside-down .gateway-button:hover,
body.upside-down .gateway-button:focus-visible {
    color: #fff;
    background: rgba(110, 203, 255, 0.18);
    border-color: var(--st-blue);
    box-shadow: 0 0 14px var(--st-blue-glow);
    outline-color: var(--st-blue);
}

/* ==========================================================================
   Responsive & accessibility
   ========================================================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Masqué visuellement, mais lu par les lecteurs d'écran (et visible dans le DOM). */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
