/* Katrina Hand: built from my own brush alphabet (letters only).
   Numbers and symbols fall back to Little Marker. Paragraphs are Century Gothic;
   where it isn't installed, Adventor (same family of letterforms) is fetched instead. */
@font-face { font-family: 'Adventor'; src: url(assets/fonts/Adventor-Regular.otf) format('opentype'); font-weight: 400 500; font-display: swap; }
@font-face { font-family: 'Adventor'; src: url(assets/fonts/Adventor-Bold.otf) format('opentype'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Katrina Hand'; src: url(assets/fonts/KatrinaHand.otf) format('opentype'); font-display: swap; }
@font-face { font-family: 'Chewy Pro'; src: url(assets/fonts/ChewyPro.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: 'Little Marker'; src: url(assets/fonts/LittleMarker.otf) format('opentype'); font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(assets/fonts/Rubik-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(assets/fonts/Rubik-Medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Rubik'; src: url(assets/fonts/Rubik-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --ink: #1E1631;
  --ink-soft: #4A3F63;
  --paper: #FFFDF8;
  --ground: #FFC49B;
  --on-ground: #1E1631;
  --tint: #FFD3FF;
  --sheet: #C879FF;
  --arrow-filter: none;
  --display: 'Chewy Pro', 'Rubik', system-ui, sans-serif;
  --title: 'Chewy Pro', 'Rubik', system-ui, sans-serif;
  --hand: 'Little Marker', 'Chewy Pro', cursive;
  --her-hand: 'Katrina Hand', 'Little Marker', cursive;   /* front page notes only */
  --text: 'Century Gothic', CenturyGothic, 'Adventor', 'Rubik', system-ui, sans-serif;
  /* Motion: strong ease-out for things arriving, ease-in-out for things travelling. */
  --out: cubic-bezier(.23, 1, .32, 1);
  --in-out: cubic-bezier(.77, 0, .175, 1);
  --gutter: clamp(16px, 4.5vw, 72px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 400 15.5px/1.65 var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .7s var(--out);
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
::selection { background: var(--tint); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 10px; transition: top .2s var(--out); }
.skip:focus { top: 12px; }

/* ---------- the room ---------- */
.stage { position: fixed; inset: 0; }
#room-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.no-room .stage { background: url(assets/drawn/sketch.webp) 70% 55% / auto 70vh no-repeat; }

/* ---------- loader: my sketch draws itself, then hands over to the real room ---------- */
.loader {
  position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--ground); transition: opacity .8s var(--out), visibility 0s .8s;
}
/* Only the number moves while things load. At 100% the sketch fades in, then the loader fades away to the room. */
.loader-sketch { width: min(52vh, 72vw); opacity: 0; transition: opacity .45s var(--out), transform .9s var(--out), filter .9s var(--out); }
.loader.full .loader-sketch { opacity: 1; }
.loader-note { display: flex; align-items: center; gap: 12px; margin: 0; font: 22px/1 var(--hand); color: var(--ink-soft); }
/* The folding triangle from css-loaders.com (shapes #2), beside the count. The original
   animates clip-path, which the browser runs on the main thread, so it stalls while the
   room is being built. Here the outline stays fixed and each quarter is a shear along one
   edge, the same fold done with transforms, which the compositor keeps smooth. */
.loader-tri { flex: none; width: 40px; aspect-ratio: 1; background: #25b09b; clip-path: polygon(0 0, 100% 0, 100% 100%); will-change: transform; animation: loader-fold 2s infinite cubic-bezier(.3, 1, 0, 1); }
@keyframes loader-fold {
  0%      { transform: rotate(0deg)    translateX(0)    skewX(0deg); }
  25%     { transform: rotate(0deg)    translateX(-50%) skewX(-45deg); }
  25.01%  { transform: rotate(-90deg)  translateX(0)    skewX(0deg); }
  50%     { transform: rotate(-90deg)  translateX(-50%) skewX(-45deg); }
  50.01%  { transform: rotate(-180deg) translateX(0)    skewX(0deg); }
  75%     { transform: rotate(-180deg) translateX(-50%) skewX(-45deg); }
  75.01%  { transform: rotate(-270deg) translateX(0)    skewX(0deg); }
  100%    { transform: rotate(-270deg) translateX(-50%) skewX(-45deg); }
}
@media (prefers-reduced-motion: reduce) { .loader-tri { animation: none; } }
body:not([data-view="loading"]) .loader { opacity: 0; visibility: hidden; }
body:not([data-view="loading"]) .loader-sketch { transform: scale(1.12); filter: blur(6px); }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 0; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
/* the star cat is the home button; my name joins it inside a section */
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark-name { width: 132px; transition: opacity .35s var(--out), transform .35s var(--out); }
/* my star cat in the nav: always takes you back to the room */
.nav-cat { display: grid; place-items: center; width: 52px; height: 48px; }
.nav-cat img { width: 50px; rotate: 6deg; filter: drop-shadow(0 4px 6px rgb(30 22 49 / .22)); transition: rotate .35s var(--out), transform .2s var(--out); }
@media (hover: hover) { .nav-cat:hover img { rotate: -8deg; } }
.nav-cat:active img { transform: scale(.94); }
.star-cat { flex: 0 0 29%; width: 29%; margin-left: 1%; rotate: 7deg; filter: drop-shadow(0 10px 14px rgb(30 22 49 / .18)); transition: rotate .4s var(--out); }
@media (hover: hover) { .star-cat:hover { rotate: -3deg; } }
[data-view="home"] .mark, [data-view="loading"] .mark { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.mark { transition: opacity .35s var(--out), transform .35s var(--out); }
.topnav { display: flex; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 20px 4px; border-radius: 999px;
  font: 21px/1 var(--display); text-decoration: none; letter-spacing: .01em;
  box-shadow: 0 6px 16px -8px rgb(30 22 49 / .45);
  transition: transform .2s var(--out), box-shadow .2s var(--out);
}
.chip-resume { background: var(--ink); color: var(--paper); rotate: -2deg; }
.chip-menu { background: var(--paper); color: var(--ink); rotate: 1.5deg; }
@media (hover: hover) {
  .chip:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgb(30 22 49 / .5); }
}
.chip:active { transform: scale(.97); }

/* ---------- home ---------- */
.hero {
  position: fixed; z-index: 10; left: var(--gutter); top: 50%; width: min(31vw, 500px);
  translate: 0 -50%; transition: opacity .45s var(--out), transform .6s var(--out);
}
[data-view="section"] .hero, [data-view="loading"] .hero { opacity: 0; transform: translateX(-24px); pointer-events: none; }
[data-view="section"] .hero { visibility: hidden; transition: opacity .3s var(--out), transform .4s var(--out), visibility 0s .4s; }
.hero-name { margin: 0 0 18px -1%; width: 100%; }
.hero-role { margin: 0; max-width: 30ch; font: 500 clamp(17px, 1.45vw, 22px)/1.4 var(--text); color: var(--ink); text-wrap: balance; }
.hero-note { margin: 14px 0 26px; font: clamp(19px, 1.5vw, 24px)/1.2 var(--hand); color: var(--ink-soft); rotate: -1.5deg; }
.tour {
  display: inline-flex; align-items: center; gap: 14px; padding: 10px 22px 8px 26px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 26px/1 var(--display);
  box-shadow: 0 10px 24px -12px rgb(30 22 49 / .6);
  transition: transform .2s var(--out);
}
.tour img { width: 56px; filter: invert(0); transition: translate .25s var(--out); }
@media (hover: hover) { .tour:hover img { translate: 6px 0; } .tour:hover { transform: rotate(-1deg); } }
.tour:active { transform: scale(.97); }
[data-view="home"] .hero > * { animation: rise .8s var(--out) both; }
[data-view="home"] .hero > :nth-child(2) { animation-delay: .08s; }
[data-view="home"] .hero > :nth-child(3) { animation-delay: .16s; }
[data-view="home"] .hero > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.room-hint {
  position: fixed; z-index: 10; right: var(--gutter); bottom: max(20px, env(safe-area-inset-bottom)); margin: 0;
  font: 19px/1 var(--hand); color: var(--ink-soft); rotate: -2deg; transition: opacity .4s var(--out);
}
[data-view="section"] .room-hint, [data-view="loading"] .room-hint, .no-room .room-hint { opacity: 0; }

/* hotspots: white dots over each section's object, smoothly */
.hotspots { position: fixed; inset: 0; z-index: 9; pointer-events: none; transition: opacity .4s var(--out); }
[data-view="section"] .hotspots, [data-view="loading"] .hotspots { opacity: 0; }
[data-view="section"] .hotspot { pointer-events: none; }
.hotspot {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; pointer-events: auto;
  display: grid; place-items: center;
}
.hotspot img { width: 18px; filter: drop-shadow(0 1px 2px rgb(30 22 49 / .4)); transition: transform .25s var(--out); }
.hotspot::before {
  content: ''; position: absolute; inset: 11px; border-radius: 50%; border: 2px solid var(--tint);
  animation: ping 2.6s var(--out) infinite;
}
.hotspot span {
  position: absolute; left: 34px; top: 50%; translate: 0 -50%; white-space: nowrap; padding: 5px 10px 3px; border-radius: 8px;
  background: var(--tint); color: var(--ink); font: 18px/1 var(--hand); rotate: -3deg;
  opacity: 0; transform: translateX(-6px); transition: opacity .2s var(--out), transform .2s var(--out);
}
.hotspot:hover span, .hotspot:focus-visible span { opacity: 1; transform: none; }
.hotspot:hover img { transform: scale(1.25); }
@keyframes ping { 0% { transform: scale(.6); opacity: .9; } 70%, 100% { transform: scale(1.9); opacity: 0; } }
@media (hover: none) { .hotspot span { display: none; } }

/* ---------- section scene ---------- */
.scene { position: fixed; inset: 0; z-index: 12; pointer-events: none; visibility: hidden; }
[data-view="section"] .scene { visibility: visible; }
.scene > * { pointer-events: auto; }

/* my torn corner: my wavy edge over a fill in the section's colour. */
.sheet { position: fixed; left: 0; top: 0; width: clamp(340px, 35vw, 660px); aspect-ratio: 1200 / 1016; pointer-events: none; }
.sheet-fill { position: absolute; inset: 0; background: var(--sheet); -webkit-mask: url(assets/drawn/corner-fill.png) 0 0 / 100% 100% no-repeat; mask: url(assets/drawn/corner-fill.png) 0 0 / 100% 100% no-repeat; transition: background-color .6s var(--out); }
.sheet-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-title { position: absolute; left: 3%; top: 60%; rotate: -36deg; transform-origin: left center; white-space: nowrap; }
.sheet-heading { margin: 0; font: clamp(40px, 4.3vw, 80px)/.95 var(--title); color: var(--on-sheet, #FFFDF8); letter-spacing: -.005em; }
.sheet-note { margin: 2px 0 0 4px; font: clamp(15px, 1.15vw, 21px)/1 var(--hand); color: var(--on-sheet, #FFFDF8); opacity: .9; }

.scene.enter .sheet { animation: tear 1s var(--in-out) .2s both; }
.scene.enter .sheet-title > * { animation: lift .7s var(--out) .62s both; }
.scene.enter .sheet-title > :last-child { animation-delay: .7s; }
.scene.enter .panel { animation: slide-in .75s var(--out) .42s both; }
.scene.enter .steps { animation: fade .6s var(--out) .8s both; }
.scene.swap .sheet { animation: tear .8s var(--in-out) both; }
.scene.swap .sheet-title > * { animation: lift .55s var(--out) .3s both; }
.scene.swap .panel-inner { animation: fade-up .5s var(--out) .25s both; }
@keyframes tear { from { clip-path: polygon(0 0, 0 0, 0 0); } to { clip-path: polygon(0 0, 210% 0, 0 210%); } }
@keyframes lift { from { opacity: 0; transform: translateY(24px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(48px) rotate(1.5deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }

/* the content card: a sheet of paper on the right */
.panel {
  position: fixed; right: var(--gutter); top: 92px; bottom: 28px; width: min(500px, 38vw);
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--tint) transparent;
  background: var(--paper); color: var(--ink);
  border-radius: 22px 30px 24px 34px / 30px 22px 34px 24px;
  box-shadow: 0 30px 60px -30px rgb(30 22 49 / .55), 0 2px 0 rgb(30 22 49 / .06);
  rotate: -.6deg; outline: none;
}
.panel-inner { padding: 34px 36px 40px; }
.panel p { margin: 0 0 14px; color: var(--ink-soft); max-width: 62ch; }
.panel .lede { font: 500 20px/1.45 var(--text); color: var(--ink); text-wrap: pretty; }
.panel h3 { margin: 0; font: 26px/1.1 var(--display); color: var(--ink); letter-spacing: .005em; }
.panel h3.hand {
  position: relative; width: fit-content; margin: 30px 0 12px; font: 23px/1 var(--hand); z-index: 0;
}
.panel h3.hand::after {
  content: ''; position: absolute; z-index: -1; left: -4px; right: -6px; bottom: -2px; height: .5em;
  background: var(--tint); border-radius: 4px; rotate: -1.5deg;
}
.panel .aside { margin-top: 26px; font: 19px/1.35 var(--hand); color: var(--ink-soft); }
.panel a { color: var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 5px 12px 4px; border-radius: 999px; background: color-mix(in srgb, var(--tint) 60%, white); font: 500 14px/1.3 var(--text); color: var(--ink); }

.polaroid { margin: 4px 0 22px; padding: 10px 10px 8px; background: #fff; width: 62%; box-shadow: 0 14px 30px -18px rgb(30 22 49 / .55); }
.polaroid img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.polaroid.wide { width: 74%; margin-left: auto; }
.polaroid.wide img { aspect-ratio: 4 / 5; }
.polaroid figcaption { padding-top: 8px; font: 20px/1 var(--hand); text-align: center; }
.tilt-l { rotate: -3deg; } .tilt-r { rotate: 2.5deg; }

.bluecard {
  margin: -6px -10px 0; padding: 30px 34px 34px;
  background: url(assets/drawn/card-blue.webp) center / 100% 100% no-repeat; color: #0B1A33;
}
.bluecard h3.hand { margin: 16px 0 10px; }
.bluecard h3.hand:first-child { margin-top: 0; }
.bluecard h3.hand::after { background: #FFFDF8; opacity: .55; }
/* Skills read as a line you'd write on a résumé, not a grid of bullets. */
.panel .skill-line { margin: 0 0 4px; max-width: none; font: 400 15.5px/1.75 var(--text); color: #0B1A33; text-wrap: pretty; }
/* Plain ruled lists (awards, coursework): one thing per line, like a notebook page. */
.plain { margin: 0; padding: 0; list-style: none; }
.plain li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 8px 2px 7px; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 18%, transparent); font: 400 15.5px/1.35 var(--text); color: var(--ink); }
.plain li:last-child { border-bottom: 0; }
.plain li span { flex: none; font: 17px/1 var(--hand); color: var(--ink-soft); }
.plain.starred li { position: relative; padding-left: 30px; }
.plain.starred li::before { content: ''; position: absolute; left: 0; top: 5px; width: 21px; height: 22px; background: url(assets/drawn/star.png) center / contain no-repeat; rotate: -8deg; }
.plain.starred li:nth-child(2n)::before { rotate: 9deg; }

/* experience + education */
.timeline { margin: 0; padding: 0 0 0 22px; list-style: none; border-left: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
.timeline li { position: relative; padding-bottom: 22px; }
.timeline li::before { content: ''; position: absolute; left: -31px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--tint); border: 2px solid var(--ink); }
.when { margin: 0 0 4px !important; font: 19px/1 var(--hand) !important; color: var(--ink-soft); }
.org { margin: 2px 0 8px !important; font: 500 15px/1.3 var(--text); color: var(--ink) !important; }
.moments { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.moments li { display: grid; grid-template-columns: 82px 1fr; column-gap: 12px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.moments .when { grid-row: span 2; padding-top: 3px; }
.moments b { font: 500 16px/1.3 var(--text); }
.moments span:last-child { font-size: 14px; color: var(--ink-soft); }
.school { padding: 16px 18px 6px; margin-bottom: 14px; border-radius: 16px 20px 18px 22px; background: color-mix(in srgb, var(--tint) 45%, white); }

.trips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.trips .polaroid { width: 100%; margin-bottom: 10px; }
.trips .polaroid:first-child { grid-column: span 2; width: 78%; justify-self: center; }
.trips .polaroid:first-child img { aspect-ratio: 3 / 2; }

.big-link { display: inline-block; margin: 8px 0 20px; font: clamp(22px, 2.2vw, 30px)/1.2 var(--display); word-break: break-all; text-decoration-color: var(--tint); text-decoration-thickness: 6px; text-underline-offset: 2px; text-decoration-skip-ink: none; }
.contact-list { margin: 0; padding: 0; list-style: none; }
.contact-list a { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 4px; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); font: 24px/1 var(--display); text-decoration: none; transition: padding .2s var(--out); }
.contact-list a span { font: 18px/1 var(--hand); color: var(--ink-soft); }
@media (hover: hover) { .contact-list a:hover { padding-left: 10px; } }

/* walking the room */
.steps {
  position: fixed; left: var(--gutter); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 22px;
  /* a scrap of paper, so the walk stays legible over whatever part of the room is behind it */
  padding: 2px 22px 0 16px; border-radius: 999px; background: var(--paper); color: var(--ink);
  box-shadow: 0 12px 26px -16px rgb(30 22 49 / .6);
}
.step { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font: 22px/1 var(--display); transition: transform .2s var(--out); }
.step img { width: 64px; filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg); }
.step-home { font: 19px/1 var(--hand); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
@media (hover: hover) { .step-prev:hover { transform: translateX(-4px); } .step-next:hover { transform: translateX(4px); } }
.step:active { transform: scale(.97); }

/* ---------- menu ---------- */
.menu { position: fixed; inset: 0; z-index: 30; background: rgb(30 22 49 / .28); }
.menu-sheet {
  position: absolute; right: var(--gutter); top: 74px; width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 96px); overflow: auto;
  padding: 18px 22px 22px; background: var(--paper); border-radius: 22px 28px 24px 30px / 28px 22px 30px 24px;
  box-shadow: 0 30px 60px -24px rgb(30 22 49 / .6); transform-origin: top right;
}
.menu.enter { animation: fade .25s var(--out); }
.menu.enter .menu-sheet { animation: pop .3s var(--out); }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-6px); } }
.menu-close { display: grid; place-items: center; width: 56px; height: 44px; margin: 0 0 4px auto; border-radius: 12px; }
.menu-close img { width: 50px; filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg); }
.menu-list { margin: 0; padding: 0; list-style: none; }
.menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 8px; border-radius: 12px; font: 26px/1.1 var(--display); text-align: left; transition: background-color .15s var(--out), padding .2s var(--out); }
.menu-list i { flex: none; width: 16px; height: 16px; border-radius: 50% 45% 52% 48%; background: var(--c); border: 2px solid var(--ink); }
.menu-list small { margin-left: auto; font: 17px/1 var(--hand); color: var(--ink-soft); }
.menu-list button[aria-current="true"] { background: color-mix(in srgb, var(--ground) 35%, white); }
@media (hover: hover) { .menu-list button:hover { padding-left: 14px; } }
.menu-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; padding-top: 14px; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); font: 15px/1.4 var(--text); }
.menu-foot button { font: 18px/1 var(--hand); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- cursor ---------- */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .25s var(--out); }
.cursor.on { opacity: 1; }
.cursor-body {
  position: absolute; width: 80px; height: 80px; margin: -40px 0 0 -40px;
  transform: scale(.24); transition: transform .3s var(--out);
  filter: drop-shadow(0 2px 4px rgb(30 22 49 / .35));
}
.cursor-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(.85); transition: opacity .18s var(--out), transform .3s var(--out); }
.cursor[data-state="dot"] .c-dot, .cursor[data-state="link"] .c-dot, .cursor:not([data-state]) .c-dot { opacity: 1; transform: none; }
.cursor[data-state="link"] .cursor-body { transform: scale(.5); }
.cursor[data-state="grow"] .c-dot { opacity: 1; transform: none; }
.cursor[data-state="grow"] .cursor-body { transform: scale(.62); }
.cursor.press[data-state="grow"] .cursor-body { transform: scale(.5); }
.cursor[data-state="link"] .c-dot { opacity: .7; }
.cursor[data-state="next"] .cursor-body, .cursor[data-state="prev"] .cursor-body { transform: scale(1); }
.cursor[data-state="next"] .c-next, .cursor[data-state="prev"] .c-prev { opacity: 1; transform: none; }
.cursor.press .cursor-body { transform: scale(.2); }
.cursor.press[data-state="next"] .cursor-body, .cursor.press[data-state="prev"] .cursor-body { transform: scale(.9); }
.cursor[data-state="grow"] .cursor-label { left: 32px; }
.cursor-label {
  position: absolute; left: 46px; top: -14px; white-space: nowrap; padding: 6px 12px 4px; border-radius: 9px;
  background: var(--tint); color: var(--ink); font: 21px/1 var(--hand); rotate: -4deg;
  opacity: 0; transform: translateX(-8px); transition: opacity .18s var(--out), transform .25s var(--out);
}
.cursor.labelled .cursor-label { opacity: 1; transform: none; }

.noscript { position: fixed; inset: auto 16px 16px; z-index: 60; padding: 14px; background: var(--paper); border-radius: 12px; }

/* ---------- phones & small tablets ---------- */
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  .mark-name { width: 108px; } .nav-cat img { width: 42px; } .star-cat { flex-basis: 30%; width: 30%; }
  .chip { min-height: 40px; padding: 6px 15px 4px; font-size: 18px; }
  .hero { top: 76px; translate: none; left: 20px; right: 20px; width: auto; }
  .hero-name { width: min(82vw, 380px); margin-bottom: 10px; }
  .hero-role { font-size: 16px; max-width: 34ch; }
  .hero-note { margin: 8px 0 0; font-size: 18px; }
  .tour { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); translate: -50% 0; padding: 10px 20px 8px 22px; font-size: 23px; }
  .room-hint { display: none; }
  .sheet { width: 88vw; }
  .sheet-heading { font-size: clamp(36px, 10.5vw, 56px); }
  .panel { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 56dvh; rotate: none; border-radius: 26px 26px 0 0; }
  .panel-inner { padding: 22px 20px 96px; }
  .scene.enter .panel { animation-name: rise-panel; }
  @keyframes rise-panel { from { opacity: 0; transform: translateY(60px); } }
  .steps { left: 8px; right: 8px; bottom: 0; justify-content: space-between; gap: 6px; padding: 8px 14px max(10px, env(safe-area-inset-bottom)); background: var(--paper); border-top: 1.5px dashed color-mix(in srgb, var(--ink) 18%, transparent); color: var(--ink); border-radius: 0; box-shadow: none; }
  .step span { display: none; }
  .step img { width: 54px; filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg) !important; }
  .polaroid { width: 70%; }
  .project-title { font-size: 28px !important; }
  .menu-sheet { right: 8px; left: 8px; width: auto; top: 64px; }
}
@media (min-width: 760px) and (max-width: 1100px) and (orientation: landscape) and (min-height: 501px) {
  .hero { width: 44vw; }
  .panel { width: 44vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* off the clock: the shows that play on the TV */
.shows { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.shows button { padding: 7px 13px 6px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); font: 500 14px/1.2 var(--text); color: var(--ink); transition: background-color .15s var(--out), transform .15s var(--out); }
.shows button[aria-pressed="true"] { background: var(--tint); border-color: var(--ink); }
@media (hover: hover) { .shows button:hover { background: color-mix(in srgb, var(--tint) 50%, white); } }
.shows button:active { transform: scale(.97); }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  .hero-note { display: none; }
  [data-view="section"] .mark-name { display: none; }
}

.chip-work { background: var(--paper); color: var(--ink); rotate: -1deg; }
.chip-work[aria-current="page"] { background: var(--tint); box-shadow: inset 0 0 0 2px var(--ink), 0 6px 16px -8px rgb(30 22 49 / .45); }

/* ---------- home: my name + the star cat ---------- */
.hero-title { display: flex; align-items: center; gap: 0; margin-bottom: 18px; }
.hero-title .hero-name { flex: 1 1 auto; margin: 0; }
[data-view="home"] .hero-role, [data-view="home"] .hero-note { color: var(--on-ground); }
.is-night[data-view="home"] .hero-name img { filter: invert(1); }
.is-night[data-view="home"] .hero-note, .is-night[data-view="home"] .room-hint { color: var(--on-ground); opacity: .85; }
.is-night[data-view="home"] .tour { background: var(--paper); color: var(--ink); }
.is-night[data-view="home"] .tour img { filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg); }

/* ---------- projects: arrows beside the monitor, a clipped paper card ---------- */
.monitor-arrows { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s var(--out); }
[data-section="projects"] .monitor-arrows { opacity: 1; transition-delay: .9s; }
.m-arrow { position: absolute; left: 0; top: 0; width: 104px; height: 64px; margin: -32px 0 0 -52px; display: grid; place-items: center; pointer-events: auto; }
body:not([data-section="projects"]) .m-arrow { pointer-events: none; }
.m-arrow img { width: 88px; filter: drop-shadow(0 3px 4px rgb(30 22 49 / .35)); transition: transform .2s var(--out); }
@media (hover: hover) { .m-prev:hover img { transform: translateX(-5px); } .m-next:hover img { transform: translateX(5px); } }
.m-arrow:active img { transform: scale(.94); }

[data-section="projects"] .panel { background: none; box-shadow: none; rotate: none; overflow: visible auto; }
[data-section="projects"] .panel-inner { padding: 8px 6px 30px; }
.papers { position: relative; margin: 14px 8px 0; }
.paper-back { position: absolute; inset: 0; }
.paper-back.b1 { background: #F05F5F; rotate: -3.5deg; translate: -10px 8px; }
.paper-back.b2 { background: #6FA8FF; rotate: 2deg; translate: 8px -6px; }
.paper-card { position: relative; padding: 34px 32px 28px; background: #F7F4EF; box-shadow: 0 24px 40px -26px rgb(30 22 49 / .7); }
.clip { position: absolute; left: 22px; top: -28px; width: 30px; height: 74px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; rotate: -8deg; }
.card-meta { display: flex; gap: 10px; align-items: center; margin: 0 0 6px 30px !important; font: 500 13px/1 var(--text); color: var(--ink-soft) !important; }
.featured { padding: 4px 9px 3px; border-radius: 999px; background: #FFD166; color: var(--ink); font: 16px/1 var(--hand); }
.card-title { margin: 6px 0 4px !important; font-size: clamp(36px, 3.4vw, 54px) !important; line-height: .95 !important; }
.card-title small { display: block; margin-top: 4px; font: 21px/1.1 var(--hand); color: var(--ink-soft); }
.paper-card .when { margin: 4px 0 14px !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.chips li { padding: 7px 12px 6px; border-radius: 9px; background: var(--ink); color: #FFFDF8; font: 500 14px/1 var(--text); }
.card-text { font-size: 17px; line-height: 1.6; color: var(--ink) !important; }
.card-note { font: 19px/1.2 var(--hand) !important; color: #6A4FD9 !important; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0 !important; }
.card-links a { font: 21px/1 var(--display); text-decoration-color: var(--tint); text-decoration-thickness: 5px; text-underline-offset: 1px; text-decoration-skip-ink: none; }
.papers.from-right .paper-card { animation: deal-r .45s var(--out); }
.papers.from-left .paper-card { animation: deal-l .45s var(--out); }
@keyframes deal-r { from { opacity: 0; transform: translateX(36px) rotate(2deg); } }
@keyframes deal-l { from { opacity: 0; transform: translateX(-36px) rotate(-2deg); } }
.project-dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 26px 8px 0; padding: 0; list-style: none; }
.project-dots button { padding: 6px 11px 5px; border-radius: 999px; background: rgb(255 253 248 / .9); font: 500 13px/1 var(--text); color: var(--ink); transition: background-color .15s var(--out); }
.project-dots button[aria-current="true"] { background: var(--ink); color: #FFFDF8; }
@media (hover: hover) { .project-dots button:hover { background: #FFFDF8; } .project-dots button[aria-current="true"]:hover { background: var(--ink); } }
[data-section="projects"] .panel .aside { margin: 14px 8px 0; color: var(--on-ground); }

/* ---------- skills blocks + books ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 7px 6px; margin: 0 0 20px; }
.badges img { height: 24px; width: auto; border-radius: 3px; }
.badges img:nth-child(3n) { rotate: -1.5deg; } .badges img:nth-child(4n+1) { rotate: 1.2deg; }
.book-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 16px; margin: 6px 0 0; padding: 0; list-style: none; }
.book-grid img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 5px 5px 2px; rotate: var(--r); box-shadow: 0 12px 20px -12px rgb(30 22 49 / .6); margin-bottom: 9px; }
.book-grid b { display: block; font: 500 14px/1.25 var(--text); }
.book-grid span { font: 16px/1.1 var(--hand); color: var(--ink-soft); }

@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  .chip-work { display: none; }
  .hero-title { margin-bottom: 8px; }
  .m-arrow { width: 72px; height: 48px; margin: -24px 0 0 -36px; }
  .m-arrow img { width: 60px; }
  [data-section="projects"] .panel { background: var(--paper); }
  .paper-card { padding: 28px 20px 22px; }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- records ---------- */
.albums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.albums button { position: relative; display: block; width: 100%; border-radius: 6px; transition: transform .2s var(--out); }
.albums img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; box-shadow: 0 8px 14px -10px rgb(30 22 49 / .6); }
.albums span { position: absolute; inset: auto 4px 4px; padding: 5px 6px 4px; border-radius: 5px; background: rgb(255 253 248 / .94); font: 500 11px/1.2 var(--text); text-align: left; opacity: 0; transform: translateY(4px); transition: opacity .15s var(--out), transform .2s var(--out); }
.albums span b { display: block; font-weight: 600; }
.albums button[aria-pressed="true"] { transform: rotate(-3deg) scale(1.04); }
.albums button[aria-pressed="true"] img { box-shadow: 0 0 0 3px var(--ink), 0 10px 16px -10px rgb(30 22 49 / .6); }
@media (hover: hover) { .albums button:hover { transform: translateY(-3px); } .albums button:hover span, .albums button:focus-visible span { opacity: 1; transform: none; } }
.albums button:active { transform: scale(.96); }

/* ---------- wins & keepsakes ---------- */
.keepsakes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 14px; margin: 4px 0 0; padding: 0; list-style: none; }
.keepsakes li { rotate: var(--r); }
.keepsakes img, .keepsakes .slot { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; margin-bottom: 8px; object-fit: cover; background: #fff; border-radius: 3px; box-shadow: 0 12px 20px -14px rgb(30 22 49 / .6); }
.keepsakes .slot { border: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); color: var(--ink-soft); font-size: 18px; }
.keepsakes b { display: block; font: 500 15px/1.3 var(--text); }
.keepsakes span:not(.slot) { font: 16px/1.2 var(--hand); color: var(--ink-soft); }

@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { .albums { grid-template-columns: repeat(3, 1fr); } .keepsakes { gap: 14px 10px; } }

/* music notes drifting up from the record */
.notes { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.notes img { position: absolute; width: calc(22px * var(--s)); margin: -20px 0 0 -11px; opacity: 0; animation: float-note 5.5s ease-out forwards; }
[data-section="offclock"] .notes img { filter: none; }
@keyframes float-note {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(.6); }
  25% { opacity: .32; }
  100% { opacity: 0; transform: translate(calc(var(--dx) * .5), -90px) rotate(calc(var(--rot) * .5)) scale(.9); }
}
/* featured star + wins on the project card */
.card-star { position: absolute; right: -22px; top: -26px; width: 72px; height: auto; rotate: 12deg; filter: drop-shadow(0 6px 8px rgb(30 22 49 / .25)); }
.card-wins { display: flex; align-items: flex-end; gap: 2px; margin: -6px 0 12px !important; }
.card-wins img { width: 34px; height: auto; }
.card-wins img:nth-child(2) { rotate: 8deg; }
.card-wins span { margin-left: 8px; font: 19px/1 var(--hand); color: #B8860B; }
.keepsakes .slot { font: 18px/1.2 var(--hand); text-align: center; padding: 10px; }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  .sheet-heading { font-size: clamp(28px, 8vw, 44px); }
  .sheet-title { top: 64%; }
  .keepsakes img, .keepsakes .slot { aspect-ratio: 4 / 3; }
}

/* the end of every panel offers the next stop instead of scroll-jacking to it */
.next-up { display: flex; align-items: center; gap: 12px; width: 100%; margin: 34px 0 0; padding: 18px 4px 4px; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent); font: 28px/1 var(--display); color: var(--ink); text-align: left; }
.next-up .hand { font: 18px/1 var(--hand); color: var(--ink-soft); }
.next-up img { width: 54px; margin-left: auto; filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg); transition: transform .2s var(--out); }
@media (hover: hover) { .next-up:hover img { transform: translateX(5px); } }
[data-section="projects"] .next-up { color: var(--on-ground); border-color: rgb(255 255 255 / .35); margin-inline: 8px; width: calc(100% - 16px); }
[data-section="projects"] .next-up .hand { color: var(--on-ground); opacity: .8; }
[data-section="projects"] .next-up img { filter: none; }
/* my own handwriting lives only on the front page */
.hero-note, .room-hint { font-family: var(--her-hand); }

.sheet-grip { display: none; }
/* ================= phone layout (redesign) =================
   Top: nav. Middle: the room, framed on the object. Bottom: a sheet that
   starts at ~46% height and can be pulled down to peek at the room. */
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  /* a small torn tab instead of a corner that eats the screen */
  .sheet { width: 54vw; }
  .sheet-title { left: 5%; top: 50%; rotate: -36deg; }
  .sheet-heading { font-size: clamp(22px, 6.6vw, 30px); }
  .sheet-note { display: none; }
  .topbar { padding-top: max(12px, env(safe-area-inset-top)); }
  .chip { min-height: 38px; padding: 6px 14px 4px; font-size: 17px; }
  .nav-cat img { width: 38px; }

  /* the sheet */
  .panel { height: 50dvh; transition: height .45s var(--out), transform .45s var(--out); padding-top: 0; }
  .panel::before { content: ''; position: sticky; top: 0; display: block; height: 22px; margin-bottom: -22px; background: linear-gradient(var(--paper) 60%, transparent); z-index: 1; }
  .panel-inner { padding: 26px 20px 88px; }
  .sheet-grip { position: fixed; left: 50%; bottom: calc(50dvh - 18px); z-index: 14; width: 64px; height: 30px; margin-left: -32px; display: grid; place-items: center; transition: bottom .45s var(--out); }
  .sheet-grip::after { content: ''; width: 42px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 28%, transparent); }
  body.peek .panel { height: 120px; }
  body.peek .sheet-grip { bottom: 102px; }
  .panel .lede { font-size: 18px; }

  /* steps bar: lighter, tucked under the sheet */
  .steps { padding: 6px 12px max(8px, env(safe-area-inset-bottom)); }
  .step img { width: 46px; }
  .step-home { font-size: 17px; }

  /* projects: arrows sit on the monitor's sides, below the tab */
  .m-arrow { width: 56px; height: 44px; margin: -22px 0 0 -28px; }
  .m-arrow img { width: 50px; }
  [data-section="projects"] .panel { background: var(--paper); }
  .paper-card { padding: 24px 18px 18px; }
  .card-title { font-size: 34px !important; }
  .card-star { width: 54px; right: -10px; top: -18px; }
  .papers { margin: 10px 2px 0; }

  /* home */
  .hero { top: 70px; left: 20px; right: 20px; }
  .hero-title { gap: 4px; }
  .hero-name { width: min(64vw, 300px); }
  .star-cat { flex-basis: 24%; width: 24%; }
  .hero-role { font-size: 15px; line-height: 1.45; max-width: 32ch; }
  .tour { white-space: nowrap; font-size: 21px; padding: 10px 18px 8px 22px; }
  .tour img { width: 46px; }
  .hotspot { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .hotspot img { width: 12px; }
  .hotspot::before { inset: 9px; animation: none; opacity: .7; }
}
/* never show the drawn cursor once someone touches the screen */
body.touched .cursor { display: none !important; }
body.touched, body.touched * { cursor: auto !important; }

/* ---------- menu (v2): cat home, three main doors, quieter rest ---------- */
.menu-sheet { padding: 0; overflow: hidden auto; border: 2.5px solid var(--ink); border-radius: 22px; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 2.5px solid var(--ink); background: #FFE7B8; }
.menu-home { display: flex; align-items: center; gap: 12px; font: 22px/1 var(--display); color: var(--ink); }
.menu-home img { width: 58px; rotate: -6deg; filter: drop-shadow(0 4px 6px rgb(30 22 49 / .25)); transition: rotate .35s var(--out); }
@media (hover: hover) { .menu-home:hover img { rotate: 6deg; } }
.menu-head .menu-close { margin: 0; }
.menu-main { margin: 0; padding: 0; list-style: none; }
.menu-main li + li, .menu-list li + li { border-top: 1.5px solid var(--ink); }
.menu-main button, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; color: var(--ink); transition: background-color .15s var(--out), padding .2s var(--out); }
.menu-main button { padding: 16px 20px; font: 34px/1 var(--display); }
.menu-main i, .menu-list i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); }
.menu-main button[aria-current="true"], .menu-list button[aria-current="true"] { background: color-mix(in srgb, var(--c) 35%, white); }
@media (hover: hover) { .menu-main button:hover, .menu-list button:hover { padding-left: 28px; } }
.menu-more { background: #F1ECE3; border-top: 2.5px solid var(--ink); }
.menu-list button { padding: 11px 20px; font: 20px/1 var(--display); }
.menu-list button:hover { background: color-mix(in srgb, var(--c) 25%, #F1ECE3); }
.menu-list small { display: none; }
.menu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0; padding: 14px 20px 18px; border-top: 1.5px solid var(--ink); }
.menu-hello { padding: 9px 16px 7px; border-radius: 999px; background: #F32B6E; color: #FFFDF8; font: 19px/1 var(--display) !important; text-decoration: none !important; }
.menu-foot a { font: 500 14px/1.3 var(--text); }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { .menu-sheet { top: 60px; } .menu-main button { font-size: 30px; padding: 14px 18px; } }
.chip-exp { rotate: 1deg; }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { .chip-exp { display: none; } }

/* each project card is its own coloured sheet */
.paper-card { background: var(--paper-card, #F7F4EF); transition: background-color .35s var(--out); }
.paper-back.b1 { background: var(--paper-b1, #F05F5F); transition: background-color .35s var(--out); }
.paper-back.b2 { background: var(--paper-b2, #6FA8FF); transition: background-color .35s var(--out); }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { [data-section="projects"] .panel { background: color-mix(in srgb, var(--ground) 18%, var(--paper)); } }

/* the demo, on the card itself */
.card-video { margin: -8px -8px 16px; padding: 7px; background: var(--ink); border-radius: 10px; box-shadow: 0 10px 20px -14px rgb(30 22 49 / .7); }
.card-video video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; background: #000; }
/* Menu stands apart from the nav links: its own colour, a little gap, an ink edge */
.chip-menu { margin-left: 10px; background: #FFD166; color: var(--ink); box-shadow: inset 0 0 0 2.5px var(--ink), 0 6px 16px -8px rgb(30 22 49 / .45); }
.chip-menu[aria-expanded="true"] { background: #FFC23D; }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { .chip-menu { margin-left: 4px; } }
/* About photos: one wide shot, then a pair */
.polaroid.wide-shot { width: 92%; margin-inline: auto; }
.polaroid.wide-shot img, .photo-pair img { aspect-ratio: 4 / 3; object-position: center 30%; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 6px; }
.photo-pair .polaroid { width: 100%; margin: 0; }
.photo-pair figcaption { font-size: 16px; }

/* About: winning moment with my trophy doodles on the corner */
.polaroid.won { position: relative; }
.won-trophies { position: absolute; right: -14px; top: -22px; display: flex; gap: 0; rotate: 10deg; filter: drop-shadow(0 4px 6px rgb(30 22 49 / .3)); }
.won-trophies img { width: 44px; height: auto; }
.won-trophies img + img { margin-left: -10px; rotate: 12deg; }
.polaroid.concert { width: 66%; margin-left: auto; }
.polaroid.concert img { aspect-ratio: 4 / 5; }
/* Fireline's photos, under its card */
.project-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 8px 0; }
.project-photos .polaroid { width: 100%; margin: 0; }
.project-photos img { aspect-ratio: 4 / 3; object-position: center 35%; }
.project-photos figcaption { font-size: 15px; }
/* travel blog: mixed shapes */
.trips .polaroid img { aspect-ratio: 4 / 5; }
.trips .polaroid:first-child img, .trips .polaroid:nth-child(4) img { aspect-ratio: 3 / 2; }
.trips .polaroid:nth-child(4) { grid-column: span 2; width: 86%; justify-self: center; }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { .won-trophies img { width: 36px; } .project-photos { margin-inline: 2px; gap: 8px; } }

/* front row seats: little playbills */
.playbills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 360px; margin: 4px 0 14px; padding: 0; list-style: none; }
.playbills li { background: #fff; border: 1px solid rgb(30 22 49 / .15); box-shadow: 0 10px 16px -12px rgb(30 22 49 / .6); }
.playbills li:nth-child(1) { rotate: -2deg; } .playbills li:nth-child(3) { rotate: 2deg; }
.pb-head { display: block; padding: 5px 2px 4px; background: #FFE500; text-align: center; line-height: 1; }
.pb-head b { display: block; font: 700 13px/1 Georgia, 'Times New Roman', serif; letter-spacing: .06em; color: #000; }
.pb-head small { display: block; margin-top: 2px; font: 500 6.5px/1 var(--text); letter-spacing: .08em; text-transform: uppercase; color: #222; }
.playbills img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }

/* About: monkey + concert side by side, then a peek at the travel blog */
.about-pair { align-items: start; margin-top: 8px; }
.about-pair img { aspect-ratio: 4 / 5 !important; object-position: center 25%; }
.see-more { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px auto; font: 22px/1 var(--display); color: var(--ink); }
.see-more img { width: 46px; filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg); transition: transform .2s var(--out); }
@media (hover: hover) { .see-more:hover img { transform: translateX(5px); } }
/* give the trophy doodles their own room above the photo */
.polaroid.won { margin-top: 44px; }
.won-trophies { top: -30px; right: -8px; z-index: 1; }

/* Education: where you'll find me, with real logos */
.orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px 12px; margin: 4px 0 6px; padding: 0; list-style: none; }
.orgs li { display: grid; gap: 7px; justify-items: center; text-align: center; }
.org-logo { display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 16px; background: var(--bg); box-shadow: inset 0 0 0 1.5px rgb(30 22 49 / .12), 0 8px 14px -10px rgb(30 22 49 / .5); }
.org-logo img { width: 86%; height: 86%; object-fit: contain; }
.orgs b { font: 500 13.5px/1.25 var(--text); color: var(--ink); text-wrap: balance; }
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) { .orgs { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; } .orgs b { font-size: 12.5px; } }

/* ================= portrait tablets =================
   Same stacked story as the phone (name, room, sheet from the bottom),
   but at tablet scale: full-size chips, a wider measure, labelled steps. */
@media (min-width: 760px) and (max-width: 1100px) and (orientation: portrait) {
  .topbar { padding-top: max(20px, env(safe-area-inset-top)); }
  .chip { min-height: 44px; padding: 6px 20px 4px; font-size: 21px; }
  .chip-work { display: inline-flex; }
  .nav-cat img { width: 48px; }

  .hero { top: 96px; left: var(--gutter); right: var(--gutter); }
  .hero-title { width: min(56vw, 520px); }
  .hero-name { width: 100%; }
  .star-cat { flex-basis: 26%; width: 26%; }
  .hero-role { font-size: 18px; max-width: 46ch; }
  .hero-note { display: block; margin: 10px 0 0; font-size: 21px; }
  .tour { bottom: max(36px, env(safe-area-inset-bottom)); font-size: 25px; padding: 12px 24px 10px 28px; }
  .tour img { width: 54px; }
  .hotspot { width: 44px; height: 44px; margin: -22px 0 0 -22px; }
  .hotspot img { width: 16px; }

  .sheet { width: 40vw; }
  .sheet-heading { font-size: clamp(34px, 5.2vw, 52px); }

  /* the sheet: centred, capped to a readable measure */
  .panel { left: max(24px, calc(50vw - 360px)); right: max(24px, calc(50vw - 360px)); }
  .panel-inner { padding: 32px 40px 104px; }
  .polaroid { width: 52%; }
  .polaroid.wide { width: 60%; }
  .steps { left: max(24px, calc(50vw - 360px)); right: max(24px, calc(50vw - 360px)); padding: 8px 20px max(12px, env(safe-area-inset-bottom)); }
  .step span { display: inline; font-size: 20px; }
  .step img { width: 54px; }
  .m-arrow { width: 84px; height: 56px; margin: -28px 0 0 -42px; }
  .m-arrow img { width: 72px; }
  .menu-sheet { left: auto; right: var(--gutter); width: min(420px, calc(100vw - 48px)); top: 76px; }
  .menu-main button { font-size: 34px; padding: 16px 20px; }
}

/* ================= short landscape (phones on their side) =================
   Keep the side-by-side story, shrunk to fit ~400px of height. */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar { padding: max(8px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .topnav { gap: 6px; }
  .chip { min-height: 36px; padding: 5px 13px 3px; font-size: 16px; }
  .chip-exp { display: none; }
  .nav-cat { width: 44px; height: 40px; } .nav-cat img { width: 36px; }
  .mark-name { width: 96px; }
  [data-view="section"] .mark-name { display: none; }   /* the torn tab already names the place */

  .hero { left: max(20px, env(safe-area-inset-left)); width: min(38vw, 330px); top: 54%; }
  .hero-title { margin-bottom: 8px; }
  .star-cat { flex-basis: 26%; width: 26%; }
  .hero-role { font-size: 14px; line-height: 1.4; }
  .hero-note { display: none; }
  .tour { margin-top: 14px; padding: 8px 16px 6px 18px; font-size: 19px; gap: 10px; }
  .tour img { width: 40px; }
  .room-hint { display: none; }
  .hotspot { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .hotspot img { width: 13px; }

  .sheet { width: clamp(220px, 27vw, 300px); }
  .sheet-title { top: 52%; }
  .sheet-heading { font-size: clamp(22px, 3.4vw, 30px); }
  .sheet-note { display: none; }

  .panel { top: 56px; bottom: 10px; right: max(12px, env(safe-area-inset-right)); width: 48vw; rotate: none; border-radius: 18px; }
  .panel-inner { padding: 20px 22px 24px; }
  .panel .lede { font-size: 17px; }
  .polaroid { width: 56%; }

  /* steps: a small paper pill bottom-left, clear of the panel */
  .steps { left: max(12px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); gap: 10px; padding: 0 14px; border-radius: 999px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 24px -14px rgb(30 22 49 / .6); }
  .step { min-height: 44px; }
  .step span { display: none; }
  .step img { width: 42px; filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg) !important; }
  .step-home { font-size: 16px; }
  .m-arrow { width: 56px; height: 44px; margin: -22px 0 0 -28px; }
  .m-arrow img { width: 48px; }
  .menu-sheet { top: 54px; max-height: calc(100dvh - 64px); }
  .menu-main button { font-size: 26px; padding: 10px 18px; }
}

/* ================= projects pager =================
   An ink strip inside the projects panel, right under the photos: it flips
   projects; the paper steps bar at the bottom walks to other rooms. */
.project-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 22px 8px 0; padding: 2px 6px;
  border-radius: 999px; background: var(--ink); color: var(--paper);
  box-shadow: 0 14px 28px -16px rgb(30 22 49 / .7);
}
.pp-btn { display: grid; place-items: center; width: 60px; height: 48px; border-radius: 999px; transition: transform .2s var(--out); }
.pp-btn img { width: 50px; }
@media (hover: hover) { .pp-prev:hover { transform: translateX(-3px); } .pp-next:hover { transform: translateX(3px); } }
.pp-btn:active { transform: scale(.94); }
.pp-btn:focus-visible { outline-color: var(--paper); }
.pp-now { margin: 0 !important; flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; text-align: center; color: var(--paper) !important; }
.pp-count { font: 15px/1 var(--hand); opacity: .85; }
.pp-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 21px/1.05 var(--display); font-weight: 400; }
.project-pager + .aside { margin-top: 12px; text-align: center; }

/* phones + portrait tablets: the steps say where they go (label under each arrow). */
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  /* the sheet is paper here, not the purple field: ink, not the field's white */
  [data-section="projects"] .panel .aside, [data-section="projects"] .next-up { color: var(--ink-soft); border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
  [data-section="projects"] .next-up { color: var(--ink); }
  [data-section="projects"] .next-up .hand { color: var(--ink-soft); opacity: 1; }
  [data-section="projects"] .next-up img { filter: brightness(0) saturate(100%) invert(9%) sepia(19%) saturate(2400%) hue-rotate(225deg); }
  .pp-title { font-size: 19px; }
  .step-prev, .step-next { flex-direction: column; gap: 2px; min-width: 64px; }
  .step-next { flex-direction: column-reverse; }
  .step span { display: block; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 14px/1 var(--hand); color: var(--ink-soft); }
  .step img { width: 40px; }
}
@media (min-width: 760px) and (max-width: 1100px) and (orientation: portrait) {
  .step span { font-size: 17px; }
  .step img { width: 50px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .pp-btn { width: 48px; height: 44px; } .pp-btn img { width: 40px; }
  .pp-count { font-size: 13px; } .pp-title { font-size: 17px; }
}

/* experience: the employer's logo as a small sticker beside the date */
.timeline li:has(.exp-logo) { padding-right: 0; }
.exp-logo { float: right; display: grid; place-items: center; margin: -4px 0 6px 12px; padding: 6px 10px; min-height: 44px; border-radius: 10px 12px 9px 13px; background: #fff; box-shadow: 0 8px 18px -12px rgb(30 22 49 / .6); rotate: 2deg; }
.timeline li:nth-child(2n) .exp-logo { rotate: -2.5deg; }
.exp-logo img { width: auto; max-width: 128px; max-height: 32px; }

/* ---------- phones: the sheet only has the lower half of the screen, so everything
   inside it is set a size smaller than on desktop. Desktop is untouched. ---------- */
@media (max-width: 759px) and (min-height: 501px), (max-width: 1100px) and (orientation: portrait) {
  .sheet-heading { font-size: clamp(26px, 7.6vw, 34px); }
  .panel-inner { padding: 18px 18px 96px; }
  .panel p { font-size: 14.5px; line-height: 1.55; }
  .panel .lede { font-size: 16.5px; line-height: 1.45; }
  .panel h3 { font-size: 20px; }
  .panel h3.hand { margin: 22px 0 10px; font-size: 19px; }
  .panel .aside { margin-top: 18px; font-size: 16px; }
  .when { font-size: 16px !important; }
  .next-up { margin-top: 26px; padding-top: 14px; font-size: 22px; }
  .next-up img { width: 44px; }
  .see-more { font-size: 18px; }

  /* photos */
  .polaroid { width: 56%; padding: 7px 7px 6px; margin-bottom: 16px; }
  .polaroid.wide-shot { width: 60%; }
  .polaroid figcaption { padding-top: 6px; font-size: 15px; }
  .photo-pair, .project-photos { gap: 8px; margin-top: 16px; }
  .photo-pair figcaption, .project-photos figcaption { font-size: 13px; }
  .won-trophies img { width: 30px; }

  /* projects */
  .paper-card { padding: 20px 16px 16px; }
  .clip { left: 16px; top: -20px; width: 22px; height: 54px; }
  .card-star { right: -10px; top: -16px; width: 46px; }
  .card-meta { margin-left: 22px !important; font-size: 11px; }
  .card-title { font-size: 30px !important; }
  .card-title small { font-size: 16px; }
  .card-wins { margin-bottom: 10px !important; }
  .card-wins img { width: 24px; }
  .card-wins span { font-size: 15px; }
  .chips { gap: 6px; margin-bottom: 12px; }
  .chips li { padding: 5px 9px 4px; font-size: 12px; border-radius: 7px; }
  .card-text { font-size: 14.5px; line-height: 1.55; }
  .card-note { font-size: 15px !important; }
  .card-links a { font-size: 17px; }

  /* books: three across, like a shelf */
  .book-grid { grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
  .book-grid img { margin-bottom: 6px; }
  .book-grid b { font-size: 12px; }
  .book-grid span { font-size: 13px; }

  /* skills, education, experience */
  .badges { gap: 5px 4px; margin-bottom: 14px; }
  .badges img { height: 18px; }
  .panel .skill-line { font-size: 14px; }
  .school { padding: 12px 14px 4px; margin-bottom: 10px; }
  .plain li { padding: 7px 2px 6px; font-size: 14px; }
  .plain li span { font-size: 14px; }
  .orgs b { font-size: 12px; }
  .moments b { font-size: 14.5px; }

  /* off the clock */
  .shows { gap: 6px; }
  .shows button { padding: 5px 10px 4px; font-size: 12.5px; }
  .albums { grid-template-columns: repeat(4, 1fr); gap: 7px; }

  /* say hello */
  .big-link { font-size: 19px; }
  .contact-list a { padding: 11px 4px; font-size: 19px; }
  .contact-list a span { font-size: 14px; }
}
