/* ==========================================================================
   bibby.foo
   CSP note: the host's policy is style-src 'self', so there are no <style>
   blocks and no style="" attributes in the HTML. Everything visual is here.

   Look: a warm paper spec sheet in light mode, a dark control room in dark
   mode, one tally-light red for the accent. Same three faces as the
   photography site (Instrument Serif, Inter Tight, IBM Plex Mono), its own face.
   ========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---- tokens ------------------------------------------------------------- */

:root {
  --bg: #f3efe7;
  --bg-2: #ebe5da;
  --surface: #faf8f3;
  --ink: #17181a;
  --ink-2: #3f4145;
  --dim: #686560;
  --line: rgba(23, 24, 26, 0.13);
  --line-2: rgba(23, 24, 26, 0.24);
  --accent: #b33c27;   /* was #c2412a; 4.48:1 on small labels, now 4.66:1 (2026-10-26) */
  --accent-soft: rgba(194, 65, 42, 0.1);
  --on-accent: #fff;
  --shadow: 0 1px 2px rgba(23, 24, 26, 0.05), 0 8px 24px -12px rgba(23, 24, 26, 0.18);

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 6px;
  --header-h: 64px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121314;
    --bg-2: #18191b;
    --surface: #1c1d20;
    --ink: #ece7de;
    --ink-2: #c4bfb6;
    --dim: #938e86;
    --line: rgba(236, 231, 222, 0.12);
    --line-2: rgba(236, 231, 222, 0.24);
    --accent: #ff6a4d;
    --accent-soft: rgba(255, 106, 77, 0.12);
    --on-accent: #16100e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121314;
  --bg-2: #18191b;
  --surface: #1c1d20;
  --ink: #ece7de;
  --ink-2: #c4bfb6;
  --dim: #938e86;
  --line: rgba(236, 231, 222, 0.12);
  --line-2: rgba(236, 231, 222, 0.24);
  --accent: #ff6a4d;
  --accent-soft: rgba(255, 106, 77, 0.12);
  --on-accent: #16100e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

/* ---- base --------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
main { flex: 1; outline: none; }

img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
.prose a, .lede a, .facts a, figcaption a, .project p a { color: var(--ink); text-decoration-line: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

.icon { width: 1em; height: 1em; flex: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--ink); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- type ----------------------------------------------------------------- */

.h1, .h2, .hero__name, .hero__headline, .tile__title, .project__title, .job__title, .stats__n {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
.h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); line-height: 1.02; max-width: 18ch; text-wrap: balance; }
.h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.08; text-wrap: balance; }
em { font-style: italic; }
.h1 em, .h2 em, .hero__headline em, .discipline__summary em { color: var(--accent); }

.lede { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 60ch; line-height: 1.55; }

.label, .eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.4;
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.dim { color: var(--dim); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.dot--off { background: var(--dim); box-shadow: none; }

.prose { display: grid; gap: 1em; max-width: 64ch; color: var(--ink-2); }
.prose--lead p:first-child { font-size: 1.2rem; color: var(--ink); }

/* ---- buttons -------------------------------------------------------------- */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: transparent; color: var(--ink);
  font-size: 0.95rem; font-weight: 500; line-height: 1.2; text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.btn:hover { border-color: var(--ink); }
.btn .icon { transition: transform 0.25s var(--ease); }
.btn:hover .icon { transform: translateX(2px); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---- header ----------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand__mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; }
.brand__mark i { display: block; width: 4px; border-radius: 1px; background: var(--ink); }
.brand__mark i:nth-child(1) { height: 9px; }
.brand__mark i:nth-child(2) { height: 14px; }
.brand__mark i:nth-child(3) { height: 20px; background: linear-gradient(var(--accent) 0 5px, var(--ink) 5px); }
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .brand__mark i { animation: meter 0.9s var(--ease) infinite alternate; }
  .brand:hover .brand__mark i:nth-child(2) { animation-delay: -0.3s; }
  .brand:hover .brand__mark i:nth-child(3) { animation-delay: -0.6s; }
}
@keyframes meter { from { transform: scaleY(0.45); } to { transform: scaleY(1); } }
.brand__mark i { transform-origin: bottom; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  font-size: 0.93rem; color: var(--ink-2); text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-2); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  background: transparent; cursor: pointer; color: var(--ink-2);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle__sun, .theme-toggle__moon { display: inline-grid; }
.theme-toggle__moon { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__moon { display: inline-grid; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: inline-grid; }
}

@media (max-width: 760px) {
  .site-header__inner { flex-wrap: wrap; gap: 0 12px; padding-top: 10px; }
  .brand { min-height: 40px; }
  .theme-toggle { margin-left: auto; }
  .site-nav { position: relative; order: 3; width: 100%; margin: 6px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter) 8px; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  /* All five links fit from ~340px wide: spread across the row with tighter side padding. Below
     that the row still scrolls (min-width keeps it from squashing). "Contact" used to be cut off
     at 390px with no hint that the row scrolled. 2026-10-26 */
  .site-nav ul { width: 100%; min-width: max-content; justify-content: space-between; }
  .site-nav a { padding: 7px 8px; font-size: 0.9rem; }
  :root { --header-h: 108px; }
}

/* ---- sections --------------------------------------------------------------- */

.section { position: relative; padding-block: clamp(56px, 9vw, 112px); }
/* The rule sits inside the gutters, lined up with the content (a border on .wrap would span its padding). */
.section::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--line); }
.section__head { display: grid; gap: 4px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section__head .eyebrow { margin-bottom: 8px; }
.page-head { padding-block: clamp(48px, 9vw, 104px) clamp(32px, 5vw, 56px); display: grid; gap: 20px; }
.page-head .eyebrow { margin-bottom: 0; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 64px; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

/* ---- home: hero ------------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px); align-items: center;
  padding-block: clamp(40px, 8vw, 104px) clamp(48px, 8vw, 96px);
}
.hero__name { font-size: clamp(3.6rem, 10.5vw, 8.4rem); line-height: 0.9; letter-spacing: -0.025em; margin-bottom: 20px; }
.hero__headline { font-size: clamp(1.6rem, 3.2vw, 2.35rem); line-height: 1.12; max-width: 22ch; margin-bottom: 20px; text-wrap: balance; }
.hero__portrait { position: relative; max-width: 420px; justify-self: end; width: 100%; }

.frame img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%;
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.status {
  position: absolute; left: -20px; bottom: 24px; right: 24px;
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.88rem; line-height: 1.35;
}
.status .label { display: block; margin-bottom: 2px; color: var(--accent); }
.status__light { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 4px var(--accent-soft), 0 0 12px var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .status__light { animation: tally 2.4s ease-in-out infinite; }
}
@keyframes tally { 50% { opacity: 0.45; box-shadow: 0 0 0 4px transparent; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  /* Name and headline first when stacked; the portrait follows (Ryan, 2026-10-26: on a phone the
     first screen used to be only the photo, with who he is below the fold). */
  .hero__portrait { justify-self: start; max-width: 360px; }
  .status { left: 12px; right: 12px; bottom: 12px; }
}

/* ---- home: stats ------------------------------------------------------------ */

.stats ul {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}
.stats li { padding: 24px 20px 24px 0; display: grid; gap: 4px; align-content: start; }
.stats li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.stats__n { font-size: clamp(2.6rem, 5vw, 3.8rem); line-height: 1; }
.stats__l { color: var(--dim); font-size: 0.92rem; line-height: 1.35; max-width: 20ch; }
@media (max-width: 760px) {
  .stats ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ---- home: discipline tiles -------------------------------------------------- */

.tiles { display: grid; grid-template-columns: 1fr; gap: 12px; }
/* Seven tiles: at three across the first and last span two (3 full rows); at two across the last does (4 rows). */
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles li:last-child { grid-column: span 2; } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tiles li:first-child { grid-column: span 2; } }
.tile {
  position: relative; height: 100%;
  display: grid; gap: 6px; align-content: start;
  padding: 22px 22px 56px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile__n { position: absolute; top: 20px; right: 22px; color: var(--dim); }
.tile__kicker { color: var(--accent); }
.tile__title { font-size: 1.75rem; line-height: 1.1; }
.tile__summary { color: var(--ink-2); font-size: 0.96rem; }
.tile__summary em { color: var(--ink); }
.tile__go { position: absolute; left: 22px; bottom: 20px; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); transition: background 0.2s, color 0.2s, border-color 0.2s; }
.tile:hover .tile__go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---- home: now, channels, cta ------------------------------------------------ */

.now { display: grid; border-top: 1px solid var(--line); }
.now li { position: relative; padding: 16px 0 16px 32px; border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.now li::before { content: "▸"; position: absolute; left: 4px; top: 16px; color: var(--accent); font-family: var(--mono); }

.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.channel {
  position: relative; height: 100%;
  display: grid; gap: 4px; align-content: start;
  padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.channel:hover { border-color: var(--line-2); background: var(--surface); }
.channel__ch { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.1em; margin-bottom: 10px; }
.channel__label { font-weight: 600; font-size: 1.1rem; }
.channel__handle { color: var(--dim); font-size: 0.8rem; overflow-wrap: anywhere; }
.channel__blurb { color: var(--ink-2); font-size: 0.94rem; margin-top: 8px; }
.channel__go { position: absolute; top: 18px; right: 18px; color: var(--dim); }
.channel:hover .channel__go { color: var(--accent); }

.cta { display: grid; justify-items: start; gap: 24px; }
.cta .h2 { max-width: 20ch; }
.cta .btn { overflow-wrap: anywhere; }

/* ---- work ------------------------------------------------------------------- */

.work { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-bottom: clamp(56px, 9vw, 112px); }
.work__index { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.work__index .label { margin-bottom: 12px; }
.work__index ol { display: grid; gap: 2px; counter-reset: d; }
.work__index li { counter-increment: d; }
.work__index a { display: flex; gap: 10px; padding: 6px 0; color: var(--ink-2); text-decoration: none; font-size: 0.95rem; }
.work__index a::before { content: counter(d, decimal-leading-zero); font-family: var(--mono); font-size: 0.75rem; color: var(--dim); padding-top: 3px; }
.work__index a:hover, .work__index a.is-active { color: var(--ink); }
.work__index a.is-active::before { color: var(--accent); }

.discipline { display: grid; gap: 24px; padding-block: 48px; border-top: 1px solid var(--line); }
.discipline:first-child { border-top: 0; padding-top: 0; }
.discipline__head { position: relative; display: grid; gap: 8px; }
.discipline__head .label { color: var(--accent); }
.discipline__n { position: absolute; right: 0; top: 0; color: var(--dim); }
.discipline__summary { font-size: 1.2rem; color: var(--ink-2); max-width: 48ch; }

@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; gap: 24px; }
  .work__index { position: static; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); }
  .work__index ol { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .discipline:first-child { padding-top: 24px; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 5px 11px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 0.84rem; color: var(--ink-2); line-height: 1.3;
}
.chips--small li { font-size: 0.78rem; padding: 3px 9px; }

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gallery a { display: block; overflow: hidden; border-radius: var(--radius); background: var(--bg-2); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; transition: transform 0.6s var(--ease), filter 0.3s; }
.gallery a:hover img { transform: scale(1.04); }
@media (max-width: 560px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- résumé ----------------------------------------------------------------- */

.resume-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; }
.resume-head .actions { margin-top: 0; }
.resume-name { max-width: none; }
.resume-contact { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--dim); font-size: 0.82rem; margin-top: 4px; }
.resume-contact a { color: var(--ink-2); text-decoration: none; }
.resume-contact a:hover { color: var(--accent); }
@media (max-width: 760px) { .resume-head { grid-template-columns: 1fr; } }

.resume {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px 72px;
  padding-bottom: clamp(56px, 9vw, 112px);
}
@media (max-width: 960px) { .resume { grid-template-columns: 1fr; } }

.resume__h {
  font-family: var(--mono); font-weight: 400; font-size: 0.75rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
  padding-bottom: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--line);
}
.resume__main .resume__h:not(:first-child) { margin-top: 56px; }

.timeline { display: grid; }
.job { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding-bottom: 32px; position: relative; }
.job__when { color: var(--dim); font-size: 0.8rem; line-height: 1.5; padding-top: 6px; }
.job__tenure { display: block; color: var(--dim); }
.job__body { position: relative; padding-left: 28px; border-left: 1px solid var(--line); padding-bottom: 4px; }
.job__body::before {
  content: ""; position: absolute; left: -5px; top: 10px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-2);
}
.job--current .job__body::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.job__title { font-size: 1.6rem; line-height: 1.15; }
.job__org { margin: 4px 0 12px; font-weight: 500; }
.job__body ul { display: grid; gap: 6px; }
.job__body li { position: relative; padding-left: 18px; color: var(--ink-2); font-size: 0.97rem; }
.job__body li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 8px; height: 1px; background: var(--dim); }
@media (max-width: 600px) {
  .job { grid-template-columns: 1fr; gap: 4px; }
  .job__when { padding-left: 29px; border-left: 1px solid var(--line); padding-top: 0; }
  .job__tenure { display: inline; margin-left: 8px; }
}

.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 24px 32px; }
.cert__issuer { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.cert li, .plain-list li { color: var(--ink-2); font-size: 0.93rem; padding: 2px 0; }

.resume__side { display: grid; gap: 40px; align-content: start; }
.resume__side h3.label { margin: 16px 0 8px; }
.resume__side .resume__h + h3.label { margin-top: 0; }
.edu__school { font-weight: 600; }

/* ---- about ------------------------------------------------------------------ */

.about {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 88px); align-items: start;
  padding-block: clamp(48px, 8vw, 104px);
}
.about__portrait { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 12px; }
.about__portrait figcaption { font-size: 0.85rem; }
.about__text .h1 { margin-bottom: 28px; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__portrait { position: static; max-width: 380px; }
}

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 40px; border-top: 1px solid var(--line); }
.facts > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.facts > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.facts dd { font-size: 1rem; }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; }
  .facts > div:nth-child(even) { padding-left: 0; border-left: 0; }
}

/* ---- contact ---------------------------------------------------------------- */

.contact { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px 72px; padding-bottom: clamp(40px, 6vw, 72px); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact__email .label { margin-bottom: 8px; }
.contact__email .label:not(:first-child) { margin-top: 32px; }
.contact__address, .contact__phone {
  display: inline-block;
  font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05;
  text-decoration: none; overflow-wrap: anywhere;
}
.contact__address:hover, .contact__phone:hover { color: var(--accent); }

.contact__links { border-top: 1px solid var(--line); }
.contact__links a {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: background 0.2s, padding 0.25s var(--ease);
}
.contact__links a:hover { background: var(--surface); padding-inline: 12px; }
.contact__links .icon { color: var(--dim); }
.contact__links a:hover .icon { color: var(--accent); }
.contact__handle { font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 460px) { .contact__links a { grid-template-columns: 1fr auto; } .contact__links .label { grid-column: 1 / -1; } }

.qsl__card {
  max-width: 520px; padding: 28px 32px; display: grid; gap: 8px;
  background: var(--surface);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: rotate(-1.2deg);
}
.qsl__call { font-size: 2.2rem; letter-spacing: 0.08em; color: var(--accent); line-height: 1; }
.qsl { padding-top: 16px; }
.qsl::before { display: none; }

/* ---- 404 --------------------------------------------------------------------- */

.notfound { padding-block: clamp(64px, 12vw, 160px); display: grid; gap: 24px; justify-items: start; }
.notfound .eyebrow { margin-bottom: 0; }
.notfound__title { font-size: clamp(3.6rem, 12vw, 9rem); line-height: 0.9; }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 48px; }
.bars i { display: block; width: 8px; height: 100%; border-radius: 1px; background: var(--line-2); transform-origin: bottom; transform: scaleY(0.08); }
@media (prefers-reduced-motion: no-preference) {
  .bars i { animation: flat 2.8s var(--ease) infinite; }
  .bars i:nth-child(2) { animation-delay: 0.1s; } .bars i:nth-child(3) { animation-delay: 0.2s; }
  .bars i:nth-child(4) { animation-delay: 0.3s; } .bars i:nth-child(5) { animation-delay: 0.4s; }
  .bars i:nth-child(6) { animation-delay: 0.5s; } .bars i:nth-child(7) { animation-delay: 0.6s; }
}
@keyframes flat { 0%, 70%, 100% { transform: scaleY(0.08); } 10% { transform: scaleY(0.6); background: var(--accent); } 25% { transform: scaleY(0.08); } }

/* ---- footer ------------------------------------------------------------------ */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding-top: 48px; font-size: 0.95rem; }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px 48px; padding-bottom: 40px; }
.site-footer__name { font-family: var(--serif); font-size: 2rem; line-height: 1; margin-bottom: 8px; }
.site-footer__role { color: var(--dim); margin-bottom: 12px; }
.site-footer__email { text-decoration: none; font-weight: 500; }
.site-footer__email:hover { color: var(--accent); }
.site-footer__links .label { margin-bottom: 10px; }
.site-footer__links ul { display: grid; gap: 4px; }
.site-footer__links a { text-decoration: none; color: var(--ink-2); }
.site-footer__links a:hover { color: var(--ink); }
.site-footer__links .dim { font-size: 0.85em; }
.site-footer__base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px 28px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.85rem; }
@media (max-width: 760px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__lead { grid-column: 1 / -1; }
}

/* ==========================================================================
   Live data, charts, the waterfall, the palette, error pages.
   ========================================================================== */

:root {
  --ok: #2f8a57;
  --warn: #c7861a;
  --down: #c2412a;
  /* The waterfall is an instrument screen: dark in both themes. */
  --wf-0: #070b10; --wf-1: #10283d; --wf-2: #1b6f86; --wf-3: #f0b43a; --wf-4: #fff4d8;
  /* Contribution levels, in the accent. */
  --hm-0: #e4ddd0; --hm-1: #f1c2b4; --hm-2: #e38a72; --hm-3: #cc5337; --hm-4: #93301c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok: #4cc083; --warn: #f0b43a; --down: #ff6a4d;
    --hm-0: #232427; --hm-1: #4d2821; --hm-2: #7e3727; --hm-3: #c44c31; --hm-4: #ff7a5c;
  }
}
:root[data-theme="dark"] {
  --ok: #4cc083; --warn: #f0b43a; --down: #ff6a4d;
  --hm-0: #232427; --hm-1: #4d2821; --hm-2: #7e3727; --hm-3: #c44c31; --hm-4: #ff7a5c;
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
kbd {
  display: inline-block; min-width: 1.5em; padding: 1px 5px;
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px;
  font-family: var(--mono); font-size: 0.72rem; line-height: 1.5; text-align: center; color: var(--ink-2);
}
.dot--warn { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent); }

.panel {
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.panel > .label { margin-bottom: 14px; }

.section__head--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 32px; max-width: none; }
.section__meta { font-size: 0.78rem; }

/* ---- page transitions (cross-document; browsers without support just navigate) -- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: 160ms var(--ease) both vt-out; }
  ::view-transition-new(root) { animation: 260ms var(--ease) both vt-in; }
}
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
.site-header { view-transition-name: site-header; }

/* ---- header buttons ---------------------------------------------------------- */
.kbd-btn {
  display: inline-flex; align-items: center; gap: 3px; height: 40px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; cursor: pointer;
}
.kbd-btn:hover { border-color: var(--line-2); }
.kbd-btn kbd { border: 0; padding: 0 2px; min-width: 0; }
@media (max-width: 760px) { .kbd-btn { display: none !important; } }

/* ---- waterfall ------------------------------------------------------------------ */
.waterfall { padding-bottom: clamp(40px, 6vw, 72px); }
.waterfall__frame {
  position: relative; overflow: hidden;
  height: clamp(150px, 20vw, 220px);
  border-radius: var(--radius);
  background: var(--wf-0);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  /* A noise floor for no-JS visitors; the canvas covers it. */
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 5px 5px;
}
.waterfall__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.waterfall__frame::after {                     /* scanline + vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.45)),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px);
}
.waterfall__scale {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1;
  display: flex; justify-content: space-between; padding: 8px 14px;
  font-size: 0.68rem; color: rgba(255, 244, 216, 0.55); letter-spacing: 0.06em;
  background: linear-gradient(rgba(7, 11, 16, 0.85), transparent);
}
.waterfall__scale span:nth-child(2) { color: var(--wf-3); }
.waterfall__hud {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 10px 14px; font-size: 0.74rem; letter-spacing: 0.06em; color: rgba(255, 244, 216, 0.8);
  background: linear-gradient(transparent, rgba(7, 11, 16, 0.9));
}
.waterfall__hud .led { margin-right: 8px; }
.waterfall__decode { color: #fff4d8; font-size: 0.9rem; }
.waterfall__decode b { font-weight: 400; color: var(--wf-3); letter-spacing: 0.18em; }
.js-decode-cursor { display: inline-block; width: 8px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--wf-3); }
@media (prefers-reduced-motion: no-preference) { .js-decode-cursor { animation: blink 1s steps(1) infinite; } }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 560px) { .waterfall__hide-sm { display: none; } }

/* ---- LEDs --------------------------------------------------------------------- */
.led {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent), 0 0 8px var(--ok);
}
.is-down .led { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 20%, transparent), 0 0 8px var(--down); }
@media (prefers-reduced-motion: no-preference) {
  .is-down .led { animation: tally 1.2s ease-in-out infinite; }
}

/* ---- home: live panels --------------------------------------------------------- */
.live { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .live { grid-template-columns: 1fr; } }
.live__panel { display: flex; flex-direction: column; gap: 16px; text-decoration: none; transition: border-color 0.2s, box-shadow 0.3s, transform 0.3s var(--ease); }
.live__panel:hover { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.live__panel .label { margin: 0; }
.live__big { font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 3.4rem); line-height: 1; }
.live__big span { font-family: var(--sans); font-size: 1rem; color: var(--dim); margin-left: 6px; }
.live__foot { display: flex; justify-content: space-between; gap: 12px; font-size: 0.78rem; margin-top: auto; }
.live__go { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); white-space: nowrap; }
.live__panel:hover .live__go { color: var(--accent); }
.leds { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.88rem; color: var(--ink-2); }
.leds__i { display: inline-flex; align-items: center; gap: 8px; }

/* ---- heatmap ------------------------------------------------------------------- */
.heatmap { display: block; width: 100%; height: auto; }
.heatmap--strip { max-width: 440px; }
.hm__c { fill: var(--hm-0); }
.hm__c.l1 { fill: var(--hm-1); } .hm__c.l2 { fill: var(--hm-2); } .hm__c.l3 { fill: var(--hm-3); } .hm__c.l4 { fill: var(--hm-4); }
.hm__c:hover { stroke: var(--ink); stroke-width: 1; }
.hm__m, .hm__d { font-family: var(--mono); font-size: 9px; fill: var(--dim); }
.heatmap-wrap { margin-top: 12px; }
.heatmap-scroll { overflow-x: auto; }
.heatmap-scroll .heatmap { min-width: 680px; }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; font-size: 0.72rem; }
.heatmap-legend svg { width: 69px; height: 11px; }

/* ---- GitHub stats ---------------------------------------------------------------- */
.ghstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.ghstats li { padding: 20px 20px 20px 0; display: grid; gap: 4px; align-content: start; }
.ghstats li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.ghstats__n { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; }
.ghstats__l { color: var(--dim); font-size: 0.9rem; line-height: 1.35; }
@media (max-width: 760px) {
  .ghstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ghstats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .ghstats li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
.code-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-top: 12px; }
@media (max-width: 860px) { .code-grid { grid-template-columns: 1fr; } }

.langbar { display: block; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; }
.langs { display: grid; gap: 8px; margin-top: 18px; }
.langs li { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }
.langs .dim { margin-left: auto; }
.swatch { width: 10px; height: 10px; flex: none; }
/* GitHub's own language colours, so the bar reads the way it does there. */
.lang-java { fill: #b07219; } .lang-labview { fill: #fede06; } .lang-jupyter-notebook { fill: #da5b0b; }
.lang-c { fill: #555555; } .lang-php { fill: #4f5d95; } .lang-javascript { fill: #f1e05a; }
.lang-python { fill: #3572a5; } .lang-shell { fill: #89e051; } .lang-powershell { fill: #012456; }
.lang-html { fill: #e34c26; } .lang-css { fill: #663399; } .lang-typescript { fill: #3178c6; }
.lang-c- { fill: #178600; } .lang-go { fill: #00add8; } .lang-rust { fill: #dea584; }
[class^="lang-"]:not(.lang-java):not(.lang-labview):not(.lang-jupyter-notebook):not(.lang-c):not(.lang-php):not(.lang-javascript):not(.lang-python):not(.lang-shell):not(.lang-powershell):not(.lang-html):not(.lang-css):not(.lang-typescript):not(.lang-c-):not(.lang-go):not(.lang-rust) { fill: var(--dim); }
:root[data-theme="dark"] .lang-c, :root[data-theme="dark"] .lang-powershell { fill: #9aa0a6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lang-c, :root:not([data-theme="light"]) .lang-powershell { fill: #9aa0a6; } }

/* Built for others: small horizontal cards. */
.others { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.other { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: start; height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: border-color 0.2s, box-shadow 0.3s; }
.other:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.other__media { display: block; overflow: hidden; border-radius: 4px; background: var(--bg-2); aspect-ratio: 1200 / 630; }
.other__media img { width: 100%; height: 100%; object-fit: cover; }
.other__body { display: grid; gap: 4px; }
.other__body .label { color: var(--accent); }
.other__title { display: inline-flex; align-items: center; gap: 6px; font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; }
.other__title .icon { width: 0.55em; height: 0.55em; color: var(--dim); }
.other:hover .other__title .icon { color: var(--accent); }
.other__text { color: var(--ink-2); font-size: 0.9rem; }
@media (max-width: 420px) { .other { grid-template-columns: 1fr; } }

.code-grid__side { display: grid; gap: 12px; align-content: start; }
.orgs { display: grid; }
.orgs a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; }
.orgs li:first-child a { border-top: 0; padding-top: 0; }
.orgs__name { font-weight: 600; overflow-wrap: anywhere; }
.orgs a:hover .orgs__name { color: var(--accent); }
.orgs .dim { font-size: 0.75rem; }
.heatmap-legend__note { margin-right: auto; }
.repos { display: grid; }
.repos a { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
.repos li:first-child a { border-top: 0; padding-top: 0; }
.repos__name { font-weight: 600; overflow-wrap: anywhere; }
.repos a:hover .repos__name { color: var(--accent); }
.repos__desc { color: var(--ink-2); font-size: 0.92rem; }
.repos__meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--dim); font-size: 0.75rem; }
.repos__meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---- status board ---------------------------------------------------------------- */
.board { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.board__row {
  display: grid; grid-template-columns: minmax(0, 1fr) 70px minmax(120px, 220px); gap: 16px; align-items: center;
  padding: 13px 18px; border-top: 1px solid var(--line); text-decoration: none; font-size: 0.95rem;
}
.board__row:first-child { border-top: 0; }
a.board__row:hover { background: var(--bg-2); }
.board__row--head { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); background: var(--bg-2); }
.board__site { display: flex; align-items: center; gap: 12px; min-width: 0; overflow-wrap: anywhere; }
.board__ms { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; color: var(--dim); font-size: 0.8rem; }
.msbar { width: 100%; height: 6px; }
.msbar rect { fill: var(--ok); opacity: 0.7; }
.is-down .msbar rect { fill: var(--down); }
@media (max-width: 560px) {
  .board__row { grid-template-columns: minmax(0, 1fr) 44px 76px; gap: 10px; padding: 12px 14px; }
  .board__ms { grid-template-columns: 1fr; }
  .msbar { display: none; }
}

/* ---- projects -------------------------------------------------------------------- */
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.88rem; text-decoration: none; color: var(--ink-2); }
.jump a:hover { border-color: var(--line-2); color: var(--ink); }

.featured { display: grid; gap: 16px; padding-bottom: clamp(56px, 9vw, 104px); }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.project {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.25s, box-shadow 0.3s;
}
.project:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.project__media { background: var(--bg-2); border-bottom: 1px solid var(--line); aspect-ratio: 1200 / 630; overflow: hidden; display: grid; place-items: center; }
.project__media picture, .project__media img { width: 100%; height: 100%; object-fit: cover; }
.project__media img { transition: transform 0.8s var(--ease); }
.project:hover .project__media img { transform: scale(1.03); }
.project__body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 20px; flex: 1; }
.project__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.project__top .label { color: var(--accent); }
.project__n { color: var(--dim); }
.project__title { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.project__title a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.project__title .icon { width: 0.6em; height: 0.6em; color: var(--dim); transition: color 0.2s, transform 0.25s var(--ease); }
.project__title a:hover .icon { color: var(--accent); transform: translate(2px, -2px); }
.project__body > p { color: var(--ink-2); font-size: 0.97rem; }
.project__body > p a { color: var(--ink); text-decoration-line: underline; }
.project__more { font-size: 0.93rem !important; color: var(--dim) !important; }
.project__host { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line-2); color: var(--dim); font-size: 0.78rem !important; }

@media (min-width: 900px) {
  .project--featured { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .project--featured .project__media { aspect-ratio: auto; min-height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
  /* A preview card is mostly type: show all of it, letterboxed in the card's own ground. */
  .project--featured .project__media img { object-fit: contain; }
  .project__media--catholic-rip { background: #122219; }
  .project--featured:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .project--featured:nth-child(even) .project__media { order: 2; border-right: 0; border-left: 1px solid var(--line); }
  .project--featured .project__body { padding: 32px 36px 28px; }
  .project--featured .project__title { font-size: 2.6rem; }
}

/* An app screenshot (it has a dark twin): a browser window on a soft ground. */
.project__media--shot {
  padding: clamp(18px, 3vw, 36px);
  background:
    radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-2), var(--surface));
}
.project__media--shot picture {
  height: auto !important; border-radius: 8px;
  border: 1px solid var(--line-2); border-top: 22px solid var(--bg-2);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.35);
  position: relative;
}
.project__media--shot picture::before {           /* the three window buttons */
  content: ""; position: absolute; top: -15px; left: 12px; width: 8px; height: 8px; border-radius: 50%;
  background: #e0605a; box-shadow: 13px 0 0 #e4b440, 26px 0 0 #5cb85c;
}
.project__media--shot img { height: auto !important; object-fit: contain; border-radius: 0 0 7px 7px; }
.project:hover .project__media--shot img { transform: none; }

/* Illustrations (fox hunt, homelab): the media box is an instrument screen. */
.project__media:has(.art) { background: var(--wf-0); padding: 24px; }
.art { width: 100%; height: auto; max-height: 100%; }
.art text { font-family: var(--mono); }
.art__base { stroke: rgba(255, 244, 216, 0.25); stroke-width: 1; }
.art__keys rect { fill: var(--wf-3); }
.art__letters text { fill: rgba(255, 244, 216, 0.85); font-size: 14px; letter-spacing: 0.1em; }
.art__cap { fill: rgba(255, 244, 216, 0.5); font-size: 10px; letter-spacing: 0.12em; }
.art__sweep { fill: #fff4d8; opacity: 0.85; }
@media (prefers-reduced-motion: no-preference) {
  .art--morse .art__sweep { animation: sweep 4.5s linear infinite; }
}
@media (prefers-reduced-motion: reduce) { .art__sweep, .art__packet { display: none; } }
@keyframes sweep { from { transform: translateX(10px); } to { transform: translateX(calc(100% - 10px)); } }
.art--morse .art__sweep { transform-box: view-box; }

.art__case { fill: #111a24; stroke: rgba(255, 244, 216, 0.22); }
.art__div { stroke: rgba(255, 244, 216, 0.12); }
.art__bay { fill: #0b1219; stroke: rgba(255, 244, 216, 0.14); }
.art__led { fill: var(--wf-2); }
.is-a .art__led { fill: #4cc083; } .is-b .art__led { fill: var(--wf-3); }
@media (prefers-reduced-motion: no-preference) {
  .art__led { animation: activity 1.7s steps(2) infinite; }
  .art__led.l1 { animation-duration: 0.9s; } .art__led.l2 { animation-duration: 2.3s; } .art__led.l3 { animation-duration: 1.3s; }
  .art__led.l5 { animation-duration: 0.7s; } .art__led.l6 { animation-duration: 3.1s; } .art__led.l7 { animation-duration: 1.1s; }
}
@keyframes activity { 50% { opacity: 0.25; } }
.art__name { fill: #fff4d8; font-size: 18px; letter-spacing: 0.16em; }
.art__sub { fill: rgba(255, 244, 216, 0.55); font-size: 10px; letter-spacing: 0.1em; }
.art__link { fill: none; stroke: rgba(255, 244, 216, 0.35); stroke-width: 1.5; stroke-dasharray: 4 5; }
.art__packet { fill: var(--wf-3); }

/* ---- résumé: career timeline -------------------------------------------------- */
.career { padding-bottom: 40px; }
.career__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-bottom: 14px; }
.career__head .label { margin: 0; }
.career__note { font-size: 0.75rem; }
.career__scroll { overflow-x: auto; }
.timeline-chart { display: block; width: 100%; min-width: 760px; height: auto; }
.tl__grid { stroke: var(--line); }
.tl__year { font-family: var(--mono); font-size: 11px; fill: var(--dim); }
.tl__now { stroke: var(--accent); stroke-dasharray: 3 3; }
.tl__bar rect { fill: var(--bg-2); stroke: var(--line-2); }
.tl__bar.is-current rect { fill: var(--accent-soft); stroke: var(--accent); }
.tl__bar:hover rect { stroke: var(--ink); }
.tl__t { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--ink); }
.tl__o { font-family: var(--sans); font-size: 10.5px; fill: var(--dim); }
.tl__t, .tl__o { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }

/* ---- contact: QSL morse --------------------------------------------------------- */
.qsl__morse { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--accent); font-size: 1.1rem; letter-spacing: 0.08em; }
.qsl__card .btn { justify-self: start; margin-top: 8px; }
.js-morse.is-playing { border-color: var(--accent); color: var(--accent); }

/* ---- footer extras ---------------------------------------------------------------- */
.site-footer__base kbd { margin: 0 1px; }
.site-footer__sign { display: inline-flex; align-items: center; gap: 8px; }
.footer-note { font-style: italic; text-decoration: none; }
.footer-note:hover { color: var(--accent); text-decoration: underline; }
.morse-btn { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.morse-btn:hover, .morse-btn.is-playing { color: var(--accent); }

/* ---- ⌘K palette ------------------------------------------------------------------- */
.palette {
  width: min(620px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 80px));
  margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.palette[open] { display: flex; }
.palette::backdrop { background: rgba(10, 10, 12, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: no-preference) {
  .palette[open] { animation: pal-in 0.22s var(--ease); }
}
@keyframes pal-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
.palette__box { display: flex; flex-direction: column; width: 100%; min-height: 0; margin: 0; }
.palette__search { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette__search .icon { width: 18px; height: 18px; color: var(--dim); }
.palette__input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: inherit; font-size: 1.05rem; }
.palette__list { overflow-y: auto; padding: 6px; }
.palette__list a, .palette__list button {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 8px; background: none; text-align: left;
  font: inherit; font-size: 0.97rem; color: var(--ink); text-decoration: none; cursor: pointer;
}
.palette__list li.is-active a, .palette__list li.is-active button { background: var(--bg-2); box-shadow: inset 2px 0 0 var(--accent); }
.palette__kind { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.palette__empty { padding: 20px; color: var(--dim); }

/* ---- error pages ------------------------------------------------------------------ */
.err {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
  gap: clamp(28px, 6vw, 80px); align-items: center;
  padding-block: clamp(56px, 10vw, 128px);
}
@media (max-width: 860px) { .err { grid-template-columns: 1fr; } }
.err__signal { display: grid; gap: 18px; justify-items: start; }
.err__code { font-family: var(--serif); font-size: clamp(6rem, 18vw, 13rem); line-height: 0.8; letter-spacing: -0.04em; color: var(--ink); }
.is-5xx .err__code { color: var(--accent); }
.err__meter { display: flex; align-items: flex-end; gap: 4px; height: 44px; }
.err__meter i { display: block; width: 9px; height: 100%; border-radius: 1px; background: var(--line-2); transform-origin: bottom; transform: scaleY(0.1); }
@media (prefers-reduced-motion: no-preference) {
  .err__meter i { animation: flat 2.8s var(--ease) infinite; }
  .err__meter i:nth-child(2) { animation-delay: 0.08s; } .err__meter i:nth-child(3) { animation-delay: 0.16s; }
  .err__meter i:nth-child(4) { animation-delay: 0.24s; } .err__meter i:nth-child(5) { animation-delay: 0.32s; }
  .err__meter i:nth-child(6) { animation-delay: 0.4s; } .err__meter i:nth-child(7) { animation-delay: 0.48s; }
  .err__meter i:nth-child(8) { animation-delay: 0.56s; } .err__meter i:nth-child(9) { animation-delay: 0.64s; }
  .err__meter i:nth-child(10) { animation-delay: 0.72s; } .err__meter i:nth-child(11) { animation-delay: 0.8s; }
  .err__meter i:nth-child(12) { animation-delay: 0.88s; }
  .is-5xx .err__meter i { animation-name: clip; animation-duration: 0.9s; }
}
@keyframes clip { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); background: var(--accent); } }
.err__text { display: grid; gap: 18px; }
.err__text .eyebrow { margin: 0; }
.err__title { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.err__try { color: var(--ink-2); }
.err__try .label { margin-right: 8px; color: var(--accent); }
.err__log {
  display: grid; gap: 4px; padding: 14px 16px; margin: 0;
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  font-size: 0.8rem; color: var(--ink-2); max-width: 560px;
}
.err__log div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
.err__log dt { color: var(--dim); }
.err__log dd { overflow-wrap: anywhere; }
.err .actions { margin-top: 4px; }

/* ---- print: the résumé (and any page) on paper ------------------------------- */

@media print {
  :root, :root[data-theme="dark"] {
    --bg: #fff; --bg-2: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --dim: #555;
    --line: #ccc; --line-2: #999; --accent: #000; --accent-soft: transparent; --shadow: none;
    color-scheme: light;
  }
  @page { margin: 12mm 14mm 12mm; }
  body { font-size: 10pt; line-height: 1.4; display: block; }
  .site-header, .site-footer, .skip, .no-print, .actions, .theme-toggle, .work__index, .waterfall, .palette, .kbd-btn { display: none !important; }
  a { text-decoration: none; }
  .page-head { padding: 0 0 10pt; }
  .h1 { font-size: 26pt; }
  .lede { font-size: 11pt; }
  .resume-contact { font-size: 8.5pt; }
  .resume { display: block; padding: 0; }
  .resume__side { display: grid; grid-template-columns: 1fr 1fr; gap: 12pt 24pt; margin-top: 16pt; }
  /* A section heading must never end a page with its content on the next one
   * ("CERTIFICATIONS & LICENCES" was left alone at the foot of page 1). */
  .resume__h { margin-bottom: 8pt; padding-bottom: 4pt; font-size: 8pt; break-after: avoid; page-break-after: avoid; }
  .resume__main .resume__h:not(:first-child) { margin-top: 16pt; }
  .job { grid-template-columns: 95pt 1fr; gap: 10pt; padding-bottom: 10pt; break-inside: avoid; }
  .job__title { font-size: 13pt; }
  .job__body { padding-left: 12pt; }
  .job__body li, .cert li, .plain-list li { font-size: 9pt; }
  .certs { grid-template-columns: repeat(4, 1fr); gap: 6pt 14pt; }
  .cert li { padding: 1px 0; }
  .cert { break-inside: avoid; }
  .chips li { border: 0; background: none; padding: 0 6pt 0 0; font-size: 9pt; }
  .frame img, .qsl__card { box-shadow: none; }
}

/* ============================================================================
   Résumé — print / PDF layout (the PDF at /resume/pdf/ is generated from this).
   Scoped to .page-resume so no other page's printout changes; the screen
   layout above is untouched. One sans family for everything but the name, no
   mono or letter-spaced labels, no timeline graphics, dates on the title line,
   and every section in the same label | content rhythm, so it reads as one
   calm document. Durations ("2 yrs 1 mo") are hidden: in a static PDF they go
   stale.
   ========================================================================== */
@media print {
  .page-resume { page: resume; font-family: var(--sans); font-size: 9.6pt; line-height: 1.42; color: #1a1a1a; }
  @page resume {
    size: letter;
    margin: 13mm 15mm 14mm;
    @bottom-right {
      content: "Ryan J. Bibby  ·  page " counter(page) " of " counter(pages);
      font-family: "Inter Tight", Arial, sans-serif; font-size: 7.5pt; color: #888;
    }
  }

  /* Header */
  .page-resume .eyebrow { display: none; }
  .page-resume .page-head { padding: 0 0 4pt; border: 0; margin-bottom: 2pt; }
  .page-resume .resume-name { font-size: 27pt; line-height: 1.05; margin: 0 0 3pt; }
  .page-resume .lede { font-size: 10.5pt; color: #333; max-width: none; line-height: 1.35; margin: 0; }
  .page-resume .resume-contact { font-family: var(--sans); font-size: 9pt; color: #444; gap: 0 8pt; margin-top: 3pt; letter-spacing: 0; }
  .page-resume .resume-contact a { color: #222; }

  /* Section headings */
  .page-resume .resume__h {
    font-family: var(--sans); font-size: 9pt; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: #000; border-bottom: 0.5pt solid #aaa;
    padding: 0 0 2.5pt; margin: 13pt 0 6pt;
  }
  .page-resume .resume__main .resume__h:not(:first-child) { margin-top: 13pt; }

  /* Experience: title + dates on one line, org beneath, plain bullets */
  .page-resume .timeline { display: block; }
  .page-resume .job { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12pt; padding: 0 0 11pt; }
  .page-resume .job__body { order: 1; padding: 0; border: 0; }
  .page-resume .job__body::before { display: none; }
  .page-resume .job__when { order: 2; font-family: var(--sans); font-size: 9pt; color: #444; text-align: right; white-space: nowrap; padding: 1.5pt 0 0; border: 0; }
  .page-resume .job__tenure { display: none; }
  .page-resume .job__title { font-family: var(--sans); font-size: 11pt; font-weight: 600; letter-spacing: 0; line-height: 1.3; color: #000; }
  .page-resume .job__org { margin: 0.5pt 0 3.5pt; font-weight: 400; color: #333; }
  .page-resume .job__org .dim { color: #555; }
  .page-resume .job__body ul { display: block; margin: 0; padding-left: 11pt; list-style: disc; }
  .page-resume .job__body li { padding: 0; margin: 0 0 2pt; font-size: 9.8pt; line-height: 1.45; color: #222; }
  .page-resume .job__body li::before { display: none; }

  /* Every other section: label | content rows */
  /* Keep the whole section on one page: page 1 is Experience, page 2 the rest. */
  .page-resume .certs { display: block; break-inside: avoid; }
  .page-resume .cert, .page-resume .resume__side section { break-inside: avoid; }
  .page-resume .cert { display: grid; grid-template-columns: 150pt minmax(0, 1fr); column-gap: 10pt; padding: 2pt 0; }
  .page-resume .cert__issuer { font-size: 9.4pt; font-weight: 600; margin: 0; color: #000; }
  /* Flex, not inline: whitespace between the <li>s would otherwise put a space before each comma. */
  .page-resume .cert ul, .page-resume .resume__side ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; column-gap: 0.3em; row-gap: 0; }
  .page-resume .cert li, .page-resume .resume__side li { display: block; padding: 0; font-size: 9.4pt; color: #222; border: 0; background: none; }
  .page-resume .cert li:not(:last-child)::after, .page-resume .resume__side li:not(:last-child)::after { content: ","; }

  /* Print order: Experience, Education (fills page 1), then Certifications,
   * Skills, Awards, Involvement. The web page keeps its sidebar layout; this
   * only reorders the printout, by flattening main + aside into one column. */
  .page-resume .resume { display: flex; flex-direction: column; gap: 0; }
  .page-resume .resume__main, .page-resume .resume__side { display: contents; }
  .page-resume .resume__main > #exp-h { order: 1; }
  .page-resume .resume__main > .timeline { order: 2; }
  .page-resume .resume__side > section:nth-of-type(1) { order: 3; }
  .page-resume .resume__main > .resume__h:not(#exp-h) { order: 4; }
  .page-resume .resume__main > .certs { order: 5; }
  .page-resume .resume__side > section:nth-of-type(2) { order: 6; }
  .page-resume .resume__side > section:nth-of-type(3) { order: 7; }
  .page-resume .resume__side > section:nth-of-type(4) { order: 8; }
  .page-resume .resume__side section { display: grid; grid-template-columns: 150pt minmax(0, 1fr); column-gap: 10pt; row-gap: 4pt; }
  .page-resume .resume__side .resume__h { grid-column: 1 / -1; }
  .page-resume .resume__side h3.label {
    grid-column: 1; margin: 0; font-family: var(--sans); font-size: 9.4pt; font-weight: 600;
    letter-spacing: 0; text-transform: none; color: #000; line-height: 1.42;
  }
  .page-resume .resume__side h3.label + ul { grid-column: 2; }
  .page-resume .resume__side .dim, .page-resume .resume__side .mono { font-family: var(--sans); font-size: inherit; color: #555; letter-spacing: 0; }
  .page-resume .resume__side li .dim::before { content: "("; }
  .page-resume .resume__side li .dim::after { content: ")"; }
  /* Education: school in the label column, degree + date beside it */
  .page-resume .edu__school { grid-column: 1; font-weight: 600; color: #000; margin: 0; }
  .page-resume .edu__school ~ p { grid-column: 2; margin: 0; }
  .page-resume .edu__school + p { grid-row: 2; }
}

/* ---- Bigger hit areas for small links (2026-10-26) ------------------------------------
   These links were 15–22px tall (WCAG 2.5.8 asks for 24px). padding-block grows the clickable box;
   the equal negative margin cancels it in the layout, so nothing on the page moves. */
.site-footer a { padding-block: 4px; margin-block: -4px; }

/* Standalone small links found by the re-check (2026-10-26); same layout-neutral padding as above. */
.morse-btn { padding-block: 3px; margin-block: -3px; }
