/* =========================================================
   Annie Wu — The Portfolio You Can Debug
   Plain CSS, no build step.
   ========================================================= */

:root {
  /* Palette from the brief */
  --cream: #FFF9F1;
  --ink: #28352F;
  --sage: #DCE8D6;
  --lavender: #E9E1F3;
  --blue: #DCECF4;
  --peach: #F5D9C6;

  /* Derived, contrast-safe accents (all ≥ 4.5:1 on cream and on their tints) */
  --ink-soft: #4A5850;
  --sage-deep: #3B5E3D;
  --lavender-deep: #574178;
  --blue-deep: #2B566E;
  --peach-deep: #84442A;
  --paper: #FFFDF9;
  --line: #E4DCCF;
  --line-strong: #C9BFAF;
  --ok: #2F6B3A;
  --ok-bg: #E3F0DD;
  --warn: #8A3D1F;
  --warn-bg: #FBE7DA;

  --shadow-soft: 0 1px 2px rgba(40, 53, 47, .06), 0 6px 20px rgba(40, 53, 47, .06);
  --shadow-block: 4px 4px 0 rgba(40, 53, 47, .10);
  --radius: 10px;
  --radius-sm: 6px;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 7vw, 88px);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1rem; font-family: var(--font-sans); }

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }

a { color: var(--sage-deep); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--ink); }

code, .mono { font-family: var(--font-mono); font-size: .88em; }
code { background: rgba(40, 53, 47, .06); padding: .08em .35em; border-radius: 4px; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--blue-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
main:focus { outline: none; }

.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;
}

.skip-link {
  position: absolute;
  left: 12px; top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--cream); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 249, 241, .92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  grid-template-columns: 9px 9px;
  gap: 2px;
}
.brand-mark i { width: 9px; height: 9px; display: block; }
.brand-mark i:nth-child(1) { background: #A8C29E; }
.brand-mark i:nth-child(2) { background: #C3B2DC; }
.brand-mark i:nth-child(3) { background: #A9CDE0; }
.brand-mark i:nth-child(4) { background: #E9B795; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
}
.site-nav a:hover { background: var(--sage); }
.site-nav .nav-resume {
  border: 1.5px solid var(--ink);
  margin-left: 6px;
}
.site-nav .nav-resume:hover { background: var(--ink); color: var(--cream); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

@media (max-width: 860px) {
  /* Only collapse when JS is running; without JS the links simply wrap. */
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; }
  .js .site-nav a { padding: 12px; font-size: 1.05rem; }
  .js .site-nav .nav-resume { margin: 8px 0 0; text-align: center; }

  html:not(.js) .header-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
}

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  -webkit-user-select: none;
  user-select: none;
}
.btn-primary { background: var(--ink); color: var(--cream); box-shadow: var(--shadow-block); }
.btn-primary:hover { color: var(--cream); background: #1d2823; }
.btn-secondary { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-block); }
.btn-secondary:hover { background: var(--sage); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); border-style: dashed; }
.btn-ghost:hover { background: rgba(40, 53, 47, .05); color: var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(40, 53, 47, .10); }
.btn-small { min-height: 44px; padding: 8px 14px; font-size: .95rem; }
.btn-note { font-weight: 400; font-size: .85em; opacity: .85; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: progress; }

.text-link {
  font-weight: 600;
  color: var(--sage-deep);
}
.text-link span { display: inline-block; transition: transform .15s ease; }
.text-link:hover span { transform: translateX(3px); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }

/* ---------- Hero: the whole room (wall + bookshelf + window + desk) ---------- */
.hero {
  --desk-h: clamp(120px, 15vh, 168px);   /* depth of the desk top */
  --k: 1;            /* scale for the desk items */
  --edge: calc(var(--desk-h) + 13px); /* top of the desk's back edge, where things stand */
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  background: #FBF1E4;
  overflow: hidden;
}
.room-wall {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: clamp(20px, 3.5vh, 52px) 0 calc(64px * var(--k) + clamp(36px, 6vh, 80px));
}
.room-wall::before { /* a few faint blocks on the wall */
  content: "";
  position: absolute;
  top: 40px; left: 47%;
  width: 16px; height: 16px;
  background: #F3E5D3;
  box-shadow: 30px 34px 0 -4px #F3E5D3, -70px 150px 0 -3px #F3E5D3, 46px 260px 0 -5px #F3E5D3, 420px 10px 0 -4px #F3E5D3;
}
.room-wall > .wrap { width: 100%; }
.room-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.room-left { padding-top: clamp(8px, 4vh, 48px); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.25rem); max-width: 32em; color: var(--ink); }
.hero h1 { font-size: clamp(2rem, min(4.4vw, 6.4vh), 3.2rem); }
.bug-g { color: var(--warn); font-style: italic; letter-spacing: -.02em; } /* the bug that snuck into "building" */

/* Bookshelf with two books that are the hero's links */
.shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: max-content;
  min-width: 290px;
  margin-top: clamp(16px, 3vh, 30px);
  padding: 0 24px;
}
.shelf-books { display: flex; align-items: flex-end; gap: 6px; }
.book {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  border: 3px solid var(--ink);
  border-radius: 4px 4px 2px 2px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 4px 0 0 rgba(40, 53, 47, .14);
  transition: transform .18s ease, box-shadow .18s ease;
}
.book::before, .book::after { /* spine bands */
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 8px;
  background: rgba(40, 53, 47, .18);
}
.book::before { top: 14px; }
.book::after { bottom: 14px; }
.book-about { height: clamp(118px, 15vh, 156px); background: #E9B795; }
.book-skills { height: clamp(110px, 14vh, 146px); width: 36px; background: #A9CDE0; }
.book-projects { height: clamp(128px, 16.5vh, 166px); background: #C3B2DC; }
.book-resume { height: clamp(116px, 15vh, 154px); width: 38px; background: #A8C29E; }
.book-label {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.book:hover, .book:focus-visible { transform: translateY(-14px); color: var(--ink); box-shadow: 4px 6px 0 rgba(40, 53, 47, .16); }
.book:focus-visible { outline-offset: 4px; }
/* An unlabeled book leaning against the others */
.book-lean {
  height: clamp(100px, 13vh, 138px);
  width: 20px;
  margin-left: clamp(20px, 2.7vh, 28px);
  background: #E9E1F3;
  transform-origin: bottom left;
  rotate: -12deg;
  pointer-events: none;
}
.shelf-ball { width: 52px; height: auto; margin-left: 14px; }
.shelf-plant { width: 46px; height: auto; margin-left: 10px; }
.shelf-plank {
  position: absolute;
  left: 0; right: 0; bottom: -14px;
  height: 14px;
  background: #E8CDB2;
  border: 3px solid var(--ink);
  border-radius: 3px;
}
.shelf-plank::before, .shelf-plank::after { /* brackets */
  content: "";
  position: absolute;
  top: 100%;
  width: 12px; height: 16px;
  background: #D9B795;
  border: 2.5px solid var(--ink);
  border-top: 0;
}
.shelf-plank::before { left: 18px; }
.shelf-plank::after { right: 18px; }
/* Window (now on the right) and the pinned sticky note */
.room-right { position: relative; padding-top: clamp(12px, 6vh, 64px); margin-right: calc(-1 * clamp(0px, 1.8vw, 30px)); }
.window-unit { position: relative; max-width: 480px; margin: 0 0 0 auto; }
.room-window { max-width: none; }
/* The window sill IS the bookshelf: the books stand on the sill drawn in the window
   picture, in front of the bottom of the mountain view. Positions are fractions of the
   window drawing (sill: x 36–372 of 344 wide, its top edge 19.5 units above the bottom). */
.shelf.shelf-sill {
  position: absolute;
  left: 5%; right: 5%;
  bottom: 7.8%;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0 10px;
}
.shelf-sill .shelf-plant { margin-left: auto; }
.shelf-sill .shelf-plank { display: none; } /* the drawn window sill is the shelf */
.room-window svg { display: block; width: 100%; height: auto; }

/* The desk: full width along the bottom of the hero */
.desk-unit {
  position: relative;
  flex: none;
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--wrap) + 160px));
  margin: 0 auto;
}
.desk {
  position: relative;
  height: var(--desk-h);
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 0 8%, #E2C8AE 8% 14%, transparent 14% 52%, #E2C8AE 52% 62%, transparent 62%) 0 34% / 100% 4px no-repeat,
    linear-gradient(90deg, transparent 0 30%, #E2C8AE 30% 38%, transparent 38% 80%, #E2C8AE 80% 88%, transparent 88%) 0 72% / 100% 4px no-repeat,
    #EBD4BC;
}
.desk::before { /* the desk's back edge */
  content: "";
  position: absolute;
  left: -3px; right: -3px; top: -16px;
  height: 16px;
  background: #E2C2A2;
  border: 3px solid var(--ink);
  border-radius: 4px 4px 0 0;
}
.desk-front { /* thick front edge of the desk top, with legs below */
  position: relative;
  height: 26px;
  background: #D9B795;
  border: 3px solid var(--ink);
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 -6px 0 rgba(40, 53, 47, .08);
}
.desk-leg {
  position: absolute;
  top: calc(100% + 3px);
  width: 22px;
  height: clamp(18px, 3.4vh, 34px);
  background: #C9A07A;
  border: 3px solid var(--ink);
  border-top: 0;
}
.leg-l { left: 4%; }
.leg-r { right: 4%; }
.room-floor {
  flex: none;
  height: calc(clamp(18px, 3.4vh, 34px) + 14px);
  margin-top: 0;
  background: linear-gradient(#FBF1E4 0 calc(100% - 14px), var(--ink) calc(100% - 14px) calc(100% - 11px), #E8D5BE calc(100% - 11px));
}
.desk-items { position: relative; max-width: var(--wrap); height: 100%; margin: 0 auto; }
.desk-item { position: absolute; display: block; margin: 0; }
.desk-item > svg { display: block; width: 100%; height: auto; }
.item-breadboard { left: 6%; bottom: calc(var(--desk-h) * .16); width: calc(132px * var(--k)); z-index: 2; } /* sits on top of the loose parts */
.item-breadboard > svg { rotate: -6deg; } /* a little askew */
.item-computer {
  left: 2%;
  bottom: var(--edge);
  width: calc(460px * var(--k));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.monitor {
  position: relative;
  width: 100%;
  padding: calc(12px * var(--k)) calc(12px * var(--k)) calc(18px * var(--k));
  background: #FFFDF9;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 rgba(40, 53, 47, .14);
}
.monitor::after { /* power light */
  content: "";
  position: absolute;
  right: 14px; bottom: calc(6px * var(--k));
  width: 6px; height: 6px;
  background: #7FC77A;
  border: 1.5px solid var(--ink);
}
.monitor-screen {
  padding: calc(10px * var(--k)) calc(14px * var(--k)) calc(12px * var(--k));
  background:
    repeating-linear-gradient(0deg, rgba(143, 227, 155, .05) 0 1px, transparent 1px 3px),
    #17201C;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: calc(.86rem * var(--k));
  line-height: 1.5;
  color: #8FE39B;
  text-shadow: 0 0 6px rgba(143, 227, 155, .25);
}
.monitor-screen p { margin: 0; }
.monitor-screen .term-bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: .5em;
  padding-bottom: .35em;
  border-bottom: 1px dashed rgba(143, 227, 155, .3);
  font-size: .78em;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6FBF7B;
}
.term-status { display: inline-flex; align-items: center; gap: 4px; }
.term-status i { width: 7px; height: 7px; background: #8FE39B; display: inline-block; }
.term-status i:nth-child(2) { background: #F5D9C6; }
.term-status i:nth-child(3) { background: #A9CDE0; }
.term-prompt { color: #F5D9C6; }
.term-line { color: #DCECF4; }
.monitor-screen .term-out { margin: .15em 0 .3em; }
.term-cursor {
  display: inline-block;
  width: .6em; height: 1.1em;
  vertical-align: text-bottom;
  background: #8FE39B;
  animation: term-blink 1.1s steps(1) infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
.monitor-screen .term-note { min-height: 1.5em; }
.monitor-screen .is-dim { color: #5E9E69; }

/* Fade between the hero and a section when a book is pulled */
.page-fade {
  position: fixed;
  inset: 0;
  z-index: 45; /* under the sticky header */
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.page-fade.is-on { opacity: 1; }
.is-entering { animation: section-in .75s ease both; }
@keyframes section-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
h2[tabindex="-1"]:focus { outline: none; }
.monitor-neck {
  width: calc(46px * var(--k));
  height: calc(24px * var(--k));
  background: #E4DCCF;
  border-left: 3px solid var(--ink);
  border-right: 3px solid var(--ink);
}
.monitor-base {
  width: calc(160px * var(--k));
  height: calc(12px * var(--k));
  background: #E4DCCF;
  border: 3px solid var(--ink);
  border-radius: 6px 6px 2px 2px;
}
.item-parts { display: none; }
/* Loose parts scattered at odd angles to the left of the breadboard */
.part { z-index: 1; }
.part-note     { left: 3.4%;  bottom: calc(var(--desk-h) * .34); width: calc(42px * var(--k)); rotate: -11deg; }
.part-chip     { left: .5%;   bottom: calc(var(--desk-h) * .6);  width: calc(40px * var(--k)); rotate: -14deg; }
.part-led-a    { left: 1.4%;  bottom: calc(var(--desk-h) * .14); width: calc(13px * var(--k)); rotate: -28deg; }
.part-led-b    { left: 16%;   bottom: calc(var(--desk-h) * .07); width: calc(13px * var(--k)); rotate: 38deg; }
.part-resistor { left: 3.6%;  bottom: calc(var(--desk-h) * .11); width: calc(44px * var(--k)); rotate: -33deg; }
.part svg { filter: drop-shadow(1.5px 1.5px 0 rgba(40, 53, 47, .14)); }
.item-keyboard { left: 24%; bottom: calc(var(--desk-h) * .14); width: calc(244px * var(--k)); }
.item-mouse { left: 47.6%; bottom: calc(var(--desk-h) * .18); width: calc(46px * var(--k)); rotate: 8deg; }
.mouse-cord { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mouse-cord path { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.item-pup { left: 58%; bottom: var(--edge); width: calc(130px * var(--k)); }
.item-nameplate { /* a long white desk name bar, extruded up and to the right */
  left: 56%;
  bottom: calc(var(--desk-h) * .58);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 26px;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 2px;
  box-shadow:
    1px -1px 0 #E4DCCF, 2px -2px 0 #E4DCCF, 3px -3px 0 #E4DCCF, 4px -4px 0 #E4DCCF,
    5px -5px 0 #E4DCCF, 6px -6px 0 #E4DCCF, 7px -7px 0 #E4DCCF, 8px -8px 0 #E4DCCF,
    9px -9px 0 var(--ink),
    3px 5px 0 rgba(40, 53, 47, .16);
  line-height: 1;
  white-space: nowrap;
}
.nameplate-name { font-family: var(--font-serif); font-weight: 800; font-size: 1rem; }
.nameplate-sep { width: 6px; height: 6px; background: var(--ink); }
.nameplate-role { font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.item-board { left: 81%; bottom: calc(var(--desk-h) * .14); width: calc(158px * var(--k)); }

/* Short laptop screens: tighten the wall so the whole room fits */
@media (min-width: 761px) and (max-height: 860px) {
  .room-wall { padding-top: 14px; }
  .hero .eyebrow { margin-bottom: 10px; }
  .hero h1 { margin-bottom: .3em; }
  .hero .lede { margin-bottom: 0; }
  .shelf { margin-top: 12px; }
}
@media (max-width: 1000px) {
  .hero { --k: .85; --desk-h: clamp(128px, 16vh, 166px); }
  .item-board { left: 79%; }
  .item-nameplate { left: 53.5%; }
  .item-keyboard { left: 25.6%; }
  .item-mouse { left: 49.6%; }
}
@media (max-width: 760px) {
  .hero { min-height: 0; }
  .room-grid { grid-template-columns: 1fr; gap: 56px; }
  .room-wall { padding-bottom: calc(130px * var(--k)); }
  .room-left { padding-top: 0; }
  .room-right { padding-top: 0; margin-right: 0; }
  .window-unit { max-width: 380px; margin: 8px auto 0; }
}
@media (max-width: 560px) {
  .hero { --k: .72; --desk-h: 140px; }
  .item-mouse, .item-board, .item-nameplate, .shelf-plant, .item-parts, .part { display: none; }
  .item-breadboard { left: 2%; }
  .item-keyboard { left: 49.5%; width: 49%; }
  .item-pup { left: 74%; }
  .room-wall { padding-bottom: 244px; }
  .item-computer { left: 1%; width: 71%; }
  .monitor-screen { font-size: .62rem; padding: 6px 8px 8px; }
  .shelf.shelf-sill { padding: 0 6px; }
  .book { width: 30px; }
  .book-skills, .book-resume { width: 28px; }
  .book-about { height: 104px; } .book-skills { height: 96px; } .book-projects { height: 116px; } .book-resume { height: 102px; }
  .book-lean { width: 16px; height: 88px; margin-left: 18px; }
  .book-label { font-size: .56rem; letter-spacing: .05em; }
  .shelf-ball { width: 36px; margin-left: auto; }
}

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; position: relative; }
.section-tint { background: linear-gradient(180deg, rgba(220, 232, 214, .45), rgba(220, 236, 244, .35)); }
.section-tint::before { /* blocky top edge */
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 8px;
  background:
    linear-gradient(90deg, transparent 0 24px, var(--cream) 24px 48px) repeat-x;
  background-size: 48px 8px;
  opacity: .9;
}
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.block-dot {
  width: 10px; height: 10px;
  background: var(--sage-deep);
  box-shadow: 4px 4px 0 var(--peach);
}
.section-intro { font-size: 1.1rem; max-width: 40em; color: var(--ink-soft); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  margin-top: 24px;
}
.about-text p { max-width: 36em; }
.facts { margin: 28px 0 0; display: grid; gap: 14px; }
.facts div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.facts dt { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding-top: .2em; }
.facts dd { margin: 0; }

.field-notes {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-block);
  /* notebook ruling */
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(43, 86, 110, .08) 31px 32px);
}
.notes-title { font-size: 1.2rem; }
.notes-title span { font-family: var(--font-sans); font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.notes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  align-content: start;
  gap: 2px;
  font-size: .95rem;
  position: relative;
}
.note strong { font-size: 1rem; }
.note span { color: var(--ink-soft); line-height: 1.45; }
.note-icon { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 4px; }
.note-sage { background: var(--sage); --card-bg: var(--sage); }
.note-blue { background: var(--blue); --card-bg: var(--blue); }
.note-peach { background: var(--peach); --card-bg: var(--peach); }
.note-lavender { background: var(--lavender); --card-bg: var(--lavender); }

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .notes { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Field notes: flip cards with a folded-corner flap ---------- */
.notes .flip {
  padding: 0;
  background: none;
  perspective: 1000px;
  min-height: 220px;
  display: flex;
}
.flip-inner {
  position: relative;
  flex: 1;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.3, .7, .3, 1);
}
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
.note-face {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
}
.note-front {
  height: 100%;
  padding: 12px 14px 30px;
  display: grid;
  align-content: start;
  gap: 2px;
  background: var(--card-bg);
}
.note-front strong { font-size: 1rem; }
.note-front > span { color: var(--ink-soft); line-height: 1.45; }
.note-back {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
  transform: rotateY(180deg);
  background: var(--ink);
}
.note-back img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-caption {
  position: absolute;
  top: 0; left: 0; right: 0;
  margin: 0;
  padding: 10px 12px 34px;
  color: #fff;
  font-weight: 700;
  font-size: .92rem;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  background: linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
}
/* The flap: a folded-down corner. It's a real button (click/tap/Enter pins the flip). */
.flap {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0 0 var(--radius-sm) 0;
  cursor: pointer;
  background:
    linear-gradient(315deg, var(--paper) 0 50%, transparent 50%),
    linear-gradient(315deg, transparent 0 46%, rgba(40, 53, 47, .28) 50%, transparent 56%);
  transition: width .18s ease, height .18s ease;
}
.flap::before { /* the underside of the folded paper */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 253, 249, .95) 0 48%, transparent 50%);
  filter: drop-shadow(-1px -1px 1px rgba(40, 53, 47, .2));
}
.flap::after { /* bigger touch target */
  content: "";
  position: absolute;
  inset: -10px;
}
.flap:hover, .flap:focus-visible, .flip.is-flipped .flap { width: 40px; height: 40px; }
.flap:focus-visible { outline-offset: 2px; }
@media (max-width: 480px) {
  .notes .flip { min-height: 260px; }
}

/* ---------- Superpowers ---------- */
.power {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-block);
  position: relative;
  overflow: hidden;
}
.power::before { /* colored block strip */
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
}
.power-lavender::before { background: #C3B2DC; }
.power-blue::before { background: #A9CDE0; }
.power-peach::before { background: #E9B795; }
.power-sage::before { background: #A8C29E; }
.power p { color: var(--ink-soft); }
.evidence { font-size: .95rem; margin: 14px 0 0; color: var(--ink) !important; }
.evidence a { font-weight: 600; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  font-family: var(--font-mono);
  font-size: .78rem;
  padding: 4px 9px;
  border-radius: 3px;
  background: var(--cream);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}



/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.project {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-block);
}
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.project-head h3 { margin-bottom: 4px; }
.project-meta { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft); margin: 0; }
.status {
  flex: none;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.status-progress { color: var(--lavender-deep); background: var(--lavender); }
.status-done { color: var(--sage-deep); background: var(--sage); }

.project-body { margin: 0 0 18px; display: grid; gap: 14px; }
.project-body dt {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.project-body dd { margin: 0; }
.project-body dd ul:not(.chips) { margin: 0; padding-left: 1.1em; }
.project-body dd ul:not(.chips) li + li { margin-top: 6px; }
.project-links { margin: auto 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding-top: 8px; }

.stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.stat-num { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--peach-deep); }
.stat-label { font-weight: 600; }
.fine { font-size: .9rem; color: var(--ink-soft); margin: 0; }

@media (max-width: 860px) {
  .projects { grid-template-columns: 1fr; }
}

/* ---------- Project book ---------- */
/* A hardcover book: closed it shows only the cover (centered); open it is a
   two-page spread. Each leaf turns around the spine in 3D. */
.pb {
  --pb-cover: #A8C29E;
  --pb-cover-dark: #8FAF86;
  --pb-inset: 10px;           /* how far the paper sits inside the boards */
  --pb-turn: .9s;
  --pb-ease: cubic-bezier(.645, .045, .355, 1);
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.pb-viewport { width: 100%; max-width: 900px; padding: 0 0 14px; }
.pb-book {
  position: relative;
  width: 100%;
  height: 480px;
  perspective: 2400px;
  perspective-origin: 50% 40%;
  transition: transform var(--pb-turn) var(--pb-ease);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.pb-book:focus-visible .pb-board,
.pb-book:focus-visible[data-open="false"] .pb-cover { outline: 3px solid var(--blue-deep); outline-offset: 6px; }
@media (min-width: 641px) {
  /* closed: slide the book so the cover sits in the middle */
  .pb-book[data-open="false"] { transform: translateX(-25%); }
}

/* Back cover board, under the right-hand pages */
.pb-board,
.pb-thick {
  position: absolute;
  top: 0; bottom: 0; left: 50%; right: 0;
  border: 2.5px solid var(--ink);
  border-radius: 3px 12px 12px 3px;
}
.pb-board {
  background: var(--pb-cover);
  box-shadow: 8px 8px 0 rgba(40, 53, 47, .13);
}
/* Page block peeking out from under a closed cover */
.pb-thick {
  top: 5px; bottom: -7px; right: -7px; left: calc(50% + 4px);
  background:
    repeating-linear-gradient(0deg, var(--paper) 0 2px, var(--line-strong) 2px 3px);
  box-shadow: 6px 6px 0 rgba(40, 53, 47, .13);
  transition: opacity .3s ease;
}
.pb-book[data-open="true"] .pb-thick { opacity: 0; transition-delay: 0s; }
.pb-book[data-open="false"] .pb-thick { opacity: 1; transition-delay: calc(var(--pb-turn) * .6); }
.pb-book[data-open="false"] .pb-board { box-shadow: none; }

/* Leaves: hinged on the spine (the middle of the book) */
.pb-leaf,
.pb-base {
  position: absolute;
  top: var(--pb-inset); bottom: var(--pb-inset);
  left: 50%;
  width: calc(50% - var(--pb-inset));
}
.pb-leaf {
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform var(--pb-turn) var(--pb-ease);
}
.pb-leaf.is-flipped { transform: rotateY(-180deg); }
.pb-leaf-cover { top: 0; bottom: 0; width: 50%; }
.pb-book.is-instant .pb-leaf,
.pb-book.is-instant { transition: none; }

.pb-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.pb-back { transform: rotateY(180deg); }

/* Shading that sweeps across a page while it turns */
.pb-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.pb-front::after { background: linear-gradient(90deg, rgba(40, 53, 47, .05), rgba(40, 53, 47, .28)); }
.pb-back::after  { background: linear-gradient(270deg, rgba(40, 53, 47, .05), rgba(40, 53, 47, .28)); }
.pb-leaf.is-turning .pb-face::after { animation: pb-shade var(--pb-turn) var(--pb-ease); }
@keyframes pb-shade {
  0%   { opacity: 0; }
  50%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Paper pages, with a soft shadow in the gutter by the spine */
.pb-paper {
  background-color: var(--paper);
  border: 1.5px solid var(--ink);
}
.pb-paper-right {
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background-image:
    linear-gradient(90deg, rgba(40, 53, 47, .16), rgba(40, 53, 47, .04) 22px, transparent 48px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(43, 86, 110, .07) 31px 32px);
}
.pb-paper-left {
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background-image:
    linear-gradient(270deg, rgba(40, 53, 47, .16), rgba(40, 53, 47, .04) 22px, transparent 48px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(43, 86, 110, .07) 31px 32px);
}
/* the last page shows the edges of the pages stacked under it */
.pb-base { box-shadow: 1.5px 1.5px 0 var(--paper), 3px 3px 0 var(--line-strong), 4.5px 4.5px 0 var(--paper), 6px 6px 0 var(--line-strong); z-index: 0; }

.pb-content {
  height: 100%;
  box-sizing: border-box;
  padding: 26px 26px 20px 30px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
}
.pb-paper-left .pb-content { padding: 26px 30px 20px 26px; }

/* Front cover */
.pb-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 28px 24px 28px 40px;
  box-sizing: border-box;
  border: 2.5px solid var(--ink);
  border-radius: 3px 12px 12px 3px;
  background:
    /* hinge groove near the spine */
    linear-gradient(90deg, rgba(40, 53, 47, .16) 0 14px, rgba(255, 255, 255, .35) 14px 16px, rgba(40, 53, 47, .14) 16px 18px, transparent 18px),
    /* cloth texture */
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .06) 0 2px, transparent 2px 4px),
    var(--pb-cover);
}
.pb-cover-plate {
  min-width: 62%;
  padding: 18px 22px 16px;
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 rgba(40, 53, 47, .14);
}
.pb-cover-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}
.pb-cover-rule {
  display: block;
  width: 70%;
  height: 0;
  margin: 10px auto 9px;
  border-top: 2px solid var(--ink);
}
.pb-cover-year {
  margin: 0;
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.pb-cover-art { width: 46%; max-width: 150px; height: auto; }
/* a hint of the cover lifting when you point at the closed book */
@media (hover: hover) {
  .pb-book[data-open="false"]:hover .pb-leaf-cover:not(.is-turning) { transform: rotateY(-14deg); }
}

/* Inside of the front cover: board edge with an endpaper holding the contents */
.pb-inside {
  border: 2.5px solid var(--ink);
  border-radius: 12px 3px 3px 12px;
  background: var(--pb-cover-dark);
}
.pb-endpaper {
  position: absolute;
  top: calc(var(--pb-inset) - 2.5px); bottom: calc(var(--pb-inset) - 2.5px);
  left: calc(var(--pb-inset) - 2.5px); right: -2.5px;
  background-color: var(--paper);
  border: 1.5px solid var(--ink);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  background-image: linear-gradient(270deg, rgba(40, 53, 47, .16), rgba(40, 53, 47, .04) 22px, transparent 48px);
  box-shadow: -1.5px 1.5px 0 var(--paper), -3px 3px 0 var(--line-strong), -4.5px 4.5px 0 var(--paper), -6px 6px 0 var(--line-strong);
}
.pb-endpaper .pb-content { padding: 26px 30px 20px 26px; }
.pb-toc { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.pb-toc-link {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 4px;
  font: inherit;
  font-size: .95rem;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.pb-toc-link:hover, .pb-toc-link:focus-visible { background: var(--sage); }
.pb-toc-title { font-family: var(--font-serif); font-weight: 600; }
.pb-toc-dots { flex: 1; min-width: 12px; border-bottom: 2px dotted var(--line-strong); transform: translateY(-4px); }
.pb-toc-num { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-soft); }

/* End page */
.pb-end { justify-content: center; align-items: center; text-align: center; gap: 10px; }
.pb-end-title { margin: 0; font-family: var(--font-serif); font-size: 1.4rem; font-weight: 700; }
.pb-end-text { margin: 0 0 6px; max-width: 26ch; color: var(--ink-soft); }

/* Project page content */
.pb-page-num {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.book-project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.book-project-head h3 { margin: 0; font-size: 1.1rem; }
.book-meta {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.book-dl { margin: 0 0 10px; display: grid; gap: 8px; }
.book-dl dt {
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
  margin-bottom: 1px;
}
.book-dl dd { margin: 0; font-size: .88rem; line-height: 1.45; }
.book-dl dd p { margin: 0; }
.book-links {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}

.book-controls { display: flex; align-items: center; gap: 12px; }
.book-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font: inherit; font-size: 1.1rem; font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-block);
  cursor: pointer;
  touch-action: manipulation;
}
.book-btn:hover { background: var(--sage); }
.book-btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 rgba(40,53,47,.10); }
.book-btn:disabled { opacity: .4; cursor: default; }
.book-btn:disabled:hover { background: var(--paper); }
.book-indicator {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink-soft);
  min-width: 13em;
  text-align: center;
}

/* Phones: the book is two screens wide and shows one page at a time */
@media (max-width: 640px) {
  .pb { --pb-inset: 8px; }
  .pb-viewport { overflow: hidden; padding: 4px 10px 16px 0; margin-right: -10px; }
  .pb-book { width: 200%; height: 540px; perspective: 1600px; transition: transform var(--pb-turn) var(--pb-ease), perspective-origin var(--pb-turn) var(--pb-ease); }
  .pb-book[data-side="right"] { transform: translateX(-50%); perspective-origin: 75% 40%; }
  .pb-book[data-side="left"]  { transform: none; perspective-origin: 25% 40%; }
  .pb-content, .pb-paper-left .pb-content, .pb-endpaper .pb-content { padding: 22px 20px 18px; }
  .pb-cover { padding-left: 34px; }
  .book-indicator { min-width: 9em; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-book, .pb-leaf { transition: none; }
  .pb-leaf.is-turning .pb-face::after { animation: none; }
}


/* ---------- Debug Playground cards (playground hub) ---------- */
.pg-cards {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.pg-card {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-block);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pg-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(40, 53, 47, .14); }
.pg-card:focus-within { outline: 3px solid var(--blue-deep); outline-offset: 3px; }
.pg-card img { width: 100%; height: auto; border-bottom: 1.5px solid var(--ink); }
.pg-card-body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.pg-card h2, .pg-card h3 { font-size: 1.2rem; margin: 0; }
.pg-card h2 a, .pg-card h3 a { color: var(--ink); text-decoration: none; }
/* The title link covers the whole card, so the card is one big target. */
.pg-card h2 a::after, .pg-card h3 a::after { content: ""; position: absolute; inset: 0; }
.pg-card h2 a:focus-visible, .pg-card h3 a:focus-visible { outline: none; }
.pg-card p { margin: 0; color: var(--ink-soft); }
.pg-card .scenario-num { margin: 0; }
.pg-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px !important; }
.pg-card-cta { font-weight: 600; color: var(--sage-deep); }
.new-window { color: var(--sage-deep); font-family: var(--font-sans); font-size: .9em; }
.status-badge {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--cream);
}
.status-badge.is-fixed { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }
@media (max-width: 860px) {
  .pg-cards { grid-template-columns: 1fr; max-width: 520px; }
}

/* ---------- Debug Playground: its own pages ---------- */
.pg-page {
  background:
    radial-gradient(circle at 1px 1px, rgba(40, 53, 47, .09) 1px, transparent 1.5px) 0 0 / 22px 22px,
    #FBF4EA;
}
.pg-page .site-header { background: rgba(255, 249, 241, .95); }
.pg-subnav {
  background: var(--cream);
  border-bottom: 1.5px solid var(--ink);
}
.pg-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.pg-home {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  padding: 10px 0;
}
.pg-home[aria-current="page"] { text-decoration: none; }
.pg-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pg-steps a {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
}
.pg-steps a:hover { background: var(--sage); }
.pg-steps a[aria-current="page"] { border-color: var(--ink); background: var(--lavender); }
.pg-count { margin: 0; font-family: var(--font-serif); font-weight: 700; }
.chip-box {
  width: 16px; height: 16px; flex: none;
  border: 2px solid var(--ink);
  background: var(--cream);
  position: relative;
}
.is-fixed .chip-box { background: var(--sage-deep); border-color: var(--sage-deep); }
.is-fixed .chip-box::after {
  content: "";
  position: absolute; left: 3px; top: -1px;
  width: 5px; height: 9px;
  border: solid var(--cream);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
@media (max-width: 640px) {
  .pg-count { display: none; }
  .pg-steps { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .pg-steps a { justify-content: center; gap: 6px; padding: 4px 4px; font-size: .8rem; white-space: nowrap; }
  .pg-steps .chip-box { width: 14px; height: 14px; }
}

.pg-main { padding: clamp(28px, 5vw, 56px) 0 clamp(48px, 7vw, 80px); overflow-x: clip; }
.pg-hub-head { max-width: 46em; margin-bottom: 8px; }
.pg-hub-foot { margin-top: 32px; color: var(--ink-soft); }
.pg-footer { margin-top: 56px; }

.disclaimer {
  background: var(--blue);
  border-left: 6px solid var(--blue-deep);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .95rem;
  max-width: 46em;
}

.pg-error {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1.5px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.pg-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.pg-pager a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-block);
}
.pg-pager a:hover { background: var(--sage); }

/* ---------- Scenario layout ---------- */
.scenario {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 6px 6px 0 rgba(40, 53, 47, .10);
  padding: clamp(20px, 3.5vw, 36px);
  position: relative;
}
.scenario::before { /* little block cluster */
  content: "";
  position: absolute; top: -1.5px; right: 28px;
  width: 36px; height: 10px;
  background: linear-gradient(90deg, #A8C29E 0 12px, #C3B2DC 12px 24px, #E9B795 24px 36px);
  border: 1.5px solid var(--ink);
  border-top: 0;
}
.scenario-num { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft); margin-bottom: 6px; }
.scenario-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); margin-bottom: .35em; }
.scenario-problem { max-width: 46em; color: var(--ink-soft); font-size: 1.08rem; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* ---------- Debug quiz: picture | code + multiple choice ---------- */
/* Everything marked .quiz-bug shows before the fix, .quiz-fix after it. */
[data-scenario]:not(.is-fixed) .quiz-fix,
[data-scenario].is-fixed .quiz-bug { display: none !important; }
[data-scenario].is-fixed .quiz-fix { animation: quiz-pop .45s ease; }
@keyframes quiz-pop { from { opacity: 0; } }

.quiz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 20px clamp(20px, 3vw, 36px);
  margin-top: 20px;
  align-items: start;
}
.quiz-scene { display: grid; gap: 12px; min-width: 0; }
.quiz-panel { display: grid; gap: 16px; min-width: 0; }
.quiz-panel > .btn-ghost { justify-self: start; }
.quiz-panel > [hidden] { display: none; }

/* the pseudocode card */
.code-card {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: #22302A;
}
.code-card-head {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: #C9D6CC;
  background: #28352F;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
[data-scenario]:not(.is-fixed) [data-code-title] { color: #F2B79A; }
[data-scenario].is-fixed [data-code-title] { color: #A8DDA0; }
.code {
  margin: 0;
  padding: 10px 0 12px;
  font-family: var(--font-mono);
  font-size: .84rem;
  line-height: 1.6;
  color: #E7EFE6;
  background: none;
  overflow-x: auto;
  counter-reset: ln;
}
.code code { display: block; padding: 0; margin: 0; font: inherit; color: inherit; background: none; border: 0; border-radius: 0; }
.code .ln {
  display: block;
  min-height: 1.6em;
  padding: 0 14px 0 3.2em;
  position: relative;
  white-space: pre;
}
.code .ln::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute;
  left: 0; width: 2.2em;
  text-align: right;
  color: #6F8277;
}
.code .cmt { color: #8FA597; }
.code .ln.is-bug { background: rgba(232, 120, 90, .22); box-shadow: inset 3px 0 0 #E8785A; }
.code .ln.is-bug::after {
  content: "← bug";
  margin-left: 10px;
  font-size: .78em;
  color: #F2B79A;
}
.code .ln.is-new { background: rgba(127, 199, 122, .2); box-shadow: inset 3px 0 0 #7FC77A; }
.code .ln.is-new::before { content: "+"; color: #A8DDA0; }

/* the multiple choice */
.quiz legend { font-family: var(--font-serif); font-size: 1.2rem; margin-bottom: 10px; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: .97rem;
  line-height: 1.35;
  text-align: left;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  counter-increment: opt;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
  touch-action: manipulation;
}
.quiz-options { counter-reset: opt; }
.quiz-option::before {
  content: counter(opt, upper-alpha);
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .85rem;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--cream);
}
.quiz-option:hover:not(:disabled) { border-color: var(--ink); background: var(--sage); transform: translateX(2px); }
.quiz-option:disabled { cursor: default; }
.quiz-option.is-wrong { color: var(--warn); background: var(--warn-bg); border-color: rgba(138, 61, 31, .45); text-decoration: line-through; text-decoration-thickness: 1px; }
.quiz-option.is-wrong::before { content: "✗"; background: var(--warn-bg); border-color: var(--warn); }
.quiz-option.is-right { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); font-weight: 600; }
.quiz-option.is-right::before { content: "✓"; background: var(--ok); color: var(--paper); border-color: var(--ok); }
[data-scenario].is-fixed .quiz-option:disabled:not(.is-right):not(.is-wrong) { opacity: .5; }

.feedback {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-weight: 600;
}
.feedback:empty { display: none; }
.feedback.is-bug { background: var(--warn-bg); color: var(--warn); border-color: rgba(138, 61, 31, .35); }
.feedback.is-fixed { background: var(--ok-bg); color: var(--ok); border-color: rgba(47, 107, 58, .45); }
.feedback .fb-title { display: block; font-family: var(--font-serif); font-size: 1.1rem; }
.feedback .fb-detail { display: block; font-weight: 400; color: var(--ink); margin-top: 2px; }

.explain-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-strong);
}
.explain-section h2 { font-size: 1.4rem; }
.explain-section p { max-width: 50em; color: var(--ink-soft); }
.explain-section .disclaimer { color: var(--ink); }
.explain-section p:last-child { margin-bottom: 0; }

/* ---------- Scenes (the illustrated pictures) ---------- */
.scene-frame {
  margin: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--blue);
}
.scene { width: 100%; height: auto; display: block; }
.scene-caption { padding: 8px 14px; background: var(--paper); border-top: 1.5px solid var(--ink); font-size: .95rem; font-weight: 600; }
[data-scenario]:not(.is-fixed) .scene-caption { color: var(--warn); }
[data-scenario].is-fixed .scene-caption { color: var(--ok); }
.scene-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; fill: #4A5850; }
.scene-label-dark { fill: #28352F; font-weight: 700; }
.scene-tag { font-family: var(--font-mono); font-size: 11px; fill: #28352F; }
.scene-readout { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; fill: #DCECF4; }

/* Scanner scene */
.tape-chip rect { fill: #3B5E3D; }
.tape-chip text { font-family: var(--font-mono); font-size: 10px; font-weight: 700; fill: #FFF9F1; }
[data-scenario].is-fixed .tape-chip + .tape-chip rect { fill: #FFF9F1; stroke: #84442A; stroke-width: 1.5; stroke-dasharray: 3 2; }
[data-scenario].is-fixed .tape-chip + .tape-chip text { fill: #84442A; }
.shelf-slot { fill: #FFF9F1; stroke: #DCE8D6; stroke-width: 1.5; }
.shelf-item.is-dupe .shelf-slot { fill: #FBE7DA; stroke: #8A3D1F; stroke-dasharray: 3 2; stroke-width: 2; }

/* Journal scene */
.cloud-text { font-family: var(--font-mono); font-size: 13px; fill: #28352F; }
.page-heading { font-family: var(--font-serif); font-weight: 700; font-size: 15px; fill: #28352F; }
.page-entry { font-family: var(--font-serif); font-style: italic; font-size: 13px; fill: #28352F; }
.page-km { font-family: var(--font-mono); font-size: 10px; fill: #4A5850; }
.page-empty { font-family: var(--font-serif); font-style: italic; font-size: 13px; fill: #4A5850; }
.pipe { fill: none; stroke: #C9BFAF; stroke-width: 3; stroke-dasharray: 5 5; }
.pipe-head { fill: #C9BFAF; }
.pipe-label { font-family: var(--font-mono); font-size: 11px; fill: #84442A; }
[data-scenario].is-fixed .pipe { stroke: #3B5E3D; stroke-dasharray: none; }
[data-scenario].is-fixed .pipe-head { fill: #3B5E3D; }
[data-scenario].is-fixed .pipe-label { fill: #3B5E3D; font-weight: 700; }
.chest-count { font-family: var(--font-mono); font-size: 13px; font-weight: 700; fill: #28352F; }
.note-text { font-family: var(--font-mono); font-size: 12px; font-weight: 700; fill: #28352F; }
.note-kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; fill: #4A5850; }

/* Robot scene */
.table-scene { background: var(--blue); }
.robot-scene { max-width: 520px; margin: 0 auto; overflow: visible; }
.seat-label { font-family: var(--font-mono); font-size: 14px; fill: var(--ink); }
[data-scenario="robot"]:not(.is-fixed) [data-seat="0"] > circle:first-child,
[data-scenario="robot"].is-fixed [data-seat="2"] > circle:first-child { stroke-width: 4; stroke: var(--sage-deep); }
.robot-head { transition: transform .4s ease; transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(-12deg); }
.robot-eyes { transition: transform .4s ease; transform: translateX(-6px); }
[data-scenario].is-fixed .robot-head { transform: rotate(12deg); }
[data-scenario].is-fixed .robot-eyes { transform: translateX(6px); }
.speech {
  position: relative;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 0 14px 14px;
  font-size: .98rem;
}
.speech::before { /* bubble tail pointing up at the robot */
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  width: 14px; height: 14px;
  background: var(--paper);
  border-left: 1.5px solid var(--ink);
  border-top: 1.5px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.turn-bars-title { margin: 4px 0 0; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.turn-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.turn-bars li { display: grid; grid-template-columns: 8.5em 1fr 2.5em; gap: 10px; align-items: center; font-size: .92rem; }
.turn-bars .bar { height: 14px; background: var(--cream); border: 1.5px solid var(--ink); border-radius: 2px; overflow: hidden; }
.turn-bars .bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #A8C29E 0 10px, #95B48A 10px 12px); }
.turn-bars .num { font-family: var(--font-mono); text-align: right; }

@media (max-width: 900px) {
  .quiz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .turn-bars li { grid-template-columns: 7em 1fr 2em; }
  .scenario { padding: 18px 14px; }
  .code { font-size: .78rem; }
  /* Let the pictures use the full phone width so their labels stay readable. */
  .quiz-scene .scene-frame {
    margin-left: calc(-15px - var(--gutter));
    margin-right: calc(-15px - var(--gutter));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

/* ---------- Experience ---------- */
.timeline { position: relative; list-style: none; padding: 0 0 0 48px; margin: 32px 0 0; display: grid; gap: 36px; }
.timeline::before { /* the line down the left */
  content: "";
  position: absolute;
  left: 14px; top: 10px; bottom: 10px;
  width: 3px;
  background: var(--line-strong);
  border-radius: 2px;
}
.role { position: relative; display: grid; grid-template-columns: 11em 1fr; gap: 24px; align-items: start; }
.role::before { /* the marker on the line */
  content: "";
  position: absolute;
  left: -42px; top: 22px;
  width: 16px; height: 16px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 3px;
}
/* With JS: one entry in focus (nearest the middle of the screen), the rest greyed out.
   Hovering or focusing a greyed entry brings it back. */
.timeline.is-enhanced .role { opacity: .45; filter: grayscale(1); transition: opacity .35s ease, filter .35s ease, transform .35s ease; }
.timeline.is-enhanced .role.is-active,
.timeline.is-enhanced .role:hover,
.timeline.is-enhanced .role:focus-within { opacity: 1; filter: none; }
.timeline.is-enhanced .role.is-active { transform: translateX(4px); }
.timeline.is-enhanced .role.is-active::before { background: var(--sage-deep); box-shadow: 0 0 0 5px rgba(59, 94, 61, .18); }
.role-when {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--ink-soft);
  padding-top: 26px;
  position: relative;
}
.role-card {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-block);
}
.role-card h3 { margin-bottom: 2px; }
.role-org { color: var(--ink-soft); margin-bottom: 10px; }
.role-card ul { margin: 0; }
.role-card li + li { margin-top: 6px; }
@media (max-width: 700px) {
  .role { grid-template-columns: 1fr; gap: 6px; }
  .role-when { padding-top: 0; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contact-item, .contact-resume {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  min-height: 56px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-block);
}
a.contact-item:hover { background: var(--sage); color: var(--ink); }
.contact-kind { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.contact-value { font-weight: 600; overflow-wrap: anywhere; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .contact-item, .contact-resume { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 36px 0 36px;
  position: relative;
  margin-top: 72px;
}
.mountains {
  position: absolute;
  left: 0; right: 0; top: -55px;
  height: 56px;
  background: url("assets/mountains.svg") bottom left / 480px 56px repeat-x;
}
.footer-links { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--cream); font-weight: 600; display: inline-block; padding: 8px 0; }
.footer-links a:hover { color: var(--peach); }
.site-footer :focus-visible { outline-color: var(--peach); }
.footer-note { font-size: .9rem; color: #D8DED8; margin: 0 0 6px; max-width: 46em; }

/* ---------- Tech Superpowers carousel ---------- */
.carousel { margin-top: 24px; }
.carousel-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.carousel-hint { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.carousel-controls { display: flex; gap: 8px; }
html:not(.js) .carousel-controls { display: none; }
.carousel-btn {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font: inherit; font-size: 1.2rem; font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-block);
  cursor: pointer;
  touch-action: manipulation;
}
.carousel-btn:hover { background: var(--sage); }
.carousel-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 rgba(40, 53, 47, .10); }
.carousel-toggle { font-size: .85rem; letter-spacing: -.05em; }
.carousel-hint kbd {
  font-family: var(--font-mono);
  font-size: .85em;
  padding: 1px 6px;
  border: 1.5px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 4px;
  background: var(--paper);
}
.carousel-track {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 14px -6px 0;
  padding: 6px 6px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
/* With JS the strip loops and has its own progress bar, so hide the scrollbar. */
.is-looping .carousel-track { scrollbar-width: none; }
.is-looping .carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline-offset: 2px; }
.carousel-track > li {
  flex: 0 0 clamp(260px, 31%, 340px);
  display: flex;
  flex-direction: column;
}
.carousel-track > li .chips { margin-top: auto; padding-top: 4px; }
.carousel-track > li .evidence { margin-top: 14px; }
.power-tool { background: rgba(255, 253, 249, .85); border-style: dashed; }
.carousel-progress { height: 4px; background: rgba(40, 53, 47, .10); border-radius: 2px; overflow: hidden; }
html:not(.js) .carousel-progress { display: none; }
.carousel-progress i { display: block; height: 100%; width: 30%; background: var(--sage-deep); border-radius: 2px; }
@media (max-width: 600px) {
  .carousel-track > li { flex-basis: 84%; }
  .carousel-hint { font-size: .88rem; }
}

/* ---------- Hero: debug "!" block on the desk, beside the breadboard ---------- */
.debug-bang {
  position: absolute;
  left: calc(100% - 30px);
  bottom: calc(100% - 16px);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: #F5D9C6;
  color: var(--warn);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(40, 53, 47, .22);
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  z-index: 2;
}
.debug-bang > span:first-child { display: inline-block; animation: bang-shake 3s ease-in-out infinite; }
.debug-bang::before { content: ""; position: absolute; inset: -8px; } /* bigger touch target */
.debug-bang::after { /* soft pulsing ring */
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(138, 61, 31, .35);
  border-radius: 9px;
  animation: bang-ring 3s ease-out infinite;
  pointer-events: none;
}
.debug-bang:hover, .debug-bang:focus-visible { background: var(--ink); color: var(--peach); }
@keyframes bang-ring { 0% { opacity: .9; transform: scale(.9); } 60%, 100% { opacity: 0; transform: scale(1.35); } }

.debug-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 40px);
  width: 260px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: .98rem;
  line-height: 1.35;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
  z-index: 3;
}
.debug-tip::after { /* tail pointing down at the "!" */
  content: "";
  position: absolute;
  left: calc(132px * var(--k) - 30px + 21px - 7px);
  bottom: -7px;
  width: 14px; height: 14px;
  background: var(--ink);
  transform: rotate(45deg);
}
.debug-bang:hover + .debug-tip,
.debug-bang:focus-visible + .debug-tip,
.debug-tip:hover {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s;
}
.debug-tip.is-dismissed { opacity: 0 !important; visibility: hidden !important; }

/* ---------- Hero: the bug crawling on the desk ---------- */
.desk-bug {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1; /* above the illustration, below the "!" and its tooltip */
  width: clamp(18px, 4.8%, 27px);
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(1px 1px 0 rgba(40, 53, 47, .18));
}
.desk-bug svg { display: block; width: 100%; height: auto; }
.desk-bug .legs-l, .desk-bug .legs-r, .desk-bug .antennae { transform-box: fill-box; }
.desk-bug .legs-l { transform-origin: right center; }
.desk-bug .legs-r { transform-origin: left center; }
.desk-bug .antennae { transform-origin: center bottom; animation: antennae 1.6s ease-in-out infinite; }
.desk-bug.is-walking .legs-l { animation: legs .22s ease-in-out infinite alternate; }
.desk-bug.is-walking .legs-r { animation: legs .22s ease-in-out infinite alternate-reverse; }
.desk-bug.is-fleeing .legs-l, .desk-bug.is-fleeing .legs-r { animation-duration: .09s; }
@keyframes legs { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes antennae { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }

/* ---------- Desk: magnifying-glass cursor, catching bugs, and the bug jar ---------- */
.desk, .desk * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ccircle cx='12' cy='12' r='8.5' fill='%23DCECF4' fill-opacity='.6' stroke='%2328352F' stroke-width='2.5'/%3E%3Cpath d='M8 9.5a4.5 4.5 0 0 1 4-3' fill='none' stroke='%23FFFDF9' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M18.6 18.6 28 28' stroke='%2328352F' stroke-width='4.2' stroke-linecap='round'/%3E%3C/svg%3E") 12 12, zoom-in;
}
.desk a, .desk button, .desk a * { cursor: pointer; }
.desk-bug.is-caught { opacity: 0; transform-origin: center; transition: opacity .2s ease; }
.catch-check {
  position: absolute;
  z-index: 3;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  display: grid; place-items: center;
  background: var(--ok);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(40, 53, 47, .2);
  pointer-events: none;
  animation: check-pop 1.15s ease forwards;
}
@keyframes check-pop {
  0% { transform: scale(.2); opacity: 0; }
  18% { transform: scale(1.15); opacity: 1; }
  30% { transform: scale(1); }
  75% { transform: translateY(-6px); opacity: 1; }
  100% { transform: translateY(-14px); opacity: 0; }
}
.item-jar { left: 73.5%; bottom: var(--edge); width: calc(80px * var(--k)); }
.jar-bugs { position: absolute; left: 14%; right: 14%; top: 34%; bottom: 7%; }
.jar-bug { position: absolute; width: 25%; }
.jar-bug svg { display: block; width: 100%; height: auto; }
.jar-bug.is-new { animation: jar-drop .55s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes jar-drop { from { transform: translateY(-160%); opacity: 0; } to { transform: none; opacity: 1; } }
.jar-label {
  position: absolute;
  left: 50%; top: 28%;
  translate: -50% 0;
  padding: 1px 6px;
  background: #FFFDF9;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: calc(.58rem * var(--k) + .06rem);
  white-space: nowrap;
  line-height: 1.3;
}
.jar-label b { font-size: 1.15em; color: var(--warn); }
/* Jar lid: a button. Hover/focus shows "release bugs"; clicking opens it and empties the jar. */
.jar-lid {
  position: absolute;
  left: 18.75%; width: 62.5%;
  top: 2.4%; height: 13.1%;
  padding: 0;
  background: #C3B2DC;
  border: 2.5px solid var(--ink);
  border-radius: 2px;
  transform-origin: 100% 100%;
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), background-color .15s ease;
  z-index: 2;
}
.jar-lid::before { content: ""; position: absolute; inset: -12px -8px -6px; } /* easier to hit */
.jar-lid:hover, .jar-lid:focus-visible { background: #B19DD0; }
.item-jar.is-open .jar-lid { transform: translate(20%, -80%) rotate(34deg); }
.jar-tip {
  position: absolute;
  left: 50%; bottom: calc(100% + 12px);
  translate: -50% 0;
  padding: 4px 9px;
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility 0s linear .15s;
  pointer-events: none;
  z-index: 3;
}
.jar-tip::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -5px;
  width: 10px; height: 10px;
  translate: -50% 0;
  rotate: 45deg;
  background: var(--ink);
}
.jar-lid:hover + .jar-tip, .jar-lid:focus-visible + .jar-tip { opacity: 1; visibility: visible; transition: opacity .15s ease, visibility 0s; }
.jar-tip.is-dismissed, .item-jar.is-open .jar-tip { opacity: 0 !important; visibility: hidden !important; }
.jar-bug.is-escaping { animation: jar-escape 1.1s ease-in-out forwards; z-index: 3; }
@keyframes jar-escape {
  /* 'translate' (not transform) so the move happens in page space, not along each bug's tilt */
  0%   { translate: 0 0; opacity: 1; }
  30%  { translate: var(--x1, 0px) calc(var(--y1, 0px) * .45); rotate: 0deg; opacity: 1; }  /* to the middle */
  58%  { translate: var(--x1, 0px) var(--y1, 0px); rotate: 0deg; opacity: 1; }              /* up to the opening */
  80%  { translate: var(--x1, 0px) calc(var(--y1, 0px) - 46px); rotate: 0deg; opacity: 1; } /* straight out the top */
  100% { translate: var(--x2, 0px) var(--y2, -60px); rotate: var(--spin, 90deg); opacity: 0; }
}
@media (max-width: 560px) {
  /* phone: the jar sits on the desk top, between the breadboard and the notebook */
  .item-jar { left: 33.5%; bottom: calc(var(--desk-h) * .38); width: 48px; }
}

/* ---------- Mr. Oli's QA pop-up ---------- */
.qa-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 10px 14px 14px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(40, 53, 47, .14), var(--shadow-soft);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}
.qa-toast[hidden] { display: none; }
.qa-toast.is-visible { opacity: 1; transform: none; }
.qa-toast.is-peek { bottom: 86px; }
.qa-avatar { flex: none; margin-top: 2px; }
.qa-body { display: grid; gap: 4px; justify-items: start; }
.qa-title { margin: 0; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.qa-text { margin: 0 0 6px; font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.qa-text [data-qa-count] { color: var(--warn); }
.qa-close {
  width: 44px; height: 44px;
  margin: -8px -2px 0 0;
  display: grid; place-items: center;
  font: inherit; font-size: 1.5rem; line-height: 1;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.qa-close:hover { background: rgba(40, 53, 47, .07); }
@media (max-width: 480px) {
  .qa-toast { right: 12px; left: 12px; bottom: 12px; width: auto; gap: 10px; padding: 10px 6px 10px 10px; align-items: center; }
  .qa-avatar { width: 40px; height: 38px; margin: 0; }
  .qa-title { font-size: .7rem; }
  .qa-text { font-size: .95rem; margin: 0; }
  .qa-body { gap: 2px; }
  .qa-text { margin-bottom: 4px; }
  .qa-body .btn { padding: 6px 12px; font-size: .9rem; }
}

/* Minimized QA report: a "!" square in the corner that shakes every 3 s */
.qa-bang {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #F5D9C6;
  color: var(--warn);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(40, 53, 47, .2);
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s ease, transform .2s ease;
}
.qa-bang[hidden] { display: none; }
.qa-bang.is-visible { opacity: 1; transform: none; }
.qa-bang.is-visible > span:first-child { animation: bang-shake 3s ease-in-out infinite; display: inline-block; }
.qa-bang:hover, .qa-bang:focus-visible { background: var(--ink); color: var(--peach); }
.qa-bang.is-calm { color: var(--ok); }
.qa-bang::after { /* soft ring, like the one in the hero */
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid rgba(138, 61, 31, .35);
  border-radius: 11px;
  animation: bang-ring 3s ease-out infinite;
  pointer-events: none;
}
.qa-bang.is-calm::after { display: none; }
@keyframes bang-shake {
  0%, 82%, 100% { transform: rotate(0); }
  85% { transform: rotate(-14deg); }
  88% { transform: rotate(12deg); }
  91% { transform: rotate(-9deg); }
  94% { transform: rotate(6deg); }
  97% { transform: rotate(-3deg); }
}
@media (max-width: 480px) {
  .qa-bang { right: 12px; bottom: 12px; width: 48px; height: 48px; }
  .qa-toast.is-peek { bottom: 72px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .btn:active { transform: none; }
  .pg-card:hover { transform: none; }
  .debug-bang, .debug-bang::after, .debug-bang > span { animation: none !important; }
  .qa-toast { transition: none; transform: none; }
  .qa-bang, .qa-bang::after, .qa-bang > span { animation: none !important; transition: none; }
  .flip-inner { transition: none; }
  .timeline.is-enhanced .role { transition: none; transform: none; }
  .desk-bug *, .desk-bug { animation: none !important; }
  .term-cursor { animation: none; }
  .catch-check, .jar-bug.is-new, .jar-bug.is-escaping { animation: none; }
  .jar-lid { transition: none; }
  .page-fade { transition: none; }
  .is-entering { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .mountains, .skip-link, .desk, .room-window, .shelf { display: none !important; }
  body { background: #fff; }
  .project, .power, .role-card { box-shadow: none; break-inside: avoid; }
}
