/* Ella Grace Park — portfolio */
:root {
  --ink: #111;
  --rule: #d9d9d9;
  --muted: #8a8a8a;
  --paper: #fff;
  --page: #f3f3f1;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Geist", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------- HOME: the 1296 × 864 board, scaled to fit ---------- */

.home {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.board-wrap { position: relative; }

.board {
  position: absolute;
  top: 0; left: 0;
  width: 1296px;
  height: 864px;
  transform-origin: 0 0;
}

.board > * { position: absolute; }

/* connector lines */
.links { left: 0; top: 0; width: 1296px; height: 864px; pointer-events: none; }
.links line {
  stroke: var(--ink);
  stroke-width: 1.5;
  transition: opacity .35s var(--ease), stroke-width .35s var(--ease);
}
.links .tech  { stroke-dasharray: none; }
.links .sound { stroke-dasharray: 8 6; }
.links .daily { stroke-dasharray: 2 4; }

/* project tiles */
.proj { width: 150px; display: block; }
.proj .thumb {
  width: 150px; height: 150px;
  background: var(--paper);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.proj .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.proj .label {
  position: absolute;
  top: 158px; left: 0;
  font-size: 16px;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.proj .label .arrow {
  display: inline-block;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
/* tile moves between spots (set by script, see HOME_HOVER.md) */
.proj { transition: left .45s var(--ease), top .45s var(--ease); }
.board.no-anim .proj { transition: none; }
/* middle tile: label right-aligned to the tile */
.proj.is-mid .label { left: auto; right: 0; }
/* paper box behind names so lines stop behind the text */
.proj .label { background: var(--paper); padding: 0 4px; margin: 0 -4px; }

.legend-row, .name-link { transition: opacity .35s var(--ease); }

/* hover: lift tile, zoom image, reveal arrow */
.proj:hover .thumb,
.proj:focus-visible .thumb {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -12px rgba(0,0,0,.35);
}
.proj:hover .thumb img,
.proj:focus-visible .thumb img { transform: scale(1.06); }
.proj:hover .label .arrow,
.proj:focus-visible .label .arrow { opacity: 1; transform: none; }

/* focus mode: when something is hovered, dim what isn't related */
.proj .thumb img, .proj .label { transition: opacity .35s var(--ease), transform .6s var(--ease); }
.board.is-focus .proj:not(.on) .thumb img,
.board.is-focus .proj:not(.on) .label { opacity: .22; }
.board.is-focus .links line:not(.on) { opacity: .12; }
.board.is-focus .links line.on { stroke-width: 2.25; }
.board.is-focus .legend-row:not(.on) { opacity: .3; }

/* legend */
.legend {
  left: 907px; top: 97px; width: 297px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.legend h2 { font-size: 20px; font-weight: 400; }
.legend-row {
  display: flex; align-items: center; gap: 20px;
  font-size: 16px;
  white-space: nowrap;
  cursor: default;
  background: none; border: 0; font: inherit; color: inherit; text-align: left;
}
.legend-row svg { width: 72px; height: 20px; flex: none; }
.legend-row svg line { stroke: var(--ink); stroke-width: 1.5; }

/* name → about */
.name-link {
  left: 687px; top: 474px; width: 564px; height: 93px;
  cursor: pointer;
}
.name-link img {
  width: 564px; height: auto;
  transition: transform .5s var(--ease), opacity .3s;
}
.name-link .hint {
  position: absolute;
  right: 0; top: -26px;
  font-size: 14px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.name-link::after {
  content: "";
  position: absolute; left: 0; bottom: -8px;
  height: 1.5px; width: 100%;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .5s var(--ease);
}
.name-link:hover img, .name-link:focus-visible img { transform: translateX(6px); }
.name-link:hover .hint, .name-link:focus-visible .hint { opacity: 1; transform: none; }
.name-link:hover::after, .name-link:focus-visible::after { transform: scaleX(1); }

/* info table */
.info-rule { left: 678px; width: 564px; height: 0; border-top: 1px solid var(--rule); }
.info-k { left: 678px; font-size: 20px; font-weight: 600; }
.info-v { left: 907px; width: 317px; font-size: 20px; line-height: 1.2; }

/* ---------- HOME on small screens: stacked layout ---------- */
.home-mobile { display: none; }

@media (max-width: 760px) {
  .home { display: none; }
  .home-mobile { display: block; padding: 40px 22px 56px; }
  .home-mobile .name-link-m { display: block; margin-bottom: 8px; }
  .home-mobile .name-link-m img { width: 100%; max-width: 420px; }
  .home-mobile .name-link-m span { font-size: 14px; color: var(--muted); }
  .home-mobile .grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 28px 18px;
    margin: 36px 0 40px;
  }
  .home-mobile .grid a { display: block; font-size: 16px; }
  .home-mobile .grid img { width: 100%; aspect-ratio: 1; object-fit: cover; margin-bottom: 8px; }
  .home-mobile dl { display: grid; grid-template-columns: 90px 1fr; border-top: 1px solid var(--rule); }
  .home-mobile dt, .home-mobile dd { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
  .home-mobile dt { font-weight: 600; }
}

/* ---------- INNER PAGES: shared top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px clamp(18px, 5.5vw, 72px);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .home-link { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.topbar .home-link .back { display: inline-block; transition: transform .3s var(--ease); }
.topbar .home-link:hover .back { transform: translateX(-4px); }
.topbar nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a {
  font-size: 15px; color: var(--muted);
  position: relative; padding: 2px 0;
  transition: color .25s;
}
.topbar nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--ink); }
.topbar nav a:hover::after, .topbar nav a[aria-current="page"]::after { transform: scaleX(1); }

@media (max-width: 760px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topbar nav { justify-content: flex-start; gap: 14px; }
}

/* ---------- PROJECT PAGES ---------- */

/* One continuous white page: slides run full width, inside the same side margin as the top bar. */
.project { --margin: clamp(18px, 5.5vw, 72px); background: var(--paper); min-height: 100vh; }

.slides {
  padding: clamp(16px, 3vw, 40px) var(--margin) 0;
  display: flex; flex-direction: column; gap: clamp(16px, 2.5vw, 40px);
}
.slide {
  background: var(--paper);
  cursor: zoom-in;
  border: 0; padding: 0; display: block; width: 100%;
}
.slide img { width: 100%; height: auto; aspect-ratio: 3 / 2; }

.pager {
  padding: clamp(28px, 5vw, 64px) var(--margin) clamp(40px, 6vw, 80px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.pager a {
  display: block;
  padding: 22px 0 0;
  border-top: 1px solid var(--rule);
  transition: border-color .3s;
}
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.pager span { font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; }
.pager .next { text-align: right; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(17,17,17,.92);
  display: none; place-items: center;
  padding: 2vw;
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 96vh; background: #fff; }
.lightbox button {
  position: absolute; top: 14px; right: 18px;
  background: none; border: 0; color: #fff; font: inherit; font-size: 15px; cursor: pointer;
}

/* ---------- ABOUT ---------- */

.about {
  max-width: 1296px; margin: 0 auto;
  padding: clamp(32px, 6vw, 73px) clamp(18px, 5.5vw, 72px) clamp(48px, 7vw, 96px);
}
.about-intro {
  display: grid;
  grid-template-columns: 1fr 215px;
  gap: 40px;
  padding: 50px 0 64px;
}
.about-intro h1 { font-size: 24px; font-weight: 600; }
.about-intro .statement {
  font-size: clamp(22px, 2.2vw, 28px); line-height: 1.35;
  max-width: 520px;
  margin: clamp(80px, 18vw, 260px) 0 0 clamp(0px, 18vw, 238px);
}
.about-intro .photos { display: flex; flex-direction: column; gap: 4px; }
.about-intro .photos img { width: 215px; }

.cv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; border-top: 1px solid var(--ink); padding-top: 22px; }
.cv-head h2 { font-size: clamp(36px, 5vw, 64px); font-weight: 400; letter-spacing: -.02em; line-height: 1.05; }

.cv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(24px, 3vw, 48px); margin-top: 28px; }
.cv section { border-top: 1px solid var(--rule); padding: 18px 0 26px; }
.cv h3 { font-size: 18px; font-weight: 600; margin-bottom: 14px; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 16px; }
.kv dt { font-weight: 600; }
.kv a { border-bottom: 1px solid var(--rule); transition: border-color .25s; }
.kv a:hover { border-color: var(--ink); }

.small-kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; font-size: 14px; }

.entry { display: grid; grid-template-columns: 140px 1fr; gap: 0 16px; margin-bottom: 18px; }
.entry .when { font-size: 14px; }
.entry .when small { display: block; font-size: 13px; color: #444; }
.entry .what { font-size: 18px; }
.entry .what p { font-size: 14px; margin-top: 2px; }
.entry ul { font-size: 14px; margin-top: 6px; padding-left: 18px; }
.entry li { margin-bottom: 2px; }

@media (max-width: 860px) {
  .cv { grid-template-columns: 1fr; }
  .about-intro { grid-template-columns: 1fr; }
  .about-intro .statement { margin: 28px 0 0; }
  .about-intro .photos { flex-direction: row; overflow-x: auto; }
  .about-intro .photos img { width: 200px; flex: none; }
  .kv, .small-kv, .entry { grid-template-columns: 110px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- VIDEO (project pages) ---------- */
.video { background: var(--paper); }
.video video, .video .embed { width: 100%; background: #000; display: block; }
.video .embed { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { font-size: 14px; margin-top: 12px; }
.video .full-film { margin-left: 10px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.video .full-film:hover { border-bottom-width: 2px; }

/* ---------- PROJECT SHEETS: real text + images placed exactly like the Figma slides ----------
   Each .sheet is one slide. Children use Figma px inside the 1296 x 864 frame. The sheet shows
   x 72-1224 (the slide's content area) from y 72 down to --h px, and the script in the page
   scales it to the page width (sets --k), like the home board. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sheets {
  padding: clamp(16px, 3vw, 40px) var(--margin) 0;
  display: flex; flex-direction: column; gap: clamp(40px, 6vw, 96px);
}
.sheets .video { margin: 0; }
.sheet { position: relative; width: 100%; aspect-ratio: 1152 / var(--h); }
.sheet-in {
  position: absolute; left: 0; top: 0; width: 1296px; height: 864px;
  transform-origin: 0 0; transform: scale(var(--k, 1)) translate(-72px, -72px);
}
.sheet .a { position: absolute; margin: 0; color: var(--ink); }
.sheet .w { color: #fff; }

/* type (sizes from Figma) */
.sheet .h1 { font-size: 72px; font-weight: 600; line-height: 1.1; }
.sheet .h2 { font-size: 24px; font-weight: 600; line-height: 1.4; }
.sheet .k20 { font-size: 20px; font-weight: 600; line-height: 1.4; }
.sheet .v20 { font-size: 20px; line-height: 1.4; }
.sheet .k16 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.sheet .v18 { font-size: 18px; line-height: 1.4; }
.sheet .cap16 { font-size: 16px; line-height: 1.4; }
.sheet .part { font-size: 15px; width: 166px; }
.sheet .small { font-size: 13px; line-height: 1.4; width: 166px; }
.sheet .list { font-size: 13px; width: 166px; }
.sheet .t13 { font-size: 13px; }
.sheet .step { font-size: 14px; line-height: 1.3; }
.sheet .step b, .sheet .step-n { font-size: 14px; font-weight: 500; }

/* lines, panels, shapes */
.sheet .rule { height: 0; border-top: 1px solid rgba(209,209,209,.35); transform: translateY(-1px); }
.sheet .rule--panel { border-top-color: rgba(255,255,255,.175); }
.sheet .panel { background: #000; }
.sheet .box { border: 1px solid #fff; }
.sheet .num {
  width: 19px; height: 19px; border-radius: 50%; background: #000; color: #fff;
  font-size: 11px; font-weight: 500; display: grid; place-items: center;
}
.sheet .cube {
  width: 68px; height: 68px; border: 1px solid #fff; border-radius: 4px; color: #fff;
  display: grid; place-items: center; font-size: 10px; font-weight: 500; text-transform: uppercase;
}
.sheet .cube.on { background: #fff; color: #000; }
.sheet .pill {
  height: 24px; border: 1px solid #fff; border-radius: 14px; color: #fff;
  font-size: 13px; display: flex; align-items: center; padding-left: 10px;
}
.sheet .pill.fill { background: #fff; color: #111; padding-left: 11px; }
.sheet .search {
  border: 1px solid #fff; border-radius: 14px; color: #fff; font-size: 13px;
  display: flex; align-items: center; padding-left: 12px;
}
.sheet .search::after {   /* divider + magnifier at the right end */
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 28px; border-left: 1px solid #fff;
  background: no-repeat 50% 50% / 13px url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 14 14%27 fill=%27none%27 stroke=%27white%27%3E%3Ccircle cx=%275.5%27 cy=%275.5%27 r=%275%27/%3E%3Cpath d=%27M9 9l3.5 3.5%27/%3E%3C/svg%3E");
}

/* photos: fill their Figma box, click to enlarge */
.sheet .zoom { border: 0; padding: 0; background: none; cursor: zoom-in; overflow: hidden; }
.sheet .zoom img { width: 100%; height: 100%; object-fit: cover; }
.sheet .zoom.round { border-radius: 10px; }

/* thin line halfway between sections */
.sheets { --gap: clamp(56px, 8vw, 128px); gap: var(--gap); }
.sheets > * { position: relative; }
.sheets > * + *::before {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--gap) / -2);
  border-top: 1px solid var(--rule);
}

/* ---------- PROJECT INTRO (screen layout) ----------
   Same type and lines as the slide, scaled by --k (page width / 1152, set by the page script).
   The picture is as tall as the window allows; the facts end on its bottom edge. */
.intro {
  --pic-h: min(calc(640px * var(--k, 1)),
               calc(100svh - 71px - clamp(16px, 3vw, 40px) - 56px * var(--k, 1)));
  display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(24px * var(--k, 1));
}
.intro-text { display: flex; flex-direction: column; justify-content: space-between; gap: calc(32px * var(--k, 1)); }
.intro-title { font-size: calc(72px * var(--k, 1)); font-weight: 600; line-height: 1.1; margin-top: calc(-8px * var(--k, 1)); }
.intro-facts {
  display: grid; grid-template-columns: calc(144px * var(--k, 1)) 1fr;
  font-size: calc(20px * var(--k, 1)); line-height: 1.4;
  border-top: 1px solid rgba(209,209,209,.35);
}
.intro-facts dt, .intro-facts dd { padding: calc(12px * var(--k, 1)) 0; border-bottom: 1px solid rgba(209,209,209,.35); }
.intro-facts dt { font-weight: 600; }
.intro-fig { position: relative; margin: 0; }
.intro-fig .zoom { display: block; width: 100%; height: var(--pic-h); border: 0; padding: 0; background: none; cursor: zoom-in; }
.intro-fig img { width: 100%; height: 100%; object-fit: cover; }
.intro-fig figcaption { position: absolute; top: 100%; left: 0; margin-top: calc(12px * var(--k, 1)); font-size: calc(16px * var(--k, 1)); line-height: 1.4; }

@media (max-width: 760px) {
  .intro { --k: .9 !important; grid-template-columns: 1fr; row-gap: 24px; }
  .intro-fig .zoom { height: auto; aspect-ratio: 564 / 640; }
  .intro-fig figcaption { position: static; }
}

/* section dividers: darker so they read on screen */
.sheets > * + *::before { border-top-color: rgba(17,17,17,.28); }
/* video caption matches the other captions (16px in Figma, scaled like the rest) */
.sheets .video figcaption { font-size: calc(16px * var(--k, 1)); line-height: 1.4; margin-top: calc(12px * var(--k, 1)); }

/* intro picture: never cropped. It keeps its 564 x 640 shape and shrinks to fit the window height;
   the text column takes the remaining width. */
.intro { grid-template-columns: 1fr auto; column-gap: calc(48px * var(--k, 1)); }
.intro-fig .zoom { width: calc(var(--pic-h) * 564 / 640); }
.intro-fig img { object-fit: contain; }
@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr; }
  .intro-fig .zoom { width: 100%; }
}

/* ---------- SIDE MENU on project pages ----------
   A narrow column on the left that stays put while you scroll. Each section's title appears
   once you reach that section; the current one is black with a short line in front. */
.case-layout {
  display: grid; grid-template-columns: clamp(150px, 13vw, 200px) minmax(0, 1fr);
  column-gap: clamp(24px, 3vw, 48px); padding-left: var(--margin);
}
.case-layout .sheets { padding-left: 0; }
.toc { position: sticky; top: calc(71px + clamp(16px, 3vw, 40px)); align-self: start; padding-top: clamp(16px, 3vw, 40px); }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.toc li { visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s; }
.toc li.in { visibility: visible; opacity: 1; transform: none; }
.toc a { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.3; color: var(--muted); transition: color .25s; }
.toc a::before { content: ""; width: 0; height: 1.5px; background: var(--ink); transition: width .3s var(--ease); flex: none; }
.toc li.on a, .toc a:hover, .toc a:focus-visible { color: var(--ink); }
.toc li.on a { font-weight: 600; }
.toc li.on a::before { width: 14px; }
html { scroll-behavior: smooth; }
[data-toc] { scroll-margin-top: calc(71px + 24px); }
@media (max-width: 900px) {
  .case-layout { display: block; padding-left: 0; }
  .case-layout .sheets { padding-left: var(--margin); }
  .toc { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* upcoming sections: shown faintly (still clickable); reached: grey; current: black + line */
.toc li { visibility: visible; opacity: .3; transform: none; }
.toc li.in { opacity: 1; }
.toc li:hover, .toc li:focus-within { opacity: 1; }
/* side menu: larger words */
.toc ol { gap: 14px; }
.toc a { font-size: 18px; }
.toc li.on a::before { width: 16px; }
.toc li { opacity: .5; } .toc li.in { opacity: 1; }

/* videos: small enough that the video AND its caption fit on screen together */
.sheets .video video {
  width: auto; max-width: 100%;
  max-height: calc(100svh - 71px - 72px - 56px * var(--k, 1));
}
/* section dividers: darker */
.sheets > * + *::before { border-top-color: rgba(17,17,17,.6); }

/* embedded films (YouTube): 16:9, sized so the film and its caption fit on screen together */
.sheets .video .embed {
  width: min(100%, calc((100svh - 71px - 72px - 56px * var(--k, 1)) * 16 / 9));
}

/* ---------- HOME: the project you hover or tab to stays; the others dim ---------- */
.proj .thumb img, .proj .label { transition: transform .45s var(--ease), opacity .35s var(--ease); }
.board.is-pick .proj:not(.is-mid) .thumb img,
.board.is-pick .proj:not(.is-mid) .label { opacity: .25; }

/* ---------- HOME: smaller name, plain role line, board centred ----------
   Right column: x 790-1150 (360 wide). The project grid moved 91 px right (see HOME_HOVER.md). */
.legend { left: 853px; top: 115px; }
.name-link { left: 790px; top: 528px; width: 360px; height: 60px; }
.name-link img { width: 360px; }

/* ---------- ABOUT: CV under the intro ---------- */
.cv-section { border-top: 1px solid var(--ink); }
.cv-section .cv { margin-top: 0; }
/* no single words hanging on their own line */
.cv dd, .cv .what, .cv li, .cv p { text-wrap: pretty; }
/* narrower date/label column so titles and lists fit on one line */
.cv-section .kv, .cv-section .small-kv, .cv-section .entry { grid-template-columns: 104px 1fr; column-gap: 16px; }
.cv-section .entry .what { font-size: 17px; }
/* About photos: same width, edges lined up */
.about-intro .photos img { width: 215px; height: auto; display: block; }
/* About photos: four equal tiles in one column, label as real text */
.about-intro .photos { gap: 4px; }
.about-intro .photos figure { position: relative; margin: 0; width: 215px; }
.about-intro .photos img { width: 100%; height: auto; aspect-ratio: 576 / 341; object-fit: cover; }
.about-intro .photos figcaption {
  position: absolute; left: 0; top: 10px; background: var(--paper);
  font-size: 12px; line-height: 1.2; padding: 1px 8px 1px 4px;
}
@media (max-width: 860px) { .about-intro .photos figure { width: 200px; flex: none; } }

/* HOME: Role / Focus table under the name, scaled down to match the smaller name (x 790-1150) */
.info-rule { left: 790px; width: 360px; }
.info-k { left: 790px; font-size: 15px; }
.info-v { left: 880px; width: 270px; font-size: 15px; line-height: 1.25; }
.about-intro .photos img.tall { aspect-ratio: auto; }   /* cockade: whole photo, not cropped */

/* ---------- HOME: screen layout using the full height ----------
   Diagram x 60-760, y 36-828 (tiles 180). Right column x 840-1236:
   legend at the top, name + Role / Focus at the bottom. See HOME_HOVER.md. */
.proj { width: 180px; }
.proj .thumb { width: 180px; height: 180px; }
.proj .label { top: 188px; font-size: 17px; }
.legend { left: 939px; top: 36px; }
.name-link { left: 840px; top: 663px; width: 396px; height: 66px; }
.name-link img { width: 396px; }
.info-rule { left: 840px; width: 396px; }
.info-k { left: 840px; font-size: 16px; }
.info-v { left: 930px; width: 306px; font-size: 16px; line-height: 1.25; }
/* About: less white space at the top */
.about { padding-top: clamp(24px, 3vw, 40px); }
.about-intro { padding-top: 0; }

/* top bar: arrow + handwritten name as the link home */
.topbar .home-link { gap: 12px; }
.topbar .home-name { height: 30px; width: auto; transition: transform .35s var(--ease); }
.topbar .home-link:hover .home-name, .topbar .home-link:focus-visible .home-name { transform: translateX(3px); }
/* home link: no arrow; underline draws in on hover, like the menu links */
.topbar .home-link { position: relative; padding-bottom: 4px; }
.topbar .home-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.topbar .home-link:hover::after, .topbar .home-link:focus-visible::after { transform: scaleX(1); }
.topbar .home-link:hover .home-name, .topbar .home-link:focus-visible .home-name { transform: none; }
/* top bar: bigger titles */
.topbar nav { gap: 26px; }
.topbar nav a { font-size: 18px; }
.topbar .home-name { height: 34px; }
@media (max-width: 760px) { .topbar nav { gap: 16px; } .topbar nav a { font-size: 16px; } }

/* ---------- top bar scrolls away; only the name + section menu stay ---------- */
.topbar { position: relative; top: auto; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper);
          border-bottom: 1px solid var(--ink); }
.toc { top: clamp(16px, 3vw, 40px); }
[data-toc] { scroll-margin-top: 24px; }
/* The name scrolls into the menu: --bar-p goes 0 -> 1 while the top bar scrolls away (set by the page script).
   The name fades/slides in and the titles ease down by the same amount, so nothing jumps. */
.toc { --tocpad: clamp(16px, 3vw, 40px); padding-top: var(--tocpad); }
.toc-home {
  position: absolute; left: 0; top: var(--tocpad); display: block;
  opacity: var(--bar-p, 0); transform: translateY(calc((1 - var(--bar-p, 0)) * -12px));
  pointer-events: none;
}
html[style*="--bar-p: 1"] .toc-home { pointer-events: auto; }
.toc-home img { height: 30px; width: auto; max-width: 100%; object-fit: contain; object-position: left; display: block; }
.toc ol { transform: translateY(calc(var(--bar-p, 0) * 58px)); }

/* ---------- bottom: arrows + back to top ---------- */
.pager { grid-template-columns: 1fr auto 1fr; align-items: end; }
.pager .to-top { border: 0; padding: 22px 0 0; font-size: 16px; color: var(--muted); align-self: end; position: relative; }
.pager .to-top:hover, .pager .to-top:focus-visible { color: var(--ink); transform: none; }
.pager { column-gap: 0; } .pager .to-top { border-top: 1px solid var(--rule); padding: 22px 16px 0; } .pager .to-top:hover, .pager .to-top:focus-visible { border-color: var(--rule); }
/* menu sticks 13px from the top: 71 (bar) - 58 (name space), so the titles never move while the name scrolls in */
.toc { top: 13px; }

/* ---------- bottom: "Back to top" centred above the line, arrows on the line ---------- */
.pager { grid-template-columns: 1fr 1fr; column-gap: 0; row-gap: 28px; }
.pager .to-top {
  grid-column: 1 / -1; grid-row: 1; justify-self: center;
  border: 0; padding: 0 0 4px; font-size: 17px; color: var(--ink); position: relative;
}
.pager .to-top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.pager .to-top:hover::after, .pager .to-top:focus-visible::after { transform: scaleX(1); }
.pager a:not(.to-top) { grid-row: 2; }

/* ---------- HOME: the name writes itself in when the page opens ---------- */
@keyframes write-name {
  from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to   { -webkit-mask-position: 0 0;    mask-position: 0 0; }
}
.name-link img, .name-link-m img {
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
          mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 220% 100%; mask-size: 220% 100%;
  -webkit-mask-position: 0 0; mask-position: 0 0;
  animation: write-name 2.2s cubic-bezier(.45,.05,.35,1) .3s both;
}
@media (prefers-reduced-motion: reduce) {
  .name-link img, .name-link-m img { animation: none; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- PROJECT PAGES: the top bar morphs into the side menu while you scroll ----------
   --bar-p: 0 (top of page) -> 1 (bar scrolled away). The bar's line slides down and shrinks
   to the menu's width under the name; the name moves from the bar into the menu. */
:root { --m: clamp(18px, 5.5vw, 72px); --tocw: clamp(150px, 13vw, 200px); }
.morph-name, .morph-line { display: none; }
@media (min-width: 901px) {
  body.project .topbar { border-bottom-color: transparent; }
  body.project .topbar .home-name { visibility: hidden; }     /* the moving copy stands in for it */
  body.project .toc-home { display: none; }
  .morph-name {
    display: block; position: fixed; z-index: 30; left: var(--m);
    top: calc(var(--n0, 18px) + (53px - var(--n0, 18px)) * var(--bar-p, 0));
    padding-bottom: 4px;
  }
  .morph-name img { display: block; height: calc(34px - 4px * var(--bar-p, 0)); width: auto; }
  .morph-name::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink);
    transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
  }
  .morph-name:hover::after { transform: scaleX(1); }
  .morph-line {
    display: block; position: fixed; z-index: 30; height: 0; border-top: 1px solid var(--ink);
    top: calc(var(--l0, 70px) + (97px - var(--l0, 70px)) * var(--bar-p, 0));
    left: calc(var(--m) * var(--bar-p, 0));
    width: calc(100% - (100% - var(--tocw)) * var(--bar-p, 0));
  }
}
/* name writing: slower, steady pace, narrower "pen tip" edge */
.name-link img, .name-link-m img {
  -webkit-mask-image: linear-gradient(90deg, #000 48%, transparent 52%);
          mask-image: linear-gradient(90deg, #000 48%, transparent 52%);
  animation: write-name 4.8s cubic-bezier(.3,.1,.5,.95) .4s both;
}
@media (min-width: 901px) {
  /* the line fades out in the first quarter of its move and only reappears in the last fifth,
     once it is short and inside the menu column, so it never cuts through text */
  .morph-line { opacity: max(calc(1 - var(--bar-p, 0) * 4), calc((var(--bar-p, 0) - .8) * 5)); }
}
@media (min-width: 901px) {
  /* narrow faster than it moves (reaches menu width at 70% of the scroll), then fade back in */
  .morph-line {
    --pw: min(1, calc(var(--bar-p, 0) * 1.43));
    left: calc(var(--m) * var(--pw));
    width: calc(100% - (100% - var(--tocw)) * var(--pw));
    opacity: max(calc(1 - var(--bar-p, 0) * 4), calc((var(--bar-p, 0) - .75) * 4));
  }
}

/* ---------- HOME: the name is drawn stroke by stroke (vector pen strokes from Figma) ---------- */
.name-link img, .name-link-m img { animation: none; -webkit-mask-image: none; mask-image: none; }
.name-svg { display: block; height: auto; overflow: visible; transition: transform .5s var(--ease); }
.name-link .name-svg { width: 396px; }
.home-mobile .name-link-m .name-svg { width: 100%; max-width: 420px; }
.name-link:hover .name-svg, .name-link:focus-visible .name-svg { transform: translateX(6px); }
.name-svg path {
  fill: none; stroke: #111; stroke-width: 1.88; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.name-svg.go path { animation: draw-stroke 1s cubic-bezier(.4,.1,.6,.9) forwards; }
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .name-svg path, .name-svg.go path { animation: none; stroke-dashoffset: 0; } }
/* top bar titles: black by default; the underline marks the current page (and draws in on hover) */
.topbar nav a { color: var(--ink); }
/* name: stop-motion boil after it is written */
.fx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.name-svg.boil { filter: url(#name-boil); }
/* the name in the top bar / side menu wobbles (stop motion) while it is hovered or focused */
.topbar .home-link:hover .home-name, .topbar .home-link:focus-visible .home-name,
.morph-name:hover img, .toc-home:hover img { filter: url(#name-boil); }
@media (prefers-reduced-motion: reduce) {
  .topbar .home-link:hover .home-name, .morph-name:hover img, .name-svg.boil { filter: none; }
}

/* ---------- HOME: connecting lines look hand drawn and flow like traffic ----------
   Dashed (sound) and dotted (daily) lines move along their length; all lines boil gently. */
.board .links { filter: url(#line-boil); }
.links line { stroke-linecap: round; }
@keyframes flow-sound { to { stroke-dashoffset: -28; } }   /* 2 x (8+6) */
@keyframes flow-daily { to { stroke-dashoffset: -12; } }   /* 2 x (2+4) */
.links .sound { animation: flow-sound 1.6s linear infinite; }
.links .daily { animation: flow-daily 1.4s linear infinite; }
.legend-row svg line[stroke-dasharray="8 6"] { animation: flow-sound 1.6s linear infinite; }
.legend-row svg line[stroke-dasharray="2 4"] { animation: flow-daily 1.4s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .board .links { filter: none; }
  .links .sound, .links .daily, .legend-row svg line { animation: none; }
}

/* ---------- HOME: "How the projects connect" as a road sign ---------- */
.legend {
  background: #111; color: #fff; border: 0; border-radius: 12px;
  box-shadow: inset 0 0 0 6px #111, inset 0 0 0 8px #fff;   /* white inner border, like a road sign */
  padding: 24px 28px;
}
.legend h2 { font-weight: 600; }
.legend-row { color: #fff; }
.legend-row svg line { stroke: #fff; }
.legend::before, .legend::after {          /* two sign posts */
  content: ""; position: absolute; top: 100%; width: 6px; height: 46px; background: #111; border-radius: 0 0 2px 2px;
}
.legend::before { left: 22%; }
.legend::after  { right: 22%; }
/* simpler sign: one-line title, no posts, tighter */
.legend { padding: 20px 24px; gap: 12px; }
.legend h2 { font-size: 18px; white-space: nowrap; }
.legend-row { font-size: 15px; gap: 16px; }
.legend-row svg { width: 60px; }
.legend::before, .legend::after { content: none; }
/* sign title in a highway-sign face (Overpass is modelled on Highway Gothic) with a panel divider */
.legend h2 {
  font-family: "Overpass", "Geist", sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .01em; line-height: 1;
  padding: 2px 0 12px; border-bottom: 1.5px solid #fff; margin-bottom: 2px;
}
/* whole sign in the highway face */
.legend-row { font-family: "Overpass", "Geist", sans-serif; font-weight: 600; font-size: 16px; letter-spacing: .01em; }

/* ---------- ABOUT: the statement is written in like the name, then wobbles ---------- */
.about-intro .statement { max-width: 560px; }
.statement-svg { display: block; width: 100%; height: auto; overflow: visible; }
.statement-svg path {
  fill: none; stroke: #111; stroke-width: 1.35; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
}
.statement-svg.go path { animation: draw-stroke 1s linear forwards; }
.statement-svg.boil { filter: url(#name-boil); }
@media (prefers-reduced-motion: reduce) { .statement-svg path, .statement-svg.go path { animation: none; stroke-dashoffset: 0; } }
/* ABOUT: greeting written in the same hand as the sentence */
.about-intro h1.hello { margin: 0; }
.hello-svg { display: block; width: min(380px, 100%); height: auto; overflow: visible; }
.hello-svg path {
  fill: none; stroke: #111; stroke-width: 1.35; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
}
.hello-svg.go path { animation: draw-stroke 1s linear forwards; }
.hello-svg.boil { filter: url(#name-boil); }
@media (prefers-reduced-motion: reduce) { .hello-svg path, .hello-svg.go path { animation: none; stroke-dashoffset: 0; } }

/* ---------- ABOUT: hand-built handwriting (tools/handwriting.py), written like a letter ---------- */
.hand { display: block; height: auto; overflow: visible; }
.hand path {
  fill: none; stroke: #111; stroke-width: 1.6; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
}
.hand.go path { animation: draw-stroke 1s linear forwards; }
.hand.boil { filter: url(#name-boil); }
.about-intro .hello .hand { width: min(400px, 100%); }
.about-intro .statement .hand { width: min(520px, 100%); }
.about-intro .statement { margin-top: clamp(60px, 12vw, 170px); }
.signoff { margin: 44px 0 0 clamp(0px, 18vw, 238px); max-width: 520px; }
.signoff .hand { width: min(300px, 100%); }
.contact {
  display: flex; gap: 24px; margin-top: 22px; font-size: 16px;
  opacity: 0; transform: translateY(6px);
  animation: contact-in .6s var(--ease) var(--contact-delay, 12s) forwards;
}
.contact a { border-bottom: 1px solid var(--rule); transition: border-color .25s; }
.contact a:hover, .contact a:focus-visible { border-color: var(--ink); }
@keyframes contact-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .hand path, .hand.go path { animation: none; stroke-dashoffset: 0; }
  .contact { animation: none; opacity: 1; transform: none; }
}
@media (max-width: 860px) { .signoff { margin-left: 0; } }
/* letter layout: everything starts at the same indent, clear of the photos */
.about-intro .statement { margin: clamp(48px, 9vw, 120px) 0 0 clamp(0px, 9vw, 120px); max-width: 560px; }
.about-intro .hand-statement { width: min(500px, 100%); }
.about-intro .hand-hello { width: min(400px, 100%); }
.signoff { margin: 40px 0 0 clamp(0px, 9vw, 120px); }
.signoff .hand-signoff { width: min(290px, 100%); }

/* ---------- ABOUT letter: aligned left like a letter; drawn buttons ---------- */
.about-intro .statement { margin-left: 0; }
.signoff { margin-left: 0; }
.signoff .hand-signoff { width: min(420px, 100%); }
.contact { gap: 16px; flex-wrap: wrap; align-items: center; }
.contact a { border-bottom: 0; }
.drawn-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  font: inherit; font-size: 16px; color: var(--ink); background: none; border: 0; cursor: pointer;
  padding: 10px 18px; text-decoration: none;
}
.drawn-btn::before {            /* hand-drawn outline that gently wobbles */
  content: ""; position: absolute; inset: 0; border: 1.5px solid var(--ink); border-radius: 999px;
  filter: url(#line-boil); transition: border-width .2s, background-color .25s;
}
.drawn-btn:hover::before, .drawn-btn:focus-visible::before { border-width: 2.5px; }
.drawn-btn:focus-visible { outline: none; }
.drawn-btn .hint { font-size: 13px; color: var(--muted); }
.drawn-btn.copied .hint { color: var(--ink); }

/* ---------- HOME: "How they connect" as a hand-drawn note (not a sign) ---------- */
.legend {
  background: var(--paper); color: var(--ink); border: 0; border-radius: 0; box-shadow: none; padding: 20px 24px;
}
.legend::before {             /* wobbly hand-drawn outline */
  content: ""; position: absolute; inset: 0; border: 1.5px solid var(--ink); border-radius: 8px;
  filter: url(#line-boil); pointer-events: none; width: auto; height: auto; top: 0; left: 0; background: none;
}
.legend h2 { font-family: inherit; font-size: inherit; border: 0; padding: 0 0 4px; margin: 0; line-height: 0; }
.legend h2 .hand { width: 190px; }
.legend h2 .hand path { stroke-dashoffset: 0; }          /* already written, no draw-in */
.legend h2 .hand { filter: url(#name-boil); }
.legend-row { color: var(--ink); font-family: inherit; font-weight: 400; font-size: 15px; letter-spacing: 0; }
.legend-row svg line { stroke: var(--ink); }
.about-intro .statement { margin-top: clamp(28px, 4vw, 52px); }
/* handwriting: a touch heavier and larger so it reads easily */
.hand path { stroke-width: 1.8; }
.about-intro .hand-hello { width: min(470px, 100%); }
.about-intro .hand-statement { width: min(620px, 100%); }
.about-intro .statement { max-width: 640px; }
.signoff .hand-signoff { width: min(520px, 100%); }
.legend h2 .hand { width: 210px; }

/* ---------- ABOUT: drawn envelope (copies email) + drawn LinkedIn logo ---------- */
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 64px; height: 56px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink);
}
.icon-btn svg { width: 44px; height: auto; overflow: visible; filter: url(#line-boil); transition: transform .3s var(--ease); }
.icon-btn svg path { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.icon-btn:hover svg, .icon-btn:focus-visible svg { transform: translateY(-2px) rotate(-3deg); }
.icon-btn:hover svg path, .icon-btn:focus-visible svg path { stroke-width: 2.4; }
.icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.copied-note {
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 4px;
  white-space: nowrap; font-size: 14px; color: var(--ink); pointer-events: none;
}
.contact { gap: 4px; }
.copied-note { left: 50%; top: 100%; transform: translateX(-50%); margin: 2px 0 0; font-size: 13px; }
.signoff .hand-signoff { width: min(500px, 100%); }
/* each letter eases like a pen stroke */
.hand.go path { animation-timing-function: cubic-bezier(.45,.05,.55,.95); }
/* email icon: "Copy email" shows on hover / focus; replaced by "Email copied" after a click */
.icon-btn .tip {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px); margin-top: 2px;
  white-space: nowrap; font-size: 13px; color: var(--ink); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease);
}
.icon-btn:hover .tip, .icon-btn:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.icon-btn.copied .tip { opacity: 0; }

/* ---------- HOME: project names in handwriting (written in, then jitter) ---------- */
.proj .label .hand { height: 24px; width: auto; display: inline-block; vertical-align: middle; }
.proj .label { align-items: center; }
.proj .label .hand { height: 30px; } .proj .label .hand path { stroke-width: 1.25; }

/* ---------- HOME: "How they connect" on a hand-drawn ribbon banner, handwritten rows ---------- */
.legend { padding: 0 6px 6px; gap: 10px; background: transparent; }
.legend::before { content: none; }
.legend h2 { position: relative; height: 74px; margin: 0 -10px 6px; line-height: 0; }
.legend h2 .ribbon { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: url(#line-boil); }
.legend h2 .ribbon path { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.legend h2 .hand-connect { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -58%); width: 168px; }
.legend-row { gap: 14px; padding: 2px 0 2px 16px; }
.legend-row .hand { height: 24px; width: auto; }
.legend-row .hand path { stroke-width: 1.25; stroke-dashoffset: 0; }
.legend-row .hand { filter: url(#name-boil); }

/* ---------- ABOUT: the letter points to the handmade work ---------- */
.crafts { display: flex; align-items: flex-end; gap: 6px; margin: 30px 0 0; max-width: 640px; }
.crafts .hand-crafts { width: min(430px, 70%); flex: none; }
.crafts .hand-arrow { width: min(150px, 28%); flex: none; margin-bottom: 26px; }
.crafts { max-width: none; } .crafts .hand-arrow { width: clamp(120px, 22vw, 330px); }
.crafts .hand-arrow path { vector-effect: none; stroke-width: 0.95; }

/* small handwriting: gentler, slower jitter */
.proj .label .hand.boil, .legend-row .hand, .legend h2 .hand-connect { filter: url(#small-boil); }

/* About: the arrow is an overlay across the page, from the sentence to the photos */
.about-intro { position: relative; }
.crafts .hand-arrow, .about-intro .hand-arrow {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; margin: 0; overflow: visible;
}
.about-intro .hand-arrow path { vector-effect: none; stroke-width: 1.6; }
.crafts .hand-crafts { width: min(560px, 100%); }

/* ---------- top bar: handwritten titles (print, static) ---------- */
.topbar nav a { display: inline-flex; align-items: center; padding: 2px 0 6px; }
.nav-hand { height: 27px; width: auto; display: block; overflow: visible; }
.nav-hand path { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
                 vector-effect: non-scaling-stroke; stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
.topbar nav a:hover .nav-hand, .topbar nav a:focus-visible .nav-hand { filter: url(#small-boil); }
@media (max-width: 760px) { .nav-hand { height: 22px; } }

/* ---------- ABOUT: the writing sits on a sheet of letter paper ---------- */
.about-intro { align-items: start; }
.letter {
  background: #fffdf7; border: 1px solid #ebe5d8; border-radius: 2px;
  padding: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 60px) clamp(32px, 4vw, 56px);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 18px 40px -22px rgba(0,0,0,.28);
  transform: rotate(-0.5deg); max-width: 760px;
}
.letter .contact { margin-top: 26px; }
.legend h2 { height: 84px; } .legend h2 .hand-connect { width: 150px; transform: translate(-50%, -60%); }

/* ---------- DOILY dividers: hand-drawn crochet lace trim with a round doily in the middle ----------
   Used between sections on project pages and between the letter and the CV on About. */
:root {
  --doily-rosette: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2280%22 height=%2280%22 viewBox=%220 0 80 80%22 fill=%22none%22 stroke=%22%23111%22 stroke-width=%221.1%22 stroke-linecap=%22round%22%3E%3Ccircle cx=%2240%22 cy=%2240%22 r=%2238%22 fill=%22%23fff%22 stroke=%22none%22/%3E%3Ccircle cx=%2240%22 cy=%2240%22 r=%225%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(0 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(45 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(90 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(135 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(180 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(225 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(270 40 40)%22/%3E%3Cellipse cx=%2240%22 cy=%2227%22 rx=%224%22 ry=%229%22 transform=%22rotate(315 40 40)%22/%3E%3Ccircle cx=%2240%22 cy=%2240%22 r=%2220%22/%3E%3Ccircle cx=%2268.0%22 cy=%2240.0%22 r=%224%22/%3E%3Ccircle cx=%2265.9%22 cy=%2250.7%22 r=%224%22/%3E%3Ccircle cx=%2259.8%22 cy=%2259.8%22 r=%224%22/%3E%3Ccircle cx=%2250.7%22 cy=%2265.9%22 r=%224%22/%3E%3Ccircle cx=%2240.0%22 cy=%2268.0%22 r=%224%22/%3E%3Ccircle cx=%2229.3%22 cy=%2265.9%22 r=%224%22/%3E%3Ccircle cx=%2220.2%22 cy=%2259.8%22 r=%224%22/%3E%3Ccircle cx=%2214.1%22 cy=%2250.7%22 r=%224%22/%3E%3Ccircle cx=%2212.0%22 cy=%2240.0%22 r=%224%22/%3E%3Ccircle cx=%2214.1%22 cy=%2229.3%22 r=%224%22/%3E%3Ccircle cx=%2220.2%22 cy=%2220.2%22 r=%224%22/%3E%3Ccircle cx=%2229.3%22 cy=%2214.1%22 r=%224%22/%3E%3Ccircle cx=%2240.0%22 cy=%2212.0%22 r=%224%22/%3E%3Ccircle cx=%2250.7%22 cy=%2214.1%22 r=%224%22/%3E%3Ccircle cx=%2259.8%22 cy=%2220.2%22 r=%224%22/%3E%3Ccircle cx=%2265.9%22 cy=%2229.3%22 r=%224%22/%3E%3Cpath d=%22M74.3 46.8 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M69.1 59.4 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M59.4 69.1 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M46.8 74.3 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M33.2 74.3 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M20.6 69.1 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M10.9 59.4 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M5.7 46.8 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M5.7 33.2 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M10.9 20.6 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M20.6 10.9 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M33.2 5.7 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M46.8 5.7 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M59.4 10.9 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M69.1 20.6 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M74.3 33.2 v0.1%22 stroke-width=%222.4%22/%3E%3C/svg%3E");
  --doily-lace: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2230%22 height=%2234%22 viewBox=%220 0 30 34%22 fill=%22none%22 stroke=%22%23111%22 stroke-width=%221.1%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M0 8 H30%22/%3E%3Cpath d=%22M0 8 Q15 30 30 8%22/%3E%3Ccircle cx=%2215%22 cy=%2215%22 r=%223%22/%3E%3Cpath d=%22M15 27 v0.1%22 stroke-width=%222.4%22/%3E%3Cpath d=%22M0 8 Q2 4 4 8 M26 8 Q28 4 30 8%22/%3E%3C/svg%3E");
}
.doily, .sheets > * + *::before, .cv-section::before {
  content: ""; display: block; height: 80px; border: 0;
  background: var(--doily-rosette) center / 80px 80px no-repeat, var(--doily-lace) left 23px / 30px 34px repeat-x;
  filter: url(#small-boil);
}
/* project pages: the doily sits in the middle of the gap between sections */
.sheets { --gap: clamp(110px, 11vw, 160px); }
.sheets > * + *::before { top: calc(var(--gap) / -2 - 40px); border-top: 0; }
/* about: the doily separates the letter from the CV */
.cv-section { border-top: 0; }
.cv-section::before { margin: 0 0 28px; }

/* ---------- ABOUT: no paper sheet behind the letter ---------- */
.letter { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; transform: none; max-width: none; }

/* ---------- HOME: lines stop just around the handwritten names (thin white halo, no box) ---------- */
.proj .label { background: none; padding: 0; margin: 0;
  filter: drop-shadow(0 0 1.5px var(--paper)) drop-shadow(0 0 1.5px var(--paper)) drop-shadow(0 0 2px var(--paper)); }

/* ---------- ABOUT: the craft photos sit in the letter, right under the words ---------- */
.about-intro { grid-template-columns: 1fr; }
.craft-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 22px; margin: 22px 0 6px; }
.craft-row figure {
  position: relative; margin: 0; width: auto; background: var(--paper); padding: 6px 6px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 18px -10px rgba(0,0,0,.25);
}
.craft-row figure:nth-child(odd)  { transform: rotate(-1.6deg); }
.craft-row figure:nth-child(even) { transform: rotate(1.4deg); }
.craft-row img, .craft-row img.tall { height: 132px; width: auto; aspect-ratio: auto; object-fit: contain; display: block; }
.craft-row figcaption { position: static; background: none; padding: 6px 2px 0; font-size: 13px; }
@media (max-width: 760px) { .craft-row img, .craft-row img.tall { height: 96px; } }

/* ---------- ABOUT: craft photos as a flat stack you can flip through ---------- */
.craft-deck { margin: 24px 0 10px; width: max-content; max-width: 100%; outline-offset: 6px; }
.deck { position: relative; height: 230px; width: 380px; max-width: 100%; }
.deck .card {
  position: absolute; left: 0; bottom: 0; margin: 0; padding: 0; background: none; box-shadow: none; cursor: pointer;
  transform: translate(calc(var(--pos, 0) * 14px), calc(var(--pos, 0) * -10px));
  opacity: calc(1 - var(--pos, 0) * 0.18);
  transition: transform .45s var(--ease), opacity .45s var(--ease);
}
.deck .card img, .deck .card img.tall { height: 200px; width: auto; max-width: 340px; object-fit: contain; display: block; aspect-ratio: auto; }
.deck .card figcaption { display: none; }
.deck .card.leaving { transform: translate(-60px, 10px) rotate(-4deg); opacity: 0; }
.deck-bar { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.deck-caption { font-size: 15px; min-width: 150px; text-align: center; white-space: pre; }
.deck-btn { background: none; border: 0; padding: 4px; cursor: pointer; line-height: 0; }
.deck-btn svg { width: 40px; height: 24px; overflow: visible; filter: url(#small-boil); }
.deck-btn path { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.deck-btn:hover path, .deck-btn:focus-visible path { stroke-width: 2.4; }
@media (max-width: 760px) { .deck { height: 170px; width: 300px; } .deck .card img, .deck .card img.tall { height: 150px; max-width: 260px; } }

/* ---------- ABOUT: paper doll — grey dress form with the real pieces as cut-outs ---------- */
.about-intro { grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 380px); column-gap: clamp(24px, 4vw, 64px); }
.doll { margin: 0; align-self: start; position: sticky; top: 24px; }
.doll .stage { position: relative; width: 100%; aspect-ratio: 300 / 520; touch-action: none; }
.doll .form { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: url(#line-boil); }
.doll .form ellipse, .doll .form path { fill: #d9d8d4; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.doll .form .stand { fill: none; }
.doll .piece {
  position: absolute; height: auto; cursor: grab; user-select: none; -webkit-user-drag: none;
  transform: rotate(var(--r, 0deg));
  /* paper-doll cut-out: white paper edge + a soft lift off the form */
  filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
          drop-shadow(0 3px 4px rgba(0,0,0,.18));
  transition: transform .25s var(--ease);
}
.doll .piece:hover { transform: rotate(var(--r, 0deg)) scale(1.04); }
.doll .piece.lift { cursor: grabbing; transform: rotate(var(--r, 0deg)) scale(1.08); }
.piece-name {
  position: absolute; left: 50%; bottom: -6px; transform: translate(-50%, 4px); font-size: 14px;
  opacity: 0; transition: opacity .2s, transform .2s var(--ease); pointer-events: none; white-space: nowrap;
}
.piece-name.on { opacity: 1; transform: translate(-50%, 0); }
.doll figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 18px; }
@media (max-width: 860px) {
  .about-intro { grid-template-columns: 1fr; }
  .doll { position: static; max-width: 320px; margin: 24px auto 0; }
}

/* ---------- DIVIDERS: one hand-drawn line (dividers.js) — draws in, then moves gently ---------- */
.sheets > * + *::before, .cv-section::before { content: none; display: none; }
.sheets { --gap: clamp(80px, 9vw, 130px); }
.divider { height: 40px; pointer-events: none; }
.divider.in-sheets { position: absolute; left: 0; right: 0; top: calc(var(--gap) / -2 - 20px); }
.about .divider { margin: 8px 0 26px; }
.divider svg { display: block; width: 100%; height: 100%; overflow: visible; }
.divider path {
  fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.divider.draw path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.45,.05,.55,.95); }
.divider.boil svg { filter: url(#small-boil); }
@media (prefers-reduced-motion: reduce) { .divider path { stroke-dashoffset: 0; transition: none; } }

/* ribbon now says "Themes" */
.legend h2 .hand-connect { width: 92px; }
.sheets { position: relative; }
.sheets > .divider.in-sheets { position: absolute; left: var(--margin, 0); right: var(--margin, 0); top: 0; }
.case-layout .sheets > .divider.in-sheets { left: 0; }

/* ---------- top bar: hand-drawn line instead of a plain border (dividers.js) ---------- */
.topbar { border-bottom-color: transparent; }
.topbar .bar-line { position: absolute; left: 0; right: 0; bottom: -10px; height: 20px; pointer-events: none; filter: url(#small-boil); }
.bar-line svg, .morph-line svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bar-line path, .morph-line path { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 901px) {
  body.project .topbar .bar-line { display: none; }          /* the moving copy (.morph-line) stands in */
  .morph-line { border-top: 0; height: 20px; margin-top: -10px; filter: url(#small-boil); }
}

/* ---------- HOME: hover preview inside the middle tile (video or a quick slideshow) ---------- */
.proj .thumb { position: relative; }
.proj .preview { position: absolute; inset: 0; background: var(--paper); opacity: 0; transition: opacity .3s var(--ease); }
.proj .preview.on { opacity: 1; }
.proj .preview video, .proj .preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj .preview { background: transparent; }
/* dividers + bar lines: smooth (no jitter filter), they sway instead */
.divider.boil svg, .topbar .bar-line, .morph-line { filter: none !important; }

/* ---------- ABOUT doll: five outfits + a drawn bag carrying the charm ---------- */
.doll .piece { cursor: default; transition: left .6s var(--ease), top .6s var(--ease), width .6s var(--ease), transform .6s var(--ease), opacity .4s; }
.doll .piece:hover { transform: rotate(var(--r, 0deg)); }
.doll .piece.off { opacity: 0; transform: rotate(var(--r, 0deg)) scale(.6); pointer-events: none; }
.doll .bag { filter: none; }
.doll .bag-art { display: block; width: 100%; height: auto; overflow: visible; filter: url(#line-boil); }
.doll .bag-art path, .doll .bag-art circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.doll .bag-art .strap { fill: none; }
.doll .bag .charm {
  position: absolute; left: 66%; top: 48%; width: 44%; height: auto; transform-origin: 50% 0; transform: rotate(-4deg);
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 4px rgba(0,0,0,.18));
  animation: charm-swing 3.2s ease-in-out infinite;
}
@keyframes charm-swing { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.outfit-bar { justify-content: center; margin-top: 14px; }
.outfit-name { font-size: 15px; min-width: 190px; text-align: center; white-space: pre; }
.doll figcaption, .piece-name { display: none; }
@media (prefers-reduced-motion: reduce) { .doll .bag .charm { animation: none; } }

/* Back to top lives in the side menu now */
.toc-top { display: inline-block; margin-top: 26px; font-size: 15px; color: var(--muted); position: relative; padding-bottom: 3px; }
.toc-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.toc-top:hover, .toc-top:focus-visible { color: var(--ink); }
.toc-top:hover::after, .toc-top:focus-visible::after { transform: scaleX(1); }
.toc ol + .toc-top { transform: translateY(calc(var(--bar-p, 0) * 58px)); }   /* moves with the titles */
.pager { grid-template-columns: 1fr 1fr; row-gap: 0; }
.pager a:not(.to-top) { grid-row: 1; }

/* ---------- ABOUT doll: dress-up with a tray for pieces that are off the doll ---------- */
.doll .stage { aspect-ratio: 300 / 640; }
.doll .form { height: 81.25%; inset: 0 0 auto 0; }
.doll .tray { position: absolute; left: 0; right: 0; bottom: 0; height: 17%; width: 100%; overflow: visible; filter: url(#line-boil); }
.doll .tray path { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.tray-label { position: absolute; left: 50%; bottom: 17%; transform: translate(-50%, 50%); background: var(--paper); padding: 0 8px; font-size: 13px; color: var(--muted); }
.doll .piece { cursor: grab; }
.doll .piece.lift { cursor: grabbing; z-index: 30; }
.doll .piece.in-tray { opacity: 1; transform: rotate(0deg); pointer-events: auto; }
.doll .piece:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.doll .piece.off { opacity: 1; }
.toc li.toc-back { margin-top: 18px; opacity: 1; }

/* ---------- natural pen lines (dividers.js): filled strokes with pen pressure, revealed by a mask ---------- */
.divider path.take, .bar-line path.take, .morph-line path.take {
  fill: var(--ink); stroke: none; stroke-dasharray: none; stroke-dashoffset: 0; display: none; transition: none;
}
.divider path.take.on, .bar-line path.take.on, .morph-line path.take.on { display: inline; }
.divider path.reveal, .bar-line path.reveal, .morph-line path.reveal {
  fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: none;
}
.divider.draw path.reveal { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.45,.05,.55,.95); }
.drawn path.reveal { stroke-dashoffset: 0 !important; }
.divider svg, .bar-line svg, .morph-line svg { filter: none !important; }

/* ---------- ABOUT: the letter on ruled lines (one sheet, same size writing throughout) ---------- */
.letter .hand-letter { display: block; width: min(640px, 100%); height: auto; }
.hand path.rule { stroke: #cfc9bd; stroke-width: 1; stroke-dasharray: none; stroke-dashoffset: 0; animation: none !important; }
.letter .contact { margin-top: 10px; }
.tray-label { line-height: 0; padding: 0 10px; }
.tray-label .hand { height: 22px; width: auto; display: block; }
.tray-label .hand path { stroke-dashoffset: 0; stroke-width: 1.2; }

/* ---------- ABOUT simplified: just the letter + the dress-up ---------- */
.hand path.rule { display: none; }
.about { padding-bottom: clamp(48px, 7vw, 96px); }
.outfit-title { margin: 0 0 6px; text-align: center; line-height: 0; min-height: 40px; }
.outfit-title .oname { display: none; }
.outfit-title .oname.on { display: inline-block; }
.outfit-title .hand { height: 40px; width: auto; }   /* outfit names in Ella's handwriting */
.outfit-title .hand path { stroke-dashoffset: 0; stroke-width: 1.4; }
.outfit-title .hand { filter: url(#small-boil); }
.outfit-count { font-size: 15px; min-width: 110px; text-align: center; white-space: nowrap; }   /* wide enough for "Styled by you", so the arrows do not jump */

/* ---------- simple thin lines (no hand-drawn loops, no animation) ---------- */
.sheets > .divider.plain { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(17,17,17,.6); }
.topbar { border-bottom: 1px solid var(--ink); }
.topbar .bar-line { display: none; }
@media (min-width: 901px) {
  body.project .topbar { border-bottom-color: transparent; }   /* the moving line stands in for it */
  .morph-line { border-top: 1px solid var(--ink); height: 0; margin-top: 0; }
  .morph-line svg { display: none; }
}
.doll .tray { display: none; }   /* wardrobe area: no outline, just the label and the pieces */
.legend h2 .hand-connect { width: 80px; transform: translate(-50%, -40%); }
.legend h2 .hand-connect { transform: translate(-50%, -54%); }

/* ---------- ABOUT: the closet is an open box the spare pieces sit in ---------- */
.doll .tray.box { display: block; position: absolute; left: 2%; right: 2%; bottom: 0; width: 96%; height: 18%; overflow: visible; filter: url(#line-boil); z-index: 0; }
.doll .tray.box path { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-dasharray: none; vector-effect: non-scaling-stroke; }
.doll .tray.box .inside { fill: #e9e7e2; }
.doll .tray.box .fold { fill: none; stroke-width: 1; opacity: .5; }
.doll .piece { z-index: 2; }
.doll .piece.in-tray { z-index: 1; }
.tray-label { bottom: 2%; transform: translate(-50%, 0); background: transparent; z-index: 3; }


/* name is now a vector file (assets/name.svg) — no filter needed to darken it */
.topbar .home-name, .morph-name img, .toc-home img { filter: none; }
.topbar .home-link:hover .home-name, .topbar .home-link:focus-visible .home-name, .morph-name:hover img { filter: url(#name-boil); }

/* ---------- ABOUT: CV as a pop-up from the document icon ---------- */
.cv-dialog {
  width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  border: 1px solid var(--ink); border-radius: 6px; padding: clamp(20px, 3vw, 40px); background: var(--paper); color: var(--ink);
}
.cv-dialog::backdrop { background: rgba(17,17,17,.35); }
.cv-dialog[open] { animation: cv-in .3s var(--ease); }
@keyframes cv-in { from { opacity: 0; transform: translateY(10px); } }
.cv-dialog-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--ink); padding-bottom: 14px; margin-bottom: 8px; }
.cv-dialog-head h2 { font-size: clamp(30px, 4vw, 48px); font-weight: 400; letter-spacing: -.02em; }
.cv-dialog .cv { margin-top: 0; }
.cv-dialog .kv, .cv-dialog .small-kv, .cv-dialog .entry { grid-template-columns: 104px 1fr; column-gap: 16px; }
.cv-dialog .entry .what { font-size: 17px; }
.cv-dialog .cv dd, .cv-dialog .cv .what, .cv-dialog .cv li { text-wrap: pretty; }
.open-cv svg { width: 30px; }
.cv-close { font: inherit; font-size: 22px; line-height: 1; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); transition: transform .3s var(--ease); }
.cv-close:hover, .cv-close:focus-visible { transform: rotate(90deg); }
.cv-dialog { margin: auto; }   /* the global margin reset would otherwise pin it to the top-left */
.legend h2 .hand-connect { width: 150px; transform: translate(-50%, -54%); }

/* ---------- ABOUT: dress-form mannequin drawing ---------- */
.doll .form .body { fill: #d6d4cf; }
.doll .form .head { fill: #dcdad5; }
.doll .form .plate { fill: #cfcdc7; }
.doll .form .seam { fill: none; stroke: #6e6b66; stroke-width: 1; }
.doll .form .seam.faint { stroke-dasharray: 3 4; opacity: .7; }
.doll .form .tape { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.doll .form .stand { fill: none; }
.doll .form .knob, .doll .form .caster { fill: var(--paper); }
/* "Common threads" rows: normal font */
.legend-row { font-family: inherit; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--ink); }
/* CV pop-up: no grey lines between sections */
.cv-dialog .cv section { border-top: 0; padding-top: 10px; }

/* ---------- top bar: the current page is marked with a thread that ends in a small loop ----------
   (drawn in left to right, loop last; hovering another title draws the thread under it) */
.topbar nav a { padding-bottom: 10px; }
.topbar nav a::after {
  content: ""; position: absolute; left: 0; right: -13px; bottom: -6px; height: 20px; transform: none;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22%3E%3Cpath d=%22M0,12.4 C4,12.6 7.4,11.6 9.6,8.4 C11.6,5.4 10,2.2 7.6,3.4 C5.2,4.6 6.4,8.6 10.2,10.4 C12.2,11.4 14.2,11.4 15.6,10.8%22 fill=%22none%22 stroke=%22%23111%22 stroke-width=%221.4%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E") right bottom / 20px 20px no-repeat, url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 200 4%22 preserveAspectRatio=%22none%22%3E%3Cpath d=%22M0,2.4 C40,1.6 80,2.8 120,2 C150,1.5 180,2.6 200,2.2%22 fill=%22none%22 stroke=%22%23111%22 stroke-width=%221.4%22 stroke-linecap=%22round%22 vector-effect=%22non-scaling-stroke%22/%3E%3C/svg%3E") left calc(100% - 4px) / calc(100% - 18px) 4px no-repeat;
  clip-path: inset(0 100% 0 0); transition: clip-path .5s cubic-bezier(.45,.05,.55,.95);
}
.topbar nav a[aria-current="page"]::after, .topbar nav a:hover::after, .topbar nav a:focus-visible::after { clip-path: inset(0 0 0 0); transform: none; }
.topbar nav a[aria-current="page"]::after { animation: thread-in .9s .3s cubic-bezier(.45,.05,.55,.95) both; }
@keyframes thread-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .topbar nav a::after { transition: none; animation: none !important; } }

/* ---------- top bar: the current page is circled by hand (replaces the thread) ---------- */
.topbar nav a { padding: 2px 0 2px; }
.topbar nav a::before { content: none; }
.topbar nav a::after {
  content: ""; position: absolute; left: -12px; right: -12px; top: -8px; bottom: -8px; height: auto; width: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 40%22 preserveAspectRatio=%22none%22%3E%3Cpath pathLength=%221%22 d=%22M14,9 C32,1 78,1 93,11 C101,19 93,33 63,37 C35,40 6,35 4,22 C3,12 16,6 32,4.6%22 fill=%22none%22 stroke=%22%23111%22 stroke-width=%221.4%22 stroke-linecap=%22round%22 vector-effect=%22non-scaling-stroke%22 stroke-dasharray=%221%22 stroke-dashoffset=%221%22%3E%3Canimate attributeName=%22stroke-dashoffset%22 from=%221%22 to=%220%22 dur=%22.7s%22 begin=%220.2s%22 fill=%22freeze%22/%3E%3C/path%3E%3C/svg%3E") center / 100% 100% no-repeat; clip-path: none; -webkit-mask: none; mask: none;
  transform: none; opacity: 0; transition: opacity .2s; animation: none; pointer-events: none;
}
.topbar nav a[aria-current="page"]::after, .topbar nav a:hover::after, .topbar nav a:focus-visible::after { opacity: 1; clip-path: none; animation: none; }

/* ---------- bottom previous / next: hover slides the arrow and circles the project name ---------- */
.pager .pg { display: inline-flex; align-items: center; gap: 10px; }
.pager .pg-arrow { display: inline-block; transition: transform .35s var(--ease); }
.pager .pg-name { position: relative; }
.pager .pg-name::after {
  content: ""; position: absolute; left: -16px; right: -16px; top: -10px; bottom: -10px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 40%22 preserveAspectRatio=%22none%22%3E%3Cpath pathLength=%221%22 d=%22M14,9 C32,1 78,1 93,11 C101,19 93,33 63,37 C35,40 6,35 4,22 C3,12 16,6 32,4.6%22 fill=%22none%22 stroke=%22%23111%22 stroke-width=%221.6%22 stroke-linecap=%22round%22 vector-effect=%22non-scaling-stroke%22/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  clip-path: inset(0 100% 0 0); transition: clip-path .45s cubic-bezier(.45,.05,.55,.95);
}
.pager a:hover .pg-name::after, .pager a:focus-visible .pg-name::after { clip-path: inset(0 0 0 0); }
.pager a:not(.next):hover .pg-arrow, .pager a:not(.next):focus-visible .pg-arrow { transform: translateX(-8px); }
.pager a.next:hover .pg-arrow, .pager a.next:focus-visible .pg-arrow { transform: translateX(8px); }
.pager a:focus-visible { outline: none; }
.pager .pg { gap: 22px; } .pager .pg-name::after { left: -20px; right: -20px; top: -13px; bottom: -13px; }

/* ---------- top bar: the current page has a small lace trim along the bottom (replaces the circle) ---------- */
.topbar nav a { padding: 2px 0 12px; }
.topbar nav a::after {
  content: ""; position: absolute; left: 0; right: 0; top: auto; bottom: 0; height: 9px; width: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 12 9%22 width=%2212%22 height=%229%22%3E%3Cg fill=%22none%22 stroke=%22%23111%22 stroke-width=%22.9%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M0,1.5 H12%22/%3E%3Cpath d=%22M0,1.5 Q6,8.4 12,1.5%22/%3E%3Ccircle cx=%226%22 cy=%223.6%22 r=%221.1%22/%3E%3C/g%3E%3Ccircle cx=%226%22 cy=%228.2%22 r=%22.7%22 fill=%22%23111%22/%3E%3C/svg%3E") left top / 12px 9px repeat-x;
  opacity: 1; clip-path: inset(0 100% 0 0); transition: clip-path .5s cubic-bezier(.45,.05,.55,.95);
  transform: none; animation: none;
}
.topbar nav a[aria-current="page"]::after, .topbar nav a:hover::after, .topbar nav a:focus-visible::after { clip-path: inset(0 0 0 0); }
.topbar nav a[aria-current="page"]::after { animation: thread-in .8s .3s cubic-bezier(.45,.05,.55,.95) both; }

/* bottom previous / next: lace under the project name on hover (replaces the circle) */
.pager .pg-name::after {
  left: 0; right: 0; top: auto; bottom: -16px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 12 9%22 width=%2212%22 height=%229%22%3E%3Cg fill=%22none%22 stroke=%22%23111%22 stroke-width=%22.9%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M0,1.5 H12%22/%3E%3Cpath d=%22M0,1.5 Q6,8.4 12,1.5%22/%3E%3Ccircle cx=%226%22 cy=%223.6%22 r=%221.1%22/%3E%3C/g%3E%3Ccircle cx=%226%22 cy=%228.2%22 r=%22.7%22 fill=%22%23111%22/%3E%3C/svg%3E") left top / 16px 12px repeat-x;
}

/* ---------- CV pop-up: three columns so it fits on one screen ---------- */
.cv-dialog { width: min(1240px, calc(100vw - 32px)); padding: clamp(18px, 2.4vw, 32px) clamp(20px, 2.8vw, 40px); }
.cv-dialog-head h2 { font-size: clamp(26px, 3vw, 38px); }
.cv-dialog-head { padding-bottom: 10px; }
.cv-dialog .cv.cv-3 { grid-template-columns: 1fr 1fr 1fr; column-gap: clamp(20px, 2.6vw, 40px); }
.cv-dialog .cv section { padding: 8px 0 12px; }
.cv-dialog .cv h3 { font-size: 16px; margin-bottom: 8px; }
.cv-dialog .kv { font-size: 14.5px; gap: 6px 14px; }
.cv-dialog .kv, .cv-dialog .small-kv, .cv-dialog .entry { grid-template-columns: 88px 1fr; column-gap: 12px; }
.cv-dialog .small-kv { font-size: 13.5px; gap: 4px 12px; }
.cv-dialog .entry { margin-bottom: 12px; }
.cv-dialog .entry .when { font-size: 13px; }
.cv-dialog .entry .what { font-size: 15.5px; }
.cv-dialog .entry .what p, .cv-dialog .entry ul { font-size: 13px; }
.cv-dialog .entry ul { margin-top: 4px; }
@media (max-width: 900px) { .cv-dialog .cv.cv-3 { grid-template-columns: 1fr; } }

/* ---------- handwriting rule: personal voice only (name, About letter, ribbon); labels typed ---------- */
.proj .label { font-size: 17px; }
.proj .pname { font-size: 17px; }
.proj .what {
  position: absolute; left: 0; top: 212px; width: 230px; font-size: 13px; line-height: 1.3; color: #555;
  background: var(--paper); box-shadow: 0 0 0 3px var(--paper); transition: opacity .35s var(--ease);
}
.proj.is-mid .what { left: auto; right: 0; text-align: right; }
.board.is-pick .proj:not(.is-mid) .what { opacity: .25; }

/* ---------- readability: grey text dark enough to read (WCAG AA 4.5:1 on white) ---------- */
:root { --muted: #6b6b6b; }
.toc li, .toc li.in { opacity: 1; }
.toc a { color: #767676; }                 /* sections you have not reached yet */
.toc li.in a { color: #4a4a4a; }           /* sections you have passed */
.toc li.on a { color: var(--ink); }        /* the one you are reading */

.swipe-hint { display: none; }
@media (max-width: 760px) {
  .sheets::before { content: none; }
  .swipe-hint { display: block; font-size: 13px; color: var(--muted); margin: 0 0 -24px; }
}
.home-mobile .grid small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.3; }

/* ---------- PHONE: everything scrolls top to bottom (phone.js splits each section into halves) ---------- */
@media (max-width: 760px) {
  .swipe-hint { display: none !important; }
  .sheet.split { aspect-ratio: auto; height: auto; overflow: visible; display: flex; flex-direction: column; gap: 22px; }
  .sheet.split .half { position: relative; width: 100%; overflow: hidden; }
  .sheet.split .half-in { position: absolute; left: 0; top: 0; width: 1296px; height: 864px; transform-origin: 0 0; zoom: 1; margin: 0; }
}

/* ---------- PHONE: top bar titles on one line (text scales with the screen) ---------- */
@media (max-width: 760px) {
  .topbar nav { flex-wrap: nowrap; justify-content: space-between; width: 100%; gap: 0; }
  .topbar nav a { font-size: min(16px, 3.05vw); white-space: nowrap; letter-spacing: -.01em; }
}
@media (max-width: 760px) { .sheet.split { gap: 14px; } .sheets { gap: 40px; --gap: 40px; } }
@media (max-width: 760px) { .sheet.split .half.card { border-radius: 6px; } .sheet.split { gap: 12px; } }
/* phone: cards in 2- or 3-column grids */
@media (max-width: 760px) {
  .card-grid { display: grid; gap: 8px; }
  .card-grid.in-panel { gap: 2px; padding: 0; border-radius: 6px; overflow: hidden; }
  .card-grid.in-panel .half.card { border-radius: 0; }
}

/* ---------- ABOUT fits one screen on desktop (no scrolling): letter + dress form sized to the window height ---------- */
@media (min-width: 861px) {
  .about { padding-bottom: 24px; }
  .about-intro { padding-bottom: 0; }
  .letter .hand-letter { width: min(800px, max(280px, (100svh - 188px) * .88), calc(100vw - 260px - 24px - var(--dw) + 28px)); }   /* at least ~130px margin each side */
  .doll .stage { width: min(100%, max(240px, (100svh - 258px) * 500 / 520)); margin: 0 0 0 auto; }
  /* letter further left and larger; dress-up further right and a bit smaller */
  .about { max-width: none; padding: 20px 40px 16px; }
  /* letter, then the dress-up straight after it (same gap at every window size) */
  .about-intro { --dw: min(44vw, max(240px, (100svh - 258px) * 500 / 520)); grid-template-columns: auto var(--dw); justify-content: center; column-gap: 24px; }
  /* the letter's writing starts under the middle of the name logo in the top bar */
  .about .letter { padding-left: 0; }
  .letter .contact { margin-top: 10px; }
  /* outfit counter / "Styled by you": larger and to the right */
  .doll .outfit-bar { margin-top: 10px; }
  .doll .outfit-count { font-size: 17px; min-width: 120px; }
}

/* home: the right column moves right by --ex and grows by --s (both set in index.html).
   Name + Role/Focus are one card (Figma x 840-1236, y 663-830), grown from its bottom-right corner;
   the key grows from its top-right corner. */
.board .legend { top: 1px; translate: var(--ex, 0px) 0; scale: var(--s, 1); transform-origin: 100% 0; }   /* top lines up with the top squares */
.board .legend h2 { margin-top: -12px; }   /* the ribbon drawing has empty space above it */
.board .namecard { left: 840px; top: 663px; width: 396px; height: 167px; translate: var(--ex, 0px) 0; scale: var(--s, 1); transform-origin: 100% 100%; }
.namecard > * { position: absolute; }
.namecard .name-link { left: 0; top: 0; }
.namecard .info-rule, .namecard .info-k { left: 0; }
.namecard .info-v { left: 90px; }
/* home: project squares bigger (250 instead of 180), grown around their centre so the connector lines still meet them */
.board .proj { width: 250px; margin: -35px 0 0 -35px; }
.board .proj .thumb { width: 250px; height: 250px; }
.board .proj .label { top: 258px; }
.board .proj .what { top: 282px; }

/* about: small hint under the dress form */
/* the hint sits right under the outfit name, above the dress form */
.doll .doll-hint { margin: 2px 0 8px; text-align: center; font-size: 15px; line-height: 1.3; color: var(--ink); }
/* name of the piece under the pointer / keyboard focus */
.doll .piece-tip {
  position: absolute; z-index: 40; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--ink); color: var(--paper); font-size: 13px; line-height: 1; padding: 6px 9px; border-radius: 4px;
  opacity: 0; transition: opacity .15s;
}
.doll .piece-tip.on { opacity: 1; }

/* project intro picture: always the full right column (Figma x 660-1224), so it lines up with the
   black panels and captions below it at every window size (no longer shrinks to the window height) */
@media (min-width: 761px) { .intro { --pic-h: calc(640px * var(--k, 1)); } }

/* videos and films: the full width of the section, like the slides around them */
.sheets .video video { width: 100%; max-width: 100%; max-height: none; height: auto; }
.sheets .video .embed { width: 100%; }

/* ---------- PHONE: wide pictures half a screen at a time (phone.js) ---------- */
@media (max-width: 760px) {
  .sheet.split .half.swipe { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .sheet.split .swipe-track { position: relative; height: 100%; }
  .sheet.split .swipe-track .snap { position: absolute; top: 0; width: 50%; height: 1px; scroll-snap-align: start; pointer-events: none; }
  .sheet.split .swipe-track .snap-a { left: 0; } .sheet.split .swipe-track .snap-b { left: 50%; }
  .sheet.split .swipe-hint { margin: -6px 0 0; font-size: 13px; color: #555; text-align: right; }
}

/* ---------- PHONE: vertical menu behind a "Menu" button (menu.js) ---------- */
.menu-btn { display: none; }
@media (max-width: 760px) {
  .topbar { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--ink); border-radius: 99px;
    padding: 7px 12px; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer;
  }
  .menu-icon { display: grid; gap: 3px; width: 14px; }
  .menu-icon i { display: block; height: 1.5px; background: var(--ink); transition: transform .25s var(--ease), opacity .2s; }
  .topbar.menu-open .menu-icon i:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
  .topbar.menu-open .menu-icon i:nth-child(2) { opacity: 0; }
  .topbar.menu-open .menu-icon i:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }
  .topbar nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; margin-top: 12px; border-top: 1px solid var(--rule); }
  .topbar.menu-open nav { display: flex; }
  .topbar nav a { font-size: 20px; color: var(--ink); padding: 12px 0; border-bottom: 1px solid var(--rule); white-space: normal; }
  .topbar nav a::after { display: none; }
  .topbar nav a[aria-current="page"] { font-weight: 600; }
  .topbar .home-name { height: 34px; width: auto; }
}

/* ---------- ABOUT: mannequin on the left of the dress-up, its box on the right ---------- */
.doll .stage { aspect-ratio: 500 / 520; }
.doll .form { inset: auto; left: 0; top: 0; width: 60%; height: 100%; }
.doll .tray.box { left: 62%; right: auto; width: 37%; bottom: 0; height: 16%; }
@media (max-width: 860px) { .doll { max-width: 440px; } }
/* desktop: the dress-up sits closer to the letter (less white space between them) */
@media (min-width: 861px) { .doll { translate: -28px 0; } }

/* dress-up labels: outfit name over the mannequin, the hint over the box, the count under the mannequin */
.doll .outfit-title, .doll .outfit-bar { width: 60%; justify-content: center; }
.doll .stage .doll-hint { position: absolute; left: 61%; width: 38%; top: 24%; margin: 0; text-align: center; font-size: 15px; line-height: 1.35; color: var(--ink); z-index: 1; text-wrap: balance; }
@media (max-width: 860px) {
  .doll .outfit-bar { width: 100%; }
  .doll .outfit-count { min-width: 90px; font-size: 14px; }
  .doll .stage .doll-hint { top: 30%; font-size: 12px; }
}

/* the cockade swings gently back and forth while it is worn (pinned at its top) */
@keyframes cockade-sway { from { rotate: -5deg; } to { rotate: 5deg; } }
.doll .piece[data-piece="cockade"]:not(.in-tray):not(.lift) { transform-origin: 50% 8%; animation: cockade-sway 1.6s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .doll .piece[data-piece="cockade"] { animation: none !important; } }

/* the bonnet tilts up and down a little, and the flower pin nods, while they are worn */
@keyframes bonnet-tilt { from { rotate: -3deg; } to { rotate: 3deg; } }
@keyframes flower-nod { from { rotate: -6deg; } to { rotate: 5deg; } }
.doll .piece[data-piece="bonnet"]:not(.in-tray):not(.lift) { transform-origin: 50% 92%; animation: bonnet-tilt 2.4s ease-in-out infinite alternate; }
.doll .piece[data-piece="flower"]:not(.in-tray):not(.lift) { transform-origin: 40% 55%; animation: flower-nod 1.9s ease-in-out .3s infinite alternate; }
@media (prefers-reduced-motion: reduce) { .doll .piece[data-piece="bonnet"], .doll .piece[data-piece="flower"] { animation: none !important; } }

/* names written on the pieces (handwriting, thin, bent along the bottom edge); they follow the piece */
.doll .piece-label { position: absolute; z-index: 4; pointer-events: none; display: flex; align-items: flex-end; justify-content: center;
  transition: left .6s var(--ease), top .6s var(--ease), width .6s var(--ease), opacity .2s; }
.doll .piece-label .hand { width: 60%; max-width: 78px; translate: 0 78%; filter: url(#small-boil); }   /* just under the piece, curving around it */
.doll .piece-label .hand path { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-dashoffset: 0; stroke-linecap: round; stroke-linejoin: round; }
.doll .piece-label .hand path.halo { stroke: #fff; stroke-width: 5; }
.doll .piece-label.in-tray .hand { width: 90%; }
.doll .piece-label.lift { opacity: 0; }
/* round pieces: the bonnet's name runs down its round back (right side), the flower's name arches over its top */
/* bag: its name sits right under the bag, close to it */
/* every name arches over the top of its piece (like a label on a round object) */
.doll .piece-label { align-items: flex-start; }
.doll .piece-label .hand { width: 64%; max-width: 86px; translate: 0 -70%; }
.doll .piece-label[data-for="bag"] .hand { width: 46%; max-width: 54px; }
/* bonnet + flower worn together: their names sit apart (bonnet to the left, flower to the right), with room under the outfit name */
.doll .piece-label[data-for="bonnet"]:not(.in-tray) .hand { translate: -34% -58%; }
.doll .piece-label[data-for="flower"]:not(.in-tray) .hand { translate: 18% -70%; }
@media (min-width: 861px) { .doll .outfit-title { margin-bottom: 22px; } }
/* names stay readable over things: a soft white glow behind each name + a thicker white outline round the letters */
.doll .piece-label .hand { background: radial-gradient(ellipse 62% 58% at 50% 62%, rgba(255,255,255,.92) 45%, rgba(255,255,255,0) 100%); border-radius: 50%; }
.doll .piece-label .hand path.halo { stroke-width: 7; }
/* the white fade sits BEHIND the pieces (glow copy, under them); the handwriting stays in front */
.doll .piece-label:not(.glow) .hand { background: none; }
.doll .piece-label.glow { z-index: 1; }
.doll .piece-label.glow .hand { filter: none; }
.doll .piece-label.glow .hand path { stroke: none; }

/* ---------- CV pop-up: a portrait page, two even columns (sections flow and balance themselves) ---------- */
.cv-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100svh - 32px); overflow: auto; padding: 32px 36px; }
.cv-dialog .cv.cv-3 { display: block; column-count: 2; column-gap: 32px; column-fill: balance; }
.cv-dialog .cv.cv-3 > div { display: contents; }
.cv-dialog .cv.cv-3 section { break-inside: avoid; }
.cv-dialog .kv, .cv-dialog .small-kv, .cv-dialog .entry { grid-template-columns: 76px 1fr; column-gap: 10px; }
.cv-dialog .kv { font-size: 13.5px; }
.cv-dialog .small-kv { font-size: 12.5px; }
.cv-dialog .entry .what { font-size: 14.5px; }
.cv-dialog .entry .what p, .cv-dialog .entry ul { font-size: 12.5px; }
.cv-dialog .entry .when { font-size: 12px; }
@media (max-width: 640px) { .cv-dialog .cv.cv-3 { column-count: 1; } }
/* CV: no split dates/places, even line lengths, no single-word last lines */
.cv-dialog .entry .when, .cv-dialog .entry .when small { white-space: nowrap; }
.cv-dialog .kv, .cv-dialog .small-kv, .cv-dialog .entry { grid-template-columns: 86px 1fr; }
.cv-dialog .cv dd, .cv-dialog .cv li, .cv-dialog .entry .what p { text-wrap: balance; }
.cv-dialog .entry .what { text-wrap: balance; }

/* ---------- PROJECT PAGES fit the window: no section is taller than the screen ----------
   The tallest slide is 1152 x 760 (Figma); the content width is capped so it fits under the top bar. */
@media (min-width: 761px) {
  .case-layout .sheets > * { width: 100%; max-width: calc((100svh - 71px - 24px) * 1152 / 742); }
  /* side menu a bit larger */
  .toc a { font-size: 20px; }
  .toc ol { gap: 16px; }
}
/* menu stays on the left; content centres in the space beside it, so spare width is shared, not piled on the right */
@media (min-width: 761px) {
  .case-layout .sheets > * { margin-left: auto; margin-right: auto; }
}
@media (min-width: 761px) { .case-layout .sheets { overflow-x: clip; } }   /* slides' hidden right margin never makes the page scroll sideways */
.doll .form .plate.rim { fill: none; }
/* phones: smaller dress-up hint, sitting clear of the pieces in the box */
@media (max-width: 860px) { .doll .stage .doll-hint { font-size: 10.5px; line-height: 1.3; top: 26%; } }

/* ---------- ABOUT (desktop): edges line up with the top bar (name on the left, About on the right),
   a clear gap between letter and dress-up, box beside the mannequin, all centred vertically ---------- */
@media (min-width: 861px) {
  .about { padding: 0 72px; min-height: calc(100svh - 72px); display: flex; align-items: center; }
  .about-intro { width: 100%; justify-content: space-between; column-gap: 56px; padding: 16px 0; }
  .about .letter { padding-left: 0; }
  .doll { translate: none; }
  .doll .form { width: 58%; }
  .doll .tray.box { left: 58%; width: 41%; }
  .doll .stage .doll-hint { left: 58%; width: 41%; }
}
@media (min-width: 861px) {
  /* letter fills its side so only a small, even space separates it from the dress-up */
  .about-intro { grid-template-columns: minmax(0, 1fr) var(--dw); justify-content: stretch; column-gap: 48px; }
  .letter .hand-letter { width: min(100%, (100svh - 190px) * 1.0); }
}
@media (min-width: 861px) {
  /* letter and dress-up sit together with a small space, and the pair is centred on the page */
  .about-intro { grid-template-columns: auto var(--dw); justify-content: center; column-gap: 8px; }
}
@media (min-width: 861px) {
  /* the letter starts under the middle of the name in the top bar; the dress-up follows a small space after */
  .about-intro { justify-content: start; }
  .about .letter { padding-left: 85px; }
}
@media (min-width: 861px) {
  .letter .hand-letter { width: min(100svh - 190px, 100vw - 144px - 85px - 8px - var(--dw)); }
}

/* ---------- ABOUT: items glow softly until the first click ---------- */
@keyframes piece-glow {
  from { filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 0 0 rgba(255,196,84,0)); }
  to   { filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 0 9px rgba(255,196,84,.95)); }
}
.doll.untouched .piece { animation: piece-glow 1.1s ease-in-out infinite alternate; }
.doll.untouched .piece[data-piece="cockade"]:not(.in-tray):not(.lift) { animation: cockade-sway 1.6s ease-in-out infinite alternate, piece-glow 1.1s ease-in-out infinite alternate; }
.doll.untouched .piece[data-piece="bonnet"]:not(.in-tray):not(.lift) { animation: bonnet-tilt 2.4s ease-in-out infinite alternate, piece-glow 1.1s ease-in-out infinite alternate; }
.doll.untouched .piece[data-piece="flower"]:not(.in-tray):not(.lift) { animation: flower-nod 1.9s ease-in-out .3s infinite alternate, piece-glow 1.1s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .doll.untouched .piece { animation: none !important; filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 0 7px rgba(255,196,84,.8)); } }
@media (min-width: 861px) { .about-intro { align-items: start; } }
/* side menu back to 18px */
@media (min-width: 761px) { .toc a { font-size: 18px; } .toc ol { gap: 14px; } }
@media (min-width: 861px) { .about .letter { display: flex; flex-direction: column; } .about .letter .contact { margin-top: auto; padding-top: 10px; } }

/* ---------- PHONE: words from the slides as real text (phone.js) ---------- */
@media (max-width: 760px) {
  .sheet.split .ph-text { display: flex; flex-direction: column; gap: 10px; }
  .sheet.split .ph-t { position: static; width: auto; max-width: none; color: var(--ink); text-align: left; white-space: normal; transform: none; }
  .sheet.split .ph-t.h2 { font-size: 21px; line-height: 1.3; font-weight: 600; }
  .sheet.split .ph-t.k20 { font-size: 18px; font-weight: 600; }
  .sheet.split .ph-t.v20, .sheet.split .ph-t.v18, .sheet.split .ph-t.sh-cap { font-size: 15px; line-height: 1.45; }
  .sheet.split .ph-t.k16 { font-size: 14px; font-weight: 600; }
  .sheet.split .ph-row { display: block; }
  .sheet.split .ph-row.kv { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--rule); }
  .sheet.split .ph-row.kv .ph-t + .ph-t + .ph-t { grid-column: 2; }
  .sheet.split .ph-t.sh-bar { position: relative; height: auto; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
  .sheet.split .ph-t.sh-bar span { position: static; font-size: 15px; }
  .sheet.split .ph-t.mh-label { font-size: 12px; }
}
@media (max-width: 760px) {
  .sheet.split .ph-t, .sheet.split .ph-t * { width: auto !important; min-width: 0; max-width: 100%; white-space: normal !important; overflow-wrap: anywhere; position: static; }
  .sheet.split .ph-row.kv > * { min-width: 0; }
}

/* ---------- ABOUT: outfit name under the mannequin (above the arrows) ---------- */
.doll { display: flex; flex-direction: column; }
.doll .stage { order: 1; }
.doll .outfit-title { order: 2; margin: 8px 0 0; }
.doll .outfit-bar { order: 3; }
/* phones: a bigger dress-up, easier to tap */
@media (max-width: 860px) { .doll { max-width: none; width: 100%; margin: 28px 0 0; } .doll .stage { width: 100%; } }
/* home on phones: the odd last project sits centred */
@media (max-width: 760px) { .home-mobile .grid > a:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 9px); } }

/* ---------- ABOUT: the outfit's name sits between the arrows (instead of 1 / 3) ---------- */
.doll .outfit-bar { width: 60%; justify-content: space-between; align-items: center; }
.doll .outfit-bar .outfit-title { order: 0; margin: 0; flex: 1; min-height: 0; width: auto; display: flex; justify-content: center; }
.doll .outfit-bar .outfit-title .hand { height: 34px; }
.doll .outfit-count[hidden] { display: none; }
@media (max-width: 860px) { .doll .outfit-bar { width: 100%; } }
@media (max-width: 760px) { .sheets .video figcaption { font-size: 13px; line-height: 1.4; margin-top: 8px; } }

/* ---------- ABOUT dress-up on phones: no double-tap zoom, pinch still works outside the items ---------- */
.doll .stage { touch-action: manipulation; }
.doll .piece { touch-action: none; }          /* items can still be dragged */
.doll .deck-btn, .doll .piece-label { touch-action: manipulation; }
.doll .piece-label .hand { overflow: visible; }


/* ---------- PROJECT INTRO on phones: smaller title, then a smaller photo, then the facts, on one screen ---------- */
@media (max-width: 760px) {
  .intro { display: flex !important; flex-direction: column; row-gap: 10px; }
  .intro .intro-text { display: contents; }
  .intro .intro-title { order: 0; font-size: 30px; line-height: 1.1; margin: 0; }
  .intro .intro-fig { order: 1; display: flex; flex-direction: column; align-items: center; }
  .intro .intro-fig .zoom { width: auto; height: min(32svh, 260px); aspect-ratio: 564 / 640; }
  .intro .intro-fig figcaption { position: static; font-size: 12px; margin-top: 4px; text-align: center; }
  .intro .intro-facts { order: 2; font-size: 13.5px; line-height: 1.35; grid-template-columns: 82px 1fr; }
  .intro .intro-facts dt, .intro .intro-facts dd { padding: 6px 0; }
}
@media (max-width: 760px) {
  .intro .intro-fig { display: contents; }
  .intro .intro-fig .zoom { order: 1; align-self: center; width: 100%; height: min(32svh, 260px); aspect-ratio: auto; }
  .intro .intro-fig .zoom img { width: 100%; height: 100%; object-fit: contain; }
  .intro .intro-fig figcaption { order: 1; }
  .intro .intro-fig .intro-note { order: 3; font-size: 13.5px; line-height: 1.4; margin: 0; }
}
@media (max-width: 760px) {
  [data-project="screenager"] .intro { --pic-h: min(28svh, 220px) !important; }
  [data-project="screenager"] .intro .intro-fig .zoom { height: var(--pic-h) !important; width: calc(var(--pic-h) * 564 / 496) !important; max-width: 100%; }
  [data-project="screenager"] .intro .intro-fig figcaption { position: static; left: auto; transform: none; white-space: normal; }
  [data-project="screenager"] .intro .intro-fig .intro-note { position: static; width: auto; margin: 0; font-size: 13.5px; }
}
