:root {
  --bg: #070a12;
  --panel: #0d1422;
  --pane: rgba(13, 20, 34, 0.9);
  --line: #1e2a40;
  --text: #e6ebf5;
  --muted: #97a5bf;
  --accent: #5eead4;
  --accent-2: #fbbf24;        /* amber: the "packet in flight" colour */
  --accent-ink: #04201c;
  --accent-soft: rgba(94, 234, 212, 0.1);
  --key: #7cb7ff;
  --ok: #86efac;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bar-h: 36px;              /* tmux bar height */
  --status-h: 30px;           /* bottom status line height */
}

:root[data-theme="light"] {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --pane: rgba(255, 255, 255, 0.92);
  --line: #d3dbe8;
  --text: #111a2c;
  --muted: #55627a;
  --accent: #0f766e;
  --accent-2: #b45309;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 118, 110, 0.09);
  --key: #1d4ed8;
  --ok: #15803d;
  --shadow: 0 14px 34px rgba(17, 26, 44, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 28px); }

body {
  margin: 0;
  padding-bottom: var(--status-h); /* keeps the footer clear of the fixed status line */
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
b { font-weight: 600; color: var(--text); }

/* Mesh canvas: fixed to the viewport, behind all content, never clickable. */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .footer { position: relative; z-index: 1; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- tmux-style window bar ---------- */
.tmux {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--bar-h);
  display: flex; align-items: stretch;
  background: var(--panel); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px;
}
.session {
  display: flex; align-items: center; padding: 0 14px; flex: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
/* The window list scrolls sideways on narrow screens instead of collapsing into a menu. */
.windows { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.windows::-webkit-scrollbar { display: none; }
.windows a {
  display: flex; align-items: center; padding: 0 13px; white-space: nowrap; color: var(--muted);
  border-right: 1px solid var(--line); transition: color .15s, background .15s;
}
.windows a:hover { color: var(--text); background: var(--accent-soft); }
.windows .idx { color: var(--accent); margin-right: 1px; }
/* tmux marks the current window with a trailing asterisk. */
.windows a.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.windows a.active::after { content: "*"; color: var(--accent-2); margin-left: 1px; }

.theme-btn {
  flex: none; width: var(--bar-h); cursor: pointer; display: grid; place-items: center;
  border: 0; border-left: 1px solid var(--line); background: transparent;
}
/* Sun/moon drawn in CSS: a disc, with a cut-out in dark mode to make a crescent. */
.theme-icon {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -5px -3px 0 0 var(--panel);
}
:root[data-theme="light"] .theme-icon { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; display: flex; align-items: center; padding: calc(var(--bar-h) + 56px) 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 20px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent);
}
h1 { font-size: clamp(2.8rem, 7vw, 5rem); line-height: 0.98; letter-spacing: -0.04em; font-weight: 800; }
.role { margin-top: 18px; font-family: var(--mono); font-size: clamp(1rem, 2vw, 1.2rem); color: var(--accent); }
.role::before { content: "> "; color: var(--accent-2); }
.lede { margin-top: 18px; max-width: 54ch; color: var(--muted); font-size: 1.05rem; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; padding: 11px 20px; border-radius: 6px;
  font-family: var(--mono); font-weight: 700; font-size: 14px; border: 1px solid transparent;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  overflow-wrap: anywhere;
}
.btn:hover { transform: translate(-2px, -2px); }
/* Offset hard shadow on hover gives a "key press" feel that suits the console look. */
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { box-shadow: 4px 4px 0 var(--accent-2); }
.btn.ghost { border-color: var(--line); background: var(--panel); }
.btn.ghost:hover { border-color: var(--accent); box-shadow: 4px 4px 0 var(--accent-soft); }

/* Terminal: stays dark in both themes, like a real terminal window. */
.terminal {
  background: #070b13; border: 1px solid #1f2b42; border-radius: 10px;
  box-shadow: var(--shadow); overflow: hidden; min-width: 0;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: #101829; border-bottom: 1px solid #1f2b42;
}
.tl { width: 11px; height: 11px; border-radius: 50%; }
.tl.r { background: #ff5f57; } .tl.y { background: #febc2e; } .tl.g { background: #28c840; }
.term-title { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: #7f8ba3; }
.term-body { padding: 18px 18px 22px; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: #d5deee; }
.term-body .tr { display: block; padding: 3px 6px; }
.c-prompt { color: #5eead4; } .c-ok { color: #86efac; font-weight: 700; } .c-dim { color: #7f8ba3; }
/* One traceroute line: hop number | host | description. Each is a link to that section. */
.hopline { display: grid !important; grid-template-columns: 2ch minmax(0, 15ch) 1fr; gap: 14px; border-radius: 4px; }
.hopline .n { color: #7f8ba3; text-align: right; }
.hopline .h { color: #7cb7ff; }
.hopline .d { color: #9aa8c2; }
.hopline:hover, .hopline:focus-visible { background: rgba(94, 234, 212, 0.12); }
.hopline:hover .h { color: #5eead4; }
.cursor {
  display: inline-block; width: 8px; height: 15px; margin-left: 6px; vertical-align: -2px;
  background: #5eead4; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
/* Typing effect: with JS on, lines stay hidden until script.js reveals them one at a time. */
.js #trace .tr { opacity: 0; }
.js #trace .tr.show { opacity: 1; transition: opacity .15s; }

/* ---------- Route rail and hops ---------- */
/* The rail is a vertical line in the left gutter. --p (set by script.js) is how far
   down the packet has travelled, in pixels. */
.route { position: relative; padding-left: 64px; --p: 0px; }
.rail {
  position: absolute; left: 20px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 12px);
}
.rail-fill {
  position: absolute; left: 0; top: 0; width: 2px; height: var(--p);
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}
.packet {
  position: absolute; left: -5px; top: var(--p); width: 12px; height: 12px; margin-top: -6px;
  border-radius: 3px; background: var(--accent-2); transform: rotate(45deg);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 22%, transparent), 0 0 18px var(--accent-2);
}

.hop { position: relative; padding-bottom: 110px; }
.hop.last { padding-bottom: 90px; }
/* Hop marker on the rail: hollow until the packet arrives, then lit. */
.hop-node {
  position: absolute; left: -52px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line); transition: border-color .3s, background .3s, box-shadow .3s;
}
.hop.up .hop-node {
  border-color: var(--accent); background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft), 0 0 16px var(--accent);
}
.hop.up .hop-node::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--accent);
  animation: hop-ring 0.9s ease-out 1;  /* one pulse on arrival */
}
@keyframes hop-ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(3); opacity: 0; } }

.hop-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.hop-n { color: var(--accent-2); font-weight: 700; }
.hop-t { color: var(--muted); }
.hop.up .hop-t { color: var(--ok); }

.sec-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; margin: 6px 0 24px;
}
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.1; }
h3 { font-size: 1.1rem; line-height: 1.35; }
.section-intro { color: var(--muted); margin: -10px 0 22px; }

/* ---------- Console panes ---------- */
.pane {
  background: var(--pane); border: 1px solid var(--line); border-radius: 10px; padding: 22px;
  transition: border-color .2s, transform .2s;
}
.pane:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.pane + .pane { margin-top: 18px; }
/* Small mono caption at the top of a pane, like a panel title in a dashboard. */
.cap {
  display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--accent); margin-bottom: 6px;
}
.kcmd { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid2 .pane + .pane { margin-top: 0; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.prose p { color: var(--muted); font-size: 1.02rem; }
.prose p + p { margin-top: 14px; }

.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.metrics .pane + .pane { margin-top: 0; }
.metric { padding: 16px 18px; }
.metric strong { display: block; font-family: var(--mono); font-size: 2.1rem; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.metric .sub { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }
/* Gauge bar: the inner bar grows to --v when the tile scrolls into view. */
.bar { display: block; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--v); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.js .reveal .bar i { width: 0; transition: width 1.2s cubic-bezier(.2, .7, .2, 1) .2s; }
.js .reveal.in .bar i { width: var(--v); }

/* ---------- Experience ---------- */
.employer { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.ladder li { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; font-size: 15px; }
.ladder li:first-child span { font-weight: 600; }
time { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }

.job header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.client { color: var(--accent); font-weight: 500; margin-top: 2px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.tags li {
  font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  /* Long tags break onto a second line instead of pushing the page wider than a phone screen. */
  max-width: 100%; overflow-wrap: anywhere;
}
/* Grid children refuse to shrink below their content by default; this lets them. */
.pane, .krow > *, .grid2 > *, .about-grid > *, .hero-grid > * { min-width: 0; }
.bullets { display: grid; gap: 8px; }
.bullets.two { grid-template-columns: repeat(2, 1fr); gap: 10px 28px; }
.bullets li { position: relative; padding-left: 20px; color: var(--muted); font-size: 15px; }
.bullets li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

/* ---------- Skills table ---------- */
.ktable { padding: 20px 22px 8px; }
.krow { display: grid; grid-template-columns: 230px 1fr; gap: 8px 20px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.khead { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; padding: 0 0 10px; border-top: 0; }
.krow h3 { font-family: var(--mono); font-size: 13.5px; font-weight: 500; color: var(--key); padding-top: 2px; overflow-wrap: anywhere; }
.krow .tags { margin: 0; }

/* ---------- Certifications ---------- */
.cert ul { margin-top: 8px; }
.cert li { position: relative; padding: 2px 0 2px 22px; color: var(--muted); font-size: 15px; }
.cert li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.edu { margin-top: 18px; }

/* ---------- Contact ---------- */
/* The email button only works once script.js has built the address, so it is hidden when JavaScript is off. */
html:not(.js) #mailBtn { display: none; }
.contact .lede { margin-top: 0; font-size: 1.15rem; color: var(--text); }

/* ---------- Footer and status line ---------- */
.footer { padding: 24px 0; font-size: 14px; border-top: 1px solid var(--line); background: var(--bg); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

.statusline {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: var(--status-h);
  display: flex; align-items: center; gap: 0;
  background: var(--panel); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden;
}
.statusline > span { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 14px; border-right: 1px solid var(--line); }
.statusline b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.sl-on { color: var(--ok); }
.sl-on i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: blink 2s ease-in-out infinite; }
#slHop { color: var(--accent); }
.sl-hint { flex: 1; }
.statusline .sl-prog { border-right: 0; margin-left: auto; }
.sl-bar { width: 90px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sl-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
#slPct { min-width: 4ch; text-align: right; }

/* ---------- Scroll reveal (only when JS is running, so no-JS visitors see everything) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease, border-color .2s; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Section heading illustrations ---------- */
.sec-anim { width: 240px; height: 64px; flex: none; overflow: visible; }
/* Makes scale/rotate pivot around each shape's own centre rather than the SVG's top-left corner. */
.sec-anim * { transform-box: fill-box; transform-origin: center; }
.sec-anim .s { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sec-anim .dim { stroke: var(--muted); opacity: 0.5; }
.sec-anim .dots { stroke-dasharray: 2 6; }
.sec-anim .f { fill: var(--accent); }
.sec-anim .pk { fill: var(--accent-2); }
.sec-anim .panel, .sec-anim .stage { fill: var(--panel); stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
/* Gear teeth: a thick dashed circle outline reads as cogs. */
.sec-anim .gear { fill: none; stroke: var(--accent); stroke-width: 6; stroke-dasharray: 5.1 5.1; }
.sec-anim .ring { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: 0; }
.sec-anim .flow { stroke-dasharray: 4 6; }
.sec-anim .draw { stroke-width: 2.4; stroke-dasharray: 40; }
.sec-anim text { font-family: var(--mono); font-size: 8px; fill: var(--muted); text-anchor: middle; }

/* Animations run only while the illustration is on screen (.live is toggled by script.js). */
.sec-anim.live .flow   { animation: sa-flow 1s linear infinite; }                 /* dashes slide = data moving */
.sec-anim.live .flow.rev { animation-direction: reverse; }
.sec-anim.live .blink  { animation: sa-blink 1.2s ease-in-out infinite; }         /* status LEDs */
.sec-anim.live .pulse  { animation: sa-pulse 1.8s ease-in-out infinite; }         /* devices on the network */
.sec-anim.live .bob    { animation: sa-bob 3s ease-in-out infinite; }             /* cloud floating */
.sec-anim.live .spin   { animation: sa-spin 5s linear infinite; }                 /* automation gear */
.sec-anim.live .pop    { animation: sa-pop 5s ease-in-out infinite backwards; }   /* pods scaling up */
.sec-anim.live .stage  { animation: sa-stage 4s linear infinite; }                /* pipeline stage lights up */
.sec-anim.live .packet-dot { animation: sa-packet 4s linear infinite; }           /* job moving through pipeline */
.sec-anim.live .draw   { animation: sa-draw 3.2s ease-in-out infinite; }          /* check mark draws itself */
.sec-anim.live .ring   { animation: sa-ring 2.4s ease-out infinite; }             /* verification pulse */
.sec-anim.live .ping   { animation: sa-ping 2s ease-in-out infinite alternate; }  /* message there and back */

/* Stagger helpers so repeated shapes don't move in unison. */
.sec-anim.live .d1 { animation-delay: 0.2s; }
.sec-anim.live .d2 { animation-delay: 0.4s; }
.sec-anim.live .d3 { animation-delay: 0.6s; }
.sec-anim.live .d1s { animation-delay: 1s; }
.sec-anim.live .d2s { animation-delay: 2s; }
.sec-anim.live .d3s { animation-delay: 3s; }
.sec-anim.live .p1 { animation-delay: 0.35s; }
.sec-anim.live .p2 { animation-delay: 0.7s; }
.sec-anim.live .p3 { animation-delay: 1.05s; }
.sec-anim.live .p4 { animation-delay: 1.4s; }

@keyframes sa-flow   { to { stroke-dashoffset: -20; } }
@keyframes sa-blink  { 50% { opacity: 0.2; } }
@keyframes sa-pulse  { 50% { transform: scale(1.25); } }
@keyframes sa-bob    { 50% { transform: translateY(-3px); } }
@keyframes sa-spin   { to { transform: rotate(360deg); } }
@keyframes sa-pop    {
  0% { transform: scale(0); opacity: 0; }
  10% { transform: scale(1.2); opacity: 1; }
  16%, 86% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
@keyframes sa-stage  { 0%, 45%, 100% { fill: var(--panel); } 6%, 35% { fill: var(--accent); } }
@keyframes sa-packet {
  0% { transform: translateX(0); opacity: 1; }
  75% { transform: translateX(180px); opacity: 1; }
  80%, 100% { transform: translateX(180px); opacity: 0; }
}
@keyframes sa-draw   { 0% { stroke-dashoffset: 40; } 30%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 40; } }
@keyframes sa-ring   { from { transform: scale(0.6); opacity: 0.7; } to { transform: scale(1.9); opacity: 0; } }
@keyframes sa-ping   { to { transform: translateX(108px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .reveal .bar i { width: var(--v); transition: none; }
  .js #trace .tr { opacity: 1; }
  .cursor, .sl-on i { animation: none; }
  .btn:hover { transform: none; }
  .hop.up .hop-node::after { animation: none; opacity: 0; }
  .sec-anim.live * { animation: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .about-grid, .employer { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .bullets.two { grid-template-columns: 1fr; }
  .krow { grid-template-columns: 1fr; }
  .khead span:last-child { display: none; }
  .sl-hint { visibility: hidden; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .route { padding-left: 34px; }
  .rail { left: 8px; }
  .hop-node { left: -34px; width: 16px; height: 16px; }
  .hop { padding-bottom: 80px; }
  .pane { padding: 18px; }
  .term-body { font-size: 12.5px; padding: 14px 10px 18px; }
  .hopline { grid-template-columns: 2ch minmax(0, 14ch) 1fr; gap: 10px; }
  .ladder li { flex-direction: column; gap: 0; }
  .sec-anim { width: 200px; height: 54px; }
  .sl-on, .sl-hint { display: none !important; }
  .statusline > span { padding: 0 10px; }
  .sl-bar { width: 48px; }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric strong { font-size: 1.7rem; }
  .sl-up { display: none !important; }
}

/* ============================================================
   EXTRA ANIMATIONS
   Everything below is motion only; the last block turns it all
   off for visitors who asked their system for reduced motion.
   ============================================================ */

/* Hero: the terminal floats gently and the status dot pulses. */
.hero .terminal { animation: x-float 6s ease-in-out infinite; }
@keyframes x-float { 50% { transform: translateY(-7px); } }
.dot { animation: x-dot 2.2s ease-out infinite; }
@keyframes x-dot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

/* Rail: the packet gives off a pulse, and a streak of light runs down the travelled part. */
.packet::after {
  content: ""; position: absolute; inset: -2px; border: 2px solid var(--accent-2); border-radius: 3px;
  animation: x-pkt 1.4s ease-out infinite;
}
@keyframes x-pkt { from { transform: scale(1); opacity: 0.8; } to { transform: scale(2.8); opacity: 0; } }
.rail-fill { overflow: hidden; }
.rail-fill::after {
  content: ""; position: absolute; left: 0; width: 2px; height: 60px; top: -60px;
  background: linear-gradient(to bottom, transparent, #fff, transparent);
  animation: x-run 2.4s linear infinite;
}
@keyframes x-run { to { top: 100%; } }

/* Hop arrival: an underline draws itself under the title and the host name flashes. */
.hop h2::after {
  content: ""; display: block; height: 3px; width: 64px; margin-top: 10px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.js .hop h2::after { width: 0; transition: width 0.7s cubic-bezier(.2, .7, .2, 1) 0.15s; }
.js .hop.up h2::after { width: 64px; }
.hop.up .hop-host { animation: x-host 0.9s ease-out 1; }
@keyframes x-host { 0% { color: var(--accent-2); text-shadow: 0 0 12px var(--accent-2); } 100% { text-shadow: none; } }

/* Status line: the hop readout flashes when it changes (script.js re-adds .flash each time). */
#slHop.flash { animation: x-flash 0.7s ease-out 1; }
@keyframes x-flash { 0% { background: var(--accent); color: var(--accent-ink); } 100% { background: transparent; } }

/* Panes: a scan line sweeps down once when the pane appears. */
.pane { position: relative; overflow: hidden; }
.js .reveal.in.pane::before, .js .reveal.in .pane::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: x-scan 1.1s ease-out 0.1s 1 both;
}
@keyframes x-scan { 0% { top: 0; opacity: 0.9; } 100% { top: 100%; opacity: 0; } }

/* Panes: a soft spotlight follows the cursor (--mx/--my are set by script.js). */
.pane::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
}
.pane:hover::after { opacity: 1; }

/* Side-by-side panes arrive from opposite sides. While waiting off to the right they
   would poke past the page edge and cause a sideways scrollbar, so main clips them. */
main { overflow-x: clip; }
.js .grid2 > .reveal:nth-child(odd):not(.in) { transform: translateX(-26px); }
.js .grid2 > .reveal:nth-child(even):not(.in) { transform: translateX(26px); }

/* Tags pop in one after another, like pods starting; bullets and check marks slide in.
   --i is each item's position in its list, set by script.js, and drives the delay. */
.js .reveal .tags li, .js .reveal .bullets li, .js .reveal.cert li { opacity: 0; }
.js .reveal .tags li { transform: scale(0.6); }
.js .reveal .bullets li, .js .reveal.cert li { transform: translateX(-12px); }
.js .reveal.in .tags li, .js .reveal.in .bullets li, .js .reveal.in.cert li {
  opacity: 1; transform: none;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(.2, 1.5, .4, 1);
  transition-delay: calc(var(--i, 0) * 28ms + 250ms);
}

/* Typed commands show a block caret while script.js is typing them. */
.kcmd.typing::after { content: "▋"; color: var(--accent); margin-left: 2px; }

/* Gauge bars: a highlight slides along the filled part every few seconds. */
.bar i { position: relative; overflow: hidden; }
.bar i::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: x-shimmer 3s ease-in-out 1.6s infinite;
}
@keyframes x-shimmer { 0% { transform: translateX(-100%); } 45%, 100% { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .hero .terminal, .dot, .packet::after, .rail-fill::after, .bar i::after,
  .hop.up .hop-host, #slHop.flash { animation: none; }
  .js .reveal.in.pane::before, .js .reveal.in .pane::before { display: none; }
  .js .hop h2::after { width: 64px; transition: none; }
  .js .grid2 > .reveal:not(.in) { transform: none; }
  .js .reveal .tags li, .js .reveal .bullets li, .js .reveal.cert li { opacity: 1; transform: none; transition: none; }
}
