/* Self-hosted, subset fonts (scripts/make_fonts.py): no wait on a font service before text appears. */
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/inter-tight.woff2") format("woff2"); font-style: normal; font-weight: 400 600; font-display: swap; }

/* Printed-paper editorial: warm paper, near-black ink, a serif display face over a grotesk,
   and one colour per project (--c, with --on for text that sits on it). */
:root {
  --bg: #f1ebdf;
  --fg: #17150f;
  --muted: #6a6253;   /* 5:1 on paper */
  --line: #d6ccb8;
  --tile: #e6dece;
  --accent: #e4572e;
  --model: #e3dccd;   /* read by viewer.js for STL parts */
  --edge: #17150f;
  --gutter: 36px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13110d; --fg: #f1ebdf; --muted: #9c937f; --line: #2d2922; --tile: #1e1b16;
    --model: #2e2a23; --edge: #efe7d6; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13110d; --fg: #f1ebdf; --muted: #9c937f; --line: #2d2922; --tile: #1e1b16;
  --model: #2e2a23; --edge: #efe7d6; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.55 var(--sans);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Paper grain over everything. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  opacity: .05; will-change: transform; contain: strict;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.skip {
  position: fixed; left: 12px; top: 10px; z-index: 80; padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg); transform: translateY(-160%); transition: transform .2s;
}
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
.tile:focus-visible, .thumb:focus-visible, .shelf-item:focus-visible, .swatch:focus-visible { outline-offset: 6px; }
main:focus { outline: none; }
main { min-height: 100vh; min-height: 100svh; }   /* the footer starts below the fold, so it doesn't jump when the page fills in */
::selection { background: var(--accent); color: #f6f0e4; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.muted { color: var(--muted); }

/* A project's colour as readable text (app.js works out --ct-l / --ct-d for light and dark pages). */
[style*="--ct-l"] { --ct: var(--ct-l); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [style*="--ct-l"] { --ct: var(--ct-d); } }
:root[data-theme="dark"] [style*="--ct-l"] { --ct: var(--ct-d); }

/* ---- header / footer ---- */
.topbar, .footer, .page { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .3s;
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 20px; padding-bottom: 16px;
}
html.over-hero .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 96%, transparent); }
.mark { font-family: var(--serif); font-size: 30px; line-height: 1; letter-spacing: -0.01em; }
.mark::after { content: "."; color: var(--accent); }
.topbar nav { display: flex; gap: 26px; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.topbar nav a { color: var(--muted); transition: color .2s; position: relative; }
.topbar nav a:hover, .topbar nav a.active { color: var(--fg); }
.topbar nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%; background: var(--accent);
}

.footer { margin-top: 160px; padding-bottom: 36px; }
.say {
  font-family: var(--serif); font-size: clamp(40px, 7.4vw, 112px); line-height: .98; letter-spacing: -0.02em;
  margin: 0 0 56px; border-top: 1px solid var(--fg); padding-top: 36px;
}
.say em { color: var(--accent); }
.say .arrow { font-family: var(--sans); font-size: .5em; vertical-align: .25em; color: var(--muted); }
.say a { background: linear-gradient(var(--accent), var(--accent)) 0 92% / 0 .06em no-repeat; transition: background-size .5s ease; }
.say a:hover { background-size: 100% .06em; }
.footer-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px;
  font-size: 14px; text-transform: uppercase; letter-spacing: .08em;
}
.footer-row > :last-child { justify-self: end; }
.links { display: inline-flex; flex-wrap: wrap; gap: 6px 18px; }
.links a { color: var(--muted); transition: color .2s; }
.links a:hover { color: var(--fg); }

/* ---- home ---- */
.lede { padding: 64px 0 56px; }
.statement {
  font-family: var(--serif); font-size: clamp(38px, 6.2vw, 96px); line-height: 1.02; letter-spacing: -0.02em;
  margin: 0; max-width: 16ch; max-width: 1180px;
}
.statement em { color: var(--accent); }
.intro { font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); max-width: 560px; margin: 36px 0 0 auto; line-height: 1.5; }
.intro em { color: var(--fg); font-size: 1.12em; }

/* The colour index: one swatch per project, which opens on hover. */
.palette { display: flex; height: 132px; margin: 8px 0 20px; gap: 4px; }
.swatch {
  flex: 1 1 0; min-width: 0; position: relative; overflow: hidden; background: var(--c); color: var(--on);
  display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px;
  transition: flex-grow .45s cubic-bezier(.2, .7, .2, 1);
}
.swatch:hover, .swatch:focus-visible { flex-grow: 3.2; }
.swatch-num { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1; }
.swatch-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }

/* The board: a scroll runway with the stage pinned inside it, full width, on solder-mask green. */
.hero-run { position: relative; height: 290vh; width: 100vw; margin-left: calc(50% - 50vw); }
.hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; }
.hero-stage {
  position: absolute; inset: 0; overflow: hidden; color: #f1ebdf;
  background: radial-gradient(120% 90% at 50% 45%, #17583f 0%, #0d3a29 55%, #082a1d 100%);
}
.hero-name {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-family: var(--serif); font-size: clamp(110px, 21vw, 380px); line-height: .8; letter-spacing: -0.025em;
  white-space: nowrap; color: #1f6e4f;
}
.hero-name span { color: inherit; }
.hero-viewer { position: absolute; inset: 0; cursor: default; }
.hero-viewer.can-grab { cursor: grab; }
.hero-viewer.dragging { cursor: grabbing; }
.hero-leaders { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hero-leaders line { stroke: rgba(241, 235, 223, .55); stroke-width: 1; }
.hero-leaders circle { fill: #f1ebdf; }
.hero-labels { position: absolute; inset: 0; pointer-events: none; }
.layer-label {
  position: absolute; left: 0; top: 0; margin-top: -.62em; opacity: 0; white-space: nowrap;
  font-size: clamp(18px, 1.9vw, 28px); color: #f1ebdf; transition: color .25s;
}
.layer-label.on { color: #ffd98a; }
.hero-readout {
  position: absolute; left: var(--gutter); bottom: 30px; display: flex; flex-wrap: wrap; gap: 10px 32px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: rgba(241, 235, 223, .7);
}
.reading b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.4vw, 34px); letter-spacing: 0; text-transform: none; color: #f1ebdf; line-height: 1.1; }
.hero-hint {
  position: absolute; right: var(--gutter); bottom: 30px; margin: 0; font-size: 11px; text-transform: uppercase;
  letter-spacing: .12em; color: rgba(241, 235, 223, .7);
}
.hero-caption { max-width: 1400px; margin: 14px auto 0; padding: 0 var(--gutter); font-size: 14px; color: var(--muted); }

.section-mark {
  font-family: var(--sans); font-weight: 500; font-size: clamp(44px, 7vw, 108px); letter-spacing: -0.045em; line-height: 1;
  margin: 120px 0 36px; display: flex; align-items: baseline; gap: .18em;
}
.section-mark em { font-size: 1.08em; letter-spacing: -0.02em; color: var(--accent); }

.masonry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.col { display: grid; gap: 24px; }
.col:nth-child(2) { margin-top: 96px; }      /* offset columns, like a pasted-up spread */
.tile { position: relative; display: block; overflow: hidden; }
.cover { position: relative; background: var(--tile); overflow: hidden; }
.cover img { width: 100%; height: auto; display: block; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.tile:hover .cover img { transform: scale(1.035); }
.cover.model { aspect-ratio: 4 / 3; }
.cover.dark { background: #12100c; }
.cover .viewer { position: absolute; inset: 0; }
.tile-num {
  position: absolute; top: 12px; left: 14px; z-index: 2; font-family: var(--serif); font-style: italic; font-size: 22px;
  line-height: 1; color: var(--on); background: var(--c); padding: 5px 9px 6px; border-radius: 999px;
}
/* Title and category on the project's colour, which rises on hover. */
.tile-text {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 26px 28px; background: var(--c); color: var(--on);
  clip-path: inset(100% 0 0 0); transition: clip-path .5s cubic-bezier(.2, .7, .2, 1);
}
.tile:hover .tile-text, .tile:focus-visible .tile-text { clip-path: inset(0 0 0 0); }
.tile-title { font-family: var(--serif); font-size: clamp(34px, 3.6vw, 56px); line-height: 1; letter-spacing: -0.01em; }
.tile-cat { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-top: 12px; opacity: .8; }
/* Phones and tablets have no hover: the title goes under the picture instead. */
@media (hover: none) {
  .tile-text {
    position: static; clip-path: none; background: none; color: var(--fg); padding: 12px 0 0;
    flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 0 12px;
  }
  .tile-title { font-size: 28px; }
  .tile-cat { color: var(--muted); margin: 0; font-size: 12px; opacity: 1; }
}

/* ---- project page: full-width pictures, then title beside the description ---- */
.stack { display: grid; gap: 16px; padding-top: 20px; }
.shot { position: relative; overflow: hidden; background: var(--tile); }
.shot img { width: 100%; height: auto; }
.shot.model { aspect-ratio: 3 / 2; background: color-mix(in srgb, var(--c) 14%, var(--tile)); }
.shot[data-zoom] { cursor: zoom-in; }
.shot[data-zoom] img { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.shot[data-zoom]:hover img { transform: scale(1.015); }
.shot.dark { background: #12100c; }
.shot.cover img { object-fit: cover; }
.shot.model .viewer { position: absolute; inset: 0; }
.hint {
  position: absolute; right: 16px; bottom: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--on); background: var(--c); padding: 5px 10px; border-radius: 999px; pointer-events: none;
}

/* Project page: a hero picture, the text, then rows of pictures at their own shapes, each captioned. */
.hero-shot { padding-top: 20px; }
.hero-shot .fig { max-width: none; }
.gallery { display: grid; gap: 56px; margin-top: 96px; }
.row { display: flex; gap: 20px; align-items: flex-start; }
.row.multi .fig { flex-basis: 0; min-width: 0; }
.row:not(.multi) .fig { flex-grow: 1 !important; }
.fig { margin: 0; flex: 1 1 0; min-width: 0; }
.fig figcaption {
  display: flex; gap: 12px; margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--muted); max-width: 620px;
}
.fig-num { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.1; color: var(--ct); flex: none; }
/* IA sample pages: three paper sheets on the project's colour. */
.row.pages { background: color-mix(in srgb, var(--c) 22%, var(--bg)); padding: clamp(24px, 4vw, 56px); }
.sheets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 36px); align-items: start; }
.sheet {
  all: unset; display: flex; flex-direction: column; gap: 12px; cursor: zoom-in; position: relative;
}
.sheet img {
  width: 100%; height: auto; background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 18px 40px -18px rgba(0, 0, 0, .45);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s;
}
.sheet:nth-child(1) img { transform: rotate(-1.2deg); }
.sheet:nth-child(3) img { transform: rotate(1deg); }
.sheet:hover img, .sheet:focus-visible img { transform: translateY(-6px) rotate(0); box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 28px 50px -20px rgba(0, 0, 0, .5); }
.sheet:focus-visible { outline: 2px solid var(--fg); outline-offset: 6px; }
.sheet-label { font-size: 20px; text-align: center; }
.fig-pages figcaption { color: var(--fg); }

/* The picture viewer. */
.lightbox {
  position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center;
  background: color-mix(in srgb, #0f0d0a 94%, transparent); color: #f1ebdf; padding: 24px 12px;
}
.lightbox[hidden] { display: none; }
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: 100%; min-height: 0; }
.lb-fig img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; object-fit: contain; background: #fff; }
.lb-fig figcaption { display: flex; gap: 14px; font-size: 15px; max-width: 760px; text-align: left; color: #d9d0bf; }
.lb-count { font-family: var(--serif); font-style: italic; color: #f1ebdf; white-space: nowrap; }
.lightbox button { all: unset; box-sizing: border-box; cursor: pointer; font-size: 28px; line-height: 1; text-align: center; padding: 14px; color: #f1ebdf; border-radius: 999px; }
.lightbox button:hover, .lightbox button:focus-visible { background: rgba(241, 235, 223, .12); }
.lightbox .lb-close { position: absolute; top: 14px; right: 18px; font-size: 34px; }
.lightbox .lb-prev { grid-column: 1; }
.lightbox .lb-next { grid-column: 3; }
.lb-fig { grid-column: 2; grid-row: 1; }
html.lb-open { overflow: hidden; }

.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 64px; margin-top: 72px; }
.about-head { display: flex; flex-direction: column; align-items: flex-start; }
.big-num {
  font-family: var(--serif); font-style: italic; font-size: clamp(96px, 13vw, 200px); line-height: .8;
  color: var(--ct); margin-bottom: 18px; letter-spacing: -0.03em;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--c) 70%, var(--fg));
}
.about h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.6vw, 68px); line-height: 1; letter-spacing: -0.015em; margin: 0; }
.about h1 em { color: var(--accent); }
.cat {
  margin-top: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
  display: inline-flex; align-items: center; gap: 10px;
}
.cat::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.desc { max-width: 660px; padding-top: 8px; }
.desc p { font-size: 18px; line-height: 1.62; margin: 0 0 1.1em; }
.desc p.first { font-size: clamp(21px, 1.9vw, 26px); line-height: 1.4; letter-spacing: -0.01em; }
.desc .plain-links { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; font-size: 16px; }
.desc .plain-links a {
  width: fit-content; background: linear-gradient(var(--c), var(--c)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 2px; transition: background-size .3s;
}
.desc .plain-links a::after { content: " ↗"; color: var(--muted); }
.desc .plain-links a:hover { background-size: 100% 100%; color: var(--on); }

.next {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 120px;
  border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg);
}
.next a { display: flex; flex-direction: column; gap: 6px; padding: 28px 0; position: relative; transition: background .35s, color .35s, padding .35s; }
.next a + a { text-align: right; border-left: 1px solid var(--fg); align-items: flex-end; }
.next a:hover { background: var(--c); color: var(--on); padding-left: 24px; padding-right: 24px; }
.step-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.step-title { font-family: var(--serif); font-size: clamp(30px, 4vw, 58px); line-height: 1; }

.more { margin-top: 88px; }
.more h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 24px; }
.more h2 em { font-size: 1.3em; color: var(--accent); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; }
.thumb { display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; }
.thumb .cover { aspect-ratio: 4 / 3; margin-bottom: 10px; box-shadow: 0 5px 0 var(--c); transition: box-shadow .3s, transform .3s; }
.thumb .cover img { height: 100%; object-fit: cover; }
.thumb:hover .cover { transform: translateY(-4px); box-shadow: 0 9px 0 var(--c); }
.thumb-title { font-family: var(--serif); font-size: 21px; line-height: 1.1; margin-top: 6px; }
.thumb-cat { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }

/* ---- profile ---- */
.pf-head { padding: 64px 0 40px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 64px; align-items: end; }
.pf-head h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 8.4vw, 132px); line-height: .92; letter-spacing: -0.02em; margin: 0; }
.pf-head h1 em { color: var(--accent); }
.pf-lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; color: var(--muted); margin: 0 0 .5em; }
.pf-h2 { font-family: var(--sans); font-weight: 500; font-size: clamp(30px, 3.6vw, 52px); letter-spacing: -0.035em; line-height: 1; margin: 0 0 28px; }
.pf-h2 em { color: var(--accent); font-size: 1.1em; letter-spacing: -0.01em; }

.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--fg); border-bottom: 1px solid var(--fg); }
.stat { display: flex; flex-direction: column; gap: 10px; padding: 28px 24px 30px 0; position: relative; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat-num { font-family: var(--serif); font-size: clamp(54px, 6.4vw, 104px); line-height: .9; letter-spacing: -0.02em; }
.stat-num::after { content: ""; display: block; width: 44px; height: 6px; background: var(--c); margin-top: 16px; }
.stat-text { font-size: 15px; line-height: 1.4; color: var(--muted); max-width: 22ch; }

.pf-shelf { margin-top: 110px; }
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.shelf-item { display: flex; flex-direction: column; gap: 4px; }
.shelf-stage {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; margin-bottom: 10px;
  background: radial-gradient(90% 70% at 50% 45%, color-mix(in srgb, var(--c) 34%, var(--bg)), color-mix(in srgb, var(--c) 62%, var(--bg)));
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.shelf-stage .viewer { position: absolute; inset: 0; }
.shelf-item:hover .shelf-stage { transform: translateY(-6px); }
.shelf-label { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.shelf-go { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); transition: color .2s; }
.shelf-item:hover .shelf-go { color: var(--fg); }

.profile .about { margin-top: 110px; }
.profile .about .pf-h2 { margin: 0; }

.pf-time { margin-top: 110px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.tl-item > a, .tl-item > div {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2px 32px; padding: 18px 0 18px 40px; position: relative;
  border-bottom: 1px solid var(--line);
}
.tl-item > a::before, .tl-item > div::before {
  content: ""; position: absolute; left: 0; top: 24px; width: 15px; height: 15px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-when { grid-row: span 2; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 6px; }
.tl-what { font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; }
.tl-detail { color: var(--muted); font-size: 16px; line-height: 1.45; max-width: 640px; }
.tl-item > a { transition: background .3s; }
.tl-item > a:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.tl-item > a:hover .tl-what { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 2px; text-underline-offset: 5px; }

.pf-skills { margin-top: 110px; }
.pf-skills dl { display: grid; grid-template-columns: 210px minmax(0, 1fr); margin: 0; border-top: 1px solid var(--line); }
.pf-skills dt { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 22px 0; border-bottom: 1px solid var(--line); }
.pf-skills dd { margin: 0; padding: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); }
.chip { font-size: 15px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; transition: border-color .2s, background .2s; }
.chip:hover { border-color: var(--fg); }

.pf-cta { margin-top: 110px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.pf-cta p { margin: 0; font-family: var(--serif); font-size: clamp(34px, 4.4vw, 64px); line-height: 1; }
.pf-cta p em { color: var(--accent); }
.pf-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; padding: 16px 26px; border-radius: 999px; font-size: 16px; font-weight: 500;
  background: var(--fg); color: var(--bg); transition: background .25s, color .25s, transform .25s;
}
.btn:hover { background: var(--accent); color: #f6f0e4; transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.btn.ghost:hover { background: var(--fg); color: var(--bg); }

/* ---- profile: what I'm doing this term ---- */
.now { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 64px; margin-top: 72px; }
.now h2 { margin: 0; font-weight: 400; display: flex; align-items: baseline; gap: 14px; }
.now h2 em { font-size: clamp(48px, 5vw, 76px); line-height: 1; color: var(--accent); }
.now-when { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.now ol { list-style: none; counter-reset: now; margin: 0; padding: 0; max-width: 660px; border-top: 1px solid var(--line); }
.now li {
  counter-increment: now; display: grid; grid-template-columns: 48px 1fr; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 19px; line-height: 1.4;
}
.now li::before { content: counter(now, decimal-leading-zero); font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }

/* ---- motion: added by app.js only when the reader has not asked for reduced motion ---- */
.motion .stat, .motion .shelf-item, .motion .tl-item, .motion .pf-skills, .motion .pf-cta, .motion .shot, .motion .fig, .motion .tile, .motion .about, .motion .next, .motion .thumb, .motion .now, .motion .hero {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
}
.motion .swatch { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1), flex-grow .45s cubic-bezier(.2, .7, .2, 1); }
.motion .in, .motion .fig .shot { opacity: 1; transform: none; }
.motion .statement { animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.motion .intro { animation: rise 1.1s .25s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---- 3D viewers ---- */
.viewer { position: relative; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
/* Vertical swipes always scroll the page, even when they start on a model: sideways drags turn a model or pull a
   board layer out. (touch-action: none here once trapped scrolling on phones wherever a model filled the screen.) */
.viewer:active { cursor: grabbing; }
.viewer.still { pointer-events: none; }   /* grid tiles: the whole tile is a link */
.viewer canvas { position: relative; display: block; width: 100% !important; height: 100% !important; transition: opacity .25s; }
.viewer > img.snap { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hero-viewer > img.snap { object-fit: cover; }
.viewer .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .mark { font-size: 26px; white-space: nowrap; }
  .topbar nav { gap: 16px; font-size: 13px; }
  .topbar nav a.active::before { left: -9px; }
  .lede { padding: 32px 0 36px; }
  .intro { margin-left: 0; }
  .palette { height: 88px; gap: 3px; }
  .hero-run { height: 230vh; }
  .hero-name { font-size: 27vw; align-items: flex-start; padding-top: 16vh; }
  .hero-readout { gap: 8px 18px; bottom: 22px; }
  .hero-hint { display: none; }
  .layer-label { font-size: 15px; }
  .swatch { padding: 8px 6px; }
  .swatch-title { display: none; }
  .swatch-num { font-size: 17px; }
  .section-mark { margin-top: 80px; }
  .masonry { grid-template-columns: 1fr; }
  .col { display: contents; }   /* one column in the original order */
  .col:nth-child(2) { margin-top: 0; }
  .about, .now { grid-template-columns: 1fr; gap: 18px; margin-top: 52px; }
  .pf-head { grid-template-columns: 1fr; padding: 32px 0 28px; }
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-shelf, .pf-time, .pf-skills, .pf-cta, .profile .about { margin-top: 72px; }
  .tl-item > a, .tl-item > div { grid-template-columns: 1fr; padding-left: 34px; }
  .tl-when { grid-row: auto; padding-top: 0; }
  .pf-skills dl { grid-template-columns: 1fr; }
  .pf-skills dt { padding: 16px 0 4px; border-bottom: 0; }
  .gallery { gap: 36px; margin-top: 64px; }
  .row { flex-direction: column; gap: 36px; }
  .row.multi .fig { flex-basis: auto; width: 100%; }
  .sheets { gap: 10px; }
  .sheet-label { font-size: 15px; }
  .lightbox { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 16px 4px; }
  .next { grid-template-columns: 1fr; }
  .next a + a { border-left: 0; border-top: 1px solid var(--fg); }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer { margin-top: 110px; }
  .footer-row { grid-template-columns: 1fr; }
  .footer-row > :last-child { justify-self: start; }
  .say { font-size: clamp(34px, 11vw, 56px); overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---- page transitions: the clicked picture grows into the next page's opening picture ---- */
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
::view-transition-old(root) { animation: vt-out .28s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .5s cubic-bezier(.2, .7, .2, 1) .08s both; }
::view-transition-group(opening) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-old(opening), ::view-transition-new(opening) { height: 100%; object-fit: cover; }
