/* ============================================================
   zachdehooge.dev · SRE / terminal theme
   ============================================================ */
:root {
    --bg: #0b0e13;
    --bg-alt: #11151c;
    --bg-raised: #161b24;
    --text: #e6e8ee;
    --muted: #8b93a3;
    --border: #232a36;
    --accent: #5b8cff;      /* links, brand */
    --ok: #3ddc97;          /* healthy / prompt */
    --warn: #f5b44a;        /* bans */
    --alert: #ff5d6c;       /* attacks */
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1040px;
    --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(91, 140, 255, 0.08), transparent 60%),
        radial-gradient(900px 500px at -10% 10%, rgba(61, 220, 151, 0.06), transparent 60%),
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px) 0 0 / 100% 32px,
        var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--ok); }
.muted { color: var(--muted); }

/* ---------- header / nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(11, 14, 19, 0.82);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.nav {
    max-width: var(--max-width); margin: 0 auto; padding: 0.85rem 1.25rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.brand { font-family: var(--mono); font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.prompt { color: var(--ok); font-family: var(--mono); }
.nav-links { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
    font-family: var(--mono); font-size: 0.88rem; color: var(--muted);
    padding: 0.35rem 0.7rem; border-radius: 6px; border: 1px solid transparent;
    display: inline-flex; align-items: center; gap: 0.45rem;
}
.nav-links a:hover { color: var(--text); text-decoration: none; background: var(--bg-raised); }
.nav-links a.active { color: var(--text); background: var(--bg-raised); border-color: var(--border); }
.nav-guests { color: var(--text) !important; border-color: var(--border) !important; }  /* always outlined, like the active tab */

.live-dot {
    --dot: 255, 93, 108;   /* red: offline / attacks */
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
    background: rgb(var(--dot)); animation: pulse 2s infinite;
}
.live-dot.ok { --dot: 61, 220, 151; }    /* green: healthy */
.live-dot.warn { --dot: 245, 180, 74; }  /* amber: delayed */
.live-dot.idle { --dot: 139, 147, 163; animation: none; }   /* grey: state not known yet */
.sep-dot { color: var(--muted); opacity: 0.6; }
.countdown-text { font-variant-numeric: tabular-nums; min-width: 14ch; display: inline-block; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--dot), 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(var(--dot), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--dot), 0); }
}


/* ---------- hero / terminal ---------- */
.hero { max-width: var(--max-width); margin: 0 auto; padding: 4.5rem 1.25rem 2.5rem; }

.terminal {
    max-width: 720px; margin: 0 auto;
    background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(61, 220, 151, 0.04);
    overflow: hidden;
}
.terminal-bar {
    display: flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.9rem;
    background: var(--bg-raised); border-bottom: 1px solid var(--border);
}
.terminal-bar em { margin-left: 0.6rem; font-style: normal; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; } .dot.amber { background: #febc2e; } .dot.green { background: #28c840; }
.terminal-body { padding: 1.4rem 1.6rem 1.6rem; font-family: var(--mono); font-size: 0.95rem; color: var(--muted); }
.terminal-body h1 {
    font-family: var(--sans); font-size: clamp(2.1rem, 6vw, 3.2rem); letter-spacing: -0.02em;
    color: var(--text); margin: 0.2rem 0 0.9rem; line-height: 1.1;
}
.terminal-body .tagline { color: var(--text); font-size: 1.05rem; margin: 0.25rem 0 0.9rem; }
.terminal-body .socials { margin-bottom: 0; }
.terminal-body .socials a { color: var(--accent); }
.terminal-body .socials a::before { content: "→ "; color: var(--muted); }
.cursor {
    display: inline-block; width: 0.6em; height: 1.1em; background: var(--ok);
    vertical-align: text-bottom; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* status strip (home) */
.status-strip { max-width: 820px; margin: 1.25rem auto 0; }
.status-head { display: flex; justify-content: center; margin-bottom: 0.75rem; }
.status-pill {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--mono); font-size: 0.78rem; color: var(--muted);
    padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-alt);
}
.status-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; }
.status-tile {
    background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px;
    padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.15rem; color: var(--text);
}
.status-tile .label { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.status-tile .value { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; }
.status-tile .hint { font-size: 0.75rem; color: var(--accent); }
.status-tile .hint.muted { color: var(--muted); }
.status-tile .value.ok { color: var(--ok); } .status-tile .value.warn { color: var(--warn); }
.status-tile-link:hover { text-decoration: none; border-color: rgba(255, 93, 108, 0.5); }

/* ---------- sections ---------- */
.section { max-width: var(--max-width); margin: 0 auto; padding: 2.75rem 1.25rem; border-top: 1px solid var(--border); }
.section h2 { margin: 0 0 1.25rem; font-family: var(--mono); font-size: 1.25rem; font-weight: 700; }
.hash { color: var(--ok); }

.panel {
    background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem 1.2rem; margin-top: 1.1rem;
}
.panel-title {
    position: relative;
    font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text); margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.panel-title .muted { text-transform: none; letter-spacing: 0; }

/* github stats / projects */
.github-stats { display: flex; gap: 1rem; }
.github-stats img { display: block; width: 100%; height: auto; flex: 1 1 0; min-width: 0; border-radius: 8px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.project-grid a { display: block; border-radius: 8px; transition: transform 0.15s ease; }
.project-grid a:hover { transform: translateY(-2px); }
.project-grid img { width: 100%; height: auto; display: block; border-radius: 8px; }

/* contributions */
.contrib-graph-wrap { overflow-x: auto; }
.contrib-grid {
    display: grid; grid-template-rows: repeat(7, 10px); grid-auto-flow: column;
    grid-auto-columns: 10px; gap: 3px; width: max-content;
}
.contrib-cell { width: 10px; height: 10px; border-radius: 2px; }
.contrib-empty { background: transparent; }
.contrib-cell:not(.contrib-empty) { cursor: pointer; }
.contrib-cell.is-hover { outline: 1px solid var(--text); outline-offset: 1px; }
.contrib-tip {
    position: absolute; z-index: 60; pointer-events: none; white-space: nowrap;
    padding: 0.4rem 0.6rem; border-radius: 6px; background: #161b24; border: 1px solid #2c3442;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); color: var(--muted); font-family: var(--mono); font-size: 0.75rem;
}
.contrib-tip strong { color: var(--text); font-weight: 700; }

/* commits */
.commit-list { display: flex; flex-direction: column; gap: 0.6rem; }
.commit-item { display: grid; grid-template-columns: auto 1fr auto; gap: 0.75rem; align-items: baseline; font-size: 0.95rem; }
.commit-repo { font-family: var(--mono); font-weight: 700; color: var(--ok); white-space: nowrap; }
a.commit-repo:hover { text-decoration: underline; }
.commit-message { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-meta { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; white-space: nowrap; }
.commit-message-private { color: var(--muted); font-style: italic; }

/* ---------- uninvited guests ---------- */
.guests-hero { text-align: center; padding-bottom: 1.5rem; }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; color: var(--alert); letter-spacing: 0.04em; margin: 0 0 0.75rem; }
.guests-hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); letter-spacing: -0.02em; margin: 0 0 1rem; line-height: 1.1; }
.lede { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 1.05rem; }
.pipeline { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0 1rem; }
.chip {
    font-family: var(--mono); font-size: 0.8rem; padding: 0.3rem 0.7rem; border-radius: 6px;
    background: var(--bg-raised); border: 1px solid var(--border);
}
.chip-you { border-color: rgba(61, 220, 151, 0.5); color: var(--ok); }
.arrow { color: var(--muted); font-family: var(--mono); }
.freshness { display: flex; justify-content: center; }
.guests-section { padding-top: 1.5rem; }

.unavailable { border-color: rgba(245, 180, 74, 0.5); display: flex; flex-direction: column; gap: 0.25rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.kpi {
    background: linear-gradient(180deg, var(--bg-raised), var(--bg-alt));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.1rem 0.85rem; display: flex; flex-direction: column; gap: 0.15rem;
    position: relative; min-width: 0;
}
.kpi .label { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.kpi-value { display: flex; align-items: baseline; gap: 0.35rem; margin-top: 0.15rem; }
.kpi .value { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .unit { font-family: var(--mono); font-size: 0.95rem; color: var(--muted); }
.kpi .sub { font-size: 0.78rem; color: var(--muted); min-height: 1.2em; }
.spark { height: 38px; margin-top: 0.5rem; }
.gauge-track { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: auto; }
.gauge-track > i { display: block; height: 100%; width: 0; border-radius: 999px;
                   background: linear-gradient(90deg, var(--ok), #9be7c4); transition: width 0.6s ease; }
.value.alert { color: var(--alert); } .value.warn { color: var(--warn); } .value.ok { color: var(--ok); } .value.info { color: var(--accent); }

.table-wrap { overflow-x: auto; }
table.jail { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.jail th {
    text-align: left; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--muted); padding: 0 0.6rem 0.55rem; border-bottom: 1px solid var(--border);
}
table.jail td { padding: 0.6rem; border-bottom: 1px solid rgba(35, 42, 54, 0.6); white-space: nowrap; }
table.jail tr:last-child td { border-bottom: none; }
.ip { font-family: var(--mono); color: var(--text); }
.countdown { font-family: var(--mono); color: var(--warn); }
table.jail th.num, table.jail td.num { text-align: right; }
table.jail td .n { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
table.jail td .u { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.served .pct { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); min-width: 3.5ch; text-align: right; }
.served { display: flex; align-items: center; gap: 0.5rem; min-width: 140px; }
.bar { flex: 1; height: 6px; background: var(--bg-raised); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--warn), var(--alert)); }
.tag {
    font-family: var(--mono); font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 4px;
    background: rgba(255, 93, 108, 0.12); color: var(--alert); margin-left: 0.4rem;
}
.footnote { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.85rem; }

.legend { margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 0.4rem; }
.sw-attempts { background: var(--alert); } .sw-bans { background: var(--warn); }



.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.1rem; }
.split.even { grid-template-columns: 1fr 1.6fr; }
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 320px; }
.chart-box + .table-wrap { margin-top: 1rem; }
.donut-box { height: 260px; }
.donut-center {
    position: absolute; left: 0; right: 0; top: calc(50% - 22px); transform: translateY(-50%);
    text-align: center; pointer-events: none; display: flex; flex-direction: column;
}
.donut-center span { font-family: var(--mono); font-size: 1.9rem; font-weight: 700; }
.donut-center small { color: var(--muted); font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.split > .panel { margin-top: 1.1rem; min-width: 0; }

.attack-map { height: 320px; border-radius: 8px; overflow: hidden; background: #0d1117; }
.attack-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.4); }
.attack-map .leaflet-container { background: #0d1117; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-raised); color: var(--text); border: 1px solid var(--border); }
.leaflet-popup-content { font-family: var(--mono); font-size: 0.8rem; }
.leaflet-control-attribution { background: rgba(11, 14, 19, 0.75) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--accent) !important; }

.hbars { display: flex; flex-direction: column; gap: 0.45rem; }
.hbar { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 0.6rem; align-items: center; font-size: 0.88rem; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .name.mono { font-family: var(--mono); }
.hbar .track { height: 10px; background: var(--bg-raised); border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: linear-gradient(90deg, rgba(255, 93, 108, 0.55), var(--alert)); border-radius: 999px; }
.hbar .num { font-family: var(--mono); color: var(--muted); font-size: 0.8rem; min-width: 3ch; text-align: right; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: baseline; font-size: 0.9rem; }
.feed .ev { font-family: var(--mono); font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 4px; }
.feed .ev-ban { background: rgba(255, 93, 108, 0.14); color: var(--alert); }
.feed .ev-unban { background: rgba(61, 220, 151, 0.12); color: var(--ok); }
.feed .when { color: var(--muted); font-family: var(--mono); font-size: 0.75rem; white-space: nowrap; }

.fineprint { color: var(--muted); font-size: 0.82rem; margin-top: 1.5rem; text-align: center; }

/* ---------- footer ---------- */
.site-footer {
    max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.25rem 3rem; border-top: 1px solid var(--border);
    color: var(--muted); text-align: center; font-family: var(--mono); font-size: 0.78rem;
    display: flex; flex-direction: column; gap: 0.4rem;
}
.footer-stack { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
    .status-tiles { grid-template-columns: repeat(2, 1fr); }
    .status-tile-link { grid-column: span 2; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .split, .split.even { grid-template-columns: 1fr; }
    .chart-box.tall { height: 280px; }
    .github-stats { flex-direction: column; }
}
@media (max-width: 520px) {
    table.jail .col-sentence, table.jail .col-served { display: none; }
    table.jail td { white-space: normal; padding: 0.55rem 0.4rem; }
    table.jail th { padding-left: 0.4rem; padding-right: 0.4rem; }
    table.jail .tag { display: block; width: fit-content; margin: 0.2rem 0 0; }
    table.jail .countdown { white-space: nowrap; }
    .nav { flex-direction: column; align-items: flex-start; }
    .nav-links { justify-content: flex-start; }
    .kpi .value { font-size: 1.6rem; }
    .sep { display: none; }
    .footer-stack { flex-direction: column; }
    .commit-item { grid-template-columns: 1fr auto; }
    .commit-item .commit-message { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
    .live-dot, .cursor { animation: none; }
    html { scroll-behavior: auto; }
}

/* ---------- "how is this calculated" tooltips ---------- */
.kpi[data-tip] { cursor: help; outline: none; }
.kpi[data-tip]:hover, .kpi[data-tip]:focus-visible { border-color: rgba(91, 140, 255, 0.55); }
.tip-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border);
    font-family: var(--mono); font-size: 0.65rem; font-weight: 700; font-style: italic; text-transform: none;
    color: var(--muted); cursor: help; outline: none; flex: 0 0 auto;
}
.tip-icon:hover, .tip-icon:focus-visible { color: var(--text); border-color: var(--accent); }
.kpi[data-tip]::after, .tip-icon[data-tip]::after {
    content: attr(data-tip);
    position: absolute; z-index: 50; top: calc(100% + 6px); left: 0;
    padding: 0.65rem 0.8rem; border-radius: 8px;
    background: #161b24; border: 1px solid #2c3442; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: var(--text); font-family: var(--sans); font-size: 0.8rem; font-weight: 400; font-style: normal;
    line-height: 1.45; letter-spacing: 0; text-transform: none; white-space: normal; text-align: left;
    opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
.kpi[data-tip]::after { right: 0; }                                   /* same width as the tile */
.tip-icon[data-tip]::after { width: min(420px, 100%); }                   /* anchored to the panel title */
.kpi[data-tip]:hover::after, .kpi[data-tip]:focus::after,
.tip-icon[data-tip]:hover::after, .tip-icon[data-tip]:focus::after {
    opacity: 1; visibility: visible; transform: translateY(0);
}

/* ---------- experience (cat experience.txt) ---------- */
.terminal-wide { max-width: none; }
#experience .terminal-body { color: var(--muted); }
.timeline { list-style: none; margin: 0.9rem 0 1.4rem; padding: 0 0 0 1.1rem; border-left: 2px solid var(--border); }
.job { position: relative; padding: 0 0 1.25rem 0.9rem; }
.job:last-child { padding-bottom: 0.2rem; }
.job::before {
    content: ""; position: absolute; left: calc(-1.1rem - 6px); top: 0.45rem;
    width: 10px; height: 10px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--muted);
}
.job.current::before { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15); }
.job-when { font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
.job-dur { color: var(--text); opacity: 0.75; }
.job-role { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 0.1rem 0 0.35rem; }
.job-at { color: var(--ok); font-family: var(--mono); font-weight: 500; font-size: 0.92em; }
.job ul { margin: 0; padding-left: 1.1rem; font-family: var(--sans); font-size: 0.92rem; color: var(--text); opacity: 0.88; }
.job ul li { margin: 0.18rem 0; }
.job ul li::marker { color: var(--muted); }
.skills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.7rem 0 1.4rem; padding: 0; }
.skills li {
    font-size: 0.8rem; color: var(--text); padding: 0.25rem 0.65rem; border-radius: 6px;
    background: var(--bg-raised); border: 1px solid var(--border);
}
.edu { margin: 0.6rem 0 0; font-family: var(--sans); color: var(--text); font-weight: 600; }
@media (max-width: 520px) {
    .timeline { padding-left: 0.8rem; }
    .job { padding-left: 0.6rem; }
    .job::before { left: calc(-0.8rem - 6px); }
}
