:root {
    /* Color Palette - HSL for easier manipulation */
    --primary-h: 185;
    --primary-s: 100%;
    --primary-l: 50%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l)); /* #00f2ff - Glitch Cyan */
    
    --accent-h: 350;
    --accent-s: 100%;
    --accent-l: 62%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l)); /* #ff3b3b - Iron Blood Red */
    
    --gold: #e5c100;
    --white: #f0f0f0;
    --bg-dark: #050506;
    --bg-card: rgba(20, 20, 22, 0.7);
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-ui: 'Orbitron', sans-serif;
    --font-name: 'Song Myung', serif;
}

/* Base Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: crosshair; /* Tactical feel */
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--white);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Effects */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 50;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 100;
    opacity: 0.3;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 242, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 242, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

/* Typography & Global UI */
h1, h2, h3 {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: var(--font-ui);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    font-weight: 900;
}

.section-title span {
    color: var(--primary);
    display: block;
    font-size: 0.8rem;
    letter-spacing: 0.5em;
    margin-top: 10px;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 30px 0;
    z-index: 1000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    padding: 15px 0;
    background: rgba(5, 5, 6, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 50px;
}

.logo {
    font-family: var(--font-ui);
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
}

.logo span {
    color: var(--primary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav ul li a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    transition: 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

/* Hero Section */
#hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10%;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://ktb.btma.workers.dev/AC/Z/grz.webp'); /* 그레이 존 배경 */
    background-size: cover;
    background-position: center;
    z-index: 0;
    transform: scale(1.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(5,5,6,0.9) 0%, rgba(5,5,6,0.4) 50%, rgba(5,5,6,0.2) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-tag {
    font-family: var(--font-ui);
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.hero-tag::before {
    content: '';
    width: 40px;
    height: 1px;
    background: var(--primary);
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.9;
    margin-bottom: 30px;
    font-weight: 900;
}

.hero-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 50px;
    max-width: 500px;
}

/* Tactical UI Elements */
.tactical-btn {
    padding: 18px 45px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: 0.3s;
    overflow: hidden;
    border: 1px solid var(--primary);
    color: #fff;
}

.tactical-btn.primary {
    background: var(--primary);
    color: #000;
}

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

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

.tactical-btn:hover {
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
    transform: translateY(-3px);
}

/* HUD Widgets */
.hud-widget {
    position: absolute;
    z-index: 10;
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    font-family: var(--font-ui);
    font-size: 0.7rem;
}

.hud-top-right { top: 120px; right: 50px; }
.hud-bottom-right { bottom: 50px; right: 50px; }

.hud-label { color: rgba(255, 255, 255, 0.4); margin-bottom: 5px; }
.hud-value { color: var(--primary); font-weight: 900; font-size: 1rem; }

/* Sections Global */
section {
    padding: 150px 0;
    position: relative;
    z-index: 5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* World Section (Split Layout) */
.world-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: center;
}

.world-visual {
    position: relative;
}

.world-img-container {
    width: 100%;
    height: 600px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    position: relative;
}

.world-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s;
}

.world-img-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 242, 255, 0.1), transparent);
}

.world-info h3 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: #fff;
}

.world-info p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 30px;
    line-height: 1.8;
}

/* Character Archive */
.char-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.char-card {
    position: relative;
    height: 500px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.char-card:hover {
    border-color: var(--primary);
    transform: translateY(-10px);
}

.char-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.char-card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: saturate(0.8) brightness(0.9);
    transition: 0.8s;
}

.char-card:hover .char-card-bg img {
    transform: scale(1.1);
    filter: saturate(1.2) brightness(1);
}

.char-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
    z-index: 2;
}

.char-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 10;
}

.char-id-tag {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 2px 8px;
    display: inline-block;
    margin-bottom: 10px;
}

.char-card-info h3 {
    font-family: var(--font-name);
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 5px;
}

.char-card-info p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Gallery Section (Battlefields) */
.gallery-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 50px;
    scroll-snap-type: x mandatory;
}

.gallery-item {
    flex: 0 0 450px;
    height: 300px;
    border: 1px solid var(--glass-border);
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
    transition: 0.5s;
}

.gallery-item:hover img {
    filter: brightness(1);
    transform: scale(1.05);
}

.gallery-item .location-name {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: #0d0d0f;
    border: 1px solid var(--glass-border);
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    overflow: hidden;
    animation: modalReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalReveal {
    from { opacity: 0; transform: scale(0.95) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-visual {
    position: relative;
    border-right: 1px solid var(--glass-border);
    background: #000;
}

.modal-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.modal-data {
    padding: 60px;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
}

.modal-data h2 {
    font-family: var(--font-name);
    font-size: 4rem;
    color: var(--gold);
    margin-bottom: 10px;
}

.modal-data .role {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 40px;
}

.data-section {
    margin-bottom: 50px;
}

.data-section h4 {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-section h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 242, 255, 0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-box {
    background: var(--glass);
    padding: 15px;
    border: 1px solid var(--glass-border);
}

.stat-label { font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.stat-val { font-family: var(--font-ui); font-size: 1.2rem; color: #fff; }

/* Glitch Animation Classes */
.glitch-text {
    position: relative;
    animation: glitch 4s infinite;
}

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

/* Footer */
footer {
    padding: 100px 0;
    background: #000;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.footer-links a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-family: var(--font-ui);
    font-size: 0.7rem;
}

.footer-links a:hover { color: var(--primary); }

.desktop-only { display: inline-block; }

@media (max-width: 768px) {
    .desktop-only { display: none; }
    #menu-toggle { display: block !important; }
    
    #nav-menu.active {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 6, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1001;
        gap: 30px;
    }
    
    #nav-menu.active li a {
        font-size: 1.5rem;
    }
}


/* Mobile & Tablet Responsiveness */
@media (max-width: 1200px) {
    .container { padding: 0 30px; }
    .world-grid { gap: 50px; }
}

@media (max-width: 1024px) {
    .modal-content {
        grid-template-columns: 1fr;
        height: 95vh;
    }
    .modal-visual {
        height: 400px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    .modal-data { padding: 40px; }
}

@media (max-width: 768px) {
    header { padding: 20px 0; }
    nav { padding: 0 20px; }
    nav ul { display: none; } /* Hide desktop menu */
    
    #hero {
        padding: 0 5%;
        justify-content: center;
        text-align: center;
    }
    
    .hero-tag { justify-content: center; }
    .hero-tag::before { display: none; }
    
    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .tactical-btn { width: 100%; max-width: 300px; text-align: center; }
    
    .hud-widget { display: none; } /* Hide HUD on small mobile for clarity */
    
    .section-title { font-size: 2rem; margin-bottom: 50px; }
    
    .world-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .world-img-container { height: 350px; }
    
    .world-info h3 { font-size: 1.8rem; }
    
    .char-archive-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item { flex: 0 0 300px; height: 200px; }
    
    .stats-grid { grid-template-columns: 1fr; }
    
    .modal-data h2 { font-size: 2.5rem; }
    
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}

/* Scrollbar Customization */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

