/* ============================================================
   BIOS PORTFOLIO — styles.css
   Samir Ghimire | GHIMIRE SYSTEMS INC.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:         #0a0c0e;
    --bg2:        #0f1215;
    --bg3:        #141820;
    --panel:      #0d1117;
    --border:     #1e3a2f;
    --border2:    #0f2318;
    --cyan:       #00f5c4;
    --cyan2:      #00c9a0;
    --cyan-dim:   rgba(0,245,196,0.12);
    --cyan-glow:  0 0 8px rgba(0,245,196,0.5);
    --green:      #39ff14;
    --green-dim:  rgba(57,255,20,0.12);
    --yellow:     #ffd700;
    --red:        #ff3b3b;
    --white:      #cfe0d8;
    --dim:        #4a6358;
    --font-mono:  'Share Tech Mono', 'Courier New', monospace;
    --font-bios:  'VT323', monospace;
    --header-h:   42px;
    --nav-h:      46px;
    --footer-h:   36px;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
    overflow: hidden;
    cursor: default;
    user-select: none;
}

a {
    color: var(--cyan);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
    color: var(--green);
}

/* ── Scanlines ── */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.12) 2px,
        rgba(0,0,0,0.12) 4px
    );
}

/* ── Blink animations ── */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
@keyframes dotBlink {
    0%, 49% { opacity: 1; box-shadow: 0 0 6px currentColor; }
    50%, 100% { opacity: 0.2; box-shadow: none; }
}
@keyframes bootFillAnim {
    from { width: 0%; }
    to   { width: 100%; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fillBar {
    from { width: 0%; }
    to   { width: var(--target); }
}
@keyframes glitch {
    0%   { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
    20%  { clip-path: inset(92% 0 1% 0);  transform: translate(2px, -2px); }
    40%  { clip-path: inset(43% 0 1% 0);  transform: translate(0, 1px); }
    60%  { clip-path: inset(25% 0 58% 0); transform: translate(1px, -1px); }
    80%  { clip-path: inset(54% 0 7% 0);  transform: translate(-1px, 0); }
    100% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
}

/* ── HUD Construct Animations — sketch/draw/trace style ── */
/* Every animation uses clip-path reveals, smooth wipes, and linear traces.
   Nothing pops or bounces — elements are "drawn" onto the screen. */

/* Draw top edge then reveal downward — like a pen drawing the border */
@keyframes drawDown {
    0%   { opacity: 0; clip-path: inset(0 0 100% 0); }
    10%  { opacity: 1; clip-path: inset(0 0 95% 0); }
    30%  { clip-path: inset(0 0 72% 0); }
    55%  { clip-path: inset(0 0 40% 0); }
    80%  { clip-path: inset(0 0 12% 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Draw bottom edge then reveal upward */
@keyframes drawUp {
    0%   { opacity: 0; clip-path: inset(100% 0 0 0); }
    10%  { opacity: 1; clip-path: inset(95% 0 0 0); }
    30%  { clip-path: inset(72% 0 0 0); }
    55%  { clip-path: inset(40% 0 0 0); }
    80%  { clip-path: inset(12% 0 0 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Trace from left edge to right — stepped like a plotter pen */
@keyframes traceRight {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
    8%   { opacity: 1; clip-path: inset(0 96% 0 0); }
    25%  { clip-path: inset(0 75% 0 0); }
    45%  { clip-path: inset(0 48% 0 0); }
    70%  { clip-path: inset(0 20% 0 0); }
    90%  { clip-path: inset(0 5% 0 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Trace from right edge to left — stepped like a plotter pen */
@keyframes traceLeft {
    0%   { opacity: 0; clip-path: inset(0 0 0 100%); }
    8%   { opacity: 1; clip-path: inset(0 0 0 96%); }
    25%  { clip-path: inset(0 0 0 75%); }
    45%  { clip-path: inset(0 0 0 48%); }
    70%  { clip-path: inset(0 0 0 20%); }
    90%  { clip-path: inset(0 0 0 5%); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Sketch outline — draw top line, then sides, then fill */
@keyframes sketchBox {
    0%   { opacity: 0; clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
    20%  { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
    50%  { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    100% { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}
/* Scan — a thin reveal line sweeps top to bottom progressively */
@keyframes scanDown {
    0%   { opacity: 0; clip-path: inset(0 0 100% 0); }
    5%   { opacity: 1; clip-path: inset(0 0 96% 0); }
    30%  { clip-path: inset(0 0 65% 0); }
    60%  { clip-path: inset(0 0 30% 0); }
    85%  { clip-path: inset(0 0 8% 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Thin horizontal line extends then expands vertically */
@keyframes drawLine {
    0%   { opacity: 0; clip-path: inset(48% 100% 48% 0); }
    40%  { opacity: 1; clip-path: inset(48% 0 48% 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Typewriter — trace left to right like a cursor writing */
@keyframes typeTrace {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
    6%   { opacity: 1; clip-path: inset(0 95% 0 0); }
    20%  { clip-path: inset(0 78% 0 0); }
    40%  { clip-path: inset(0 52% 0 0); }
    60%  { clip-path: inset(0 30% 0 0); }
    80%  { clip-path: inset(0 10% 0 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Gentle fade while tracing from left */
@keyframes fadeTrace {
    0%   { opacity: 0; clip-path: inset(0 80% 0 0); }
    30%  { opacity: 0.6; clip-path: inset(0 40% 0 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Construct from center outward */
@keyframes expandCenter {
    0%   { opacity: 0; clip-path: inset(0 50% 0 50%); }
    15%  { opacity: 1; }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Sketch a small element — quick trace */
@keyframes sketchSmall {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
    20%  { opacity: 0.7; }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Draw dots/lines progressively */
@keyframes drawDots {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
    100% { opacity: 0.6; clip-path: inset(0 0 0 0); }
}
/* Construct a bar — scaleX from 0 to 1, no overshoot */
@keyframes constructBar {
    0%   { opacity: 0; transform: scaleX(0); transform-origin: left; }
    15%  { opacity: 1; }
    100% { opacity: 1; transform: scaleX(1); }
}
/* Stat box — scan line expands from center outward, content revealed as it grows */
@keyframes constructStatBox {
    0%   { opacity: 0; clip-path: inset(48% 0 48% 0); }
    15%  { opacity: 1; clip-path: inset(36% 0 36% 0); }
    40%  { clip-path: inset(14% 0 14% 0); }
    70%  { clip-path: inset(3% 0 3% 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Log entry — border draws in from left then content fills right */
@keyframes constructLogEntry {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
    8%   { opacity: 1; clip-path: inset(0 92% 0 0); }
    30%  { clip-path: inset(0 60% 0 0); }
    60%  { clip-path: inset(0 25% 0 0); }
    85%  { clip-path: inset(0 5% 0 0); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Clock digits — expand from center */
@keyframes constructClock {
    0%   { opacity: 0; clip-path: inset(20% 50% 20% 50%); }
    20%  { opacity: 1; clip-path: inset(10% 30% 10% 30%); }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Separator — draw a line left to right */
@keyframes drawSeparator {
    0%   { opacity: 0; clip-path: inset(0 100% 0 0); }
    20%  { opacity: 0.4; }
    100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
/* Notice — outline draws in then fill fades */
@keyframes constructNotice {
    0%   { opacity: 0; clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); }
    30%  { opacity: 0.5; clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%); }
    100% { opacity: 1; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

/* Hidden state for HUD elements before reveal */
[data-hud] {
    opacity: 0;
    visibility: hidden;
}
[data-hud].hud-visible {
    visibility: visible;
}

/* ── Per-component construct selectors ── */
/* Header — draws top line then reveals downward */
[data-hud="header"].hud-visible {
    animation: drawDown 0.6s ease forwards;
}
/* Nav — same draw-down construct */
[data-hud="nav"].hud-visible {
    animation: drawDown 0.5s ease forwards;
}
/* Nav tabs — trace in from left */
[data-hud="nav-tab"].hud-visible {
    animation: traceRight 0.38s ease forwards;
}
/* Left panel — trace from left edge */
[data-hud="left-panel"].hud-visible {
    animation: traceRight 0.6s ease forwards;
}
/* Title bars — wipe right like drawing a highlight */
[data-hud="title-bar"].hud-visible {
    animation: traceRight 0.42s ease forwards;
}
/* Right sections — scan reveal top to bottom */
[data-hud="right-section"].hud-visible {
    animation: scanDown 0.5s ease forwards;
}
/* Right titles — trace right */
[data-hud="right-title"].hud-visible {
    animation: traceRight 0.25s ease forwards;
}
/* Clock — expand from center */
[data-hud="clock"].hud-visible {
    animation: constructClock 0.55s ease forwards;
}
/* Footer — draws up from bottom edge */
[data-hud="footer"].hud-visible {
    animation: drawUp 0.6s ease forwards;
}
/* Footer children — typewriter trace */
[data-hud="footer-child"].hud-visible {
    animation: typeTrace 0.35s ease forwards;
}
/* Info rows — trace right like writing data */
[data-hud="info-row"].hud-visible {
    animation: traceRight 0.3s ease forwards;
}
/* Header left — typewriter trace */
[data-hud="header-left"].hud-visible {
    animation: typeTrace 0.4s ease forwards;
}
/* Header right — trace from right side */
[data-hud="header-right"].hud-visible {
    animation: traceLeft 0.35s ease forwards;
}

/* ── Granular element construct selectors ── */
/* Right panel — trace from right edge */
[data-hud="right-panel"].hud-visible {
    animation: traceLeft 0.6s ease forwards;
}
/* Brand text — typewriter trace */
[data-hud="hud-brand"].hud-visible {
    animation: typeTrace 0.55s ease forwards;
}
/* Separator flash — simple line draw */
[data-hud="hud-flash"].hud-visible {
    animation: drawSeparator 0.2s ease forwards;
}
/* Date — fade + trace */
[data-hud="hud-date"].hud-visible {
    animation: fadeTrace 0.3s ease forwards;
}
/* Status — expand from center */
[data-hud="hud-status"].hud-visible {
    animation: expandCenter 0.35s ease forwards;
}
/* Menu arrow — quick sketch */
[data-hud="hud-arrow"].hud-visible {
    animation: sketchSmall 0.2s ease forwards;
}
/* Menu label — trace right */
[data-hud="hud-label"].hud-visible {
    animation: typeTrace 0.25s ease forwards;
}
/* Menu dots — draw progressively */
[data-hud="hud-dots"].hud-visible {
    animation: drawDots 0.4s linear forwards;
}
/* Menu value — trace from right */
[data-hud="hud-val"].hud-visible {
    animation: traceLeft 0.25s ease forwards;
}
/* Separator lines — draw left to right */
[data-hud="hud-electric"].hud-visible {
    animation: drawSeparator 0.4s ease forwards;
}
/* Boot sequence items — trace right */
[data-hud="hud-seq"].hud-visible {
    animation: traceRight 0.22s ease forwards;
}
/* Key binding items — sketch in */
[data-hud="hud-keyitem"].hud-visible {
    animation: sketchSmall 0.22s ease forwards;
}
/* Mini bar labels — fade trace */
[data-hud="hud-minilabel"].hud-visible {
    animation: fadeTrace 0.2s ease forwards;
}
/* Mini bar fills — construct bar from left */
[data-hud="hud-minibar"].hud-visible {
    animation: constructBar 0.3s ease forwards;
}
/* Memory labels — trace right */
[data-hud="hud-memlabel"].hud-visible {
    animation: traceRight 0.2s ease forwards;
}
/* Memory ASCII bars — trace right */
[data-hud="hud-membar"].hud-visible {
    animation: traceRight 0.3s ease forwards;
}
/* Notice box — construct from left */
[data-hud="hud-notice"].hud-visible {
    animation: constructNotice 0.4s ease forwards;
}
/* Key hints — sketch in */
[data-hud="hud-keyhint"].hud-visible {
    animation: sketchSmall 0.22s ease forwards;
}
/* Info row key — trace right (the label part) */
[data-hud="hud-infokey"].hud-visible {
    animation: typeTrace 0.2s ease forwards;
}
/* Info row value — trace from right */
[data-hud="hud-infoval"].hud-visible {
    animation: traceLeft 0.22s ease forwards;
}
/* Title bar icon — sketch small quick */
[data-hud="hud-titleicon"].hud-visible {
    animation: sketchSmall 0.12s ease forwards;
}
/* Tab icon (▸) — quick sketch */
[data-hud="hud-tabicon"].hud-visible {
    animation: sketchSmall 0.1s ease forwards;
}
/* Status dot — expand from center */
[data-hud="hud-statusdot"].hud-visible {
    animation: expandCenter 0.2s ease forwards;
}
/* Keyboard keys in key bindings */
[data-hud="hud-kbd"].hud-visible {
    animation: sketchSmall 0.12s ease forwards;
}
/* Footer version span */
[data-hud="hud-footspan"].hud-visible {
    animation: typeTrace 0.2s ease forwards;
}
/* Stat box — constructs itself from a scan line expanding to full height */
[data-hud="hud-statbox"].hud-visible {
    animation: constructStatBox 0.5s ease forwards;
}
/* Log entry — draws itself in from left as a single unit */
[data-hud="hud-logentry"].hud-visible {
    animation: constructLogEntry 0.38s ease forwards;
}

/* ── Fast tab-switch construct animations (sketch/draw style) ── */

/* Section children hidden before tab-switch anim */
.bios-section .tab-hud-target {
    opacity: 0;
}
.bios-section .tab-hud-target.tab-hud-visible {
    opacity: 1;
}

/* Title bars — trace right */
.tab-hud-target.tab-hud-visible.t-title {
    animation: traceRight 0.22s ease forwards;
}
/* Info/data rows — trace right */
.tab-hud-target.tab-hud-visible.t-row {
    animation: traceRight 0.18s ease forwards;
}
/* Bio lines — typewriter trace */
.tab-hud-target.tab-hud-visible.t-bio {
    animation: typeTrace 0.22s ease forwards;
}
/* Flag items — sketch in */
.tab-hud-target.tab-hud-visible.t-flag {
    animation: sketchSmall 0.2s ease forwards;
}
/* Skill entries — trace right */
.tab-hud-target.tab-hud-visible.t-skill {
    animation: traceRight 0.2s ease forwards;
}
/* Tool group labels — trace right */
.tab-hud-target.tab-hud-visible.t-grouplabel {
    animation: traceRight 0.18s ease forwards;
}
/* Tool chips — sketch in */
.tab-hud-target.tab-hud-visible.t-chip {
    animation: sketchSmall 0.18s ease forwards;
}
/* Form rows — scan down */
.tab-hud-target.tab-hud-visible.t-form {
    animation: scanDown 0.2s ease forwards;
}
/* Buttons — draw line then expand */
.tab-hud-target.tab-hud-visible.t-btn {
    animation: drawLine 0.2s ease forwards;
}
/* Separator lines — draw left to right */
.tab-hud-target.tab-hud-visible.t-sep {
    animation: drawSeparator 0.15s ease forwards;
}
/* Generic blocks — scan down */
.tab-hud-target.tab-hud-visible.t-block {
    animation: scanDown 0.22s ease forwards;
}
/* Menu items — trace right */
.tab-hud-target.tab-hud-visible.t-menu {
    animation: traceRight 0.2s ease forwards;
}
/* Menu arrow — sketch small */
.tab-hud-target.tab-hud-visible.t-menuarrow {
    animation: sketchSmall 0.1s ease forwards;
}
/* Menu label — typewriter */
.tab-hud-target.tab-hud-visible.t-menulabel {
    animation: typeTrace 0.16s ease forwards;
}
/* Menu dots — draw progressively */
.tab-hud-target.tab-hud-visible.t-menudots {
    animation: drawDots 0.22s linear forwards;
}
/* Menu value — trace from right */
.tab-hud-target.tab-hud-visible.t-menuval {
    animation: traceLeft 0.16s ease forwards;
}
/* Title icon — quick sketch */
.tab-hud-target.tab-hud-visible.t-titleicon {
    animation: sketchSmall 0.08s ease forwards;
}
/* Info key — typewriter trace */
.tab-hud-target.tab-hud-visible.t-infokey {
    animation: typeTrace 0.14s ease forwards;
}
/* Info value — trace from right */
.tab-hud-target.tab-hud-visible.t-infoval {
    animation: traceLeft 0.16s ease forwards;
}
/* Flag status — sketch */
.tab-hud-target.tab-hud-visible.t-flagstatus {
    animation: sketchSmall 0.12s ease forwards;
}
/* Flag name — typewriter */
.tab-hud-target.tab-hud-visible.t-flagname {
    animation: typeTrace 0.16s ease forwards;
}
/* Skill name — typewriter */
.tab-hud-target.tab-hud-visible.t-skillname {
    animation: typeTrace 0.14s ease forwards;
}
/* Skill bar — construct bar from left */
.tab-hud-target.tab-hud-visible.t-skillbar {
    animation: constructBar 0.22s ease forwards;
}
/* Skill percentage — trace from right */
.tab-hud-target.tab-hud-visible.t-skillpct {
    animation: traceLeft 0.12s ease forwards;
}
/* Form label — typewriter */
.tab-hud-target.tab-hud-visible.t-formlabel {
    animation: typeTrace 0.14s ease forwards;
}
/* Form input — draw line then expand */
.tab-hud-target.tab-hud-visible.t-forminput {
    animation: drawLine 0.2s ease forwards;
}
/* Stat box — constructs as a whole unit: scan line expands to full height */
.tab-hud-target.tab-hud-visible.t-statbox {
    animation: constructStatBox 0.36s ease forwards;
}
/* Log entry — draws itself in from left as a whole unit */
.tab-hud-target.tab-hud-visible.t-logentry {
    animation: constructLogEntry 0.28s ease forwards;
}
/* Projects header stat — constructs as a whole unit like a stat box */
.tab-hud-target.tab-hud-visible.t-projstat {
    animation: constructStatBox 0.34s ease forwards;
}

/* Overlay grid flash during init */
.hud-grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 4999;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 30px,
            rgba(0,245,196,0.03) 30px,
            rgba(0,245,196,0.03) 31px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 30px,
            rgba(0,245,196,0.03) 30px,
            rgba(0,245,196,0.03) 31px
        );
    opacity: 0;
    transition: opacity 0.3s ease;
}
.hud-grid-overlay.active {
    animation: hudGridPulse 2.5s ease forwards;
}
@keyframes hudGridPulse {
    0%   { opacity: 0; }
    10%  { opacity: 0.8; }
    40%  { opacity: 0.3; }
    70%  { opacity: 0.15; }
    100% { opacity: 0; }
}

.blink-text { animation: blink 1s step-end infinite; }
.blink-dot  {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    animation: dotBlink 1.2s ease infinite;
    vertical-align: middle;
}
.green-dot  { background: var(--green); color: var(--green); }

/*
   BOOT SCREEN
 */
#boot-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}
#boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.boot-content {
    width: min(780px, 96vw);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.boot-logo {
    text-align: center;
}

.ascii-logo {
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: clamp(6px, 1.5vw, 13px);
    line-height: 1.2;
    text-shadow: var(--cyan-glow);
    white-space: pre;
    display: inline-block;
}

.bios-brand {
    color: var(--dim);
    font-size: 12px;
    margin-top: 6px;
    letter-spacing: 2px;
}

.bios-subtitle {
    color: var(--cyan2);
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 6px;
    margin-top: 8px;
    text-shadow: 0 0 6px rgba(0,201,160,0.4);
}

.boot-log {
    border: 1px solid var(--border);
    background: var(--bg2);
    padding: 12px 16px;
    height: 160px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--white);
    line-height: 1.7;
}
.boot-log::-webkit-scrollbar { width: 4px; }
.boot-log::-webkit-scrollbar-track { background: var(--bg2); }
.boot-log::-webkit-scrollbar-thumb { background: var(--border); }

.boot-log-line.ok   { color: var(--green); }
.boot-log-line.warn { color: var(--yellow); }
.boot-log-line.err  { color: var(--red); }
.boot-log-line.info { color: var(--cyan); }
.boot-log-line.dim  { color: var(--dim); }

.boot-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.boot-progress-bar {
    flex: 1;
    height: 18px;
    border: 1px solid var(--border);
    background: var(--bg2);
    padding: 2px;
}

.boot-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan2), var(--cyan));
    box-shadow: var(--cyan-glow);
    transition: width 0.1s linear;
}

#boot-pct {
    color: var(--cyan);
    font-size: 14px;
    min-width: 36px;
    text-align: right;
}

.boot-hint {
    text-align: center;
    color: var(--dim);
    font-size: 12px;
}

/*
   MAIN BIOS UI
 */
#bios-main {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow: hidden;
}

#bios-main.hidden {
    display: none;
}

/* ── Header ── */
.bios-header {
    height: var(--header-h);
    background: linear-gradient(90deg, #001a12 0%, #002418 50%, #001a12 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    flex-shrink: 0;
}

.header-brand {
    color: var(--cyan);
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: var(--cyan-glow);
    font-family: var(--font-bios);
    font-size: 18px;
}

.header-sep { color: var(--dim); margin: 0 10px; }

.header-date { color: var(--dim); font-size: 12px; }

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--green);
    font-size: 12px;
    letter-spacing: 1px;
}

/* ── Nav ── */
.bios-nav {
    height: var(--nav-h);
    background: #050a07;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    flex-shrink: 0;
    gap: 8px;
}

.nav-tabs {
    display: flex;
    height: 100%;
    align-items: stretch;
}

.nav-tab {
    background: transparent;
    border: none;
    border-right: 1px solid var(--border2);
    color: var(--dim);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 0 20px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-tab:hover {
    color: var(--white);
    background: var(--cyan-dim);
}

.nav-tab.active {
    color: var(--bg);
    background: var(--cyan);
    font-weight: bold;
}

.nav-tab.active .tab-icon {
    color: var(--bg);
}

.tab-icon {
    font-size: 10px;
    color: var(--dim);
}

.nav-keys {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}

.key-hint {
    color: var(--dim);
    font-size: 11px;
}

/* ── Hamburger ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 8px;
    cursor: pointer;
    flex-shrink: 0;
    z-index: 10;
}
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--cyan);
    transition: all 0.25s ease;
}
.hamburger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ── Body ── */
.bios-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ── Panels ── */
.bios-panel {
    overflow-y: auto;
    padding: 14px;
}

.bios-panel::-webkit-scrollbar { width: 6px; }
.bios-panel::-webkit-scrollbar-track { background: var(--bg2); }
.bios-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.left-panel {
    flex: 1;
    border-right: 1px solid var(--border);
}

.left-panel:has(#section-main.active) {
    overflow: hidden;
}

.right-panel {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg2);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Sections ── */
.bios-section {
    display: none;
    animation: fadeIn 0.25s ease;
}

.bios-section.active {
    display: block;
}

#section-main.active {
    overflow: hidden;
}

/* ── Section Title Bar ── */
.section-title-bar {
    background: linear-gradient(90deg, var(--cyan) 0%, var(--cyan2) 100%);
    color: var(--bg);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 4px 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.section-title-bar.small {
    font-size: 10px;
    padding: 3px 8px;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.section-icon { font-size: 8px; }

.badge {
    margin-left: auto;
    background: var(--bg);
    color: var(--cyan);
    font-size: 10px;
    padding: 1px 6px;
    border: 1px solid var(--cyan);
}

/* ── Info Table ── */
.info-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.info-row {
    display: flex;
    align-items: baseline;
    gap: 0;
    padding: 3px 6px;
    border-bottom: 1px solid var(--border2);
    transition: background 0.1s;
}

.info-row:hover {
    background: var(--cyan-dim);
}

.info-key {
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 1px;
    min-width: 150px;
    flex-shrink: 0;
}

.info-key::after { content: ' :'; }

.info-val {
    color: var(--white);
    font-size: 12px;
    word-break: break-all;
}

.accent { color: var(--cyan); text-shadow: var(--cyan-glow); }
.green  { color: var(--green); }
.yellow { color: var(--yellow); }

/* ── Separator ── */
.separator-line {
    border: none;
    border-top: 1px solid var(--border);
    margin: 14px 0;
}

/* ── Main Page — Stat Grid ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-box {
    border: 1px solid var(--border);
    background: var(--bg2);
    padding: 12px 10px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 2px; height: 100%;
    background: var(--cyan);
    opacity: 0.5;
}

.stat-box:hover {
    border-color: var(--cyan2);
    background: var(--cyan-dim);
}

.stat-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--dim);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--font-bios);
    font-size: 28px;
    line-height: 1;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stat-sub {
    font-size: 9px;
    color: var(--dim);
    letter-spacing: 1px;
}

/* ── Main Page — Activity Log ── */
.activity-log {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
    border: 1px solid var(--border2);
    background: var(--bg2);
}

.log-entry {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border2);
    font-size: 12px;
    transition: background 0.1s;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry:hover {
    background: var(--cyan-dim);
}

.log-ts {
    color: var(--dim);
    font-size: 11px;
    min-width: 54px;
    flex-shrink: 0;
}

.log-tag {
    font-size: 11px;
    min-width: 66px;
    flex-shrink: 0;
    font-family: var(--font-mono);
    letter-spacing: 0.5px;
}

.log-tag.ok   { color: var(--green); }
.log-tag.warn { color: var(--yellow); }
.log-tag.err  { color: var(--red); }
.log-tag.info { color: var(--cyan); }

.log-msg {
    color: var(--white);
    opacity: 0.85;
    font-size: 12px;
}

/* ── About Two-Column Layout ── */
.about-two-col {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0 20px;
    align-items: start;
}

/* Larger info rows scoped to about section */
#section-about .info-key {
    font-size: 12px;
    min-width: 140px;
}

#section-about .info-val {
    font-size: 13px;
}

#section-about .info-row {
    padding: 5px 6px;
}

.about-col-bio,
.about-col-flags {
    display: flex;
    flex-direction: column;
}

/* ── Projects Header Bar ── */
.projects-header-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border);
    background: var(--bg2);
    margin-bottom: 12px;
}

.proj-stat {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-right: 1px solid var(--border2);
    position: relative;
    overflow: hidden;
}

.proj-stat::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    opacity: 0.3;
}

.proj-stat:last-child { border-right: none; }

.proj-stat-label {
    font-size: 9px;
    color: var(--dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.proj-stat-val {
    font-size: 12px;
    color: var(--white);
    letter-spacing: 0.5px;
}

/* ── Contact Two-Column Layout ── */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 0 20px;
    align-items: start;
}

.contact-col-info,
.contact-col-form {
    display: flex;
    flex-direction: column;
}

.contact-col-info .link-buttons {
    flex-direction: column;
    gap: 8px;
}

.contact-col-info .bios-btn {
    display: block;
    text-align: center;
}

/* ── Contact — scoped larger text ── */
#section-contact .info-key { font-size: 12px; min-width: 130px; }
#section-contact .info-val { font-size: 13px; }
#section-contact .info-row { padding: 5px 6px; }
#section-contact .form-label { font-size: 12px; min-width: 110px; }
#section-contact .bios-input { font-size: 13px; }

/* ── Contact — Preferred Channels ── */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border2);
    background: var(--bg2);
    margin-bottom: 10px;
}

.channel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border2);
    transition: background 0.1s;
}

.channel-row:last-child { border-bottom: none; }
.channel-row:hover { background: var(--cyan-dim); }

.channel-rank {
    font-family: var(--font-bios);
    font-size: 18px;
    color: var(--cyan);
    min-width: 28px;
    opacity: 0.7;
}

.channel-name {
    flex: 1;
    color: var(--white);
    font-size: 13px;
    letter-spacing: 0.5px;
}

.channel-note {
    color: var(--dim);
    font-size: 11px;
}

/* ── About — Active Processes ── */
.process-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border2);
    background: var(--bg2);
    margin-bottom: 10px;
}

.process-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border2);
    transition: background 0.1s;
}

.process-row:last-child { border-bottom: none; }
.process-row:hover { background: var(--cyan-dim); }

.proc-id {
    color: var(--dim);
    font-size: 10px;
    min-width: 58px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.proc-name {
    flex: 1;
    color: var(--white);
    font-size: 13px;
}

.proc-status {
    font-size: 10px;
    padding: 2px 7px;
    border: 1px solid;
    letter-spacing: 0.5px;
    min-width: 72px;
    text-align: center;
}

.proc-status.running  { color: var(--green);  border-color: rgba(57,255,20,0.4);  background: rgba(57,255,20,0.06); }
.proc-status.learning { color: var(--cyan);   border-color: rgba(0,245,196,0.4);  background: var(--cyan-dim); }
.proc-status.idle     { color: var(--yellow); border-color: rgba(255,215,0,0.4);  background: rgba(255,215,0,0.06); }

/* ── Bio Block ── */
.bio-block { padding: 4px 0 14px; }

.bio-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 6px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--white);
}

.prompt { color: var(--cyan); font-size: 14px; flex-shrink: 0; }

.cursor { color: var(--cyan); }

/* ── Flags ── */
.flags-grid { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }

.flag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 6px;
    font-size: 13px;
}

.flag-status {
    font-size: 12px;
    letter-spacing: 1px;
    min-width: 100px;
}

.flag-item.enabled .flag-status { color: var(--green); }
.flag-item.disabled .flag-status { color: var(--red); }
.flag-item.enabled .flag-name { color: var(--white); }
.flag-item.disabled .flag-name { color: var(--dim); }

/* ── Skills Bars ── */
.skill-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }

.skill-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
}

.skill-name {
    min-width: 130px;
    font-size: 11px;
    color: var(--white);
    letter-spacing: 0.5px;
}

.skill-bar-wrap {
    flex: 1;
    height: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 1px;
}

.skill-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan2), var(--cyan));
    box-shadow: 0 0 4px rgba(0,245,196,0.4);
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-pct {
    font-size: 11px;
    color: var(--cyan);
    min-width: 34px;
    text-align: right;
}

/* ── Skills Section — Fill entire panel height ── */
#section-skills.active {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Top: 3-column skill bars — stretches to fill ~55% */
.skills-bar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0 28px;
    flex: 1;
    align-content: start;
}

.skills-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Spacious skills styling */
#section-skills .section-title-bar {
    font-size: 12px;
    padding: 6px 12px;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

#section-skills .separator-line {
    margin: 12px 0;
    flex-shrink: 0;
}

#section-skills .skill-rows {
    gap: 10px;
    margin-bottom: 0;
}

#section-skills .skill-entry {
    padding: 4px 8px;
    gap: 12px;
}

#section-skills .skill-name {
    min-width: 140px;
    font-size: 13px;
}

#section-skills .skill-bar-wrap {
    height: 16px;
}

#section-skills .skill-pct {
    font-size: 12px;
    min-width: 36px;
}

/* Bottom: Tools area — stretches to fill remaining ~45% */
.skills-tools-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tools-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px 28px;
    padding: 10px 6px;
    flex: 1;
    align-content: start;
}

.tool-group-inline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-group-inline .tool-group-label {
    color: var(--dim);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border2);
    padding-bottom: 4px;
}

.tool-group-inline .tool-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-group-inline .tool-chip {
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--cyan);
    font-size: 12px;
    padding: 6px 14px;
    letter-spacing: 1px;
    cursor: default;
    transition: all 0.15s;
}

.tool-group-inline .tool-chip:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
}

/* ── Tools Grid ── */
.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px;
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tool-group-label {
    color: var(--dim);
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border2);
    padding-bottom: 3px;
}

.tool-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tool-chip {
    border: 1px solid var(--border);
    background: var(--bg2);
    color: var(--cyan);
    font-size: 11px;
    padding: 5px 12px;
    letter-spacing: 1px;
    cursor: default;
    transition: all 0.15s;
}

.tool-chip:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
}

/* ── Projects ── */
.projects-status {
    color: var(--cyan);
    font-size: 12px;
    padding: 6px 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-entry {
    border: 1px solid var(--border);
    background: var(--bg2);
    padding: 10px 14px;
    transition: all 0.15s;
    cursor: pointer;
}

.project-entry:hover {
    border-color: var(--cyan);
    background: var(--cyan-dim);
    box-shadow: inset 0 0 0 1px var(--cyan);
}

.project-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.project-num {
    color: var(--dim);
    font-size: 10px;
    min-width: 26px;
}

.project-name {
    color: var(--cyan);
    font-size: 13px;
    letter-spacing: 0.5px;
    flex: 1;
}

.project-links {
    display: flex;
    gap: 10px;
}

.project-link {
    font-size: 10px;
    color: var(--dim);
    border: 1px solid var(--border);
    padding: 1px 6px;
    transition: all 0.1s;
}

.project-link:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    text-decoration: none;
}

.project-desc {
    font-size: 11px;
    color: var(--dim);
    margin: 4px 0;
    line-height: 1.5;
}

.project-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.lang-tag {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--yellow);
    font-size: 10px;
    padding: 1px 7px;
}

.project-meta {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 10px;
    color: var(--dim);
}

.project-meta span { display: flex; align-items: center; gap: 4px; }

.projects-footer {
    padding: 10px 4px;
    display: flex;
    justify-content: flex-start;
}

.error-entry {
    border: 1px solid var(--red);
    background: rgba(255, 59, 59, 0.05);
    padding: 12px 14px;
    color: var(--red);
    font-size: 12px;
    line-height: 1.8;
}

.loading-entry {
    color: var(--dim);
    font-size: 12px;
    padding: 8px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Contact Form ── */
.bios-form { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 10px; }

.form-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-label {
    color: var(--dim);
    font-size: 11px;
    min-width: 100px;
    padding-top: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.bios-input {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    transition: border-color 0.15s;
    resize: none;
}

.bios-input:focus {
    border-color: var(--cyan);
    background: var(--cyan-dim);
    box-shadow: var(--cyan-glow);
}

.bios-input::placeholder { color: var(--dim); }

.bios-textarea { font-family: var(--font-mono); }

.form-submit-row {
    gap: 12px;
    flex-wrap: wrap;
}

.form-status {
    font-size: 12px;
    padding: 4px 6px;
    min-height: 22px;
}

.form-status.success { color: var(--green); }
.form-status.error   { color: var(--red); }

.link-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 0;
}

/* ── BIOS Buttons ── */
.bios-btn {
    display: inline-block;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 5px 14px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.15s;
    text-decoration: none;
}

.bios-btn:hover {
    background: var(--cyan-dim);
    border-color: var(--cyan);
    box-shadow: var(--cyan-glow);
    color: var(--cyan);
    text-decoration: none;
}

.bios-btn-primary {
    background: var(--cyan);
    color: var(--bg);
    border-color: var(--cyan);
    font-weight: bold;
}

.bios-btn-primary:hover {
    background: var(--green);
    border-color: var(--green);
    color: var(--bg);
    box-shadow: 0 0 8px rgba(57,255,20,0.5);
}

/* ── Right Panel Sections ── */
.right-section {
    border-bottom: 1px solid var(--border2);
    padding: 10px;
    flex-shrink: 0;
}

/* Clock */
.clock-display {
    font-family: var(--font-bios);
    font-size: 38px;
    color: var(--cyan);
    text-shadow: var(--cyan-glow);
    letter-spacing: 3px;
    text-align: center;
    line-height: 1;
}

.date-display {
    font-size: 11px;
    color: var(--dim);
    text-align: center;
    margin-top: 4px;
    letter-spacing: 1px;
}

/* Mini CPU bars */
.mini-bars { display: flex; flex-direction: column; gap: 6px; }

.mini-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.mini-bar-row span {
    min-width: 65px;
    color: var(--dim);
    letter-spacing: 0.5px;
}

.mini-fill-wrap {
    flex: 1;
    height: 9px;
    background: var(--bg);
    border: 1px solid var(--border2);
    padding: 1px;
}

.mini-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cyan2), var(--cyan));
    animation: fillBar 2s 1.5s ease forwards;
}

.red-fill {
    background: linear-gradient(90deg, #c00, var(--red));
}

/* Memory Map */
.mem-map { display: flex; flex-direction: column; gap: 4px; }

.mem-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    align-items: center;
}

.mem-label { color: var(--dim); min-width: 45px; }
.mem-bar { color: var(--cyan); font-size: 10px; letter-spacing: -1px; }

/* Boot Sequence */
.boot-seq { display: flex; flex-direction: column; gap: 3px; }

.seq-item {
    font-size: 11px;
    color: var(--dim);
}

.seq-item.ok   { color: var(--green); }
.seq-item.warn { color: var(--yellow); }
.seq-item.err  { color: var(--red); }

/* Key List */
.key-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.key-item {
    font-size: 11px;
    color: var(--dim);
    display: flex;
    align-items: center;
    gap: 4px;
}

kbd {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 1px 5px;
}

/* Dev Notice */
.dev-notice-box {
    font-size: 11px;
    color: var(--dim);
    line-height: 1.7;
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

/* ── Footer ── */
.bios-footer {
    height: var(--footer-h);
    background: linear-gradient(90deg, #001a12 0%, #002418 50%, #001a12 100%);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    flex-shrink: 0;
    font-size: 11px;
}

.footer-left { color: var(--dim); display: flex; gap: 10px; align-items: center; }
.footer-sep { color: var(--border); }
.footer-right { display: flex; gap: 12px; align-items: center; }
.footer-right .key-hint { color: var(--dim); }

/* ── Popup ── */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8000;
}

.popup.hidden { display: none; }

.popup-box {
    border: 2px solid var(--cyan);
    background: var(--bg);
    box-shadow: var(--cyan-glow);
    padding: 24px 36px;
    text-align: center;
    min-width: 320px;
}

.popup-title {
    color: var(--cyan);
    font-size: 15px;
    letter-spacing: 2px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.popup-msg {
    color: var(--white);
    font-size: 13px;
    line-height: 1.8;
}

#popup-no {
    color: var(--dim);
    cursor: pointer;
}

.esteregg{
    padding: 4px 8px;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--dim);
}

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

#popup-no:hover { color: var(--red); }

/* ── Scrollbar global ── */
* { scrollbar-width: thin; scrollbar-color: var(--border) var(--bg2); }

/*
   RESPONSIVE
 */

/* ── Tablet ≤ 900px ── */
@media (max-width: 900px) {
    .right-panel { width: 180px; }
    .info-key { min-width: 110px; }
    .skill-name { min-width: 100px; }
    .nav-keys { display: none; }
    .menu-dots, .menu-val { display: none; }

    #section-skills .skill-name { min-width: 100px; }
    .skills-bar-grid { gap: 0 12px; }
    .tools-full { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 14px; }
}

/* ── Small Tablet / Large Phone ≤ 768px ── */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
        font-size: 12px;
    }
    #bios-main {
        position: relative;
        overflow: auto;
        min-height: 100vh;
    }

    /* Header */
    .bios-header {
        padding: 0 10px;
        flex-wrap: wrap;
        height: auto;
        min-height: var(--header-h);
    }
    .header-brand { font-size: 14px; }
    .header-sep { display: none; }
    .header-date { display: none; }

    /* Nav — show hamburger, collapse tabs */
    .hamburger { display: flex; }
    .bios-nav {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--nav-h);
        padding: 6px;
    }
    .nav-tabs {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 2;
    }
    .nav-tabs.open {
        display: flex;
    }
    .nav-tab {
        padding: 8px 14px;
        border-right: none;
        border-bottom: 1px solid var(--border2);
        justify-content: flex-start;
        font-size: 12px;
    }
    .nav-keys { display: none; }

    /* Body — single column */
    .bios-body {
        flex-direction: column;
        overflow: visible;
    }
    .left-panel {
        border-right: none;
        overflow: visible;
    }
    .right-panel {
        width: 100%;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
    }

    /* Info rows */
    .info-key { min-width: 100px; }

    /* Skills */
    .skill-name { min-width: 80px; }
    .skill-entry { flex-wrap: wrap; }

    /* Skills — single column on mobile */
    .skills-bar-grid {
        grid-template-columns: 1fr;
        gap: 12px 0;
    }
    .tools-full {
        grid-template-columns: 1fr 1fr;
        gap: 10px 12px;
    }
    #section-skills.active {
        overflow: auto;
        height: auto;
    }

    /* About two-col — stack on mobile */
    .about-two-col { grid-template-columns: 1fr; }

    /* Projects header bar — 2 columns */
    .projects-header-bar { grid-template-columns: repeat(2, 1fr); }
    .proj-stat:nth-child(2) { border-right: none; }

    /* Contact layout — stack on mobile */
    .contact-layout { grid-template-columns: 1fr; }
    .contact-col-info .bios-btn { display: inline-block; text-align: left; }
    .contact-col-info .link-buttons { flex-direction: row; }

    /* Projects */
    .project-entry-header { flex-wrap: wrap; gap: 6px; }
    .project-links { width: 100%; }

    /* Contact form — stack labels */
    .form-row {
        flex-direction: column;
        gap: 4px;
    }
    .form-label {
        min-width: unset;
        padding-top: 0;
    }

    /* Footer */
    .bios-footer {
        flex-wrap: wrap;
        height: auto;
        padding: 6px 10px;
        gap: 6px;
    }
    .footer-right { display: none; }

    /* Popup */
    .popup-box {
        min-width: unset;
        width: 90vw;
        padding: 18px;
    }
}

/* ── Phone ≤ 560px ── */
@media (max-width: 560px) {
    /* Boot screen */
    .ascii-logo {
        font-size: clamp(5px, 2.5vw, 10px);
    }
    .boot-content {
        width: 98vw;
        padding: 0 4px;
    }
    .boot-log {
        height: 120px;
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Header shrink */
    .bios-header { padding: 0 8px; }
    .header-brand { font-size: 12px; letter-spacing: 0; }

    /* Panels */
    .bios-panel { padding: 10px 8px; }

    /* Info rows — stack key/val */
    .info-row {
        flex-direction: column;
        gap: 2px;
        padding: 5px 6px;
    }
    .info-key {
        min-width: unset;
        font-size: 10px;
    }
    .info-key::after { content: ''; }
    .info-val { font-size: 12px; padding-left: 8px; }

    /* Projects header bar — single column on phone */
    .projects-header-bar { grid-template-columns: repeat(2, 1fr); }
    .proj-stat { border-right: none; }

    /* Section titles */
    .section-title-bar {
        font-size: 10px;
        letter-spacing: 1px;
        padding: 4px 8px;
    }

    /* Skills */
    .skill-entry {
        flex-wrap: wrap;
        gap: 4px;
    }
    .skill-name {
        min-width: unset;
        width: 100%;
        font-size: 11px;
    }
    .skill-bar-wrap { flex: 1; min-width: 0; }
    .skill-pct { min-width: 30px; font-size: 10px; }

    /* Tool chips */
    .tool-chip {
        font-size: 10px;
        padding: 4px 8px;
    }

    /* Projects */
    .project-entry { padding: 8px 10px; }
    .project-name { font-size: 12px; }
    .project-desc { font-size: 10px; }
    .project-meta { flex-wrap: wrap; gap: 8px; }

    /* Flags */
    .flag-item {
        flex-wrap: wrap;
        gap: 4px;
    }
    .flag-status {
        min-width: unset;
        font-size: 10px;
    }

    /* Right panel sections */
    .clock-display { font-size: 28px; }
    .right-section { padding: 8px; }
    .key-list { grid-template-columns: 1fr; }

    /* Footer */
    .footer-left {
        flex-wrap: wrap;
        font-size: 10px;
        gap: 4px;
    }
    .footer-sep { display: none; }

    /* Bio */
    .bio-line { font-size: 11px; }

    /* Form buttons */
    .form-submit-row {
        flex-direction: column;
        gap: 8px;
    }
    .bios-btn { font-size: 10px; padding: 6px 10px; text-align: center; }
    .link-buttons { flex-direction: column; }
}
