/* ============================================================
   Rachael Chan — scrapbook portfolio
   Palettes transcribed from the light + dark mockups.
   ============================================================ */

/* ---------- dark (default) ---------- */
:root {
  --paper: #171c22;
  --dot: rgba(255, 255, 255, .055);
  --vignette: inset 0 0 240px rgba(0, 0, 0, .3);

  --ink: #e6dfd1;
  --ink-soft: #c5c1b5;
  --ink-quiet: #b4afa3;
  --ink-body: #e2dbcb;
  --mono-mute: #a09b8e;

  --accent: #9fbcd8;
  --accent-rule: #4e6580;
  --accent-hover: #c3d8ec;

  --card: #232b33;
  --card-alt: #1f262e;
  --line: #38424d;
  --line-2: #45505c;
  --rule: #38424d;

  --chip-bg: #2c343d;
  --chip-fg: #cbc3b2;
  --solid-bg: #e6dfd1;
  --solid-fg: #171c22;

  --label-bg: #3b4650;
  --label-border: #4e5a66;
  --label-rule: #93b0cd;
  --label-fg: #f0ebdf;
  --label-dash-bg: #3b4650;
  --label-dash-border: #5c6874;
  --label-dash-fg: #ece6da;
  --label-shadow: 2px 3px 0 rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .4);

  --highlight: rgba(78, 116, 150, .55);
  --sticker: #171c22;
  --sticker-drop: rgba(0, 0, 0, .5);

  --shadow-xs: 0 1px 3px rgba(0, 0, 0, .45);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 3px 9px rgba(0, 0, 0, .45);
  --shadow-frame: 0 3px 10px rgba(0, 0, 0, .5);
  --shadow-lift: 0 6px 16px rgba(0, 0, 0, .5);
  --shadow-lift-lg: 0 9px 22px rgba(0, 0, 0, .55);

  --hatch-a: #2b333c;
  --hatch-b: #323b45;
  --grid-bg: #212932;
  --grid-line: #333d47;

  --hole: #161c22;
  --hole-ring: #414c57;
  --mount: #1b222a;
  --mount-line: #3b4650;
  --mount-shadow:
    0 1px 2px rgba(0, 0, 0, .45),
    0 6px 12px -3px rgba(0, 0, 0, .44),
    0 16px 26px -10px rgba(0, 0, 0, .48);
  --frame-lift:
    0 1px 2px rgba(0, 0, 0, .4),
    0 5px 10px -3px rgba(0, 0, 0, .38),
    0 13px 20px -10px rgba(0, 0, 0, .4);
  --stamp: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20fill%3D%22%239fbcd8%22%20opacity%3D%22.82%22%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(0%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(45%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(90%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(135%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(180%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(225%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(270%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(315%2020%2020)%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%222.8%22%2F%3E%3C%2Fg%3E%3Cg%20opacity%3D%22.55%22%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%239fbcd8%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(0%200)%20rotate(0)%22%2F%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%239fbcd8%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(40%200)%20rotate(90)%22%2F%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%239fbcd8%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(40%2040)%20rotate(180)%22%2F%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%239fbcd8%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(0%2040)%20rotate(270)%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%239fbcd8%22%20opacity%3D%22.45%22%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%221.5%22%20r%3D%221.1%22%2F%3E%3Ccircle%20cx%3D%221.5%22%20cy%3D%2220%22%20r%3D%221.1%22%2F%3E%3Ccircle%20cx%3D%2238.5%22%20cy%3D%2220%22%20r%3D%221.1%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2238.5%22%20r%3D%221.1%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E');
  --scrim: rgba(6, 9, 12, .72);
  --well: inset 0 0 0 1px rgba(0, 0, 0, .3), inset 0 3px 12px rgba(0, 0, 0, .5), inset 0 -2px 8px rgba(0, 0, 0, .32);
  --well-sheen: linear-gradient(180deg, rgba(0, 0, 0, .18) 0, rgba(0, 0, 0, 0) 16%, rgba(0, 0, 0, 0) 84%, rgba(0, 0, 0, .12) 100%);
  --paper-veil: rgba(35, 43, 51, .78);
  --paper-line: rgba(255, 255, 255, .055);
  --margin-rule: rgba(190, 120, 110, .38);
  --frame: #232b33;
  --frame-line: #38424d;
  --dash: #454f5a;

  --tape-sheen: linear-gradient(180deg, rgba(255, 255, 255, .16) 0, rgba(255, 255, 255, 0) 26%, rgba(0, 0, 0, .18) 74%, rgba(0, 0, 0, .3) 100%);
  --plaid-base: #4a4335;
  --plaid-thread: rgba(255, 245, 225, .28);
  --plaid-accent: rgba(214, 112, 96, .42);
  --plaid-glint: rgba(255, 255, 255, .16);

  --avatar: linear-gradient(150deg, #5d6a76, #39434d);
  --logo-chs-bg: #1f3330;
  --logo-chs-line: #35504b;
  --logo-utfr-bg: #0e1317;
  --logo-yncn-bg: #332c1c;
  --logo-yncn-line: #514630;
}

/* ---------- light ---------- */
[data-theme="light"] {
  --paper: #f5f2ec;
  --dot: rgba(90, 70, 50, .075);
  --vignette: inset 0 0 200px rgba(125, 98, 60, .1);

  --ink: #2b2620;
  --ink-soft: #6f6559;
  --ink-quiet: #7d7266;
  --ink-body: #4a4038;
  --mono-mute: #9b9082;

  --accent: #3f6188;
  --accent-rule: #b6c3d4;
  --accent-hover: #28405e;

  --card: #fffdf8;
  --card-alt: #faf6ee;
  --line: #e4dbcb;
  --line-2: #d9cdb8;
  --rule: #ddd3c2;

  --chip-bg: #ece3d3;
  --chip-fg: #5c4b38;
  --solid-bg: #2b2620;
  --solid-fg: #f5f2ec;

  --label-bg: #fffdf8;
  --label-border: #ddd3c2;
  --label-rule: #8fa8c4;
  --label-fg: #2b2620;
  --label-dash-bg: #ece3d3;
  --label-dash-border: #c9bca4;
  --label-dash-fg: #5c4b38;
  --label-shadow: 2px 3px 0 rgba(70, 85, 110, .12), 0 4px 9px rgba(60, 50, 40, .14);

  --highlight: #dae8f4;
  --sticker: #fffdf8;
  --sticker-drop: rgba(70, 85, 110, .17);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 2px 5px rgba(60, 45, 30, .08);
  --shadow-frame: 0 2px 6px rgba(60, 45, 30, .1);
  --shadow-lift: 0 5px 12px rgba(60, 45, 30, .12);
  --shadow-lift-lg: 0 8px 18px rgba(60, 45, 30, .14);

  --hatch-a: #e4dccd;
  --hatch-b: #dcd3c2;
  --grid-bg: #fbf8f1;
  --grid-line: #e8e0d0;

  --hole: #e9e2d4;
  --hole-ring: #d6cbb8;
  --mount: #fbfaf6;
  --mount-line: #cdd6e0;
  --mount-shadow:
    0 1px 2px rgba(60, 45, 30, .13),
    0 5px 11px -3px rgba(60, 45, 30, .13),
    0 15px 24px -10px rgba(60, 45, 30, .15);
  --frame-lift:
    0 1px 2px rgba(60, 45, 30, .11),
    0 4px 9px -3px rgba(60, 45, 30, .11),
    0 12px 18px -10px rgba(60, 45, 30, .13);
  --stamp: url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cg%20fill%3D%22%233f6188%22%20opacity%3D%22.82%22%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(0%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(45%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(90%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(135%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(180%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(225%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(270%2020%2020)%22%2F%3E%3Cellipse%20cx%3D%2220%22%20cy%3D%2211.5%22%20rx%3D%222.4%22%20ry%3D%225%22%20transform%3D%22rotate(315%2020%2020)%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2220%22%20r%3D%222.8%22%2F%3E%3C%2Fg%3E%3Cg%20opacity%3D%22.55%22%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%233f6188%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(0%200)%20rotate(0)%22%2F%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%233f6188%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(40%200)%20rotate(90)%22%2F%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%233f6188%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(40%2040)%20rotate(180)%22%2F%3E%3Cpath%20d%3D%22M0%209%20A9%209%200%200%201%209%200%22%20fill%3D%22none%22%20stroke%3D%22%233f6188%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20transform%3D%22translate(0%2040)%20rotate(270)%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%233f6188%22%20opacity%3D%22.45%22%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%221.5%22%20r%3D%221.1%22%2F%3E%3Ccircle%20cx%3D%221.5%22%20cy%3D%2220%22%20r%3D%221.1%22%2F%3E%3Ccircle%20cx%3D%2238.5%22%20cy%3D%2220%22%20r%3D%221.1%22%2F%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2238.5%22%20r%3D%221.1%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E');
  --scrim: rgba(58, 48, 36, .5);
  --well: inset 0 0 0 1px rgba(60, 45, 30, .1), inset 0 3px 10px rgba(60, 45, 30, .2), inset 0 -2px 6px rgba(60, 45, 30, .1);
  --well-sheen: linear-gradient(180deg, rgba(60, 45, 30, .1) 0, rgba(60, 45, 30, 0) 15%, rgba(60, 45, 30, 0) 85%, rgba(60, 45, 30, .06) 100%);
  --paper-veil: rgba(255, 253, 248, .78);
  --paper-line: rgba(90, 110, 140, .13);
  --margin-rule: rgba(196, 108, 96, .45);
  --frame: #fffdf8;
  --frame-line: #e2d9c9;
  --dash: #ded3bd;

  --tape-sheen: linear-gradient(180deg, rgba(255, 255, 255, .32) 0, rgba(255, 255, 255, 0) 20%, rgba(0, 0, 0, .04) 70%, rgba(0, 0, 0, .1) 100%);
  --plaid-base: #e3d9c6;
  --plaid-thread: rgba(78, 68, 54, .36);
  --plaid-accent: rgba(160, 82, 70, .38);
  --plaid-glint: rgba(255, 255, 255, .3);

  --avatar: linear-gradient(150deg, #cfc4b1, #a9997f);
  --logo-chs-bg: #dfe9e6;
  --logo-chs-line: #c6d4d0;
  --logo-utfr-bg: #2b2620;
  --logo-yncn-bg: #f1e6cf;
  --logo-yncn-line: #ddcfb2;
}

/* ============================================================
   base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* nothing is ever allowed to scroll sideways — the sheet is exactly as
   wide as the window. `clip` rather than `hidden` so it doesn't turn the
   root into a scroll container (which would break sticky positioning). */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

/* the dotted paper runs the full width of the window; the content
   column stays 1000px so it still reads like the mockup */
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100%;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 10px 10px;
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

/* soft edge shading so the sheet has depth without boxing the content in */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  box-shadow: var(--vignette);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 0 44px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, video { max-width: 100%; }

/* ============================================================
   washi tape
   ============================================================ */
.tape {
  position: absolute;
  background-color: var(--tb);
  background-image:
    var(--tape-sheen),
    repeating-linear-gradient(0deg, var(--ts) 0 5px, transparent 5px 10px),
    repeating-linear-gradient(90deg, var(--ts) 0 5px, transparent 5px 10px);
  opacity: .9;
  pointer-events: none;
  z-index: 5;
  clip-path: polygon(0 0, 4px 12%, 0 25%, 4px 37%, 0 50%, 4px 62%, 0 75%, 4px 87%, 0 100%,
    100% 100%, calc(100% - 4px) 87%, 100% 75%, calc(100% - 4px) 62%, 100% 50%,
    calc(100% - 4px) 37%, 100% 25%, calc(100% - 4px) 12%, 100% 0);
  filter: drop-shadow(0 1.5px 1.5px rgba(62, 52, 38, .26));
}

.tape--blue   { --tb: rgba(69, 85, 102, .92);  --ts: rgba(184, 200, 217, .3); }
.tape--green  { --tb: rgba(76, 92, 78, .92);   --ts: rgba(191, 207, 193, .3); }
.tape--violet { --tb: rgba(88, 81, 101, .92);  --ts: rgba(203, 196, 216, .3); }
.tape--rose   { --tb: rgba(113, 84, 92, .92);  --ts: rgba(228, 198, 207, .3); }
.tape--sand   { --tb: rgba(112, 99, 73, .92);  --ts: rgba(227, 214, 187, .3); }

[data-theme="light"] .tape--blue   { --tb: rgba(255, 255, 255, .5); --ts: rgba(126, 155, 186, .34); }
[data-theme="light"] .tape--green  { --tb: rgba(255, 255, 255, .5); --ts: rgba(138, 168, 142, .34); }
[data-theme="light"] .tape--violet { --tb: rgba(255, 255, 255, .5); --ts: rgba(160, 148, 184, .34); }
[data-theme="light"] .tape--rose   { --tb: rgba(255, 255, 255, .5); --ts: rgba(206, 152, 168, .34); }
[data-theme="light"] .tape--sand   { --tb: rgba(255, 255, 255, .5); --ts: rgba(204, 180, 132, .36); }

/* gingham tape used on the polaroids */
.tape--plaid {
  background-color: var(--plaid-base);
  background-image:
    var(--tape-sheen),
    repeating-linear-gradient(0deg, var(--plaid-thread) 0 1.5px, transparent 1.5px 13px),
    repeating-linear-gradient(90deg, var(--plaid-thread) 0 1.5px, transparent 1.5px 13px),
    repeating-linear-gradient(0deg, var(--plaid-accent) 5px 6.5px, transparent 6.5px 13px),
    repeating-linear-gradient(90deg, var(--plaid-accent) 5px 6.5px, transparent 6.5px 13px),
    repeating-linear-gradient(0deg, var(--plaid-glint) 9px 11px, transparent 11px 13px);
}

/* ============================================================
   photo wells — every image sits in a shallow recess in the paper
   rather than flat on top of it
   ============================================================ */
.polaroid .shot,
.work-thumb,
.snap-img { position: relative; }

.polaroid .shot::after,
.work-thumb::after,
.snap-img::after,
.dd-figure::after {
  content: "";
  position: absolute;
  z-index: 1;
  pointer-events: none;
  box-shadow: var(--well);
  background: var(--well-sheen);
}
.polaroid .shot::after,
.work-thumb::after,
.snap-img::after { inset: 0; }

/* the diagram frames are padded, so the well hugs the image inside */
.dd-figure { position: relative; }
.dd-figure::after { inset: 10px 10px 12px; }

/* ============================================================
   header
   ============================================================ */
/* stays put as you scroll; no bar of its own, so the dotted paper just
   runs behind it — the chips carry their own backgrounds */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 56px 16px;
  background: transparent;
}

/* full-bleed blurred band, faded out at the bottom, so the header
   separates from whatever scrolls under it without becoming a solid bar */
.top::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 58%, transparent 100%);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transform: rotate(-.6deg);
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand .tape { top: -9px; left: 22px; width: 44px; height: 16px; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--avatar);
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand .name {
  font-family: Caveat, cursive;
  font-size: 19px;
  font-weight: 600;
}

.top-nav { display: flex; gap: 6px; align-items: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
  padding: 5px 9px;
  background: var(--chip-bg);
  border: 1px solid var(--line-2);
  color: var(--chip-fg);
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.chip:hover {
  color: var(--chip-fg);
  transform: rotate(0deg) translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.chip--solid {
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  color: var(--solid-fg);
}
.chip--solid:hover { color: var(--solid-fg); }

.ci { width: 12px; height: 12px; flex: none; display: block; }

.r1 { transform: rotate(.8deg); }
.r2 { transform: rotate(-.9deg); }
.r3 { transform: rotate(.5deg); }
.r4 { transform: rotate(-.4deg); }

/* the toggle is a .chip too, so it matches the others exactly; all it
   adds is the tilt and swapping which icon and word show */
.theme-toggle {
  margin-left: 2px;
  cursor: pointer;
  transform: rotate(1deg);
}
.theme-toggle:hover { transform: rotate(0deg) translateY(-1px); box-shadow: var(--shadow-xs); }
/* swap which icon and word show. The icons must stay display:block like
   every other .ci — flipping them to inline changes their layout box and
   made the toggle shorter than the chips beside it. */
.theme-toggle .ti-moon { display: none; }
.theme-toggle .tt-light { display: none; }
[data-theme="light"] .theme-toggle .ti-sun { display: none; }
[data-theme="light"] .theme-toggle .tt-dark { display: none; }
[data-theme="light"] .theme-toggle .ti-moon { display: block; }
[data-theme="light"] .theme-toggle .tt-light { display: inline; }

/* ============================================================
   intro
   ============================================================ */
.intro {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  padding: 28px 56px 0;
}
.intro-text { flex: 1; min-width: 0; }

.intro-hi {
  font-family: Caveat, cursive;
  font-size: 24px;
  color: var(--accent);
  transform: rotate(-1deg);
  margin-bottom: -4px;
}

.intro-name {
  font-family: Caveat, cursive;
  font-size: 84px;
  font-weight: 700;
  line-height: .92;
  margin: 0 0 16px;
  letter-spacing: -.01em;
  text-shadow:
    4px 0 0 var(--sticker), -4px 0 0 var(--sticker), 0 4px 0 var(--sticker), 0 -4px 0 var(--sticker),
    3px 3px 0 var(--sticker), -3px 3px 0 var(--sticker), 3px -3px 0 var(--sticker), -3px -3px 0 var(--sticker),
    5px 6px 0 var(--sticker-drop);
}
[data-theme="light"] .intro-name {
  text-shadow:
    4px 0 0 var(--sticker), -4px 0 0 var(--sticker), 0 4px 0 var(--sticker), 0 -4px 0 var(--sticker),
    3px 3px 0 var(--sticker), -3px 3px 0 var(--sticker), 3px -3px 0 var(--sticker), -3px -3px 0 var(--sticker),
    4px 5px 0 var(--sticker-drop);
}

.intro-desc {
  font-size: 21px;
  line-height: 1.5;
  margin: 0 0 14px;
  max-width: 30em;
  text-wrap: pretty;
}
.intro-desc strong {
  font-weight: inherit;
  padding: 0 2px;
  background: linear-gradient(transparent 12%, var(--highlight) 12%, var(--highlight) 88%, transparent 88%);
}

/* no width cap here: the rotating phrase varies a lot in length and the
   line should use the whole column rather than wrapping onto a second
   line for the longer ones */
.intro-line {
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-quiet);
  text-wrap: pretty;
}
/* if it ever has to wrap, break before the phrase, never inside it */
.rotator { white-space: nowrap; }
.rotator {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-rule);
  transition: opacity .35s ease, transform .35s ease;
  display: inline-block;
}
.rotator.out { opacity: 0; transform: translateY(-4px); }

/* the headshot, mounted on the same patterned stock as the footer note.
   The tile is scaled down so a full motif still reads in the narrower
   border band. */
.polaroid {
  position: relative;
  flex: none;
  width: 220px;
  margin: 0;
  padding: 15px;
  background-color: var(--mount);
  background-image: var(--stamp);
  background-size: 24px 24px;
  background-repeat: round;
  border: 1px solid var(--mount-line);
  box-shadow: 0 0 0 1px var(--mount) inset, var(--frame-lift);
  transform: rotate(1.6deg);
  transition: transform .25s ease;
}
.polaroid:hover { transform: rotate(0deg) translateY(-3px); }
.polaroid .tape { top: -13px; left: 50%; width: 84px; height: 24px; transform: translateX(-50%) rotate(-2deg); }
/* frame matches the photo's own ratio so none of it is cropped away,
   double-ruled in the accent colour like the footer note */
.polaroid .shot {
  display: block;
  aspect-ratio: var(--ar, 1 / 1);
  background: repeating-linear-gradient(45deg, var(--hatch-a) 0 6px, var(--hatch-b) 6px 12px);
  overflow: hidden;
  border: 1.5px solid var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--mount);
}
.polaroid .shot img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ============================================================
   section labels
   ============================================================ */
.block { padding: 56px 56px 0; }

.block-label {
  display: inline-block;
  font-family: Caveat, cursive;
  font-size: 26px;
  font-weight: 600;
  padding: 3px 17px 5px;
  margin-bottom: 18px;
  background: var(--label-bg);
  border: 1px solid var(--label-border);
  border-bottom: 2px solid var(--label-rule);
  color: var(--label-fg);
  box-shadow: var(--label-shadow);
  transform: rotate(-.8deg);
}
.block-label.dashed {
  background: var(--label-dash-bg);
  border: 1px dashed var(--label-dash-border);
  color: var(--label-dash-fg);
  transform: rotate(1deg);
}
.block-label.t2 { transform: rotate(-.2deg); }
.block-label.t3 { transform: rotate(.7deg); }
.block-label.t4 { transform: rotate(-.9deg); }

/* ============================================================
   experience
   ============================================================ */
.exp-row {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  padding: 56px 56px 0;
  align-items: start;
}
.exp-row .block { padding: 0; }
.exp-row .block-label { margin-bottom: 16px; }

.roles { display: flex; flex-direction: column; gap: 12px; }

.role {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 17px 18px 17px 32px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease;
}
.role:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.role::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--hole);
  border: 1px solid var(--hole-ring);
}

.roles--past .role { background: var(--card-alt); box-shadow: none; }
/* paperclip — just on the top card, as if it holds the little stack */
.roles--past .role:first-child::after {
  content: "";
  position: absolute;
  top: -9px;
  left: -6px;
  width: 13px;
  height: 30px;
  border: 1.5px solid #b9ae99;
  border-radius: 7px;
  border-bottom-color: transparent;
  transform: rotate(-8deg);
}

.role-logo {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
}
.role-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.role-logo.chs  { background: var(--logo-chs-bg);  border: 1px solid var(--logo-chs-line); }
.role-logo.utfr { background: var(--logo-utfr-bg); }
.role-logo.yncn { background: var(--logo-yncn-bg); border: 1px solid var(--logo-yncn-line); }

.role-body { flex: 1; min-width: 0; }
.role-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.role-title { font-size: 15.5px; font-weight: 600; }
.role-date {
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  color: var(--mono-mute);
  flex: none;
}
.role-at { display: block; font-size: 14px; color: var(--accent); margin-top: 3px; }
.role-note { font-size: 14px; color: var(--ink-soft); margin-top: 7px; }

/* ============================================================
   projects
   ============================================================ */
.works { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }

.work {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 12px 18px;
  box-shadow: var(--shadow-md);
  transition: transform .2s ease, box-shadow .2s ease;
}
.work:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift-lg); }

.work.tape-left > .tape { top: -12px; left: 26px; width: 76px; height: 22px; transform: rotate(-3deg); }
.work.tape-right > .tape { top: -12px; right: 26px; width: 76px; height: 22px; transform: rotate(2.5deg); }

/* the frame takes the clip's own aspect ratio (--ar) so the entire video
   frame is always visible — never cropped, never letterboxed */
.work-thumb {
  position: relative;
  display: block;
  aspect-ratio: var(--ar, 16 / 9);
  background: repeating-linear-gradient(45deg, var(--hatch-a) 0 6px, var(--hatch-b) 6px 12px);
  overflow: hidden;
}
.work-thumb video, .work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.thumb-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: .06em;
  padding: 3px 8px;
  background: var(--paper-veil);
  color: var(--mono-mute);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.work-thumb.failed .thumb-note { opacity: 1; }

.work-body { padding: 14px 6px 0; }
.work-title { font-size: 17px; font-weight: 600; }
.work-metric {
  font-family: Caveat, cursive;
  font-size: 17px;
  color: var(--accent);
  margin: 2px 0 6px;
}
.work-metric b { font-weight: 600; }
.work-sub { font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 14px; }

.work-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
}
.work-links a, .work-links button {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid var(--line-2);
  background: none;
  color: var(--chip-fg);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.work-links a:hover, .work-links button:hover {
  color: var(--chip-fg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.work-links a.primary {
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  color: var(--solid-fg);
}
.work-links a.primary:hover { color: var(--solid-fg); }
.work-links .nb-open-btn { border-color: var(--accent); color: var(--accent); }
.work-links .nb-open-btn:hover { color: var(--accent); }

/* ============================================================
   "Why?" — graph-paper index card
   ============================================================ */
.spec {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease, margin-top .3s ease;
  margin-top: 0;
}
.spec.open { grid-template-rows: 1fr; margin-top: 14px; }
.spec > .spec-inner { min-height: 0; overflow: hidden; }
/* plain paper, not graph paper: the ruling fought with the wrapped
   paragraphs in here. The dashed row dividers carry the structure. */
.spec-inner {
  background: var(--card-alt);
  border: 1px solid var(--line);
}
/* no hairline peeking through while collapsed */
.spec:not(.open) > .spec-inner { border-width: 0; }
.spec-cell {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 7px 13px;
  border-bottom: 1px dashed var(--line-2);
}
.spec-cell:last-child { border-bottom: none; }
.sh {
  font-family: Caveat, cursive;
  font-size: 16px;
  line-height: 1.3;
  color: var(--accent);
}
.spec-cell p { font-size: 13px; line-height: 1.45; color: var(--ink-soft); }

/* ============================================================
   case-study notebook — a ring-bound notebook that zooms open over
   the page. One transform, no reflow, so it stays smooth.
   ============================================================ */
.nb-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  /* minmax(0,1fr) so the track can't grow to the tab row's max-content —
     otherwise the notebook's own `width: 100%` resolves against that */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 4vh 24px;
  opacity: 0;
  transition: opacity .32s ease;
}
/* `display` beats the hidden attribute, so opt out explicitly */
.nb-overlay[hidden] { display: none; }
.nb-overlay.open { opacity: 1; }

.nb-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px) saturate(.85);
  -webkit-backdrop-filter: blur(4px) saturate(.85);
  cursor: pointer;
}

.nb {
  position: relative;
  width: min(920px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--frame);
  border: 1px solid var(--frame-line);
  box-shadow: 0 26px 70px -12px rgba(0, 0, 0, .6), 0 3px 10px rgba(0, 0, 0, .3);
  /* the zoom: origin is set from the card that opened it */
  transform: scale(.9) translateY(26px);
  transform-origin: var(--nb-origin, 50% 50%);
  opacity: 0;
  transition: transform .5s cubic-bezier(.16, .84, .28, 1), opacity .3s ease;
  will-change: transform, opacity;
}
.nb-overlay.open .nb { transform: none; opacity: 1; }

.nb-tape-l { top: -13px; left: 42px; width: 92px; height: 24px; transform: rotate(-2.4deg); z-index: 6; }
.nb-tape-r { top: -13px; right: 152px; width: 84px; height: 24px; transform: rotate(1.8deg); z-index: 6; }

/* the strips on the notebook are opaque — they read as tape holding it
   up rather than a tint over the scrim behind */
.nb .tape { opacity: 1; }
.nb .tape--green  { --tb: #4c5c4e; --ts: rgba(191, 207, 193, .42); }
.nb .tape--sand   { --tb: #706349; --ts: rgba(227, 214, 187, .42); }
.nb .tape--violet { --tb: #585165; --ts: rgba(203, 196, 216, .42); }
.nb .tape--rose   { --tb: #71545c; --ts: rgba(228, 198, 207, .42); }
[data-theme="light"] .nb .tape--green  { --tb: #dde6db; --ts: rgba(108, 142, 112, .4); }
[data-theme="light"] .nb .tape--sand   { --tb: #ece2cc; --ts: rgba(176, 150, 100, .4); }
[data-theme="light"] .nb .tape--violet { --tb: #e4dfec; --ts: rgba(132, 118, 160, .4); }
[data-theme="light"] .nb .tape--rose   { --tb: #f0dfe2; --ts: rgba(186, 128, 144, .4); }

/* punched margin down the left edge */
.nb-rings {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 46px;
  z-index: 1;
  border-right: 1px solid var(--line);
  background-color: var(--card-alt);
  background-image: radial-gradient(circle at 23px 17px, var(--hole) 0 5.5px, var(--hole-ring) 5.5px 6.5px, transparent 6.5px);
  background-size: 100% 40px;
  background-repeat: repeat-y;
  pointer-events: none;
}
/* the red margin rule just inside the punch line */
.nb-rings::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: -5px;
  width: 1px;
  background: var(--margin-rule);
}

.nb-close {
  position: absolute;
  top: -14px;
  right: -10px;
  z-index: 4;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  letter-spacing: .06em;
  padding: 5px 10px;
  background: var(--solid-bg);
  border: 1px solid var(--solid-bg);
  color: var(--solid-fg);
  cursor: pointer;
  transform: rotate(2deg);
  box-shadow: var(--shadow-md);
  transition: transform .18s ease;
}
.nb-close:hover { transform: rotate(0deg) translateY(-1px); }

/* ruled paper that scrolls under the binding */
.nb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 0 40px 40px 74px;
  background-image: repeating-linear-gradient(var(--paper-line) 0 1px, transparent 1px 30px);
  background-position: 0 44px;
  scrollbar-width: thin;
}
.nb-scroll::-webkit-scrollbar { width: 10px; }
.nb-scroll::-webkit-scrollbar-track { background: transparent; }
.nb-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--frame); }

.nb-head { padding: 34px 0 4px; }
.nb-kicker {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mono-mute);
}
.nb-title {
  font-family: Caveat, cursive;
  font-size: 46px;
  font-weight: 700;
  line-height: 1.02;
  margin: 2px 0 8px;
}
.nb-sub { font-size: 16.5px; line-height: 1.5; color: var(--ink-soft); max-width: 46em; }
.nb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.nb-meta i {
  font-family: 'Courier Prime', monospace;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mono-mute);
  margin-right: 7px;
}
.nb-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
}
.nb-actions a {
  padding: 5px 9px;
  border: 1px solid var(--line-2);
  color: var(--chip-fg);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nb-actions a:hover { color: var(--chip-fg); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.nb-actions a.primary { background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }

/* section tabs: they follow the title, then pin to the top as you read.
   The scroller has no top padding, so `top: 0` is exactly the top edge —
   nothing can ever slide above them. Opaque, and stretched from the
   binding to the right edge so no text peeks around either side. */
.nb-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 22px -40px 0 -16px;
  padding: 12px 40px 12px 16px;
  background: var(--frame);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.nb-tabs-track { display: flex; gap: 6px; flex-wrap: wrap; }
.nb-tabs button {
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 5px 9px;
  background: var(--chip-bg);
  border: 1px solid var(--line-2);
  color: var(--chip-fg);
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, color .15s ease;
}
.nb-tabs button:hover { transform: translateY(-1px); }
.nb-tabs .t-short { display: none; }
.nb-tabs button[aria-current="true"] {
  background: var(--solid-bg);
  border-color: var(--solid-bg);
  color: var(--solid-fg);
}

.nb-sec { padding-top: 28px; }
.nb-sec > * + * { margin-top: 13px; }
.nb-sec p { font-size: 15.5px; line-height: 1.72; color: var(--ink-soft); }
.nb-sec strong { color: var(--ink); font-weight: 600; }

.nb-h {
  display: inline-block;
  font-family: Caveat, cursive;
  font-size: 29px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  border-bottom: 2px solid var(--label-rule);
  padding-bottom: 1px;
}

.nb-end {
  margin-top: 44px;
  text-align: center;
  font-family: Caveat, cursive;
  font-size: 19px;
  color: var(--mono-mute);
}

.dd-note {
  padding: 11px 13px;
  background: var(--card);
  border: 1px dashed var(--line-2);
  font-size: 14.5px !important;
}

.dd-stats, .dd-steps { display: flex; flex-direction: column; gap: 9px; }
.dd-stats li, .dd-steps li {
  position: relative;
  padding-left: 24px;
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.dd-stats li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .68em;
  width: 9px;
  height: 2px;
  background: var(--accent);
  transform: rotate(-8deg);
}
.dd-steps { counter-reset: step; }
.dd-steps li { counter-increment: step; padding-left: 26px; }
.dd-steps li::before {
  content: counter(step) ".";
  position: absolute;
  left: 2px;
  top: -1px;
  font-family: Caveat, cursive;
  font-size: 19px;
  color: var(--accent);
}

/* diagrams get a polaroid frame */
.dd-figure {
  margin: 12px 0 0;
  padding: 10px 10px 12px;
  background: var(--frame);
  border: 1px solid var(--frame-line);
  box-shadow: var(--shadow-md);
}
.dd-figure img { width: 100%; height: auto; display: block; }

/* KPIs as ticket stubs */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi-grid.k2 { grid-template-columns: 1fr 1fr; }
.kpi {
  padding: 13px 12px;
  background: var(--grid-bg);
  border: 1px dashed var(--line-2);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  text-align: center;
}
.kpi-num {
  display: block;
  font-family: Caveat, cursive;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.kpi-label {
  display: block;
  margin-top: 5px;
  font-family: 'Courier Prime', monospace;
  font-size: 9.5px;
  line-height: 1.45;
  letter-spacing: .03em;
  color: var(--mono-mute);
}

/* takeaways as sticky notes */
.tk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tk-card {
  padding: 15px 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  transition: transform .2s ease;
}
.tk-card:nth-child(1) { transform: rotate(-1.2deg); }
.tk-card:nth-child(2) { transform: rotate(.8deg); }
.tk-card:nth-child(3) { transform: rotate(-.6deg); }
.tk-card:hover { transform: rotate(0deg) translateY(-3px); }
.tk-icon { width: 20px; height: 20px; color: var(--accent); display: block; margin-bottom: 8px; }
.tk-title { font-size: 14.5px; font-weight: 600; margin-bottom: 5px; }
.tk-card p { font-size: 13px; line-height: 1.55; color: var(--ink-soft); }

/* ============================================================
   skills — graph paper
   ============================================================ */
/* sits above the corner tape, which is z-index 5 */
.skills-label { position: relative; z-index: 6; }
.toolkit {
  position: relative;
  background: var(--grid-bg);
  border: 1px solid var(--frame-line);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 14px;
  column-gap: 20px;
  align-items: baseline;
}
.toolkit .tape.tl { top: -11px; left: -16px; width: 80px; height: 22px; transform: rotate(-34deg); }
.toolkit .tape.br { bottom: -11px; right: -16px; width: 80px; height: 22px; transform: rotate(-34deg); }
.tk-label { font-family: Caveat, cursive; font-size: 19px; color: var(--accent); }
.toolkit p { font-size: 14.5px; color: var(--ink-body); }

/* ============================================================
   off the clock
   ============================================================ */
/* the section label with a handwritten aside beside it, so the flip is
   discoverable without hovering — which never happens on a phone */
.block-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.deck-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: Caveat, cursive;
  font-size: 24px;
  color: var(--accent);
  transform: rotate(-1.2deg);
}
.deck-hint svg {
  width: 36px;
  height: 23px;
  flex: none;
  color: var(--accent);
  transform: rotate(4deg) scaleX(-1);
}

/* ---------- the deck: a strip of polaroids you page through ---------- */
.snap-deck { --gap: 22px; --per: 4; }

.snap-viewport {
  /* clip sideways but let the tilted cards and their shadows breathe
     vertically; the clip margin keeps rotated corners from being shaved */
  overflow-x: clip;
  overflow-y: visible;
  overflow-clip-margin: 16px;
  /* keep vertical page scrolling; horizontal drags are ours to handle */
  touch-action: pan-y;
}
/* without this the browser starts a native image drag, which fires
   pointercancel and kills the swipe before it can page */
.snap-viewport img { -webkit-user-drag: none; user-drag: none; }
.snap-flip { -webkit-user-select: none; user-select: none; }

.snap-track {
  display: flex;
  /* frames differ in height because each keeps its photo's ratio, so hang
     them from the top rather than stretching them to match */
  align-items: flex-start;
  gap: var(--gap);
  transition: transform .55s cubic-bezier(.22, .78, .3, 1);
  will-change: transform;
}

.snap {
  position: relative;
  flex: 0 0 calc((100% - (var(--per) - 1) * var(--gap)) / var(--per));
  margin: 0;
  perspective: 1100px;
  transition: transform .2s ease;
}
/* a repeating set of tilts and pin colours so any number of photos stays
   hand-placed rather than falling into a pattern */
.snap:nth-child(4n + 1) { transform: rotate(-1.6deg); --pin: #c05a52; --pin-deep: #8a3a34; }
.snap:nth-child(4n + 2) { transform: rotate(1.2deg);  --pin: #6d8aa8; --pin-deep: #445f79; }
.snap:nth-child(4n + 3) { transform: rotate(-.8deg);  --pin: #7f9a72; --pin-deep: #536e49; }
.snap:nth-child(4n + 4) { transform: rotate(1.7deg);  --pin: #c19a4e; --pin-deep: #8a6a2b; }
.snap:hover { transform: rotate(0deg) translateY(-3px); }

/* The pin holding the print to the board. It lives on the wrapper rather
   than the card, so the photo swings around it when you flip it over.
   A rounded head, but with the specular highlight kept small and low
   so it doesn't read as shiny plastic. Colours are the washi hues. */
.snap::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: -7px;
  left: 50%;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .3) 0 9%, rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 62% 72%, var(--pin-deep), var(--pin) 70%);
  box-shadow:
    0 2px 3px rgba(0, 0, 0, .32),
    inset 0 -1px 1.5px rgba(0, 0, 0, .22),
    inset 0 1px 1px rgba(255, 255, 255, .1);
}

/* the card itself turns over in 3D; the tilt above stays on the wrapper
   so the two transforms don't fight each other */
.snap-flip {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.22, .72, .24, 1);
}
.snap.flipped .snap-flip { transform: rotateY(180deg); }
.snap-flip:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.snap-face {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  outline: 1.5px dashed var(--dash);
  outline-offset: -6px;
  padding: 9px 9px 0;
  box-shadow: var(--shadow-md);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Safari doesn't cull positioned descendants with the face they belong
     to, so the photo well's overlay printed a ghost rectangle through the
     reverse. Hiding the away-facing side outright fixes it everywhere;
     the delay is half the flip, so the swap happens edge-on. */
  transition: visibility 0s linear .31s;
}
.snap:not(.flipped) .snap-back { visibility: hidden; }
.snap.flipped .snap-front { visibility: hidden; }

.snap-cap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  font-family: Caveat, cursive;
  font-size: 17px;
  text-align: center;
  padding: 7px 0 10px;
  color: var(--ink);
}
.snap-turn {
  font-style: normal;
  font-size: 12px;
  color: var(--mono-mute);
  opacity: 0;
  transition: opacity .2s ease;
}
.snap:hover .snap-turn, .snap-flip:focus-visible .snap-turn { opacity: 1; }
@media (hover: none) {
  .snap-turn { opacity: .6; }
}

/* the reverse: the blank side of the print, written on */
.snap-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 15px;
  /* flat: no inset dashed frame and the same paper as the front, so the
     reverse doesn't read as a recessed panel */
  outline: none;
  background: var(--card);
  overflow: hidden;
}
.snap-fact-label {
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--mono-mute);
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line-2);
  margin-bottom: 2px;
}
.snap-note {
  /* takes the space between the label and the back link, with the words
     centred in it, so short and long facts both sit right */
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Caveat, cursive;
  font-size: 19px;
  line-height: 1.32;
  color: var(--ink);
  text-align: center;
  text-wrap: pretty;
}
.snap-turn-back {
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: .08em;
  text-align: center;
  color: var(--mono-mute);
}

.snap-img {
  display: block;
  aspect-ratio: var(--ar, 4 / 3);
  overflow: hidden;
  background: repeating-linear-gradient(45deg, var(--hatch-a) 0 6px, var(--hatch-b) 6px 12px);
}
.snap-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* per-photo tone tweak, set with --adjust on the .snap-img */
  filter: var(--adjust, none);
}

/* ---------- paging controls, in the same taped-label idiom ---------- */
.snap-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.snap-btn {
  font-family: 'Courier Prime', monospace;
  font-size: 14px;
  line-height: 1;
  padding: 6px 13px 7px;
  background: var(--chip-bg);
  border: 1px solid var(--line-2);
  color: var(--chip-fg);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform .16s ease, box-shadow .16s ease;
}
.snap-btn:first-of-type { transform: rotate(-1.4deg); }
.snap-btn:last-of-type { transform: rotate(1.4deg); }
.snap-btn:hover { transform: rotate(0deg) translateY(-1px); box-shadow: var(--shadow-md); }
.snap-count {
  font-family: 'Courier Prime', monospace;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--mono-mute);
  min-width: 44px;
  text-align: center;
}
.snap-count b { color: var(--ink); font-weight: 400; }

/* ============================================================
   email picker — personal or school
   ============================================================ */
.mail-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 5vh 20px;
  opacity: 0;
  transition: opacity .28s ease;
}
.mail-overlay[hidden] { display: none; }
.mail-overlay.open { opacity: 1; }

.mail-card {
  position: relative;
  width: min(430px, 100%);
  padding: 28px 26px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--mount-shadow);
  transform: scale(.93) translateY(18px);
  transform-origin: var(--mail-origin, 50% 50%);
  opacity: 0;
  transition: transform .42s cubic-bezier(.18, .82, .26, 1), opacity .26s ease;
}
.mail-overlay.open .mail-card { transform: none; opacity: 1; }

.mail-tape {
  top: -12px;
  left: 50%;
  width: 92px;
  height: 22px;
  margin-left: -46px;
  transform: rotate(-2deg);
}
.mail-close {
  position: absolute;
  top: -13px;
  right: -8px;
  z-index: 4;
  font-family: 'Courier Prime', monospace;
  font-size: 10px;
  letter-spacing: .06em;
  padding: 5px 9px;
  background: var(--solid-bg);
  border: 1px solid var(--solid-bg);
  color: var(--solid-fg);
  cursor: pointer;
  transform: rotate(2deg);
  box-shadow: var(--shadow-md);
  transition: transform .16s ease;
}
.mail-close:hover { transform: rotate(0deg) translateY(-1px); }

.mail-kicker {
  font-family: Caveat, cursive;
  font-size: 24px;
  color: var(--accent);
  transform: rotate(-1deg);
}
.mail-title {
  font-family: Caveat, cursive;
  font-size: 31px;
  font-weight: 600;
  color: var(--ink);
  margin: -2px 0 16px;
}

.mail-list { display: flex; flex-direction: column; gap: 10px; }
.mail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--card-alt);
  border: 1px solid var(--line);
  transition: transform .16s ease, box-shadow .16s ease;
}
.mail-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mail-opt { flex: 1; min-width: 0; display: block; }
.mail-tag {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mono-mute);
}
.mail-addr {
  display: block;
  font-family: Newsreader, Georgia, serif;
  font-size: 15.5px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-rule);
  margin-top: 2px;
  word-break: break-all;
}
.mail-copy {
  flex: none;
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: .08em;
  padding: 6px 9px;
  background: var(--chip-bg);
  border: 1px solid var(--line-2);
  color: var(--chip-fg);
  cursor: pointer;
  transition: transform .15s ease;
}
.mail-copy:hover { transform: translateY(-1px); }
.mail-copy.done { background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }

@media (max-width: 640px) {
  .mail-card { padding: 24px 18px 20px; }
  .mail-title { font-size: 27px; }
  .mail-addr { font-size: 14px; }
}

/* ============================================================
   footer — a note mounted on patterned card, taped down
   ============================================================ */
.foot { margin: 60px 56px 0; }

.foot-mount {
  position: relative;
  padding: 22px;
  background-color: var(--mount);
  background-image: var(--stamp);
  background-size: 40px 40px;
  background-repeat: round;
  border: 1px solid var(--mount-line);
  box-shadow: 0 0 0 1px var(--mount) inset, var(--mount-shadow);
  transform: rotate(-.4deg);
}
.foot-tape {
  top: -11px;
  left: 50%;
  width: 104px;
  height: 24px;
  margin-left: -52px;
  transform: rotate(-1.6deg);
}

/* the note itself, double-ruled in the accent colour */
.foot-card {
  position: relative;
  padding: 28px 32px 26px;
  background: var(--card);
  border: 1.5px solid var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--mount);
}

.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
}

.foot-hi {
  font-family: Caveat, cursive;
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  transform: rotate(-.8deg);
  margin-bottom: 10px;
}
.foot-mail {
  display: inline-block;
  font-family: Newsreader, Georgia, serif;
  font-size: 23px;
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent-rule);
  padding-bottom: 2px;
  transition: border-color .18s ease;
}
.foot-mail:hover { border-bottom-color: var(--accent); }

.foot-chips {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.foot-chips .chip { padding: 5px 10px; }
.foot-chips .chip:first-child { transform: rotate(-.7deg); }
.foot-chips .chip:last-child { transform: rotate(.6deg); }
.foot-chips .chip:hover { transform: rotate(0deg) translateY(-1px); }

.foot-end { text-align: right; flex: none; }
.foot-thanks {
  font-family: Caveat, cursive;
  font-size: 19px;
  color: var(--mono-mute);
  transform: rotate(1.2deg);
  margin-bottom: 8px;
}
.foot-copy {
  font-family: 'Courier Prime', monospace;
  font-size: 10.5px;
  color: var(--mono-mute);
}

/* ============================================================
   reveals
   ============================================================ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   responsive — tracks the 392px mobile mockup
   ============================================================ */
@media (max-width: 900px) {
  .exp-row { grid-template-columns: 1fr; gap: 26px; }
  .works { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .tk-grid { grid-template-columns: 1fr; }
  .snap-deck { --per: 2; }
}

@media (max-width: 640px) {
  .top { padding: 16px 20px 12px; }
  .brand { gap: 8px; padding: 5px 11px 5px 6px; transform: rotate(-.8deg); }
  .brand .tape { display: none; }
  .avatar { width: 22px; height: 22px; }
  .brand .name { font-size: 16px; }
  .top-nav { gap: 5px; }
  .chip { position: relative; font-size: 9px; padding: 6px; gap: 0; }
  .chip .chip-label { display: none; }
  .chip::after, .theme-toggle::after {
    content: "";
    position: absolute;
    inset: -9px -6px;
  }
  .theme-toggle { position: relative; }
  .ci { width: 13px; height: 13px; }


  .intro { display: block; padding: 16px 20px 0; }
  .intro-hi { font-size: 20px; }
  .intro-name { font-size: 52px; line-height: .95; margin-bottom: 12px; }
  .intro-desc { font-size: 17px; line-height: 1.45; margin-bottom: 10px; }
  .intro-line { font-size: 13px; }
  .polaroid { width: 168px; margin: 20px auto 0; padding: 12px; background-size: 20px 20px; }
  .polaroid .tape { top: -11px; width: 66px; height: 20px; }

  .block, .exp-row { padding: 26px 20px 0; }
  .block-label { font-size: 22px; padding: 3px 14px 4px; margin-bottom: 13px; }

  .role { padding: 14px 15px; }
  .role::before { display: none; }
  .role-line { display: block; }
  .role-date { display: block; margin-bottom: 2px; font-size: 10px; }
  .role-title { font-size: 14.5px; }
  .role-at { font-size: 13.5px; }
  .role-note { font-size: 13px; margin-top: 6px; }
  .role-logo { display: none; }
  .roles--past .role:first-child::after { display: none; }

  .works { gap: 16px; }
  .work { padding: 10px 10px 14px; }
  .work > .tape { display: none; }
  .work-body { padding: 12px 4px 0; }
  .work-title { font-size: 16px; }
  .work-metric { font-size: 16px; margin: 1px 0 5px; }
  .work-sub { font-size: 13px; margin-bottom: 11px; }
  .work-links { gap: 6px; font-size: 9.5px; }
  .work-links a, .work-links button { padding: 4px 7px; }

  .spec-cell { grid-template-columns: 60px 1fr; gap: 10px; padding: 8px 12px; }

  .dd-title { font-size: 19px; }
  .dd-copy { padding: 0 14px; }
  .dd-head[aria-expanded="true"] + .dd-body > .dd-copy { padding: 12px 14px 16px; }
  .kpi-grid, .kpi-grid.k2 { grid-template-columns: 1fr; }

  .toolkit { grid-template-columns: 1fr; row-gap: 4px; padding: 14px 16px; background-size: 20px 20px; }
  .toolkit .tk-label { font-size: 18px; }
  .toolkit p { font-size: 13.5px; margin-bottom: 8px; }
  .toolkit .tape { display: none; }

  .deck-hint { font-size: 18px; margin-bottom: 13px; gap: 5px; }
  .deck-hint svg { width: 29px; height: 19px; }
  .snap-deck { --per: 2; --gap: 14px; }
  /* comfortable thumb targets */
  .snap-btn { padding: 12px 20px; font-size: 15px; }
  .snap-count { min-width: 52px; font-size: 12px; }
  .snap-face { padding: 8px 8px 0; outline-offset: -5px; }
  .snap::before { width: 12px; height: 12px; margin-left: -6px; top: -6px; }
  .snap-cap { font-size: 15px; padding: 6px 0 9px; }
  .snap-back { padding: 12px 11px; gap: 7px; }
  .snap-note { font-size: 16px; }
  .snap-nav { justify-content: center; margin-top: 14px; }

  .foot { margin: 34px 20px 0; }
  .foot-mount { padding: 15px; background-size: 34px 34px; transform: rotate(-.5deg); }
  .foot-tape { top: -10px; width: 86px; height: 21px; margin-left: -43px; transform: rotate(-1.8deg); }
  .foot-card { padding: 22px 20px 20px; }
  .foot-row { display: block; }
  .foot-hi { font-size: 26px; margin-bottom: 8px; }
  .foot-mail { font-size: 17px; word-break: break-all; }
  .foot-chips { gap: 8px; margin-top: 14px; }
  .foot-chips .chip { padding: 5px 9px; font-size: 10px; gap: 0; }
  .foot-end {
    text-align: left;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px dashed var(--line-2);
  }
  .foot-thanks { font-size: 17px; transform: rotate(1deg); margin-bottom: 0; }
  .foot-copy { font-size: 9.5px; margin-top: 4px; }
}

/* body scroll lock while a notebook is open */
html.nb-lock, html.nb-lock body { overflow: hidden; }

/* ---------- notebook, small screens ---------- */
@media (max-width: 860px) {
  .nb-overlay { padding: 0; }
  .nb { width: 100%; max-height: 100vh; height: 100vh; border: 0; }
  .nb-tape-l, .nb-tape-r { display: none; }
  .nb-rings { width: 26px; }
  .nb-rings { background-image: radial-gradient(circle at 13px 15px, var(--hole) 0 4px, var(--hole-ring) 4px 5px, transparent 5px); background-size: 100% 34px; }
  .nb-close { top: 10px; right: 12px; transform: none; }
  .nb-close:hover { transform: none; }
  .nb-kicker { padding-right: 92px; }
  .nb-scroll { padding: 0 20px 34px 42px; }
  .nb-head { padding-top: 24px; }
  .nb-title { font-size: 34px; }
  .nb-sub { font-size: 15px; }
  .nb-tabs {
    margin: 18px -20px 0 -5px;
    padding: 10px 20px 10px 5px;
  }
  /* wrap onto a second row rather than scrolling sideways — over half the
     tabs used to sit off-screen with nothing to show they were there.
     The right margin keeps the first row clear of the close chip. */
  .nb-tabs-track {
    flex-wrap: wrap;
    gap: 5px;
    margin-right: 74px;
  }
  .nb-tabs .t-full { display: none; }
  .nb-tabs .t-short { display: inline; }
  .nb-tabs button { padding: 5px 8px; letter-spacing: .03em; }
  .nb-sec { padding-top: 24px; }
  .nb-sec p, .dd-stats li, .dd-steps li { font-size: 14.5px; line-height: 1.65; }
  .nb-h { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .nb { transform: none; }
  .nb-scroll { scroll-behavior: auto; }
  .snap-flip { transition: none; }
  .snap-face { transition-delay: 0s; }
}
