:root {
    --bg-dark: #040814;
    --card-bg: rgba(10, 18, 40, 0.65);
    --primary-red: #ff0000;
    --primary-cyan: #00f2ff;
    --text-white: #ffffff;
    --text-muted: #8a9bbd;
    --border-light: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Chakra Petch', sans-serif;
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    color: var(--text-white);
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.2)
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.3;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader-logo {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: 6px;
    text-shadow: 0 0 15px rgba(227, 10, 23, 0.8);
    animation: pulseLogo 1.5s infinite alternate;
}

.loader-bar-container {
    width: 250px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    border-radius: 2px;
}

.loader-bar {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #ff0000;
    box-shadow: 0 0 15px #ff0000;
    animation: loadingScan 1.5s ease-in-out infinite;
}

.loader-text {
    font-size: 13px;
    color: var(--primary-cyan);
    letter-spacing: 3px;
    animation: blinkText 1s infinite;
}

.tech-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    perspective: 1000px;
    transform: rotateX(60deg) translateY(-100px) translateZ(-200px);
    animation: gridMove 20s linear infinite;
}

.glowing-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    z-index: 0;
}

.orb-red {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.95) 0%, rgba(255, 0, 0, 0) 80%);
    top: 10%;
    left: -10%;
    animation: intenseRedPulse 18s infinite ease-in-out;
}

.orb-blue {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.95) 0%, rgba(0, 242, 255, 0) 80%);
    bottom: 10%;
    right: -10%;
    animation: intenseBluePulse 20s infinite ease-in-out;
}

.national-card {
    position: relative;
    z-index: 20;
    width: 90%;
    max-width: 440px;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-light);
    padding: 50px 35px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255,255,255,0.02);
    border-radius: 8px;
    opacity: 0;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: cardEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.8s;
}

.card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-cyan));
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.neon-title {
    font-size: 52px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 4px;
    color: var(--text-white);
    transform: translateZ(30px);
    text-shadow: 0 4px 15px rgba(227, 10, 23, 0.6), 0 0 20px rgba(227, 10, 23, 0.4);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    position: relative;
    display: inline-block;
}

.neon-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
        transparent 45%,
        var(--primary-red) 50%,
        transparent 55%
    );
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    mix-blend-mode: color-dodge;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.national-card:not(:hover) .neon-title {
    color: var(--text-white);
    text-shadow: 0 4px 15px rgba(227, 10, 23, 0.6), 0 0 20px rgba(227, 10, 23, 0.4);
    letter-spacing: 4px;
    transform: translateZ(30px);
}

.national-card:not(:hover) .neon-title::after {
    opacity: 1;
    animation: textWaveSmooth 2s infinite ease-out;
}

.national-card:hover .neon-title {
    color: var(--primary-cyan);
    text-shadow: 0 0 20px rgba(0, 194, 203, 0.8), 0 0 40px rgba(0, 194, 203, 0.4);
    transform: translateZ(50px) scale(1.05);
    letter-spacing: 8px;
    animation: none;
}

.national-card:hover .neon-title::after {
    opacity: 0;
    animation: none;
}

p {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transform: translateZ(10px);
}

.link-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateZ(25px);
}

.tech-btn {
    display: block;
    text-decoration: none;
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.return-btn {
    margin-bottom: 10px;
    background: rgba(0, 194, 203, 0.1);
    border-color: var(--primary-cyan);
}

.btn-content {
    display: flex;
    align-items: center;
    padding: 18px 24px;
    position: relative;
    z-index: 2;
}

.btn-icon {
    font-size: 22px;
    margin-right: 18px;
    color: var(--primary-cyan);
    width: 26px;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.tech-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-red);
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom;
    z-index: 3;
}

.tech-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: skewX(-20deg);
    transition: none;
    z-index: 1;
}

.tech-btn:hover {
    background: linear-gradient(90deg, rgba(227, 10, 23, 0.15), rgba(0, 194, 203, 0.05));
    border-color: rgba(227, 10, 23, 0.5);
    transform: translateX(10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.tech-btn:hover .btn-icon {
    color: var(--primary-red);
    text-shadow: 0 0 12px rgba(227, 10, 23, 0.6);
    transform: scale(1.15);
}

.tech-btn:hover::before {
    transform: scaleY(1);
}

.tech-btn:hover::after {
    left: 200%;
    transition: all 0.7s ease-in-out;
}

.tech-btn.connecting {
    background: rgba(227, 10, 23, 0.15);
    border-color: var(--primary-red);
    transform: scale(0.98);
    box-shadow: inset 0 0 25px rgba(227, 10, 23, 0.4);
    pointer-events: none;
}

.tech-btn.connecting::before {
    transform: scaleY(1);
    width: 100%;
    background: rgba(227, 10, 23, 0.2);
    z-index: 1;
}

.tech-btn.connecting .btn-content {
    justify-content: center;
}

.tech-btn.connecting .btn-icon {
    color: var(--text-white);
    margin-right: 12px;
}

.tech-btn.connecting .btn-text {
    color: var(--text-white);
    font-size: 15px;
}

.pulse-icon {
    animation: iconPulse 1s infinite alternate;
}

.blink-text {
    animation: blinkText 0.8s infinite;
}

@keyframes intenseRedPulse {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    33% {
        transform: translate(-60px, 40px) scale(1.1);
        opacity: 0.95;
    }
    66% {
        transform: translate(30px, -70px) scale(0.9);
        opacity: 0.4;
    }
}

@keyframes intenseBluePulse {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    33% {
        transform: translate(70px, -60px) scale(1.15);
        opacity: 0.45;
    }
    66% {
        transform: translate(-40px, 60px) scale(0.85);
        opacity: 0.95;
    }
}

@keyframes textWaveSmooth {
    0% {
        background-position: 150% 0;
    }
    15% {
        background-position: -150% 0;
    }
    100% {
        background-position: -150% 0;
    }
}

@keyframes pulseLogo {
    0% { opacity: 0.6; text-shadow: 0 0 10px rgba(227, 10, 23, 0.4); }
    100% { opacity: 1; text-shadow: 0 0 30px rgba(227, 10, 23, 1); }
}

@keyframes loadingScan {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes blinkText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes iconPulse {
    0% { transform: scale(0.9); text-shadow: 0 0 5px rgba(255,255,255,0.5); }
    100% { transform: scale(1.2); text-shadow: 0 0 20px rgba(255,255,255,1); }
}

@keyframes cardEntrance {
    0% { opacity: 0; transform: translateY(40px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 50px; }
}