/* Components: nav, buttons, glass cards, rail, HUD, output labels, cursor, boot. */

/* ---- nav ---------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px var(--gutter);
  transition: background 0.5s var(--ease), padding 0.5s var(--ease), border-color 0.5s, opacity 1.2s var(--ease) 0.2s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding-top: 14px; padding-bottom: 14px;
  background: rgba(1, 4, 14, 0.55);
  border-bottom-color: var(--rule);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: 0.2em;
  white-space: nowrap; flex: none;
}
.brand svg { color: var(--accent); filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5)); }
.brand:hover { color: #fff; }
.nav-links { display: flex; gap: 4px; margin-left: auto; font-family: var(--mono); font-size: var(--label-1); letter-spacing: var(--track-label); }
.nav-links a { position: relative; padding: 12px 14px; color: var(--body); }
.nav-links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-resume {
  padding: 10px 18px;
  font-family: var(--mono); font-size: var(--label-1); letter-spacing: var(--track-label);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  background: rgba(1, 3, 9, 0.5);
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  transition: background 0.3s, color 0.3s;
  white-space: nowrap; flex: none;
}
.nav-resume:hover { background: var(--accent); color: #010614; }

/* ---- hero bits ------------------------------------------------------------ */
.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow::before { content: ""; width: 34px; height: 1px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ctas { display: flex; flex-wrap: wrap; gap: 14px; }
/* (the hero's buttons and status lines measured as wide as they are, not as the column, when the
   hero's caption checks it is clear of the page's text, main.js) */
.hero .ctas, .hero .status { width: fit-content; }
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 28px;
  font-family: var(--display); font-weight: 600; font-size: 15.5px; letter-spacing: 0.08em;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.btn-primary { background: var(--accent); color: #010614; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}
.btn-primary:hover { color: #010614; background: #B5E7FF; }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary svg { transition: transform 0.4s var(--ease); }
.btn-primary:hover svg { transform: translateX(4px); }
.btn-ghost {
  color: var(--ink);
  background: rgba(4, 10, 28, 0.55);
  box-shadow: inset 0 0 0 1px rgba(185, 199, 238, 0.32);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn-ghost:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.8); background: rgba(10, 26, 70, 0.6); }

.status { display: flex; flex-direction: column; gap: 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.status .row { display: flex; align-items: center; gap: 12px; }
.hex {
  flex: none; width: 8px; height: 14px; background: var(--accent); box-shadow: 0 0 10px var(--accent);
  clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0 70%, 0 30%);
  animation: blink 2.4s ease-in-out infinite;
}
.hint { font-size: var(--label-1); letter-spacing: var(--track-label); color: var(--muted); }
/* copy that names the gesture: the pointer's words, or a touchscreen's */
.t-touch { display: none; }
@media (hover: none) { .t-fine { display: none; } .t-touch { display: inline; } }
.nw { white-space: nowrap; }
.hint-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--accent); box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.5); }
@keyframes blink { 50% { opacity: 0.35; } }

.scroll-cue {
  position: absolute; left: var(--gutter); bottom: 32px;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: var(--label-2); letter-spacing: 0.2em; color: var(--muted);
}
.scroll-cue i { position: relative; display: block; width: 64px; height: 1px; background: rgba(157, 184, 255, 0.2); overflow: hidden; }
.scroll-cue i::after {
  content: ""; position: absolute; top: 0; left: 0; width: 24px; height: 1px;
  background: var(--accent); box-shadow: 0 0 6px var(--accent);
  animation: run 2s var(--ease) infinite;
}
@keyframes run { from { transform: translateX(-24px); } to { transform: translateX(64px); } }

/* the hero's load cases */
.traits {
  position: fixed; inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.trait {
  position: absolute; left: 0; top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  width: 204px;
  padding: 8px 12px 9px;
  border: 0; border-radius: 0;
  cursor: pointer;
  pointer-events: auto;
  text-align: left;
  font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label); color: var(--muted);
  background: rgba(1, 4, 14, 0.62);
  box-shadow: inset 0 0 0 1px rgba(157, 184, 255, 0.16);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  will-change: transform;
  transition: box-shadow 0.3s, color 0.3s;
}
.trait-k { color: var(--faint); }
.trait-n { color: var(--ink); }
.trait-w { color: var(--faint); font-variant-numeric: tabular-nums; }
.trait-bar { grid-column: 1 / -1; position: relative; height: 2px; background: rgba(157, 184, 255, 0.14); }
.trait-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0.33); background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.trait.top { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.55), 0 0 24px rgba(var(--accent-rgb), 0.18); }
.trait.top .trait-k, .trait.top .trait-w { color: var(--accent); }
.trait.top .trait-bar i { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.trait:hover, .trait:focus-visible { color: #fff; outline: none; box-shadow: inset 0 0 0 1px var(--accent); }

/* ---- figure captions ----------------------------------------------------- */
/* captions are pinned to the viewport like the figures they describe, and crossfade with them */
.fig {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  right: calc(var(--gutter) + 56px);
  bottom: 40px;
  max-width: 300px;
  padding: 10px 14px 11px;
  border-left: 1px solid rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(90deg, rgba(1, 4, 14, 0.46), rgba(1, 4, 14, 0.22));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: var(--mono); font-size: 11px; line-height: 1.7; letter-spacing: 0.02em;
  color: var(--body);
}
.fig b { display: block; margin-bottom: 4px; font-weight: 500; letter-spacing: var(--track-label); color: var(--accent); }
.fig-left { right: auto; left: var(--gutter); }
/* the live figures' captions once they are running live (main.js) */
.fig-live, .foil-live #p-airfoil .fig-static, .adv-live #p-privacy .fig-static, .res-live #p-research .fig-static { display: none; }
.foil-live #p-airfoil .fig-live, .adv-live #p-privacy .fig-live, .adcs-live #p-cubesat .fig-live, .res-live #p-research .fig-live { display: inline; }
/* Laptops from 1280px to 1440px: narrower captions, so that every readout fits between its card
   and its caption (main.js shows them from 1280 x 640) */
@media (min-width: 1280px) and (max-width: 1439px) {
  .fig { max-width: 250px; }
}

/* ---- glass cards ------------------------------------------------------- */
.card, .contact-panel {
  --c: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(540px, 100%);
  padding: 36px 36px 32px;
  background: linear-gradient(180deg, rgba(10, 22, 58, 0.58), rgba(3, 8, 24, 0.72));
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c)));
}
/* hairline border that brightens under the pointer */
.card::before, .contact-panel::before {
  content: "";
  position: absolute; inset: 0;
  padding: 1px;
  background:
    radial-gradient(360px circle at var(--mx, 70%) var(--my, 0%), rgba(var(--accent-rgb), 0.9), transparent 65%),
    linear-gradient(140deg, rgba(var(--accent-rgb), 0.38), rgba(157, 184, 255, 0.08) 45%, rgba(var(--violet-rgb), 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.card::after, .contact-panel::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(520px circle at var(--mx, 70%) var(--my, -20%), rgba(var(--accent-rgb), 0.09), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
.card:hover::after, .contact-panel:hover::after { opacity: 1; }
.cut { position: absolute; width: var(--c); height: var(--c); stroke: rgba(var(--accent-rgb), 0.7); stroke-width: 1.5; fill: none; z-index: 1; }
.cut.tr { top: 0; right: 0; }
.cut.bl { bottom: 0; left: 0; }

.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-idx { font-family: var(--mono); font-size: var(--label-1); letter-spacing: var(--track-label); color: var(--accent); }
.card-idx i { font-style: normal; color: var(--faint); margin: 0 4px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label);
  padding: 5px 10px;
  color: var(--body);
  box-shadow: inset 0 0 0 1px rgba(185, 199, 238, 0.3);
}
.tag.live { color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.55); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
.card p { font-size: 16.5px; line-height: 1.65; color: var(--body); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tags span { padding: 5px 10px; background: rgba(157, 184, 255, 0.09); }
.card-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.08em;
}
.card-links { display: flex; flex-wrap: wrap; column-gap: 32px; }
.card-link span { transition: transform 0.4s var(--ease); }
.card-link:hover span { transform: translateX(5px); }

/* ---- contact ------------------------------------------------------------- */
.contact-panel { --c: 34px; width: min(760px, 100%); gap: 30px; padding: 64px 56px; }
.contact-panel h2 { font-weight: 700; font-size: clamp(36px, 4.6vw, 66px); line-height: 1; }
.contact .email { font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; }
.contact-panel .contact-next { margin: -10px 0 0; font-size: 17px; line-height: 1.55; color: var(--muted); }

.foot { position: relative; border-top: 1px solid var(--rule); }
.foot-in {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding-top: 26px; padding-bottom: 34px;
  font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label); color: var(--muted);
}
.foot-in a { padding: 12px 0; }
.foot-mid { color: var(--faint); }

/* ---- depth rail ---------------------------------------------------------- */
.rail {
  position: fixed;
  right: 22px; top: 50%;
  z-index: 15;
  display: flex; flex-direction: column; align-items: flex-end; gap: 26px;
  transform: translateY(-50%);
}
.rail-line { position: absolute; right: 5px; top: 6px; bottom: 6px; width: 1px; background: rgba(157, 184, 255, 0.16); }
.rail-line i { position: absolute; inset: 0; transform-origin: top; transform: scaleY(0); background: linear-gradient(var(--accent), var(--violet)); box-shadow: 0 0 6px var(--accent); }
.rail-i { position: relative; display: flex; align-items: center; gap: 8px; padding: 2px 0; font-family: var(--mono); font-size: var(--label-3); letter-spacing: var(--track-micro); color: var(--faint); }
/* (a dark backing, so that a label shown over the page's text still reads as the rail's; its margin keeps
   the rail's spacing as it was) */
.rail-l {
  padding: 3px 7px; margin: -3px 0;
  background: rgba(1, 4, 14, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: translateX(8px); transition: opacity 0.35s, transform 0.35s var(--ease); white-space: nowrap;
}
.rail-n {
  width: 11px; height: 11px;
  background: #020718;
  box-shadow: inset 0 0 0 1px rgba(157, 184, 255, 0.4);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  transition: background 0.3s, box-shadow 0.3s;
}
.rail:hover .rail-l, .rail-i:focus-visible .rail-l { opacity: 1; transform: none; }
/* arriving at a layer shows its label for a few seconds, so you know where you are, unless it
   would cover the page's text or a caption (.clash, main.js); hovering the rail still shows it */
.rail-i.on.fresh:not(.clash) .rail-l { opacity: 0.85; transform: none; }
.rail-i.on { color: var(--accent); }
.rail-i.on .rail-n { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.rail-i:hover { color: #fff; }

/* ---- HUD: a live instrument strip in the nav ------------------------------ */
.hud {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  padding: 7px 12px;
  font-family: var(--mono); font-size: var(--label-3); letter-spacing: var(--track-micro); color: var(--faint);
  white-space: nowrap;
  background: rgba(1, 4, 14, 0.42);
  box-shadow: inset 0 0 0 1px rgba(157, 184, 255, 0.12);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
/* sits beside the brand, with the space between it and the nav links; 8px + the nav's 24px gap = 32px from the name */
.hud-wrap { position: relative; margin-left: 8px; flex: none; }
.hud-wrap .hud { margin-left: 0; cursor: help; }
.hud-cell { display: inline-flex; align-items: center; gap: 8px; }
/* one tooltip, outside the HUD's clipped shape, moved under whichever reading is hovered */
.hud-tip {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 2;
  width: max-content; max-width: 260px; padding: 8px 11px 9px;
  font-family: var(--mono); font-size: 11px; line-height: 1.5; letter-spacing: 0.02em; color: var(--body);
  background: rgba(2, 7, 20, 0.92);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.28), 0 14px 30px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transform: translateY(-3px);
  transition: opacity 0.15s, transform 0.15s var(--ease), visibility 0.15s, left 0.15s var(--ease);
  pointer-events: none;
}
.hud-tip.on { opacity: 1; visibility: visible; transform: none; }
.hud-k { color: var(--faint); }
.hud-v { color: var(--body); font-variant-numeric: tabular-nums; margin-right: 8px; }
.hud-form { min-width: 11.6em; color: var(--accent); }
.hud-num { min-width: 2.6em; }
.hud-led { width: 6px; height: 6px; border-radius: 50%; background: #6EF0B0; box-shadow: 0 0 8px #6EF0B0; animation: blink 1.6s infinite; }
.hud canvas { display: block; width: 110px; height: 20px; border-left: 1px solid var(--rule); padding-left: 0; }

/* ---- cursor ----------------------------------------------------------------- */
.has-cursor, .has-cursor * { cursor: none !important; }
.has-cursor input, .has-cursor textarea { cursor: text !important; }
.cursor { position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.cursor.on { opacity: 1; }
.cursor-dot, .cursor-ring { position: absolute; left: 0; top: 0; will-change: transform; }
.cursor-dot::before {
  content: ""; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: #EAF7FF; box-shadow: 0 0 10px var(--accent), 0 0 2px #fff;
}
.cursor-ring::before {
  content: ""; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  transition: transform 0.35s var(--ease), border-color 0.3s, background 0.3s;
}
.cursor-ring::after {
  content: ""; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px;
  background:
    linear-gradient(var(--accent), var(--accent)) 50% 0 / 1px 5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 50% 100% / 1px 5px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 0 50% / 5px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 100% 50% / 5px 1px no-repeat;
  opacity: 0.6;
  transition: transform 0.35s var(--ease), opacity 0.3s;
}
.cursor.hot .cursor-ring::before { transform: scale(0.55) rotate(45deg); border-color: var(--accent); background: none; }
.cursor.hot .cursor-ring::after { opacity: 0; transform: scale(1.4); }
.cursor.down .cursor-ring::before { transform: scale(0.7); }

/* ---- boot ---------------------------------------------------------------- */
.boot {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 1, 6, 0) 0%, rgba(0, 1, 6, 0.6) 100%);
  transition: opacity 0.9s var(--ease);
}
.boot.out { opacity: 0; }
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; font-family: var(--mono); font-size: var(--label-2); letter-spacing: 0.22em; color: var(--muted); transform: translateY(110px); }
.boot-k { color: var(--accent); }
.boot-n b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.boot-bar { position: relative; width: 220px; height: 1px; background: rgba(157, 184, 255, 0.18); }
.boot-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ---- fallbacks and small screens ------------------------------------------- */
.no-gl .traits, .no-gl .hud-wrap { display: none; }

@media (max-width: 1500px) { .hud-x { display: none; } }
@media (max-width: 1240px) {
  .hud-wrap { display: none; }
  .nav-links { margin-left: auto; }
}
@media (max-width: 1180px) {
  .rail { display: none; }
  .fig { right: var(--gutter); }
}
@media (max-width: 899px) {
  .nav-links { display: none; }
  .nav-resume { margin-left: auto; }
  .trait { width: auto; gap: 3px 8px; padding: 6px 9px 7px; font-size: var(--label-3); }
  .trait-k { display: none; }
  .fig { display: none; }
  .scroll-cue { display: none; }
  .card { padding: 30px 26px 26px; }
  .contact-panel { padding: 48px 28px; }
}
@media (max-width: 480px) {
  .brand span { letter-spacing: 0.14em; }
}
@media (prefers-reduced-motion: reduce) {
  .hex, .hud-led, .pulse, .scroll-cue i::after { animation: none; }
}

/* ---- ignition: content waits for the network to boot ------------------------ */
.rail { transition: opacity 1.2s var(--ease) 0.4s; }
.js:not(.booted) .nav, .js:not(.booted) .rail, .js:not(.booted) main { opacity: 0; }
main { transition: opacity 1.4s var(--ease); }

/* ---- content blocks added with the résumé content -------------------------- */
.metrics {
  margin: 2px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(157, 184, 255, 0.14);
  box-shadow: 0 0 0 1px rgba(157, 184, 255, 0.14);
}
.metrics div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 14px 14px 12px; background: rgba(3, 9, 24, 0.7); }
.metrics dt { font-family: var(--mono); font-size: var(--label-3); letter-spacing: var(--track-micro); line-height: 1.4; color: var(--faint); }
.metrics dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1; color: var(--accent); text-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35); white-space: nowrap; }
.card p.fine, .edu p.fine, .fine { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* experience timeline: a trace with a node per role */
.timeline { position: relative; margin: 6px 0 0; padding: 0 0 0 26px; list-style: none; display: flex; flex-direction: column; gap: 26px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--accent), rgba(var(--violet-rgb), 0.5) 70%, rgba(157, 184, 255, 0.1)); }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 6px; }
.timeline li::before {
  content: ""; position: absolute; left: -26px; top: 3px; width: 11px; height: 11px;
  background: #020718; box-shadow: inset 0 0 0 1px var(--accent), 0 0 10px rgba(var(--accent-rgb), 0.4);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.timeline li:first-child::before { background: var(--accent); }
.tl-when { font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label); color: var(--accent); }
.tl-role { font-size: 21px; font-weight: 600; line-height: 1.25; }
.tl-role span { display: block; font-family: var(--sans); font-size: 15px; font-weight: 500; color: var(--muted); }
.timeline p { font-size: 15.5px; line-height: 1.6; color: var(--body); }

.edu, .toolbox { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; background: rgba(3, 9, 24, 0.72); box-shadow: inset 0 0 0 1px rgba(157, 184, 255, 0.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.edu-k { font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label); color: var(--muted); }
.edu-school { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--ink); }
.edu-school span { font-family: var(--mono); font-weight: 400; font-size: var(--label-2); letter-spacing: var(--track-label); color: var(--faint); align-self: center; }
.edu p { font-size: 15px; line-height: 1.6; color: var(--body); }

/* ClosedBook, nested inside the chess card */
.sub { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--rule); }
.sub-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sub h4 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: 0.02em; }
.card .sub p { font-size: 15px; }

/* piano hint and key hover */
.key-hint { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: var(--label-2) !important; letter-spacing: var(--track-label); color: var(--accent) !important; }
.key-glyph { display: inline-flex; gap: 2px; }
.key-glyph i { width: 7px; height: 16px; box-shadow: inset 0 0 0 1px var(--accent); animation: key 1.8s ease-in-out infinite; }
.key-glyph i:nth-child(2) { animation-delay: 0.3s; }
.key-glyph i:nth-child(3) { animation-delay: 0.6s; }
@keyframes key { 0%, 70%, 100% { background: transparent; transform: none; } 15% { background: var(--accent); transform: translateY(2px); } }
.on-key .cursor-ring::before { transform: scale(0.75) rotate(45deg); border-color: var(--accent); background: rgba(var(--accent-rgb), 0.15); }
.on-key .cursor-ring::after { opacity: 0; }
.no-gl .key-hint, .no-gl .sound-toggle { display: none; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; }
.key-row .key-hint { margin: 0; }
.sound-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 12px;
  font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label); color: var(--muted);
  background: rgba(1, 4, 14, 0.5); border: 0;
  box-shadow: inset 0 0 0 1px rgba(157, 184, 255, 0.22);
  cursor: pointer; transition: color 0.25s, box-shadow 0.25s;
}
.sound-toggle:hover, .sound-toggle:focus-visible { color: #fff; outline: none; box-shadow: inset 0 0 0 1px var(--accent); }
.sound-ico { width: 12px; height: 10px; background: currentColor; clip-path: polygon(0 30%, 35% 30%, 75% 0, 75% 100%, 35% 70%, 0 70%); }
.sound-toggle[aria-pressed="true"] { color: var(--accent); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.6), 0 0 16px rgba(var(--accent-rgb), 0.16); }

.contact-panel .ctas .email-row { flex: 1 1 100%; display: flex; gap: 10px; }
.contact-panel .ctas .email { flex: 1 1 auto; justify-content: center; text-transform: none; }
.contact .copy { flex: 0 0 auto; padding: 0 20px; font-family: var(--mono); font-size: var(--label-2); letter-spacing: var(--track-label); }
.contact .copy.done { color: var(--accent); border-color: var(--accent); }
.contact .email { letter-spacing: 0.04em; }
/* FIG. 8's probe and answer, on the page: the button flashes as the probe leaves it, and the panel lights where the answer lands */
@keyframes f8-sent { 0% { filter: brightness(2.1); } 100% { filter: none; } }
@keyframes f8-glow { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 0; } }
@keyframes f8-btn { 0% { filter: brightness(2.4); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 1), inset 0 0 26px rgba(var(--accent-rgb), 0.55); } 100% { filter: none; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.8), inset 0 0 0 rgba(var(--accent-rgb), 0); } }
.contact-panel .btn.sent { animation: f8-sent 0.7s ease-out; }
.contact-panel .btn.answered { animation: f8-btn 1.9s ease-out; }
.contact-panel.answered::after { background: radial-gradient(560px circle at var(--mx, 70%) var(--my, 0%), rgba(var(--accent-rgb), 0.3), transparent 62%); animation: f8-glow 1.9s ease-out; }
@media (prefers-reduced-motion: reduce) { .contact-panel .btn.sent, .contact-panel .btn.answered, .contact-panel.answered::after { animation: none; } }
/* Beside the figure, the panel is as wide as its row of three links, and the email and its copy button span
   exactly that row. The heading wraps to the same width rather than widening the panel, and is capped so
   its first line ("Ready to go beyond") still fits the row */
@media (min-width: 900px) {
  .contact-panel { width: fit-content; max-width: 100%; }
  .contact-panel h2 { font-size: clamp(36px, 4.6vw, 52px); contain: inline-size; }
  .contact-panel .contact-next { contain: inline-size; }
  .contact-panel .ctas { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; }
  .contact-panel .ctas .email-row { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .metrics div { flex-direction: row-reverse; justify-content: space-between; align-items: baseline; }
  .contact .email { font-size: 13px; padding: 0 18px; }
}
/* the narrowest phones (360 px): the address and its copy button need the panel's side padding back */
@media (max-width: 400px) {
  .contact-panel { padding-left: 20px; padding-right: 20px; }
  .contact .email { font-size: 12px; padding: 0 12px; }
  .contact .copy { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) { .key-glyph i { animation: none; } }

/* Laptops and other short screens (see layout.css): tighter cards, so the tallest of them fits
   between the nav and the foot of the screen */
@media (min-width: 900px) and (max-height: 780px) {
  .scroll-cue { bottom: 22px; }
  .btn { min-height: 46px; padding: 0 24px; }
  .card { gap: 16px; padding: 28px 32px 26px; }
  .card p { font-size: 15.5px; line-height: 1.55; }
  .card p.fine { font-size: 13.5px; }
  .metrics div { padding: 12px 12px 10px; }
  .metrics dd { font-size: 21px; }
  .card-link { min-height: 36px; }
  /* (the links are smaller here, so the heading is too) */
  .contact-panel { gap: 22px; padding: 40px 40px; }
  .contact-panel h2 { font-size: clamp(32px, min(3.6vw, 8.5vh), 50px); }
  .contact-panel .contact-next { margin-top: -6px; font-size: 15px; }
  /* captions in a smaller face, so that a long one stands less tall over its figure */
  .fig { font-size: 10.5px; line-height: 1.62; }
}
/* the shortest screens (layout.css): the contact panel tightens so that it fits between the nav and the footer */
@media (min-width: 900px) and (max-height: 620px) {
  .contact-panel { gap: 18px; padding: 30px 40px; }
}
/* and, from 1280 px, as wide as each readout still allows between its card and its caption */
@media (min-width: 1280px) and (max-width: 1439px) and (max-height: 780px) {
  .fig { max-width: clamp(250px, 91vw - 900px, 300px); }
}
