/* ════════════════════════════════════════════════════════════════════════
   CYBERPUNK TERMINAL — custom components (overhaul). Loaded after style.css.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Shared tokens ──────────────────────────────────────────────────────*/
.dim { color: var(--text-secondary); }
.prompt { color: var(--accent); }
.path { color: var(--text-secondary); }
.ok, .granted { color: var(--accent); }
.pending { color: var(--pending); }
.danger { color: var(--danger); }
.blink { animation: blink 1s step-end infinite; }

.badge {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border: 1px solid currentColor;
    border-radius: 0;
    white-space: nowrap;
}
.badge-live    { color: var(--accent); box-shadow: 0 0 10px rgba(56, 217, 255, 0.15); }
.badge-read    { color: var(--text-secondary); }
.badge-pending { color: var(--pending); }
.badge-danger  { color: var(--danger); }
/* Amber is reserved for the hire signal — the one thing a recruiter scans for.
   Used only on the two availability badges so it stays a focal accent. */
.badge-hire    { color: var(--amber); box-shadow: 0 0 12px rgba(255, 159, 28, 0.20); }

/* ── Terminal window chrome ─────────────────────────────────────────────*/
.term-window {
    border: 1px solid var(--border-color);
    background: rgba(12, 23, 34, 0.35);
    box-shadow: 0 0 0 1px rgba(56, 217, 255, 0.04), 0 0 40px rgba(0, 0, 0, 0.6);
}
.term-bar {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.55rem 0.9rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    box-shadow: inset 3px 0 12px -6px var(--accent-glow);
    font-size: 0.78rem;
}
/* Command bar = the window's header. Bold + a hair larger so it reads as a
   title against the dim meta on the right (tier 1 of the type system). */
.term-bar .term-cmd { color: var(--accent); letter-spacing: 0.04em; font-weight: 700; font-size: 0.82rem; }
.term-bar .dim { margin-left: auto; font-size: 0.72rem; }
.term-dots { display: inline-flex; gap: 5px; }
.term-dots i { width: 9px; height: 9px; display: block; }
.term-dots i:nth-child(1) { background: var(--danger); opacity: 0.7; }
.term-dots i:nth-child(2) { background: var(--pending); opacity: 0.7; }
.term-dots i:nth-child(3) { background: var(--accent); opacity: 0.7; }
.term-body { padding: 1.5rem; }

/* ── Hero: boot sequence + matrix rain ──────────────────────────────────*/
.hero {
    position: relative;
    overflow: hidden;
    text-align: left;
    min-height: auto;
    display: block;
    padding: 9rem 0 5rem;
    border-bottom: none;
    background:
        radial-gradient(90% 70% at 8% -15%, rgba(56, 217, 255, 0.12), transparent 55%),
        radial-gradient(80% 90% at 105% 115%, rgba(255, 42, 109, 0.12), transparent 55%),
        linear-gradient(rgba(56, 217, 255, 0.025) 1px, transparent 1px) 0 0 / 100% 34px,
        linear-gradient(90deg, rgba(56, 217, 255, 0.025) 1px, transparent 1px) 0 0 / 34px 100%;
}
.hero { border-bottom: 1px solid var(--border-color); }
.cta-group { justify-content: flex-start; }
/* CRT vignette so the schematic grid fades into the dark at the edges */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    box-shadow: inset 0 0 180px 40px rgba(7, 11, 18, 0.92);
}
.hero-inner { position: relative; z-index: 1; }

.boot-sequence { font-size: 0.82rem; line-height: 1.9; margin-bottom: 2rem; }
.boot-line { white-space: pre-wrap; }
/* Status lines: flex leader auto-fills the gap so every [OK] right-aligns,
   instead of hand-counted dot strings that never lined up. */
.boot-line.boot-status { display: flex; align-items: center; white-space: nowrap; }
.boot-line.boot-status .boot-label,
.boot-line.boot-status .boot-ok { flex: 0 0 auto; }
.boot-line.boot-status .lead { flex: 1 1 auto; margin: 0 0.6rem; border-bottom: 1px dotted var(--border-color); transform: translateY(-0.12em); }
.boot-line.granted {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-shadow: 0 0 12px var(--accent-glow);
    margin-top: 0.4rem;
}

.id-card {
    position: relative;
    max-width: 640px;
    margin: 0 0 2.25rem;
    border: 1px solid var(--border-color);
    background: rgba(12, 23, 34, 0.5);
    box-shadow: 0 0 40px rgba(56, 217, 255, 0.05);
}
/* HUD scope-corner brackets on the identity panel */
.id-card::before,
.id-card::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
}
.id-card::before { top: -3px; left: -3px; border-right: none; border-bottom: none; border-color: var(--accent); }
.id-card::after { bottom: -3px; right: -3px; border-left: none; border-top: none; border-color: var(--hot); box-shadow: 0 0 12px var(--hot-glow); }
.id-body { padding: 1.5rem 1.75rem; }
.id-name {
    font-size: clamp(2.4rem, 6.5vw, 3.8rem);
    line-height: 1;
    letter-spacing: 0.04em;
    color: #EAFBFF;
    /* RGB-split chromatic glitch (Ruiner) — static so it shows in captures */
    text-shadow:
        3px 0 0 var(--hot),
        -3px 0 0 #00FFF2,
        0 0 24px var(--accent-glow);
    margin-bottom: 0.6rem;
}
.id-role { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 1rem; }
.id-status { display: flex; align-items: center; gap: 0.75rem; font-size: 0.8rem; margin: 0; }

.thought-block { font-size: 0.82rem; margin-bottom: 2.25rem; }
.thought-output {
    color: var(--text-primary);
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    margin: 0.5rem 0 0;
    text-shadow: 0 0 8px var(--accent-glow);
    display: block;
}
.thought-output i { color: var(--text-secondary); margin-right: 0.5rem; font-size: 0.8em; }
.thought-output .thought-text::after {
    content: "_";
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

/* ── Section rhythm (tighter, terminal-dense) ───────────────────────────*/
/* This ID-specific selector is the EFFECTIVE rule (beats .section in style.css).
   2.25rem each side = 4.5rem between windows — stacked-shell density, not
   floating islands. */
.status-section, #projects.section, #blog.section { padding: 2.25rem 0; }

/* ── Status HUD ─────────────────────────────────────────────────────────*/
.status-section { padding-top: 1.5rem; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.stat { padding: 1.25rem 1.4rem; border-right: 1px solid var(--border-color); }
.stat:last-child { border-right: none; }
.stat-label { font-size: 0.65rem; letter-spacing: 0.12em; color: var(--text-secondary); margin-bottom: 0.5rem; }
.stat-val { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; text-shadow: 0 0 10px var(--accent-glow); }
.stat-val.danger { color: var(--danger); text-shadow: 0 0 10px rgba(255, 51, 51, 0.2); }
.bar { margin-top: 0.75rem; height: 4px; background: var(--bg-color); border: 1px solid var(--border-color); }
.bar i { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 6px rgba(56, 217, 255, 0.4); }
.bar.danger i { background: var(--danger); box-shadow: 0 0 6px rgba(255, 51, 51, 0.4); }

/* neofetch-style system readout (real content, replaces the joke metrics) */
.sysinfo { display: grid; gap: 0.55rem; margin: 0; font-size: 0.9rem; }
.sysinfo > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem; align-items: baseline; }
.sysinfo dt {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
}
.sysinfo dt::before { content: "› "; color: var(--accent); }
.sysinfo dd { color: var(--text-primary); margin: 0; }
@media (max-width: 600px) {
    .sysinfo > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* ── Featured: file entry ───────────────────────────────────────────────*/
.file-entry { display: block; text-decoration: none; color: inherit; }
.file-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.file-name { font-size: 1.5rem; font-weight: 700; color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
.file-name i { margin-right: 0.5rem; }
.file-tagline { color: var(--pending) !important; font-weight: 600; margin-bottom: 0.85rem; }
.file-desc { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 0.75rem; line-height: 1.8; }
/* Lede: one framing sentence at a readable measure (mono prose past ~65ch tires) */
.file-lede { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; margin: 0 0 1.4rem; max-width: 62ch; }
/* Spec sheet: shares the neofetch (.sysinfo) key/value language for cohesion */
.file-spec { display: grid; gap: 0.5rem; margin: 0 0 0.5rem; font-size: 0.9rem; }
.file-spec > div { display: grid; grid-template-columns: 7rem 1fr; gap: 1.25rem; align-items: baseline; }
.file-spec dt { color: var(--text-secondary); text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.14em; }
.file-spec dt::before { content: "\203A "; color: var(--accent); }
.file-spec dd { color: var(--text-primary); margin: 0; }
@media (max-width: 600px) { .file-spec > div { grid-template-columns: 1fr; gap: 0.1rem; } }
.file-note {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 1rem 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border-color);
    background: rgba(56, 217, 255, 0.03);
}
.file-action {
    display: inline-block;
    margin-top: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    transition: var(--transition);
}
.file-entry:hover .file-action { text-shadow: 0 0 10px var(--accent-glow); }
.file-entry:hover .file-name { text-shadow: 0 0 18px var(--accent-glow); }

/* ── Blog: log listing ──────────────────────────────────────────────────*/
.log-list { padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.log-row {
    display: grid;
    grid-template-columns: 6rem 1fr auto;
    /* top-align so the date + READ sit with the title, not floating in the
       middle of a tall (multi-line) description */
    align-items: start;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: background 0.12s ease, color 0.12s ease;
}
.log-row:nth-child(odd) { border-right: 1px solid var(--border-color); }
/* Odd entry count: let the lone final row span both columns instead of
   leaving a dead cell. (Only matches when last item sits in an odd slot.) */
.log-row:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: none; }
.log-date { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.log-date::before { content: "["; }
.log-date::after { content: "]"; }
.log-body { min-width: 0; }
.log-title { display: block; color: var(--accent); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.log-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}
.log-row .badge-read { transition: var(--transition); }
/* terminal "selection" invert on hover */
.log-row:hover { background: var(--accent); color: var(--bg-color); }
.log-row:hover .log-title,
.log-row:hover .log-date,
.log-row:hover .log-desc { color: var(--bg-color); }
.log-row:hover .badge-read { color: var(--bg-color); border-color: var(--bg-color); }

/* ── Structural two-tone: alternate panel headers cyan / magenta ─────────*/
.status-section .term-bar,
#blog .term-bar {
    border-left-color: var(--hot);
    box-shadow: inset 3px 0 12px -6px var(--hot-glow);
}
.status-section .term-cmd,
.status-section .term-cmd .prompt,
#blog .term-cmd,
#blog .term-cmd .prompt { color: var(--hot); }

/* one magenta metric in the HUD for contrast */
.stat-val.hot { color: var(--hot); text-shadow: 0 0 10px var(--hot-glow); }
.bar.hot i { background: var(--hot); box-shadow: 0 0 6px var(--hot-glow); }

/* ── CTA buttons as commands ────────────────────────────────────────────*/
.cta-group .btn { font-size: 0.85rem; }

/* ════════════════════════════════════════════════════════════════════════
   TERMINAL MOTION — boots line-by-line, bars fill, name glitches.
   Every effect degrades to the static end-state (screenshot fixture disables
   animations; reduced-motion users get the guard below), so motion is purely
   additive on top of a complete static design.
   ════════════════════════════════════════════════════════════════════════ */
@keyframes lineIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes barFill { from { width: 0; } }
@keyframes scanDrift { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 0 11px; } }
@keyframes nameGlitch {
    0%, 90%, 100% { text-shadow: 3px 0 0 var(--hot), -3px 0 0 #00FFF2, 0 0 24px var(--accent-glow); transform: none; }
    92% { text-shadow: -5px 0 0 var(--hot), 4px 0 0 #00FFF2, 0 0 24px var(--accent-glow); transform: translateX(2px) skewX(-1deg); }
    94% { text-shadow: 6px 0 0 var(--hot), -3px 0 0 #00FFF2, 0 0 30px var(--accent-glow); transform: translateX(-2px); }
    96% { text-shadow: 3px 0 0 var(--hot), -3px 0 0 #00FFF2, 0 0 24px var(--accent-glow); transform: none; }
}

/* Boot status lines stream in line-by-line — but FAST (done in ~0.6s) and only
   on the decorative status lines, never the showpiece content. Base opacity:1
   so any frozen/disabled-animation state shows them, and the quick timeline
   means a live capture lands after they've all arrived.
   The identity panel, name, thought, and CTAs are ALWAYS visible (no reveal) —
   the page never renders an empty hero, in captures or for no-JS users. */
.boot-sequence .boot-line { animation: lineIn 0.25s ease both; }
.boot-sequence .boot-line:nth-child(1) { animation-delay: 0.05s; }
.boot-sequence .boot-line:nth-child(2) { animation-delay: 0.16s; }
.boot-sequence .boot-line:nth-child(3) { animation-delay: 0.27s; }
.boot-sequence .boot-line:nth-child(4) { animation-delay: 0.38s; }
.boot-sequence .boot-line:nth-child(5) { animation-delay: 0.50s; }

/* HUD bars sweep up to value */
.bar i { animation: barFill 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* the name flickers/glitches every few seconds */
.id-name { animation: nameGlitch 6s steps(1, end) infinite; }

/* CRT scanlines drift slowly */
.background-grid { animation: scanDrift 9s linear infinite; }

/* Respect reduced-motion: kill all motion, force final visible state */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
    .boot-sequence .boot-line, .id-card, .thought-block, .cta-group { opacity: 1 !important; }
}

/* ── Responsive ─────────────────────────────────────────────────────────*/
@media (max-width: 768px) {
    .status-grid { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: none; }
    .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border-color); }
    .log-list { grid-template-columns: 1fr; }
    .log-row { grid-template-columns: 1fr auto; gap: 0.4rem 1rem; }
    .log-row:nth-child(odd) { border-right: none; }
    .log-date { grid-column: 1 / -1; }
    .term-body { padding: 1.1rem; }
}

/* ── Nav-bar WebGL fluid shader ─────────────────────────────────────────
   Canvas fills the fixed header and paints the neon-fluid drift (nav-shader.js).
   It sits ON TOP of the navbar's own --nav-bg but BEHIND the logo/links, so the
   dim translucent bar still shows through the shader's transparent base. The bar
   never depends on it: if WebGL is unavailable the canvas stays clear and the
   navbar looks exactly as before. */
.nav-shader {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* z-index:-1 sits the canvas ABOVE the navbar's own --nav-bg but BELOW the
       logo/links (which are in normal flow). The navbar is position:fixed, so it
       always forms a stacking context and the negative layer can't escape it.
       This deliberately avoids making .container a positioning context — doing so
       would steal the mobile dropdown's anchor (it is absolute / left:0 / right:0
       against the navbar) and break its full-bleed width. */
    z-index: -1;
    pointer-events: none;
    display: block;
}

/* Touch: capture finger-drags across the bar so they reliably stir the light.
   touch-action:none stops the browser reverting a drag into a scroll mid-gesture
   (which made the disturbance fire once and stop). The bar is a thin fixed strip
   at the very top, so the lost "scroll by swiping the nav" gesture is negligible;
   the page still scrolls normally from anywhere below it. */
.navbar,
.navbar .container { touch-action: none; }
