/* 1. RESET / BASE */
:root {
    --bg: #050505;
    --surface: #0a0a0a;
    --surface-alt: rgba(255, 255, 255, 0.02);
    --accent: #00ff41;
    --accent-glow: rgba(0, 255, 65, 0.4);
    --alert: #ff003c;
    --warning: #ff9800;
    --warning-glow: rgba(255, 152, 0, 0.4);
    --dim: #444;
    --text: #a0a0a0;
    --text-alt: #d7f7ff;
    --text-article: #e0e0e0;
    --cyan: #00ffff;
    --cyan-glow: rgba(0, 255, 255, 0.4);
    --glitch-offset: 2px;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Fira Code', 'Courier New', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.4;
    font-size: 13px;
}

/* 2. TIPOGRAFÍA */
h1, h2, h3 {
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 15px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--cyan);
    text-shadow: 0 0 5px var(--cyan);
}

.highlight-g {
    color: var(--accent);
    text-shadow: 0 0 5px var(--accent-glow);
}

.highlight-r {
    color: var(--alert);
    text-shadow: 0 0 5px var(--alert);
}

.highlight-o {
    color: var(--warning);
    text-shadow: 0 0 5px var(--warning-glow);
}

/* 3. LAYOUT */
.main-wrapper {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: min-content;
    gap: 15px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

header {
    grid-column: 1 / 13;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--dim);
    padding-bottom: 10px;
}

/* Overlays */
.noise {
    position: fixed;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.08;
    pointer-events: none;
    z-index: 9999;
}

.crt-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
}

.vignette {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, transparent 50%, black 150%);
    pointer-events: none;
    z-index: 9997;
}

/* Shard Grid Placement */
.shard-nav { grid-column: 1 / 4; grid-row: 2 / 6; min-height: 400px; }
.shard-main { grid-column: 4 / 13; grid-row: 2 / 8; min-height: 600px; }
.shard-status { grid-column: 1 / 4; grid-row: 6 / 8; }

/* 4. COMPONENTES */

/* Navigation */
nav {
    grid-column: 1 / 13;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav-btn {
    background: var(--surface);
    border: 1px solid var(--dim);
    color: var(--cyan);
    padding: 8px 15px;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover, .nav-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Logo */
.logo-raw {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: -1px;
    position: relative;
}

.logo-raw::before, .logo-raw::after {
    content: "Security and Hacking";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.logo-raw::before {
    color: var(--alert);
    z-index: -1;
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.logo-raw::after {
    color: var(--cyan);
    z-index: -2;
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

/* Shards */
.shard {
    background: var(--surface);
    border: 1px solid var(--dim);
    padding: 15px;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.shard::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.shard-header {
    font-size: 14px;
    color: var(--cyan);
    text-transform: uppercase;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--dim);
    padding-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 0 5px var(--cyan-glow);
}

.shard-content {
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
    color: var(--text-alt);
}

.shard-content::-webkit-scrollbar { width: 4px; }
.shard-content::-webkit-scrollbar-track { background: var(--bg); }
.shard-content::-webkit-scrollbar-thumb { background: var(--dim); }

/* Item Lists */
.item-list { margin-top: 20px; }
.item-entry { margin-bottom: 25px; border-left: 2px solid var(--dim); padding-left: 15px; }
.item-title { font-weight: bold; color: var(--cyan); font-size: 1.1rem; display: block; margin-bottom: 5px; }
.item-desc { color: var(--text); font-size: 0.9rem; }
.item-meta { font-size: 0.8rem; color: var(--dim); margin-top: 5px; }

/* Tools */
.tool-section { margin-bottom: 30px; }
.tool-section-title {
    background: var(--dim);
    color: var(--bg);
    padding: 5px 10px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 15px;
}
.tool-card {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background: var(--surface-alt);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.tool-img { width: 50px; height: auto; object-fit: contain; }
.tool-info { flex: 1; }

/* Video */
.video-container {
    background: #000;
    border: 1px solid var(--dim);
    padding: 10px;
    margin-bottom: 20px;
}
video { width: 100%; height: auto; border: 1px solid var(--accent); }

/* Article */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.article-container p {
    margin-bottom: 1.5em;
    font-size: 1.1rem;
    color: var(--text-article);
}

.article-container ol, .article-container ul {
    margin-bottom: 1.5em;
    padding-left: 20px;
}

.article-container li {
    margin-bottom: 0.5em;
}

/* 5. UTILIDADES */
ul { list-style: none; }
li { margin-bottom: 10px; position: relative; padding-left: 20px; }
li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
}

@keyframes glitch-anim {
    0% { clip: rect(44px, 450px, 56px, 0); transform: skew(0.5deg); }
    20% { clip: rect(12px, 450px, 34px, 0); transform: skew(0.2deg); }
    40% { clip: rect(89px, 450px, 98px, 0); transform: skew(0.8deg); }
    60% { clip: rect(15px, 450px, 22px, 0); transform: skew(0.3deg); }
    80% { clip: rect(67px, 450px, 80px, 0); transform: skew(0.6deg); }
    100% { clip: rect(3px, 450px, 12px, 0); transform: skew(0.1deg); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(14px, 450px, 26px, 0); transform: skew(-0.5deg); }
    20% { clip: rect(52px, 450px, 74px, 0); transform: skew(-0.2deg); }
    40% { clip: rect(19px, 450px, 28px, 0); transform: skew(-0.8deg); }
    60% { clip: rect(45px, 450px, 52px, 0); transform: skew(-0.3deg); }
    80% { clip: rect(37px, 450px, 50px, 0); transform: skew(-0.6deg); }
    100% { clip: rect(23px, 450px, 32px, 0); transform: skew(-0.1deg); }
}

/* 6. RESPONSIVE */
@media (max-width: 900px) {
    .main-wrapper { grid-template-columns: 1fr; }
    .shard {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        margin-bottom: 20px;
    }
    header { text-align: center; }
    nav { justify-content: center; }
}
