:root {
    --bg-color: #020202;
    --primary: #fcee0a; /* Cyberpunk Yellow */
    --primary-dim: #8b8303;
    --secondary: #00f0ff; /* Cyan */
    --alert: #ff003c; /* Neon Red */
    --text-main: #e0e0e0;
    --text-dim: #666;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    cursor: crosshair;
}

h1, h2, h3, .logo, .cyber-btn {
    font-family: 'Orbitron', sans-serif;
}

/* -------------------
   PERSISTENT HUD
------------------- */
.hud-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

.scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    opacity: 0.6;
}

.vignette {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    box-shadow: inset 0 0 150px rgba(0,0,0,0.9);
}

.crosshair {
    position: absolute;
    width: 30px; height: 30px;
    border: 2px solid var(--primary-dim);
}
.top-left { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.top-right { top: 20px; right: 20px; border-left: none; border-bottom: none; }
.bottom-left { bottom: 20px; left: 20px; border-right: none; border-top: none; }
.bottom-right { bottom: 20px; right: 20px; border-left: none; border-top: none; }

.hud-top-left {
    position: absolute; top: 30px; left: 40px;
    color: var(--primary);
    display: flex; gap: 15px; align-items: center;
}
.blinking-rec {
    color: var(--alert);
    animation: blink 1s infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.hud-top-right {
    position: absolute; top: 30px; right: 40px;
    color: var(--primary);
    text-align: right;
    display: flex; align-items: center; gap: 10px;
}
.battery-bar {
    width: 60px; height: 12px;
    border: 1px solid var(--primary);
    padding: 2px;
}
.battery-fill {
    width: 90%; height: 100%;
    background-color: var(--primary);
}

.hud-bottom-left {
    position: absolute; bottom: 30px; left: 40px;
    color: var(--primary-dim);
    font-size: 0.8rem;
    height: 60px; overflow: hidden;
    width: 150px;
}
#hex-scroll {
    animation: scrollUp 5s linear infinite;
}
@keyframes scrollUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }

.hud-bottom-right {
    position: absolute; bottom: 30px; right: 40px;
    color: var(--primary);
    text-align: right;
    font-size: 0.9rem;
}

/* -------------------
   3D GRID
------------------- */
.grid-container {
    position: fixed;
    bottom: 0; left: 0;
    width: 100vw; height: 40vh;
    perspective: 400px;
    z-index: -1;
    overflow: hidden;
}
.cyber-grid {
    width: 200vw; height: 200vh;
    background-image: 
        linear-gradient(to right, var(--primary-dim) 1px, transparent 1px),
        linear-gradient(to bottom, var(--primary-dim) 1px, transparent 1px);
    background-size: 50px 50px;
    position: absolute;
    bottom: -50vh; left: -50vw;
    transform: rotateX(80deg);
    animation: moveGrid 3s linear infinite;
    opacity: 0.3;
}
@keyframes moveGrid {
    from { transform: rotateX(80deg) translateY(0); }
    to { transform: rotateX(80deg) translateY(50px); }
}

/* -------------------
   UI ELEMENTS
------------------- */
.cyber-btn {
    background: rgba(252, 238, 10, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 15px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.3s;
    position: relative;
    pointer-events: auto;
}
.cyber-btn:hover {
    background: var(--primary);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--primary);
}
.cyber-btn.small {
    padding: 8px 15px;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
}

.clip-panel {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--primary-dim);
    border-left: 4px solid var(--primary);
    padding: 40px;
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
    position: relative;
}

/* -------------------
   ENTRANCE
------------------- */
#entrance {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-color);
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}
.entrance-panel {
    text-align: center;
    padding: 50px;
    border: 1px solid var(--alert);
    background: rgba(255,0,60,0.05);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
}
.entrance-panel p { color: var(--alert); margin: 20px 0; }
.entrance-panel .cyber-btn { border-color: var(--alert); color: var(--alert); }
.entrance-panel .cyber-btn:hover { background: var(--alert); color: var(--bg-color); box-shadow: 0 0 20px var(--alert); }

/* -------------------
   MAIN CONTENT
------------------- */
#main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 20px;
    position: relative;
    z-index: 10;
}
.hidden { display: none !important; }

nav { margin-bottom: 60px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; color: var(--primary); }

.sys-title { color: var(--secondary); font-size: 1rem; margin-bottom: 10px; }
.hero-name { font-size: 4rem; color: var(--primary); margin-bottom: 10px; text-shadow: 0 0 10px rgba(252, 238, 10, 0.5); }
.hero .subtitle { color: var(--text-main); font-size: 1.1rem; margin-bottom: 30px; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.stat-box { background: rgba(255,255,255,0.05); padding: 15px; border: 1px solid #333; }
.stat-label { color: var(--secondary); display: block; margin-bottom: 5px; }
.stat-bar { height: 6px; background: #222; width: 100%; margin-bottom: 5px; }
.stat-bar .fill { height: 100%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.stat-num { color: var(--text-main); font-size: 1.2rem; font-weight: bold; }

/* Sections */
.content-section { margin-top: 80px; }
.section-heading {
    font-size: 2rem; color: var(--secondary); margin-bottom: 40px;
    border-bottom: 2px solid var(--secondary); padding-bottom: 10px; display: inline-block;
}

.cyber-card {
    background: rgba(10,10,10,0.8);
    border: 1px solid #333;
    border-left: 3px solid var(--primary);
    margin-bottom: 30px;
    padding: 25px;
    transition: all 0.3s;
}
.cyber-card:hover { border-color: var(--primary); background: rgba(252, 238, 10, 0.05); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-header h3 { color: var(--primary); font-size: 1.5rem; }
.badge { background: var(--primary-dim); color: var(--bg-color); padding: 4px 10px; font-size: 0.8rem; font-weight: bold; }
.badge.alert { background: var(--alert); }

.card-body .role { color: var(--secondary); margin-bottom: 15px; font-size: 1.1rem; }
.card-body .desc { margin-bottom: 15px; font-size: 1.1rem; }
.card-body .highlight { color: var(--primary); }
.card-body .sys-msg { color: var(--text-dim); font-style: italic; }

.mission-stats { display: flex; gap: 20px; margin-bottom: 15px; color: var(--text-dim); font-size: 0.9rem; }

/* Skill Tree */
.skill-tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-branch { border: 1px solid #333; padding: 20px; background: rgba(0,0,0,0.5); }
.branch-title { color: var(--secondary); border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px; text-align: center; }
.skill-list { list-style: none; }
.skill-list li { margin-bottom: 10px; color: var(--text-main); font-size: 0.95rem; }
.skill-list li:hover { color: var(--primary); padding-left: 5px; transition: 0.2s; }

/* Schematics */
.schematic-card {
    display: flex; gap: 30px; margin-bottom: 40px;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.02) 10px, rgba(255,255,255,0.02) 20px);
    border: 1px dashed var(--secondary); padding: 20px;
}
.schematic-img pre { color: var(--secondary); font-size: 0.7rem; line-height: 1.2; text-shadow: 0 0 5px var(--secondary); }
.schematic-info h3 { color: var(--primary); font-size: 1.8rem; margin-bottom: 15px; }
.schematic-info p { font-size: 1.1rem; }

/* Glitch Text */
.glitch-text { position: relative; display: inline-block; }
.glitch-text:hover::before, .glitch-text:hover::after {
    content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color);
}
.glitch-text:hover::before { left: 2px; text-shadow: -1px 0 var(--alert); clip: rect(24px, 550px, 90px, 0); animation: glitch-anim-2 0.5s infinite linear alternate-reverse; z-index: -1; }
.glitch-text:hover::after { left: -2px; text-shadow: -1px 0 var(--secondary); clip: rect(85px, 550px, 140px, 0); animation: glitch-anim 0.5s infinite linear alternate-reverse; z-index: -2; }

@keyframes glitch-anim { 0% { clip: rect(10px, 9999px, 86px, 0); } 100% { clip: rect(60px, 9999px, 81px, 0); } }
@keyframes glitch-anim-2 { 0% { clip: rect(65px, 9999px, 100px, 0); } 100% { clip: rect(10px, 9999px, 50px, 0); } }

/* Typing Effect cursor */
.type-cursor { display: inline-block; width: 10px; height: 1em; background-color: var(--primary); margin-left: 5px; animation: blink 1s infinite; vertical-align: text-bottom; }

.section-block { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.section-block.visible { opacity: 1; transform: translateY(0); }

.cyber-footer { margin-top: 100px; border-top: 1px solid #333; padding-top: 30px; text-align: center; }

/* -------------------
   RESPONSIVE (MOBILE/TABLET)
------------------- */
@media (max-width: 900px) {
    .hud-bottom-left, .scanlines { opacity: 0.3; }
    .hud-top-right, .hud-top-left, .hud-bottom-right { transform: scale(0.8); transform-origin: top right; }
    .hud-top-left { transform-origin: top left; }
    .hud-bottom-right { transform-origin: bottom right; }

    .hero-name { font-size: 3rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .skill-tree { grid-template-columns: repeat(2, 1fr); }
    
    nav { flex-direction: column; gap: 20px; }
    .links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
}

@media (max-width: 600px) {
    #main-content { padding: 80px 15px; }
    
    .hud-top-right, .hud-top-left, .hud-bottom-right { transform: scale(0.6); }
    .crosshair { width: 15px; height: 15px; }
    .top-left { top: 10px; left: 10px; }
    .top-right { top: 10px; right: 10px; }
    .bottom-left { bottom: 10px; left: 10px; }
    .bottom-right { bottom: 10px; right: 10px; }

    .hero-name { font-size: 2rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .skill-tree { grid-template-columns: 1fr; }
    .clip-panel { padding: 20px; }
    .cyber-card { padding: 15px; }
    
    .schematic-card { flex-direction: column; gap: 15px; overflow: hidden; }
    .schematic-img { overflow-x: auto; max-width: 100%; padding-bottom: 10px; }
    .schematic-img pre { font-size: 0.5rem; }
    
    .mission-stats { flex-direction: column; gap: 5px; }
}
