/* Fulmerica — shared styles for every page */
:root {
  /* The Tabletop look: the page is warm paper and the words are charcoal. The names date from the site's first,
     dark look, so read --ink as "the page" and --paper as "the text". */
  --ink: #EDE8DE;            /* the page: the table */
  --ink-2: #FBF9F4;          /* raised things: sheets of lighter paper, form fields */
  --ink-3: #E2DCCF;          /* hover rows, the current page and section */
  --ink-4: #D3CCBC;
  --line: rgba(27, 27, 26, 0.15);
  --line-2: rgba(27, 27, 26, 0.4);
  --line-3: rgba(27, 27, 26, 0.55);      /* the edge of a control (outline buttons, form fields): 3.6:1 on the page, 3.8:1 on a sheet */
  --paper: #1B1B1A;          /* text */
  --muted: #48463F;          /* 7.6:1 on the page, 6.8:1 on a hover row */
  --faint: #57544C;          /* 6.2:1 on the page, 5.5:1 on a hover row */
  --verm: #D93B1B;           /* the full stop, arrows and rules. Not for small words: 3.7:1 on the page */
  --verm-hi: #9F2912;        /* vermilion for words: 6.2:1 on the page */
  --verm-soft: rgba(217, 59, 27, 0.11);
  --cyan: #1B1B1A;           /* the second accent is charcoal in this look: links, focus rings, chosen options */
  --cyan-soft: rgba(27, 27, 26, 0.08);
  --row-alt: rgba(27, 27, 26, 0.035);   /* every other row in a list; hover rows are --ink-3 */
  --sheet-shadow: 0 1px 1px rgba(27, 27, 26, 0.1), 0 16px 30px -20px rgba(27, 27, 26, 0.45);   /* a sheet of paper lying on the table */
  --thumb-shadow: 0 1px 1px rgba(27, 27, 26, 0.1), 0 10px 22px -16px rgba(27, 27, 26, 0.45);   /* a small print or screenshot */

  /* Title font. build.py sets these from site/brand.py, so change them there; these are fallbacks. */
  --display: 'Libre Franklin', 'Franklin Gothic Medium', 'Helvetica Neue', sans-serif;
  --display-weight: 700;     /* the biggest titles */
  --heading-weight: 700;     /* section and card titles */
  --wordmark-weight: 800;    /* "fulmerica" in the header */
  --display-stretch: 100%;
  --track: 1.2;              /* scales every title's negative letter-spacing */
  --h1-fit: 11.1;            /* the homepage headline's size, in hundredths of the page's content width, at which it fills one line */
  --ui: 'Hanken Grotesk', 'Helvetica Neue', system-ui, sans-serif;   /* buttons, labels, small links */
  --body: 'Hanken Grotesk', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4.5vw, 48px);
  --nav-h: 64px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  opacity: 0.28;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.2 0 0 0 0.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--paper); color: var(--ink); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); letter-spacing: calc(-0.025em * var(--track)); line-height: 1.02; text-wrap: balance; }
p { text-wrap: pretty; }
.dot { color: var(--verm); }

.label {
  font-family: var(--mono); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); display: inline-flex; align-items: center; gap: 10px;
}
.label b { color: var(--verm-hi); font-weight: 500; }
.label a { text-decoration: none; }
.label a:hover { color: var(--paper); }

/* ---------- Buttons, pills, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ui); font-weight: 600; font-size: 1rem; letter-spacing: -0.005em;
  padding: 13px 22px; border-radius: 999px; text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn-primary { background: var(--paper); color: var(--ink-2); }
.btn-primary:hover { background: #F0502F; color: var(--paper); transform: translateY(-2px); }   /* charcoal on the bright vermilion: 5.0:1 */
.btn-ghost { border-color: var(--line-3); color: var(--paper); background: transparent; }
.btn-ghost:hover { border-color: var(--paper); background: var(--ink-3); transform: translateY(-2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.status { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.status-live { background: var(--cyan-soft); color: var(--paper); }
.status-dev { background: var(--verm-soft); color: #8A220E; }
.status-proto { background: rgba(27, 27, 26, 0.07); color: var(--paper); }
.status-spec { border: 1px solid var(--line-2); color: var(--muted); padding: 3px 9px; }

.tech { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tech li { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }

/* ---------- Nav ---------- */
.skip { position: absolute; left: 16px; top: -60px; z-index: 400; background: var(--paper); color: var(--ink-2); padding: 10px 18px; border-radius: 0 0 10px 10px; font-weight: 700; text-decoration: none; transition: top 0.2s; }
.skip:focus { top: 0; }
.nav {
  position: sticky; top: 0; z-index: 200; height: var(--nav-h);
  background: rgba(237, 232, 222, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { max-width: none; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--wordmark-weight, var(--display-weight)); font-size: 1.35rem; letter-spacing: calc(-0.04em * var(--track)); }
.brand svg { width: 28px; height: 28px; flex-shrink: 0; }
.nav-links { display: flex; gap: 2px; list-style: none; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--muted); padding: 8px 14px; border-radius: 999px; transition: color 0.2s, background-color 0.2s; }
.nav-links a:hover { color: var(--paper); background: var(--ink-3); }
/* the current page: heavier words with a vermilion rule under them (the fill alone is too close to the page color to see) */
.nav-links a[aria-current="page"] { color: var(--paper); background: var(--ink-3); font-weight: 700; text-decoration: underline 2px var(--verm); text-underline-offset: 6px; }
.nav-links a[aria-current="page"]::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--verm); }
/* small pictures of objects beside the section links (hidden in the phone menu); the portrait beside About is round */
.nav-ico { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
img.nav-ico[src*="nav-about"] { border-radius: 50%; object-fit: cover; }
.nav-links a:has(.nav-ico) { padding: 5px 14px 5px 6px; }
.nav-links a:has(.nav-ico)[aria-current="page"]::before { display: none; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 26px 0 30px; }
.footer .wrap { max-width: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.footer small { font-family: var(--mono); font-size: 0.75rem; color: var(--faint); letter-spacing: 0.03em; }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer nav a { display: inline-flex; align-items: center; min-height: 24px; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-decoration: none; letter-spacing: 0.03em; }   /* 24px targets when the links wrap on a phone (WCAG 2.5.8) */
.footer nav a:hover { color: var(--paper); }

/* =========================================================
   Home
   ========================================================= */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section + .section { padding-top: 0; }
.more { display: inline-flex; align-items: center; gap: 8px; font-family: var(--ui); font-weight: 600; color: var(--paper); text-decoration: none; border-bottom: 1.5px solid var(--verm); padding-bottom: 2px; }
.more svg { width: 16px; height: 16px; color: var(--verm); transition: transform 0.25s var(--ease); }
.more:hover svg { transform: translateX(3px); }

/* the one dark band on the page: charcoal with cream words, so the text and ring colors swap inside it */
.hello { --paper: #EDE8DE; --muted: #CFC9BB; --line-2: rgba(237, 232, 222, 0.5); --line-3: rgba(237, 232, 222, 0.6); --cyan: #EDE8DE;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(20px, 3vw, 40px); align-items: center; padding: clamp(24px, 3vw, 36px); background: #1B1B1A; color: var(--paper); border-radius: var(--radius); }
.hello .btn-primary { background: #FBF9F4; color: #1B1B1A; }
.hello .btn-primary:hover { background: #F0502F; color: #1B1B1A; }
.hello .btn-ghost:hover { background: rgba(237, 232, 222, 0.12); border-color: #EDE8DE; }
.hello img { width: 120px; aspect-ratio: 864 / 1160; object-fit: cover; object-position: top; border-radius: 60px 60px 10px 10px; }
.hello h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); letter-spacing: calc(-0.03em * var(--track)); margin-bottom: 8px; }
.hello p { color: var(--muted); max-width: 56ch; }

/* =========================================================
   Page header (index, lab, about, project)
   ========================================================= */
.page-head { padding: clamp(40px, 7vw, 96px) 0 clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: clamp(3rem, 8vw, 6.6rem); letter-spacing: calc(-0.045em * var(--track)); line-height: 0.92; font-weight: var(--display-weight); margin-top: 18px; }
.page-head p { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 56ch; margin-top: 22px; }

/* =========================================================
   Index
   ========================================================= */
.idx-group { padding-bottom: clamp(40px, 6vw, 72px); }
/* The list every tab on Work & play and Read & learn uses. Each row (.idx-card) is a grid with named areas, so
   narrower windows move the line and the status under the name instead of hiding them. Most rows are one link;
   a playground row (.idx-card-play) is a div whose name link covers the whole row, with two small links on top.
   Dated rows (posts, Brief issues) sit in .idx-dated, whose date column is a little wider than the status column.
   Every other row has a faint warm tint (--row-alt) so a long row is easy to follow across. Hover is ink-3, on the
   card, so it covers the tint and stays clearly lighter than plain and tinted rows alike. */
.idx-list { list-style: none; --meta: 130px; }
.idx-dated { --meta: 150px; }
.idx-list-after { margin-top: 20px; }
.idx-card {
  position: relative;
  display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1.3fr) var(--meta) 20px; align-items: center; gap: 6px 20px;
  grid-template-areas: "thumb name line meta arrow";
  padding: 12px 10px; border-bottom: 1px solid var(--line); border-radius: 10px; text-decoration: none;
  transition: background-color 0.2s;
}
.idx-card-play { grid-template-areas: "thumb name line meta arrow" "thumb links line meta arrow"; }
.idx-row { border-radius: 10px; }
.idx-row:nth-child(even) { background: var(--row-alt); }
.idx-thumb { grid-area: thumb; }
.idx-name { grid-area: name; }
.idx-line { grid-area: line; }
.idx-card > .status, .idx-meta { grid-area: meta; justify-self: start; }
.idx-arrow { grid-area: arrow; }
.idx-links { grid-area: links; }
.idx-name { font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); font-size: clamp(1.25rem, 1.9vw, 1.6rem); letter-spacing: calc(-0.03em * var(--track)); line-height: 1.05; overflow-wrap: break-word; }
.idx-line { color: var(--muted); font-size: 0.98rem; line-height: 1.45; }
.idx-meta { font: 500 0.78rem/1.4 var(--mono); letter-spacing: 0.03em; color: var(--faint); }
.idx-era { color: var(--verm-hi); letter-spacing: 0.02em; }
.idx-era::first-letter { text-transform: uppercase; }
.idx-arrow { width: 18px; height: 18px; color: var(--faint); transition: color 0.2s; }
a.idx-card:hover, a.idx-card:focus-visible, .idx-card-play:hover, .idx-card-play:has(.idx-main:focus-visible) { background: var(--ink-3); }
.idx-card:hover .idx-name, a.idx-card:focus-visible .idx-name { color: var(--paper); }
.idx-card:hover .idx-arrow, a.idx-card:focus-visible .idx-arrow, .idx-card-play:has(.idx-main:focus-visible) .idx-arrow { color: var(--verm); }
.idx-thumb { width: 76px; height: 50px; object-fit: cover; object-position: top left; border-radius: 4px; border: 1px solid var(--line); box-shadow: var(--thumb-shadow); }
.idx-thumb.center { object-position: center 40%; }
.idx-thumb.obj { object-fit: contain; object-position: center; background: var(--ink-2); }      /* an object, shown whole on a small sheet */
.idx-mark { display: flex; align-items: center; justify-content: center; background: var(--ink); }
.idx-mark svg { width: 34px; height: 34px; }
.idx-main { text-decoration: none; }
.idx-main::after { content: ''; position: absolute; inset: 0; border-radius: 10px; }
.idx-links { display: flex; flex-wrap: wrap; gap: 0 18px; }
.idx-links a {
  position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 24px;
  font: 0.8rem var(--mono); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2);
}
.idx-links a:hover { color: var(--verm-hi); text-decoration-color: var(--verm-hi); }
/* =========================================================
   Project page
   ========================================================= */
.proj-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: end; padding: clamp(20px, 4vw, 48px) 0 clamp(24px, 3vw, 40px); }
.proj-head h1 { font-size: clamp(3rem, 8.5vw, 7.2rem); letter-spacing: calc(-0.05em * var(--track)); line-height: 0.9; font-weight: var(--display-weight); margin: 0 0 20px; }
.proj-head .lede { color: var(--muted); font-size: clamp(1.15rem, 2vw, 1.5rem); max-width: 34ch; line-height: 1.4; }
.proj-badge { display: grid; justify-items: end; gap: 14px; }
.proj-badge img { width: clamp(150px, 18vw, 240px); aspect-ratio: 1; object-fit: contain; }   /* the area's object, loose on the page */
.proj-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: clamp(28px, 4vw, 44px); }
.private-note, .proj-note { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.8rem; color: var(--faint); }
.private-note svg { width: 14px; height: 14px; }
.proj-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: var(--ink-2); box-shadow: 0 1px 1px rgba(27, 27, 26, 0.1), 0 30px 60px -36px rgba(27, 27, 26, 0.5); }
.proj-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; }
.proj-media.center img { object-position: center 40%; }
/* a project with no screenshot shows an object instead: whole, lying on the sheet, not cropped to fill it */
.proj-media.art { display: grid; place-items: center; padding: clamp(8px, 2vw, 24px); }
.proj-media.art img { width: auto; max-width: 100%; height: clamp(220px, 40vw, 460px); aspect-ratio: 1; object-fit: contain; }
.proj-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(32px, 6vw, 96px); padding: clamp(40px, 6vw, 80px) 0; }
.proj-about { display: grid; gap: 18px; align-content: start; }
.proj-about p { font-size: clamp(1.08rem, 1.4vw, 1.22rem); line-height: 1.7; color: #2B2A28; max-width: 62ch; }
.proj-about p:first-child { font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.5; color: var(--paper); }
.facts { display: grid; gap: 0; align-content: start; border-top: 1px solid var(--line-2); }
.facts > div { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.facts dd { color: var(--paper); }
.facts dd a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.facts ul.notes { list-style: none; display: grid; gap: 8px; }
.facts ul.notes li { display: flex; gap: 10px; align-items: baseline; color: var(--muted); font-size: 0.98rem; }
.facts ul.notes li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--verm); flex-shrink: 0; transform: translateY(-2px); }
.proj-about a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
/* songs to hear on a project page (tracks_section in build.py) */
.listen { padding-bottom: clamp(40px, 6vw, 80px); }
.listen h2 { font-size: 1.5rem; letter-spacing: calc(-0.025em * var(--track)); margin-bottom: 10px; }
.listen-intro { color: #2B2A28; max-width: 62ch; margin-bottom: 18px; }
.tracks { list-style: none; border-top: 1px solid var(--line-2); }
.track { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 48px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.track-text { display: grid; gap: 8px; align-content: start; min-width: 0; }
.track h3 { font-size: 1.35rem; line-height: 1.15; }
.track-meta { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--faint); }
.track-about { color: var(--paper); max-width: 66ch; }
.track-from { color: var(--muted); font-size: 0.95rem; max-width: 66ch; }
.track-from-label { color: var(--faint); }
.track audio { width: 100%; max-width: 520px; height: 44px; color-scheme: light; }
.listen-credits { color: var(--muted); font-size: 0.88rem; line-height: 1.6; max-width: 90ch; margin-top: 20px; }
@media (min-width: 900px) {
  .track { grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: center; }
}
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; padding-bottom: clamp(40px, 6vw, 80px); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: var(--radius); border: 1px solid var(--line-2); box-shadow: var(--thumb-shadow); }
.pager { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-2); }
.pager a { display: grid; gap: 6px; padding: clamp(24px, 4vw, 44px) 0; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.pager > a:nth-child(2) { text-align: right; border-left: 1px solid var(--line); padding-left: 24px; }
.pager a:first-child { padding-right: 24px; }
.pager .p-name { font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); font-size: clamp(1.5rem, 3.4vw, 2.8rem); letter-spacing: calc(-0.035em * var(--track)); line-height: 1; transition: color 0.2s; }
.pager a:hover .p-name { color: var(--verm-hi); }

/* =========================================================
   About
   ========================================================= */
.about { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); padding-block: clamp(40px, 7vw, 96px); align-items: start; }
.portrait { width: min(100%, 440px); aspect-ratio: 864 / 1160; object-fit: cover; object-position: top; border-radius: 220px 220px var(--radius) var(--radius); position: sticky; top: calc(var(--nav-h) + 32px); }
.about-text { display: grid; gap: 20px; }
.about-text h1 { font-size: clamp(2.8rem, 6vw, 5rem); letter-spacing: calc(-0.045em * var(--track)); line-height: 0.95; font-weight: var(--display-weight); }
.about-text > p { color: var(--muted); font-size: 1.14rem; }
.about-text > p strong { color: var(--paper); font-weight: 600; }
.principles { list-style: none; border-top: 1px solid var(--line); margin-top: 8px; }
.principles li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.principles .n { font-family: var(--mono); font-size: 0.8rem; color: var(--verm-hi); padding-top: 4px; grid-row: span 2; }
.principles h2 { font-size: 1.2rem; letter-spacing: calc(-0.015em * var(--track)); }
.principles p { color: var(--faint); font-size: 0.98rem; }
/* the professional section: a short work history, one row per stretch (CAREER in build.py) */
.career { display: grid; gap: 12px; margin-top: 18px; }
.career h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); letter-spacing: calc(-0.03em * var(--track)); }
.career > p { color: var(--muted); font-size: 1.08rem; }
.career-list { list-style: none; border-top: 1px solid var(--line); margin-top: 4px; }
.career-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 2px 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.career-when { font-family: var(--mono); font-size: 0.8rem; color: var(--faint); padding-top: 5px; grid-row: span 2; white-space: nowrap; }
.career-list h3 { font-size: 1.2rem; letter-spacing: calc(-0.015em * var(--track)); line-height: 1.2; }
.career-list p { color: var(--faint); font-size: 0.98rem; }
.career > .career-note { font-size: 0.95rem; color: var(--faint); }
@media (max-width: 480px) {
  .career-list li { grid-template-columns: minmax(0, 1fr); }
  .career-when { grid-row: auto; padding-top: 0; }
}
.contact-card { margin-top: 18px; display: grid; gap: 18px; padding: clamp(24px, 3vw, 36px); border-radius: var(--radius); background: var(--ink-2); box-shadow: var(--sheet-shadow); position: relative; overflow: hidden; }
.contact-card h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: calc(-0.04em * var(--track)); }
.contact-card > p { color: var(--muted); max-width: 40ch; }
/* the contact form sits on the raised card, so its fields drop back to the page color */
.contact-form { gap: 18px; }
.contact-card .note-form :is(textarea, input), .contact-card .fb-fallback textarea { background: var(--ink); }
.contact-card .fb-fallback, .contact-card .note-done { margin: 0; background: var(--ink); }
/* the picture of the bench gets its own row under the form, running off the card's corner, so no text sits on it */
.contact-card img { order: 1; justify-self: end; width: 260px; height: auto; margin: -36px -80px -100px 0; pointer-events: none; }
.contact-card > *:not(img) { position: relative; z-index: 1; }
.about-text > .colophon { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 26px; align-items: start; margin-top: 14px; padding-top: 28px; border-top: 1px solid var(--line); }
.colophon .seal { width: 128px; height: 128px; }
.colophon p { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); line-height: 1.8; }

/* =========================================================
   404
   ========================================================= */
.lost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: clamp(40px, 7vw, 96px); }
.lost h1 { font-size: clamp(3rem, 8vw, 6rem); letter-spacing: calc(-0.045em * var(--track)); line-height: 0.92; font-weight: var(--display-weight); margin: 18px 0; }
.lost p { color: var(--muted); font-size: 1.15rem; margin-bottom: 28px; max-width: 40ch; }
.plate { position: relative; width: 100%; max-width: 520px; justify-self: center; }
.plate canvas { display: block; width: 100%; aspect-ratio: 1; }
.plate .seal { position: absolute; right: 3%; bottom: 2%; width: 30%; height: auto; transform: rotate(-12deg); filter: drop-shadow(0 8px 14px rgba(27, 27, 26, 0.3)); }

.feedback-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px 32px; padding: clamp(24px, 3vw, 36px); margin-bottom: clamp(56px, 8vw, 110px); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.feedback-cta h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); letter-spacing: calc(-0.03em * var(--track)); margin-bottom: 6px; }
.feedback-cta p { color: var(--muted); max-width: 58ch; }

/* =========================================================
   Forms: playground feedback and the About page's contact form (forms.js)
   ========================================================= */
.wrap.narrow { max-width: 760px; }
.note-form { display: grid; gap: 22px; }
.note-form[hidden] { display: none; }
.fb-form { padding-bottom: clamp(56px, 8vw, 110px); }
.field { display: grid; gap: 8px; border: 0; }
.field label, .field legend { font-family: var(--ui); font-weight: 600; font-size: 1.05rem; }
.field .opt { font-family: var(--mono); font-weight: 400; font-size: 0.75rem; color: var(--faint); margin-left: 8px; }
.note-form select, .note-form textarea, .note-form input[type="email"], .note-form input[type="text"] {
  width: 100%; font: 400 1rem/1.5 var(--body); color: var(--paper); background: var(--ink-2);
  border: 1px solid var(--line-3); border-radius: 10px; padding: 12px 14px;
}
.note-form select:focus-visible, .note-form textarea:focus-visible, .note-form input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.note-form [aria-invalid="true"] { border-color: var(--verm-hi); border-width: 2px; }
.form-note { color: var(--muted); font-size: 0.95rem; }
.form-note a { color: var(--paper); text-underline-offset: 3px; }
/* after sending: the thank-you takes the form's place and gets focus */
.note-done { display: grid; gap: 14px; margin-bottom: clamp(56px, 8vw, 110px); padding: clamp(20px, 3vw, 28px); border: 1px solid var(--cyan); border-radius: var(--radius); background: var(--ink-2); }
.note-done[hidden] { display: none; }
.note-done h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); letter-spacing: calc(-0.03em * var(--track)); }
.note-done p { color: var(--muted); max-width: 58ch; }
.note-done:focus-visible, .fb-fallback h2:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; font: 500 0.95rem var(--body); border: 1px solid var(--line-3); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.choices label:has(input:checked) { border-color: var(--cyan); background: var(--cyan-soft); box-shadow: inset 0 0 0 1px var(--cyan); }
.choices input { accent-color: var(--cyan); }
.err { color: var(--verm-hi); font-size: 0.92rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-status { color: var(--cyan); min-height: 1.6em; }
.fb-status a { color: var(--cyan); }

/* =========================================================
   Research band (home)
   ========================================================= */
.research-band { border-top: 1px solid var(--line); }
/* The top of every section on Work & play and Read & learn (section_intro() in build.py) */
.section-intro { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: center; margin-bottom: clamp(24px, 3vw, 36px); }
.section-intro img { width: 230px; }
.section-intro h2 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: calc(-0.035em * var(--track)); margin: 12px 0 14px; overflow-wrap: break-word; }
.section-intro p { color: var(--muted); font-size: 1.1rem; max-width: 64ch; }
.section-intro .section-more { margin-top: 16px; }

/* =========================================================
   Blog
   ========================================================= */
.inline-link { color: var(--cyan); text-underline-offset: 3px; }
.post-list { list-style: none; border-top: 1px solid var(--line); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 28px; padding: 22px 10px; border-radius: 10px; text-decoration: none; transition: background-color 0.2s; }
.post-row time { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); letter-spacing: 0.03em; padding-top: 6px; grid-row: span 2; }
.post-title { font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); font-size: clamp(1.35rem, 2.2vw, 1.8rem); letter-spacing: calc(-0.025em * var(--track)); line-height: 1.15; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.post-sum { color: var(--muted); }
.post-row:hover { background: var(--ink-3); }
.post-list-lg { margin-bottom: clamp(56px, 8vw, 110px); }
.empty-note { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 28px; color: var(--muted); display: grid; gap: 8px; margin-bottom: 80px; }
.empty-note a { color: var(--cyan); }
.post { max-width: 820px; }
.draft-flag { margin-top: 28px; padding: 12px 16px; border-radius: 10px; background: var(--verm-soft); color: var(--verm-hi); font-family: var(--mono); font-size: 0.82rem; }
.post-head { padding: clamp(20px, 4vw, 44px) 0 clamp(24px, 3vw, 36px); }
.post-head .post-meta { margin-top: 18px; font: 500 0.78rem var(--mono); letter-spacing: 0.03em; color: var(--faint); }
.post-head h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: calc(-0.045em * var(--track)); line-height: 0.98; font-weight: var(--display-weight); margin: 0 0 18px; }
.post-head .lede { color: var(--muted); font-size: clamp(1.1rem, 1.8vw, 1.35rem); line-height: 1.45; }
.post-cover img { border-radius: var(--radius); border: 1px solid var(--line-2); box-shadow: var(--thumb-shadow); }
.prose { font-size: 1.1rem; line-height: 1.75; color: #2B2A28; padding-bottom: clamp(32px, 5vw, 56px); }
/* a post holds whatever was typed into it: long words, links and code wrap instead of pushing the page sideways */
.post { overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: calc(-0.03em * var(--track)); color: var(--paper); margin-top: 2.2em; line-height: 1.15; }
.prose h3 { font-size: 1.3rem; letter-spacing: calc(-0.02em * var(--track)); color: var(--paper); margin-top: 1.8em; line-height: 1.25; }
.prose h4 { font-size: 1.1rem; color: var(--paper); margin-top: 1.5em; }
.prose a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose strong { color: var(--paper); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { border-left: 3px solid var(--verm); padding-left: 18px; color: var(--muted); font-style: italic; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--ink-3); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; overflow-x: auto; position: relative; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 2.4em 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line-2); }
.prose figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); margin-top: 10px; }
/* position: relative keeps hidden helper text ("opens in a new tab") inside the scrolling box, not off the page's edge */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 10px; position: relative; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); min-width: 140px; }
.prose th { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.02em; color: var(--faint); background: var(--ink-2); }
.prose tr:last-child td { border-bottom: 0; }
.post-foot { display: grid; gap: 22px; padding: 24px 0 clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); }
.post-project { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px; border: 1px solid transparent; border-radius: var(--radius); background: var(--ink-2); box-shadow: var(--sheet-shadow); text-decoration: none; transition: border-color 0.2s; }
.post-project:hover { border-color: var(--line-2); }
.post-project img { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-radius: 8px; }
.post-project .pp-name { display: block; font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); font-size: 1.3rem; margin: 4px 0; }
.post-project .pp-line { display: block; color: var(--muted); font-size: 0.95rem; }
.related { padding-bottom: clamp(40px, 6vw, 72px); }
.related h2 { font-size: 1.5rem; letter-spacing: calc(-0.025em * var(--track)); margin-bottom: 14px; }
.nav-toggle { display: none; font: 600 0.92rem var(--body); color: var(--paper); background: transparent; border: 1px solid var(--line-3); border-radius: 999px; padding: 8px 16px; cursor: pointer; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1000px) {
  .hello { grid-template-columns: auto minmax(0, 1fr); }
  .hello .btn-row { grid-column: 1 / -1; }
  .idx-list { --meta: 120px; }
  .idx-dated { --meta: 150px; }
  .idx-card { grid-template-columns: 76px minmax(0, 1fr) var(--meta) 20px; grid-template-areas: "thumb name meta arrow" "thumb line meta arrow"; }
  .idx-card-play { grid-template-areas: "thumb name meta arrow" "thumb line meta arrow" "thumb links meta arrow"; }
  .proj-body, .about, .lost { grid-template-columns: 1fr; }
  .portrait { position: static; width: min(100%, 340px); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hello { grid-template-columns: 1fr; }
  .hello img { width: 96px; }
  .about-text > .colophon { grid-template-columns: 88px minmax(0, 1fr); gap: 18px; }
  .colophon .seal { width: 88px; height: 88px; }
  :root { --nav-h: 58px; }
  .brand span { display: none; }
  .nav-ico { display: none; }
  .nav-links a:has(.nav-ico) { padding: 12px 14px; }
  .nav-links a:has(.nav-ico)[aria-current="page"]::before { display: block; }
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px var(--gutter) 18px; background: var(--ink-2); border-bottom: 1px solid var(--line-2);
    max-height: calc(100dvh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1.05rem; }
  .section-intro { grid-template-columns: 1fr; }
  .section-intro img { width: 150px; }
  .post-row { grid-template-columns: 1fr; padding: 18px 4px; }
  .post-row time { grid-row: auto; padding-top: 0; }
  .post-project { grid-template-columns: 1fr; }
  .post-project img { width: 100%; }
  .idx-card { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "thumb name" "thumb line" "thumb meta"; align-items: start; gap: 6px 14px; padding: 14px 4px; }
  .idx-card-play { grid-template-areas: "thumb name" "thumb line" "thumb meta" "thumb links"; }
  .idx-thumb { width: 64px; height: 44px; }
  .idx-arrow { display: none; }
  .idx-name { font-size: 1.35rem; }
  .proj-head { grid-template-columns: 1fr; }
  .proj-badge { justify-items: start; }
  .proj-badge img { display: none; }
  .proj-head { gap: 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager > a:nth-child(2) { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; text-align: left; }
  .pager > span:first-child { display: none; }
  .pager > a:nth-child(2) .label { justify-content: flex-start !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Work & play: the playground section; Read & learn ---------- */
.play-strip { padding-bottom: clamp(40px, 6vw, 72px); }
.play-strip .idx-list { margin-bottom: 22px; }
.play-note { color: var(--muted); }
.idx-play {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; vertical-align: middle; white-space: nowrap;
  font: 600 0.75rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--cyan); background: var(--cyan-soft); padding: 4px 9px 4px 8px; border-radius: 999px;
}
.idx-play svg { width: 10px; height: 10px; }
.idx-more { color: var(--muted); padding-bottom: clamp(56px, 8vw, 110px); }
.read .section { padding: 0 0 clamp(48px, 7vw, 88px); }
@media (max-width: 720px) {
  .idx-play { margin-left: 8px; font-size: 0.75rem; padding: 3px 7px; }
}

/* ---------- Home: the Lineup ---------- */
/* A headline the full width of the page, the introduction and the two ways in, then nine objects in one row, the way
   tools get lined up on a bench (decoration: the row is described once, as one picture). Under the row, three plain
   columns of words: Work & play, Read & learn and What's new. build_home() in build.py. */
.wrap-home { max-width: 1480px; }
.lu-top { padding: clamp(24px, 4vw, 56px) 0 0; }
.home-h1 { font-weight: var(--display-weight); font-size: clamp(3.2rem, 14.5vw, 6.2rem); line-height: 0.92; letter-spacing: calc(-0.05em * var(--track)); }
.lu-lede { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px 48px; align-items: end; margin-top: clamp(16px, 2.2vw, 28px); }
.lu-lede p { color: var(--muted); font-size: clamp(1.1rem, 1.5vw, 1.28rem); max-width: 60ch; }
@media (min-width: 1001px) {
  /* One line, sized to the page's content width (not the window, which is wider than the content on a big screen):
     --h1-fit (site/brand.py) is the size, in hundredths of that width, at which the title font fills the line, with
     room left for the fallback fonts, which run a little wider. The first size is for browsers without container units. */
  .lu-top { container-type: inline-size; }
  .home-h1 { font-size: min(150px, 9.9vw); white-space: nowrap; }
  @supports (font-size: 1cqi) { .home-h1 { font-size: calc(var(--h1-fit, 11.1) * 1cqi); } }
  .lu-lede { grid-template-columns: minmax(0, 1fr) auto; }
}
/* The row of objects: five on small screens, all nine on wide ones. Each object's size is a share of the row's width
   (--u is the full height; --r makes small things smaller), so the row always fills the line. The objects are spaced
   by their own edges, not their pictures' (--w and --x, from site/objects.json), which leaves the same gap between
   every pair; the pictures' margins and shadows hang outside. The first sizes are for browsers without container units. */
.lu-row { container-type: inline-size; display: flex; justify-content: space-between; align-items: flex-end; margin: clamp(22px, 3vw, 44px) 0 clamp(8px, 1vw, 14px); padding-bottom: 10px;
  --u: min(15.7vw, 143px); }
.lu-row .o { flex: none; --h: calc(var(--u) * var(--r, 1)); width: calc(var(--h) * var(--w)); height: var(--h); }
.lu-row .o img { display: block; height: 100%; width: auto; max-width: none; margin-left: calc(var(--h) * var(--x) * -1); }
.lu-row .o:nth-child(n+6) { display: none; }
@supports (width: 1cqi) { .lu-row { --u: 17.5cqi; } }
@media (min-width: 900px) {
  .lu-row { --u: min(9.3vw, 143px); }
  .lu-row .o:nth-child(n+6) { display: block; }
  @supports (width: 1cqi) { .lu-row { --u: 10.33cqi; } }
}
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 28px; border-top: 1px solid var(--line-2); }
.home-cols > section { display: grid; gap: 10px; align-content: start; justify-items: start; min-width: 0; }
.home-cols > section > ul { justify-self: stretch; }
.home-cols h2 { font-size: clamp(1.7rem, 2.4vw, 2.1rem); letter-spacing: calc(-0.03em * var(--track)); margin-bottom: 6px; }
.home-cols .more { margin-top: 10px; }
@media (min-width: 900px) { .home-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* a column's list: a name and one line (Work & play, Read & learn), or a name, what it is and its date (What's new) */
.home-list, .n-list { list-style: none; border-top: 1px solid var(--line-2); }
.home-list li, .n-list li { border-bottom: 1px solid var(--line); }
.home-list a, .n-list a { position: relative; display: grid; gap: 2px; padding: 11px 6px; text-decoration: none; transition: background-color 0.2s; }
.home-list a:hover, .home-list a:focus-visible, .n-list a:hover, .n-list a:focus-visible { background: var(--ink-3); }
.home-name, .n-name { font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); font-size: 1.3rem; line-height: 1.12; letter-spacing: calc(-0.02em * var(--track)); }
.n-name { font-size: 1.2rem; line-height: 1.14; }
.home-line { color: var(--faint); font-size: 0.93rem; line-height: 1.45; }
.n-list { margin-bottom: 8px; }
.n-list a { gap: 3px; }
.n-meta { font: 500 0.76rem/1.4 var(--mono); letter-spacing: 0.03em; color: var(--faint); }
.news-kind { color: var(--verm-hi); margin-right: 0.6em; }
/* a row of pieces to play, linked by name */
.play-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin-top: clamp(18px, 2.4vw, 28px); padding: 10px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.play-row a { position: relative; display: inline-flex; align-items: center; min-height: 32px; font-family: var(--display); font-stretch: var(--display-stretch); font-weight: var(--heading-weight); font-size: 1.12rem; color: var(--paper); text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.play-row a:hover { text-decoration-color: var(--verm); }
.play-row .play-all { font: 600 0.95rem var(--ui); margin-left: auto; }
@media (max-width: 1000px) { .play-row .play-all { margin-left: 0; } }
.play-row + .section { padding-top: clamp(40px, 6vw, 72px); }

/* ---------- Section bar (Work & play, Read & learn) ---------- */
/* On wide screens the sections are a list down the left side (the next block). Narrower, this bar: it sticks under
   the main nav, full width, and wraps onto a second row when the window is too narrow for one
   (it never scrolls sideways, so no section is ever out of sight). nav.js keeps --subnav-h equal to the bar's
   real height, so in-page links and keyboard focus stop below it however many rows it has. */
html:has(.subnav) { scroll-padding-top: calc(var(--nav-h) + var(--subnav-h, 52px) + 16px); }
.subnav {
  position: sticky; top: var(--nav-h); z-index: 150; margin-bottom: clamp(28px, 4vw, 44px);
  --subnav-tint: rgba(27, 27, 26, 0.035);       /* a shade darker than the page */
  background: linear-gradient(var(--subnav-tint), var(--subnav-tint)), rgba(237, 232, 222, 0.97);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.subnav-inner { display: flex; flex-wrap: wrap; row-gap: 0; column-gap: clamp(2px, calc(2.4vw - 16px), 16px); }
.subnav-inner { padding-left: calc(var(--gutter) - 8px); }   /* the first section's text lines up with the page */
.subnav a {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 12px 8px 10px;
  font: 500 0.92rem var(--ui); color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.subnav a span { font: 500 0.75rem var(--mono); color: var(--faint); }
.subnav-ico { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.subnav a:hover { color: var(--paper); }
.subnav a[aria-current="true"] { color: var(--paper); border-bottom-color: var(--verm); }
.subnav a[aria-current="true"] span { color: var(--muted); }
/* the ring sits inside the link, so on a wrapped bar it doesn't overlap the row above or below */
.subnav a:focus-visible { outline-offset: -4px; border-radius: 8px; }

/* ---------- Section list down the side (wide screens) ---------- */
/* On a wide screen the bar of sections becomes a list down the left side, each section's object beside its name, and
   stays in view while the list on the right scrolls. Nothing wraps and every section is always visible. The markup
   and the tab script (nav.js) are the same either way: the same links, in the same order, before the same content.
   Short windows keep the list in the page instead of sticking, so its last links can't end up below the window. */
@media (min-width: 1000px) {
  @supports selector(:has(a)) {
    main:has(> .subnav) { display: grid; grid-template-columns: 256px minmax(0, 1fr); column-gap: clamp(28px, 4vw, 60px); align-content: start;
      width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
    main:has(> .subnav) > .wrap { max-width: none; margin: 0; padding: 0; min-width: 0; }
    main:has(> .subnav) > .wrap:first-child { grid-column: 1 / -1; margin-bottom: clamp(8px, 1.4vw, 20px); }
    main:has(> .subnav) > .subnav { grid-column: 1; align-self: start; position: sticky; top: calc(var(--nav-h) + 20px); z-index: 1;
      margin: 0 0 clamp(40px, 6vw, 72px); background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
    main:has(> .subnav) .subnav-inner { flex-direction: column; flex-wrap: nowrap; padding: 0; gap: 2px; border-top: 1px solid var(--line-2); }
    main:has(> .subnav) .subnav a { padding: 10px; gap: 12px; white-space: normal; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
    main:has(> .subnav) .subnav a span { margin-left: auto; }
    main:has(> .subnav) .subnav a:hover { background: var(--ink-3); }
    main:has(> .subnav) .subnav a[aria-current="true"] { border-bottom-color: var(--line); background: var(--ink-3); font-weight: 700; box-shadow: inset 3px 0 0 var(--verm); }
    main:has(> .subnav) .subnav-ico { width: 36px; height: 36px; }
    main:has(> .subnav) .subnav a:focus-visible { outline-offset: -3px; }
    html:has(main > .subnav) { scroll-padding-top: calc(var(--nav-h) + 16px); }
    /* the section's object is beside its name in the list, so the section doesn't repeat it */
    main:has(> .subnav) .section-intro { grid-template-columns: 1fr; }
    main:has(> .subnav) .section-intro img { display: none; }
  }
}
@media (min-width: 1000px) and (max-height: 640px) {
  main:has(> .subnav) > .subnav { position: static; }
}

/* ---------- Work & play, Read & learn: compact head with an object beside it, one section at a time ---------- */
/* The object is decoration: a background picture, hidden where there isn't room for it beside the words. */
.page-head-compact { padding-bottom: clamp(20px, 3vw, 32px); background: url(/art/t/obj-drum.webp) no-repeat right 3% center / auto min(88%, 240px); }
.read .page-head-compact { background-image: url(/art/t/obj-books.webp); }
@media (max-width: 1000px) { .page-head-compact, .read .page-head-compact { background-image: none; } }
@media (min-width: 1001px) { .page-head-compact h1, .page-head-compact p { max-width: min(720px, calc(100% - 370px)); } }   /* the words stop short of the object */
.page-head-compact h1 { font-size: clamp(2.6rem, 5.4vw, 4.4rem); margin-top: 14px; }
.page-head-compact p { margin-top: 14px; }
[data-panel][hidden]:not([hidden="until-found"]) { display: none; }
[data-panel][hidden="until-found"] { padding: 0 !important; margin: 0 !important; border: 0 !important; }
.idx-group { padding-bottom: clamp(28px, 4vw, 48px); }

/* ---------- Project pages and posts: where it sits, and a short Previous / Next ---------- */
.step-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: clamp(24px, 4vw, 44px); }
.step { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.step a {
  display: inline-flex; align-items: center; gap: 8px; max-width: 28ch; padding: 7px 14px;
  border: 1px solid var(--line-3); border-radius: 999px; font: 500 0.85rem var(--ui); color: var(--muted);
  text-decoration: none; transition: color 0.2s, background-color 0.2s;
}
.step a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step a svg { width: 14px; height: 14px; flex-shrink: 0; transition: color 0.2s; }
.step a:hover, .step a:focus-visible { color: var(--paper); background: var(--ink-3); }
.step a:hover svg, .step a:focus-visible svg { color: var(--verm); }
.step-count { font: 500 0.75rem var(--mono); color: var(--faint); padding: 0 6px; white-space: nowrap; }
@media (max-width: 640px) {
  .step a { padding: 8px 11px; }
  .step a span { display: none; }
}


/* ---------- Accessibility: zoom, small screens, contrast themes ---------- */
/* Short windows (a laptop at 300-400% zoom, a phone on its side): the header and section bar stop sticking, so they
   don't cover half the window. Normal phones and desktops keep them sticky. */
@media (max-height: 30em) {
  .nav, .subnav, main:has(> .subnav) > .subnav { position: relative; top: auto; }
  html, html:has(.subnav), html:has(main > .subnav) { scroll-padding-top: 16px; }
}
/* Phones: the section bar drops its pictures and scrolls with the page (three sticky rows would cover too
   much of a small screen). */
@media (max-width: 560px) {
  .subnav { position: relative; top: auto; }
  html:has(.subnav) { scroll-padding-top: calc(var(--nav-h) + 16px); }
  .subnav-ico { display: none; }
  .subnav a { padding: 10px 8px 8px; }
}
/* Long one-word titles ("Glasperlenspiel") fit a 320px window */
.home-h1, .page-head h1, .proj-head h1, .post-head h1, .about-text h1, .lost h1 { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 400px) { .proj-head h1 { font-size: 2.4rem; } }
/* Crumbs read as words, not spaced-out capitals, and their links look like links */
.label.crumbs, .lost .label { text-transform: none; letter-spacing: 0.02em; }
.crumbs a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.crumbs a:hover { text-decoration-color: currentColor; }
/* A heading that receives focus after choosing a section */
h2[tabindex="-1"]:focus { outline: none; }
h2[tabindex="-1"]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
/* The 404 drawing's pause button */
.plate .plate-pause {
  position: absolute; left: 3%; bottom: 3%; min-height: 36px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font: 600 0.85rem var(--ui); color: var(--paper); background: rgba(251, 249, 244, 0.92); border: 1px solid var(--line-3);
}
.plate .plate-pause[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
/* Windows contrast themes: backgrounds and shadows are dropped, so mark the current page and section another way */
@media (forced-colors: active) {
  body::after { display: none; }      /* no paper grain over a contrast theme's colors */
  .subnav a { border-bottom-color: Canvas; }
  .subnav a[aria-current="true"], main:has(> .subnav) .subnav a[aria-current="true"] { border-bottom: 4px solid Highlight; }
  .nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
  .status, .idx-play { border: 1px solid CanvasText; }
  .plate .plate-pause[aria-pressed="true"] { border-width: 3px; }
}
/* Forms: the copy-it-yourself fallback when a note can't be sent */
.fb-fallback { display: grid; gap: 12px; margin: -24px 0 clamp(56px, 8vw, 110px); padding: clamp(20px, 3vw, 28px); border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--ink-2); }
.fb-fallback[hidden] { display: none; }
.fb-fallback h2 { font-size: 1.5rem; }
.fb-fallback p { color: var(--muted); }
.fb-fallback label { font: 600 1rem var(--ui); }
.fb-fallback textarea { width: 100%; font: 400 0.95rem/1.5 var(--mono); color: var(--paper); background: var(--ink); border: 1px solid var(--line-3); border-radius: 10px; padding: 12px 14px; }
/* ---------- Builder's Brief: an issue as one plain page (brief_issue_page in build.py) ---------- */
/* The whole issue as ordinary text inside .prose: parts under a heavy rule, stories under a light one. Only parts and
   story headlines are headings; the labels inside a story ("The facts", "So what") are plain labels, so the outline
   stays short enough to move through by heading. */
.brief-open { margin-top: 14px; color: var(--muted); }
.brief-part { padding-top: 1.4em; border-top: 2px solid var(--paper); }
.brief-part + .brief-part { margin-top: 2.6em; }
.brief-part > h2 { margin-top: 0; }
.brief-part > * + * { margin-top: 1em; }
.brief-blurb { color: var(--muted); }
.story > * + * { margin-top: 0.9em; }
.story + .story { margin-top: 2.2em; padding-top: 1.8em; border-top: 1px solid var(--line-2); }
.prose .story h3 { margin-top: 0.2em; font-size: clamp(1.45rem, 2.4vw, 1.8rem); line-height: 1.12; }
.story-dek { font-size: 1.15rem; line-height: 1.55; color: var(--paper); }
.story-meta { font: 500 0.78rem/1.6 var(--mono); letter-spacing: 0.02em; color: var(--faint); }
.story-part { font: 600 0.78rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding-top: 0.6em; }
.story-art img { width: 100%; max-width: 560px; }
.salt { background: var(--ink-2); box-shadow: var(--sheet-shadow); border-radius: var(--radius); padding: 16px 18px; font-size: 0.98rem; line-height: 1.55; }
.salt > * + * { margin-top: 0.7em; }
.salt-h { font-family: var(--display); font-weight: var(--heading-weight); font-size: 1.15rem; color: var(--paper); }
.salt dl { display: grid; gap: 8px; }
.salt dt { font: 600 0.75rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.prose ul.angles { list-style: none; padding-left: 0; }
.stance { font: 600 0.72rem var(--mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--verm-hi); margin-right: 6px; }
.story-read a { font-weight: 600; }
.brief-audio { display: block; width: 100%; max-width: 520px; height: 44px; color-scheme: light; }
.brief-script { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; }
.brief-script summary { cursor: pointer; font-weight: 600; }
.brief-script > * + * { margin-top: 0.9em; }
.prose .brief-script h3 { margin-top: 1.4em; font-size: 1.05rem; }
/* Accessibility page */
.a11y-page .prose { padding-bottom: clamp(56px, 8vw, 110px); }
.a11y-page .prose h2:first-child { margin-top: 0; }
.a11y-updated { font: 500 0.8rem var(--mono); color: var(--faint); }
