/* ============================================================
   OFFENSIVE SECURITY PORTFOLIO — black / white / red terminal theme
   Edit the variables below to recolor the whole site at once.
============================================================ */
:root {
    --bg:        #0a0a0b;     /* near-black background */
    --bg-soft:   #111114;     /* panels */
    --bg-card:   #131316;     /* cards */
    --line:      #26262b;     /* borders */
    --text:      #e6e6e6;     /* main text */
    --muted:     #7c7c85;     /* dim text */
    --white:     #ffffff;
    --red:       #ff003c;     /* primary accent */
    --red-dim:   #b3002a;
    --red-glow:  rgba(255, 0, 60, 0.55);
    --green:     #00d97e;     /* "done" accents only */
    --amber:     #ffb000;     /* "paused" accents only */
    --mono: 'JetBrains Mono', 'Share Tech Mono', ui-monospace, monospace;
    --maxw: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--mono);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: page-in 0.32s ease;
}
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
/* page content wrapper — pushes footer to the bottom. #view is swapped by the router,
   while the header / footer / background stay mounted (so the header never disappears). */
main.page { flex: 1 0 auto; width: 100%; }
#view { transition: opacity 0.22s ease; }
#view.view-leaving { opacity: 0; }
/* breadcrumb prompt at the top of each content page */
.page-crumb { color: var(--muted); font-size: 0.85rem; margin-bottom: 22px; }
.page-crumb .accent { color: var(--red); }

.container { width: 92%; max-width: var(--maxw); margin: 0 auto; }

a { color: inherit; text-decoration: none; }

.accent { color: var(--red); }
.muted  { color: var(--muted); }
.hash   { color: var(--red); }

/* ---------- background effects ---------- */
#matrix {
    position: fixed; inset: 0; z-index: 0;
    width: 100%; height: 100%;
    opacity: 0.10; pointer-events: none;
}
.scanlines {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: repeating-linear-gradient(
        to bottom, rgba(255,255,255,0.02) 0 1px, transparent 1px 3px);
    mix-blend-mode: overlay;
}
.noise {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* keep content above effects */
.site-header, section, .footer { position: relative; z-index: 2; }

/* ---------- boot / login sequence ---------- */
.boot {
    position: fixed; inset: 0; z-index: 9999;
    background: #050506;
    display: flex; flex-direction: column; justify-content: center;
    padding: 6vw; cursor: pointer;
    transition: opacity 0.5s ease;
}
.boot.done { opacity: 0; pointer-events: none; }
.boot-log {
    font-family: var(--mono); font-size: clamp(0.7rem, 1.7vw, 0.95rem);
    line-height: 1.7; color: var(--text); white-space: pre-wrap;
    max-width: 900px; margin: 0 auto; width: 100%;
}
.boot-log .ok   { color: var(--green); }
.boot-log .warn { color: var(--amber); }
.boot-log .tag  { color: var(--muted); }
.boot-log .granted {
    color: var(--red); font-weight: 800; font-size: 1.4em;
    text-shadow: 0 0 18px var(--red-glow); letter-spacing: 3px;
}
.boot-skip {
    position: fixed; bottom: 24px; left: 0; right: 0; text-align: center;
    color: var(--muted); font-size: 0.75rem; animation: blink 1.6s infinite;
}

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; }

/* ---------- navbar ---------- */
.navbar {
    position: relative;
    background: rgba(10,10,11,0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 800; letter-spacing: 0.5px; }
.logo-prompt { color: var(--red); }
.logo-path { color: var(--white); }
.nav-links { list-style: none; display: flex; gap: 22px; }
.nav-links a {
    color: var(--muted); font-size: 0.85rem; position: relative; transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }
.nav-links a::after {
    content: ''; position: absolute; left: 0; bottom: -6px;
    width: 0; height: 2px; background: var(--red); transition: width 0.25s;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--white); }
.nav-links a.active::after { width: 100%; }
.nav-toggle {
    display: none; background: none; border: 1px solid var(--line);
    color: var(--red); font-family: var(--mono); padding: 6px 10px;
    cursor: pointer; border-radius: 4px;
}
.nav-right { display: flex; align-items: center; gap: 18px; }

/* language dropdown */
.lang-select { position: relative; flex: none; }
.lang-current {
    display: inline-flex; align-items: center; gap: 5px; background: transparent;
    border: 1px solid var(--line); color: var(--muted); font-family: var(--mono);
    font-size: 0.72rem; padding: 5px 9px; border-radius: 4px; cursor: pointer;
    transition: color 0.18s, border-color 0.18s; white-space: nowrap;
}
.lang-current:hover { color: var(--white); border-color: var(--red); }
.lang-caret { font-size: 0.6rem; transition: transform 0.2s; }
.lang-select.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px;
    list-style: none; padding: 4px; margin: 0; z-index: 60;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.55);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.lang-select.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-opt {
    display: block; width: 100%; text-align: left; background: transparent; border: none;
    color: var(--text); font-family: var(--mono); font-size: 0.82rem;
    padding: 8px 11px; border-radius: 4px; cursor: pointer;
}
.lang-opt:hover { background: rgba(255,0,60,0.12); color: var(--red); }
.lang-opt.active { color: var(--red); }
.lang-opt.active::after { content: ' ✓'; }

/* ---------- terminal window ---------- */
.term-bar {
    display: flex; align-items: center; gap: 8px;
    background: #18181c; border-bottom: 1px solid var(--line);
    padding: 10px 14px; border-radius: 8px 8px 0 0;
}
.term-bar.small { padding: 8px 12px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: #3a3a40; display: inline-block; }
.dot.red { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }
.term-title { margin-left: auto; color: var(--muted); font-size: 0.75rem; }
.term-body { padding: 22px; }
.term-line { color: var(--muted); }
.out { color: var(--text); margin: 8px 0; }
.term-body .out + .out { margin-top: 14px; }

/* ---------- hero ---------- */
.hero { min-height: calc(100vh - 60px); display: flex; align-items: center; padding: 50px 0; }
.hero-grid { width: 92%; max-width: var(--maxw); margin: 0 auto; }
.hero-terminal {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 0 0 1px rgba(255,0,60,0.05), 0 30px 80px rgba(0,0,0,0.6);
    max-width: 780px;
}
.cursor { color: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- interactive console ---------- */
.term-body.console {
    height: clamp(300px, 46vh, 440px);
    overflow-y: auto; overflow-x: hidden;
    font-size: 0.9rem; line-height: 1.6; cursor: text;
}
.term-body.console::-webkit-scrollbar { width: 8px; }
.term-body.console::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
#console-output { white-space: pre-wrap; word-break: break-word; }
#console-output .line { margin: 2px 0; }
#console-output .cmd-echo { color: var(--text); margin-top: 10px; }
#console-output .prompt { color: var(--red); }
#console-output .muted { color: var(--muted); }
#console-output .accent { color: var(--red); }
#console-output .ok { color: var(--green); }
#console-output .key { color: var(--white); }
#console-output a { color: var(--red); text-decoration: underline; }

/* prompt + input line with block cursor */
.input-line { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.prompt { color: var(--red); white-space: nowrap; }
.prompt .p-user { color: var(--red); }
.prompt .p-path { color: var(--white); }
.input-wrap { position: relative; display: inline-flex; align-items: baseline; flex: 1; min-width: 0; }
#console-input {
    background: transparent; border: none; outline: none; padding: 0; margin: 0;
    color: var(--text); font-family: var(--mono); font-size: 0.9rem; line-height: 1.6;
    caret-color: transparent; width: 1ch; max-width: 100%;
}
.cursor-block { color: var(--red); animation: blink 1s steps(1) infinite; margin-left: -2px; }
.input-line.blurred .cursor-block { animation: none; opacity: 0.45; }
.sizer {
    position: absolute; left: -9999px; top: 0; visibility: hidden; white-space: pre;
    font-family: var(--mono); font-size: 0.9rem;
}

.hero-hint { margin-top: 16px; color: var(--muted); font-size: 0.85rem; }

.scroll-hint {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
    color: var(--muted); font-size: 0.8rem; animation: bob 2s infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* glitch text */
.glitch { position: relative; }
.glitch::before, .glitch::after {
    content: attr(data-text); position: absolute; inset: 0;
    clip-path: inset(0);
}
.glitch::before { color: var(--red); left: 2px; text-shadow: -2px 0 var(--red); animation: glitch-1 2.5s infinite linear alternate-reverse; }
.glitch::after  { color: #00e5ff; left: -2px; text-shadow: 2px 0 #00e5ff; animation: glitch-2 3s infinite linear alternate-reverse; }
@keyframes glitch-1 {
    0%,100% { clip-path: inset(0 0 95% 0); } 20% { clip-path: inset(40% 0 40% 0); }
    40% { clip-path: inset(80% 0 5% 0); } 60% { clip-path: inset(10% 0 80% 0); }
    80% { clip-path: inset(60% 0 20% 0); }
}
@keyframes glitch-2 {
    0%,100% { clip-path: inset(90% 0 0 0); } 25% { clip-path: inset(20% 0 60% 0); }
    50% { clip-path: inset(50% 0 30% 0); } 75% { clip-path: inset(5% 0 85% 0); }
}

/* ---------- buttons ---------- */
.btn {
    display: inline-block; font-family: var(--mono); font-size: 0.9rem; font-weight: 500;
    padding: 12px 20px; border-radius: 6px; cursor: pointer; transition: all 0.2s;
    border: 1px solid var(--red);
}
.btn-primary { background: var(--red); color: #0a0a0b; font-weight: 700; }
.btn-primary:hover { background: #ff2a5a; box-shadow: 0 0 22px var(--red-glow); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--red); }
.btn-ghost:hover { background: rgba(255,0,60,0.1); box-shadow: 0 0 18px var(--red-glow); transform: translateY(-2px); }

/* ---------- sections ---------- */
.section { padding: 90px 0; border-top: 1px solid var(--line); }
.section-title {
    font-size: clamp(1.4rem, 4vw, 2rem); color: var(--white);
    margin-bottom: 40px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.section-title::before {
    content: attr(data-index); color: var(--red); font-size: 0.9rem;
    border: 1px solid var(--red); border-radius: 4px; padding: 2px 7px; align-self: center;
}
.title-sub { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; align-items: start; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px;
    padding: 22px 16px; text-align: center; transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--red); transform: translateY(-3px); }
.stat-num { display: block; font-size: 2.2rem; font-weight: 800; color: var(--red); line-height: 1; }
.stat-label { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 8px; }

/* ---------- progress bars (shared) ---------- */
.bar {
    width: 100%; height: 8px; background: #1c1c20; border-radius: 20px;
    overflow: hidden; border: 1px solid var(--line);
}
.fill {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--red-dim), var(--red));
    box-shadow: 0 0 12px var(--red-glow);
    border-radius: 20px; transition: width 1.1s ease;
}
.fill.animate { width: var(--w); }

/* ---------- current ops ---------- */
.ops-grid, .arsenal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.op-card {
    background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px;
    padding: 22px; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column;
}
.op-card:hover { border-color: var(--red); transform: translateY(-4px); box-shadow: 0 14px 40px rgba(255,0,60,0.08); }
.op-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.op-tag { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 4px; }
.status-active { color: var(--red); border: 1px solid var(--red); }
.status-paused { color: var(--amber); border: 1px solid var(--amber); }
.status-done   { color: var(--green); border: 1px solid var(--green); }
.op-id { color: var(--muted); font-size: 0.75rem; }
.op-title { color: var(--white); font-size: 1.15rem; margin-bottom: 10px; }
.op-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; }
.op-desc.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.op-readmore { align-self: flex-start; margin: -10px 0 16px; padding: 0; background: none; border: none; cursor: pointer; font: inherit; font-size: 0.8rem; color: var(--red); }
.op-readmore:hover { text-decoration: underline; }
.op-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { font-size: 0.72rem; color: var(--text); background: #1b1b1f; border: 1px solid var(--line); padding: 3px 8px; border-radius: 20px; }
.op-progress { margin-top: auto; }
.op-progress-head { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.op-link { display: inline-block; margin-top: 14px; color: var(--red); font-size: 0.85rem; }
.op-link:hover { text-decoration: underline; }

/* ---------- learning ---------- */
.learning-grid { display: grid; gap: 16px; margin-bottom: 40px; }
.learn-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.learn-card:hover { border-color: var(--red); }
.learn-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; gap: 12px; }
.learn-name { color: var(--white); font-weight: 500; }
.learn-note { display: block; color: var(--muted); font-size: 0.78rem; }
.learn-pct { color: var(--red); font-weight: 700; }
.learn-track { margin-bottom: 34px; }
/* 19px = .learn-track.done's 18px padding + 1px border, so names and pcts column-align */
.learn-track:not(.done) { padding: 0 19px; }
.track-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.track-name { color: var(--white); font-weight: 700; font-size: 1.05rem; }
.track-note { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.track-pct { color: var(--red); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.learn-track .learning-grid { margin-bottom: 0; }
.learn-track.done { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 18px; margin-bottom: 12px; transition: border-color 0.2s; }
.learn-track.done:hover { border-color: var(--green); }
.learn-track.done .track-head { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.learn-track.done .track-pct { color: var(--green); }

/* now / next / done board */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.board-col { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.board-title { color: var(--white); font-size: 0.95rem; margin-bottom: 12px; text-transform: lowercase; }
.board-list { list-style: none; display: grid; gap: 8px; }
.board-list li { color: var(--text); font-size: 0.85rem; padding-left: 16px; position: relative; }
.board-list li::before { content: '▹'; position: absolute; left: 0; color: var(--red); }
.board-list.done li { color: var(--muted); text-decoration: line-through; }
.board-list.done li::before { content: '✓'; color: var(--green); }

/* ---------- arsenal ---------- */
.arsenal-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; transition: border-color 0.2s, transform 0.2s; }
.arsenal-card:hover { border-color: var(--red); transform: translateY(-3px); }
.arsenal-cat { color: var(--red); font-size: 0.9rem; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    font-size: 0.8rem; color: var(--text); background: #1b1b1f;
    border: 1px solid var(--line); padding: 5px 11px; border-radius: 5px; transition: all 0.18s;
}
.tag:hover { box-shadow: 0 0 10px var(--red-glow); transform: translateY(-1px); }
/* proficiency by colour: neutral (low) -> brand red intensifies (high) */
.tag.lvl-1 { color: var(--white); background: #1b1b1f; border-color: #3a3a40; }
.tag.lvl-2 { color: var(--red); background: rgba(255,0,60,0.05); border-color: var(--red-dim); }
.tag.lvl-3 { color: var(--red); background: transparent; border-color: var(--red); box-shadow: 0 0 9px var(--red-glow); font-weight: 600; }
.tag.lvl-4 { color: #0a0a0b; background: var(--red); border-color: var(--red); box-shadow: 0 0 10px var(--red-glow); font-weight: 700; }
/* currently learning — keeps its level colour, adds a pulsing cyan dot */
.tag.learning { color: var(--green); background: rgba(0,217,126,0.08); border-color: var(--green); position: relative; animation: tagpulse 1.8s ease-in-out infinite; }
.tag.learning::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); vertical-align: middle; }
@keyframes tagpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }
.arsenal-legend { color: var(--muted); font-size: 0.78rem; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arsenal-legend .tag { cursor: default; }
/* clickable tool tags — pointer cursor + focus ring */
.tag-info { cursor: pointer; }
.tag-info:focus-visible { outline: 1px solid var(--red); outline-offset: 2px; }

/* ---------- tool modal (explains what a tool does) ---------- */
.tool-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tool-modal[hidden] { display: none; }
.tool-modal-backdrop { position: absolute; inset: 0; background: rgba(5,5,7,0.72); backdrop-filter: blur(3px); animation: page-in 0.18s ease; }
.tool-modal-box { position: relative; width: 100%; max-width: 460px; background: var(--bg-soft); border: 1px solid var(--red); border-radius: 10px; box-shadow: 0 0 30px var(--red-glow); overflow: hidden; animation: modal-pop 0.18s ease; }
@keyframes modal-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.tool-modal-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--bg-card); border-bottom: 1px solid var(--line); }
.tool-modal-dots { display: flex; gap: 6px; }
.tool-modal-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a40; display: block; }
.tool-modal-dots i:first-child { background: var(--red); }
.tool-modal-title { color: var(--muted); font-size: 0.78rem; letter-spacing: 1px; }
.tool-modal-close { margin-left: auto; background: transparent; border: none; color: var(--muted); font-family: var(--mono); font-size: 0.95rem; cursor: pointer; padding: 0 4px; transition: color 0.15s; }
.tool-modal-close:hover, .tool-modal-close:focus-visible { color: var(--red); }
.tool-modal-body { padding: 18px 20px 22px; }
.tool-modal-cmd { font-size: 0.85rem; color: var(--white); margin-bottom: 12px; }
.tool-modal-cmd .accent { margin-right: 6px; }
.tool-modal-desc { color: var(--text); font-size: 0.9rem; line-height: 1.65; }

/* ---------- writeups / research ---------- */
.wu-intro { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
.wu-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.wu-fbtn { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 5px 12px; cursor: pointer; transition: color 0.18s, border-color 0.18s, box-shadow 0.18s; }
.wu-fbtn:hover { color: var(--white); border-color: var(--muted); }
.wu-fbtn.active { color: var(--red); border-color: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.wu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.wu-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: flex; flex-direction: column; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.wu-card:hover { border-color: var(--red); transform: translateY(-4px); box-shadow: 0 14px 40px rgba(255,0,60,0.08); }
.wu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.wu-type { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.wu-type.type-htb { color: var(--green); border-color: var(--green); }
.wu-type.type-ctf { color: var(--red); border-color: var(--red); }
.wu-type.type-research { color: #00e5ff; border-color: #00e5ff; }
.wu-type.type-blog { color: var(--amber); border-color: var(--amber); }
.wu-type.type-notes { color: var(--amber); border-color: var(--amber); }
.wu-date { color: var(--muted); font-size: 0.75rem; }
.wu-title { color: var(--white); font-size: 1.1rem; margin-bottom: 4px; }
.wu-sub { color: var(--muted); font-size: 0.75rem; margin-bottom: 12px; }
.wu-desc { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin-bottom: 14px; }
.wu-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.wu-link { margin-top: auto; color: var(--red); font-size: 0.85rem; }
.wu-link:hover { text-decoration: underline; }
/* blog post (reader) + language blocks */
.lang-block { display: none; }
.lang-block[data-lang="en"] { display: block; }
.post-back { display: inline-block; color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
.post-back:hover { color: var(--red); }
.post { max-width: 760px; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-title { color: var(--white); font-size: 1.7rem; line-height: 1.25; margin-bottom: 12px; }
.post .wu-meta { margin-bottom: 24px; }
.post-body { color: var(--text); }
.post-body p { margin-bottom: 14px; }
.post-body h2 { color: var(--red); font-size: 1.15rem; margin: 26px 0 10px; }
.post-body h3 { color: var(--white); font-size: 1rem; margin: 20px 0 8px; }
.post-body ul, .post-body ol { margin: 0 0 14px 22px; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--red); text-decoration: underline; }
.post-body pre { background: #0e0e11; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; margin-bottom: 16px; }
.post-body code { font-family: var(--mono); font-size: 0.85rem; }
.post-body :not(pre) > code { background: #1b1b1f; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--red); }
.post-body pre code { color: var(--text); background: none; border: none; padding: 0; }

/* ---------- roadmap / timeline ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 30px 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
    position: absolute; left: -28px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--muted);
}
.tl-item.done .tl-node { border-color: var(--green); background: var(--green); box-shadow: 0 0 10px var(--green); }
.tl-item.active .tl-node { border-color: var(--red); background: var(--red); box-shadow: 0 0 12px var(--red-glow); animation: pulse 1.6s infinite; }
.tl-item.studied .tl-node { border-color: #ffb000; background: linear-gradient(90deg, #ffb000 50%, var(--bg) 50%); box-shadow: 0 0 10px rgba(255,176,0,0.45); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--red-glow); } 50% { box-shadow: 0 0 0 8px transparent; } }
.tl-content { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.tl-content h3 { color: var(--white); font-size: 1.05rem; margin: 6px 0 8px; }
.tl-content p { color: var(--muted); font-size: 0.88rem; margin-bottom: 12px; }
.tl-content p:last-child { margin-bottom: 0; }
.tl-state { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px; }
.tl-item.done .tl-state { color: var(--green); }
.tl-item.active .tl-state { color: var(--red); }
.tl-item.studied .tl-state { color: #ffb000; }
.tl-item.planned .tl-state { color: var(--muted); }

/* ---------- live progress tracker ---------- */
.prog-updated { color: var(--muted); font-size: 0.82rem; margin-bottom: 24px; }
.prog-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.kpi { background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; text-align: center; }
.kpi-num { display: block; font-size: 1.8rem; font-weight: 800; color: var(--red); line-height: 1; }
.kpi-num .muted { font-size: 1rem; font-weight: 500; }
.kpi-lbl { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.prog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.prog-card {
    background: var(--bg-card); border: 1px solid var(--line); border-radius: 10px;
    padding: 24px; transition: border-color 0.2s, transform 0.2s;
}
.prog-card:hover { border-color: var(--red); transform: translateY(-3px); }
.prog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.prog-head h3 { color: var(--white); font-size: 1.15rem; }
.prog-badge {
    font-size: 0.72rem; font-weight: 700; color: var(--red);
    border: 1px solid var(--red); border-radius: 4px; padding: 3px 8px; white-space: nowrap;
}
.prog-sub { color: var(--muted); font-size: 0.8rem; margin-bottom: 18px; }
.prog-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 0.85rem; margin-bottom: 7px; }
.prog-row span:first-child { color: var(--text); }
.prog-stats { display: flex; gap: 26px; margin: 20px 0 4px; }
.prog-stats.wide { gap: 22px; }
.prog-stats .num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--red); line-height: 1; }
.prog-stats .num .muted { font-size: 1.1rem; font-weight: 500; }
.prog-stats .lbl { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 6px; }
.prog-mini { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px; }
.prog-list { list-style: none; display: grid; gap: 7px; }
.prog-list li { color: var(--text); font-size: 0.85rem; padding-left: 16px; position: relative; }
.prog-list li::before { content: '▹'; position: absolute; left: 0; color: var(--red); }
.prog-card.wide-card { grid-column: 1 / -1; }
.prog-topics { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 24px; }
.prog-topics .topic .prog-row { margin-bottom: 5px; }
.topic.done .fill { background: var(--green); box-shadow: none; }
.topic.done .prog-row .muted { color: var(--green); }

/* unified HTB Academy cert list */
.cert-list { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 28px; }
.cert-row { display: flex; flex-direction: column; }
/* pin bars to the row bottom so they align across columns even when a name wraps */
.cert-row .bar { margin-top: auto; }
.cert-list .prog-row { margin-bottom: 5px; }
.cert-row .cert-full { color: var(--muted); font-size: 0.78rem; }
.cert-row .tick { color: var(--green); }
.cert-row.done .prog-row .muted { color: var(--green); }
.cert-row.done .fill { background: var(--green); box-shadow: none; }

/* ---------- contact ---------- */
.contact-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.term-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.contact-form { display: grid; gap: 14px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field-label { color: var(--red); font-size: 0.78rem; }
.field-label::before { content: '> '; }
.contact-form input, .contact-form textarea {
    width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
    padding: 12px 14px; color: var(--text); font-family: var(--mono); font-size: 0.9rem; resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,0,60,0.12);
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #55555c; }
.form-message { font-size: 0.85rem; min-height: 1.2em; }
.form-message.ok { color: var(--green); }
.form-message.err { color: var(--red); }
.form-message.flag { color: #00e5ff; font-weight: 700; letter-spacing: 0.3px; text-shadow: 0 0 10px rgba(0,229,255,0.5); }

.contact-side { display: grid; gap: 12px; align-content: start; }
.contact-link {
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
    background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px;
    padding: 14px 16px; transition: all 0.18s;
}
.contact-link:hover { border-color: var(--red); transform: translateX(4px); }
.cl-key { color: var(--red); font-size: 0.8rem; flex: none; }
.cl-key::before { content: './'; color: var(--muted); }
.cl-val { color: var(--text); font-size: 0.85rem; min-width: 0; overflow-wrap: anywhere; text-align: right; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px 0; background: var(--bg-soft); }
.footer-inner { text-align: center; display: grid; gap: 10px; }
.footer-line { color: var(--text); font-size: 0.9rem; }
.footer-copy { color: var(--muted); font-size: 0.8rem; }
.footer-hint { color: var(--muted); font-size: 0.78rem; }
.kbd {
    display: inline-block; min-width: 18px; text-align: center;
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
    padding: 0 6px; margin: 0 1px; background: #16161a; color: var(--text);
    font-family: var(--mono); font-size: 0.78rem; line-height: 1.5;
}

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
    .about-grid, .contact-wrap { grid-template-columns: 1fr; }
    .board { grid-template-columns: 1fr; }
    .nav-right { gap: 10px; }
    .lang-current { font-size: 0.66rem; padding: 4px 7px; }
    .nav-toggle { display: block; }
    .nav-links {
        position: absolute; top: 60px; left: 0; right: 0; flex-direction: column;
        gap: 0; background: var(--bg-soft); border-bottom: 1px solid var(--line);
        max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
    }
    .nav-links.open { max-height: calc(100vh - 60px); overflow-y: auto; }
    .nav-links li { width: 100%; border-top: 1px solid var(--line); }
    .nav-links a { display: block; padding: 14px 6%; font-size: 0.95rem; }
    .term-body { padding: 18px; }
}
@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .hero-cta { flex-direction: column; }
    .hero-cta .btn { text-align: center; }
    .prog-kpis { grid-template-columns: 1fr 1fr; }
    .kpi-num { font-size: 1.5rem; }
    .section-title { flex-wrap: wrap; }
    .wu-title, .op-title, .post-title, .wu-desc, .op-desc { overflow-wrap: anywhere; }
    .post-body pre { font-size: 0.8rem; }
}

/* ============================================================
   SCARY / REAL-HACKER LAYER
============================================================ */

/* CRT vignette + flicker */
.crt {
    position: fixed; inset: 0; z-index: 3; pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,0.5) 100%),
        radial-gradient(ellipse at center, rgba(255,0,60,0.045) 0%, transparent 62%);
    animation: flicker 5s infinite steps(50);
}
@keyframes flicker {
    0%,100% { opacity: 1; } 6% { opacity: 0.92; } 12% { opacity: 1; }
    18% { opacity: 0.88; } 24% { opacity: 0.98; } 50% { opacity: 0.95; }
    52% { opacity: 0.86; } 54% { opacity: 0.99; } 72% { opacity: 0.93; }
}

/* random global glitch flash (toggled by JS: body.glitching) */
.glitch-overlay {
    position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0;
    background: repeating-linear-gradient(0deg, rgba(255,0,60,0.14) 0 2px, transparent 2px 5px);
    mix-blend-mode: screen;
}
body.glitching .glitch-overlay { animation: glitchflash 0.34s steps(2) 1; }
@keyframes glitchflash {
    0%   { opacity: 0; clip-path: inset(0 0 0 0); }
    20%  { opacity: 1; clip-path: inset(15% 0 45% 0); transform: translateX(-7px); }
    45%  { opacity: 0.5; clip-path: inset(60% 0 12% 0); transform: translateX(6px); }
    70%  { opacity: 1; clip-path: inset(35% 0 35% 0); transform: translateX(-3px); }
    100% { opacity: 0; transform: translateX(0); }
}

/* boot skull */
.boot-wrap { max-width: 900px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.boot-log .bad { color: var(--red); font-weight: 700; }

/* hero glitch head (the "old" look, back on top of the terminal) */
.hero-head { margin-bottom: 24px; }
.hero-glitch {
    font-size: clamp(2.4rem, 8vw, 4.6rem); font-weight: 800; color: var(--white);
    letter-spacing: -1px; line-height: 1; margin-bottom: 10px;
}
.hero-tag { color: var(--text); font-size: clamp(0.9rem, 2.5vw, 1.15rem); }

/* glitch section titles on hover */
.section-title { cursor: default; }
.section-title:hover { text-shadow: 2px 0 var(--red), -2px 0 #00e5ff; animation: titleglitch 0.35s steps(2) infinite; }
@keyframes titleglitch { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-1px,0); } }

/* reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    .crt { opacity: 0.9; }
    .glitch-overlay { display: none; }
}
