/* ═══════════════════════════════════════════════════════════════
   MAIN: the site stylesheet on the new design system (DESIGN.md v3.3).
   Loaded after tokens.css. Uses ONLY tokens for colour, type, motion,
   space, radius and shadow; one-off layout numbers carry a comment.
   Every page uses it (the old site.css was retired in Oct 2026 when the
   last pages were restyled).
   Seeded from the approved /design/ specimen (design.css, deleted at the
   Phase 2 release), minus the
   specimen-only parts (spec bar, system sheet, slot toggle).
   Scroll reveals and page cross-fades belong to the later "Motion
   layer" item, so they are deliberately not here yet.
═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--leading-body); color: var(--color-ink); background: var(--color-bg); -webkit-font-smoothing: antialiased; }
a { color: var(--color-accent); text-underline-offset: 0.2em; }
:focus-visible { outline: 2.5px solid var(--color-accent); outline-offset: 3px; border-radius: var(--radius-sm); }
::selection { background: var(--color-accent-soft); color: var(--color-ink); }
ul[role="list"], ol[role="list"] { list-style: none; }
/* Components set display:flex/grid, which would beat the hidden attribute. */
[hidden] { display: none !important; }
.wrap { max-width: var(--layout-max); margin: 0 auto; padding: 0 var(--layout-gutter); }

/* Sections reached from the sticky nav (/#work, /#how) must not hide
   their heading under it. 88px = the 72px nav plus breathing room. */
[id] { scroll-margin-top: 88px; }

/* ─── Shared bits ─── */
.accent { color: var(--color-accent); }
.mono { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-3); }
.hand { font-family: var(--font-hand); font-weight: var(--weight-semibold); color: var(--color-ink-3); line-height: 1.1; }
.chip { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: var(--text-2xs); font-weight: var(--weight-medium); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-ink-2); background: var(--chip-fill); border: 1px solid var(--chip-border); border-radius: var(--radius-pill); padding: 0.35rem 0.65rem; }

/* Buttons: pill, 46px tall (DESIGN.md §6). Colour changes only on hover. */
.btn { display: inline-flex; align-items: center; gap: var(--space-1); height: 46px; padding: 0 1.25rem; border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1; text-decoration: none; border: 1.5px solid var(--color-ink); transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.btn-fill { background: var(--color-ink); color: var(--color-on-dark); }
.btn-fill:hover { background: var(--color-accent); border-color: var(--color-accent); }
.btn-line { background: var(--color-surface); color: var(--color-ink); }
.btn-line:hover { border-color: var(--color-accent); color: var(--color-accent); }
.arr { display: inline-block; transition: transform var(--duration-base) var(--ease-out); }
.btn:hover .arr { transform: translateX(3px); }

/* ─── Skip link ─── */
.skip-link { position: absolute; left: var(--space-2); top: -100px; z-index: 300; background: var(--color-ink); color: var(--color-on-dark); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: var(--weight-medium); text-decoration: none; }
.skip-link:focus { top: var(--space-1); }

/* ═══ Shell: nav + mobile menu ═══
   Class names are shared with site.css (the shell markup is identical on
   every page; checks/shell.mjs enforces that), so pages still on site.css
   keep their old look until they're restyled. */
.nav { position: sticky; top: 0; z-index: 100; background: var(--color-bg); border-bottom: 1px solid var(--color-line); }
/* 72px bar: fixed so the mobile menu can open exactly below it. */
.nav-in { max-width: var(--layout-max); height: 72px; margin: 0 auto; padding: 0 var(--layout-gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.nav-logo { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-head); color: var(--color-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
/* Logo mark = the favicon monogram, so the tab icon and the nav read as one identity. */
.nav-logo i { width: 1.15em; height: 1.15em; background: url(/assets/img/icon-source.svg) center / contain no-repeat; display: block; }
.nav-links { display: flex; list-style: none; gap: 0.25rem; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; color: var(--color-ink-2); text-decoration: none; font-weight: var(--weight-medium); font-size: var(--text-sm); padding: 0.5rem 0.75rem; border-radius: var(--radius-pill); transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.nav-links a:hover, .nav-links a.on { background: var(--color-accent-soft); color: var(--color-ink); }
/* Résumé is the primary button in the nav (DESIGN.md §6). 40px: a nav-sized pill. */
.nav-links .nav-resume a { height: 40px; padding: 0 1rem; margin-left: 0.25rem; background: var(--color-ink); color: var(--color-on-dark); }
.nav-links .nav-resume a:hover { background: var(--color-accent); color: var(--color-on-dark); }

/* Menu button: three bars that turn into an ×. 44px = minimum touch target. */
.nav-hamburger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer; }
.nav-hamburger:hover { background: var(--color-accent-soft); }
.nav-hamburger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--color-ink); transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-fast) var(--ease-out); }
.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 73px = the 72px bar plus its hairline, so the menu opens just under it. */
.nav-mobile-menu { display: none; position: fixed; top: 73px; left: 0; right: 0; z-index: 99; background: var(--color-bg); border-bottom: 1px solid var(--color-line); box-shadow: var(--shadow-hover); }
.nav-open .nav-mobile-menu { display: block; }
.nav-mobile-menu ul { list-style: none; padding: var(--space-1) var(--layout-gutter) var(--space-2); }
.nav-mobile-menu a { display: block; padding: 0.9rem 0.75rem; border-bottom: 1px solid var(--color-line); color: var(--color-ink); text-decoration: none; font-weight: var(--weight-medium); }
.nav-mobile-menu a:hover { background: var(--color-accent-soft); }
.nav-mobile-menu li:last-child a { border-bottom: 0; }

/* ═══ Hero ═══ */
.hero { position: relative; padding: var(--space-6) 0 var(--space-5); }
.hero > .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--space-5); align-items: center; }
.hero-label { display: inline-flex; align-items: center; gap: var(--space-1); }
/* 8px dot: the accent as a non-text mark (DESIGN.md §1.5). */
.hero-label b { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent-bright); display: block; }
.hero-h1 { font-size: var(--text-h1); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); margin: var(--space-2) 0 var(--space-3); }
.hero-intro { font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 32ch; }
.hero-intro strong { color: var(--color-ink); font-weight: var(--weight-semibold); }

/* Currently / Previously. dd pinned to column 2 so one label can carry
   two lines (two "Currently" roles). */
.now { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.25rem; margin: var(--space-4) 0; font-size: var(--text-sm); max-width: 34rem; }
.now dt { grid-column: 1; padding-top: 0.15rem; }
.now dd { grid-column: 2; color: var(--color-ink-2); }
.now dd b { color: var(--color-ink); font-weight: var(--weight-semibold); }
/* Keep "· Organisation" together; on phones it moves to its own line and
   drops the dot, so no line ever starts with a stray "·". */
.now .org { white-space: nowrap; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Portrait: full frame, never cropped (the caption needs both boosters). 420px: the sketch's photo width. */
.portrait { position: relative; justify-self: end; width: min(100%, 420px); }
.photo { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-line); box-shadow: var(--shadow-photo); }
.photo img { width: 100%; transition: transform var(--duration-slow) var(--ease-out); }
.portrait:hover .photo img { transform: scale(1.02); }
.portrait .hand { margin-top: 0.75rem; font-size: var(--text-lg); }

/* Reserved animation slots (DESIGN.md §9): named, empty layers. */
[data-anim] { position: relative; }
.anim-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

/* Metrics bar: four hairline-divided proof points. */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--space-6); border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.metrics > li { padding: var(--space-3) var(--space-3) var(--space-3) 0; }
.metrics > li + li { padding-left: var(--space-3); border-left: 1px solid var(--color-line); }
.num { font-size: var(--text-stat); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: var(--tracking-display); margin-top: 0.6rem; font-variant-numeric: tabular-nums; }
.num em { font-style: normal; color: var(--color-accent); }
.metrics p { font-size: var(--text-sm); color: var(--color-ink-2); margin-top: 0.4rem; }

/* Logo strip: greyscale, 30px tall, colour on hover. */
.logos { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-line); }
.logos .mono { flex: none; }
.logos ul { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex: 1; flex-wrap: wrap; }
.logos img { height: 30px; width: auto; filter: grayscale(1) contrast(0.9); opacity: 0.7; transition: filter var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out); }
.logos li:hover img { filter: none; opacity: 1; }

/* ═══ Sections ═══ */
.sec { padding: var(--space-7) 0 0; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-5); flex-wrap: wrap; }
.sec-title { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); }
.sec-head p { color: var(--color-ink-2); max-width: 38ch; }

/* Case cards: white, hairline, text one side and image on panel the
   other; sides alternate. The title link stretches over the whole card
   (one link per card, named by its title, instead of a card-sized link
   that a screen reader reads out in full). */
.cases { display: grid; gap: var(--space-4); }
.case { position: relative; display: grid; grid-template-columns: 1fr 1.1fr; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); border: 1px solid var(--color-line); transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
.case:hover { border-color: var(--color-line-strong); box-shadow: var(--shadow-hover); }
.case:has(a:focus-visible) { border-color: var(--color-accent); }
.case:nth-child(even) .case-media { order: -1; }
.case-body { padding: clamp(1.5rem, 4vw, 3.25rem); display: flex; flex-direction: column; }
.case-body > .mono { color: var(--color-ink-2); }
.case-title { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin: var(--space-2) 0 var(--space-3); max-width: 18ch; }
.case-title a { color: var(--color-ink); text-decoration: none; }
.case-title a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.case:hover .case-title a { text-decoration: underline; text-decoration-thickness: 1px; }
.rq { border-left: 3px solid var(--color-ink); padding: 0.1rem 0 0.1rem var(--space-2); margin-bottom: var(--space-3); }
.rq .mono { display: block; margin-bottom: 0.25rem; }
.rq p { line-height: var(--leading-lead); }
.case-out { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: var(--space-3); }
.case-out b { font-size: var(--text-h3); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-head); white-space: nowrap; }
.case-out span { font-size: var(--text-sm); color: var(--color-ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; }
.case-go { margin-top: var(--space-3); font-weight: var(--weight-semibold); display: inline-flex; gap: var(--space-1); align-items: center; }
/* 34px round arrow chip. */
.case-go .arr { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--color-ink); color: var(--color-on-dark); }
.case:hover .case-go .arr { transform: translateX(4px); }
.case-media { min-height: 320px; padding: clamp(1rem, 3vw, 2.5rem); display: flex; align-items: center; background: var(--color-panel); }
.case-media img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius-md); box-shadow: var(--shadow-image); transition: transform var(--duration-slow) var(--ease-out); }
.case:hover .case-media img { transform: scale(1.02); }

/* More work: the three non-featured projects as a compact list. */
.more { margin-top: var(--space-6); }
.more-head { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-head); margin-bottom: var(--space-2); }
.more ul { border-top: 1px solid var(--color-line); }
.more li { border-bottom: 1px solid var(--color-line); }
.more-row { display: grid; grid-template-columns: 15rem 1fr auto; gap: var(--space-1) var(--space-3); align-items: baseline; padding: var(--space-3) var(--space-2); color: var(--color-ink); text-decoration: none; transition: background var(--duration-fast) var(--ease-out); }
.more-row:hover { background: var(--color-accent-soft); }
.more-row .mono { color: var(--color-ink-2); }
.more-title { font-weight: var(--weight-semibold); }
.more-out { display: block; font-size: var(--text-sm); color: var(--color-ink-2); }
.more-row:hover .arr { transform: translateX(4px); }

/* How I work: three numbered steps. */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.how > li { border-top: 3px solid var(--color-ink); padding-top: var(--space-3); }
.how .n { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-accent); }
.how h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin: var(--space-2) 0 var(--space-1); }
.how p { color: var(--color-ink-2); }

/* Kind words. */
.quotes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.quote { background: var(--color-surface); border: 1.5px solid var(--color-line); border-radius: var(--radius-xl); padding: clamp(1.25rem, 3vw, 2.25rem); display: flex; flex-direction: column; }
.qm { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: 0.6; color: var(--color-accent); display: block; height: 1.5rem; }
.quote blockquote { font-size: var(--text-md); line-height: var(--leading-lead); margin: var(--space-2) 0 var(--space-3); flex: 1; }
.who { display: flex; gap: 0.75rem; align-items: center; }
/* 44px round headshot. */
.who img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.who b { display: block; font-weight: var(--weight-semibold); }
.who span { font-size: var(--text-sm); color: var(--color-ink-3); }

/* ═══ Inner pages: shared page head ═══
   Case studies, publications and the 404 open the same way: a mono
   label or breadcrumb, a title at section size (--text-h1 is the
   homepage hero's alone), a lead in the hero-intro style, then chips or
   buttons. */
.page-head { padding: var(--space-6) 0 var(--space-5); border-bottom: 1px solid var(--color-line); }
.page-title { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin: var(--space-2) 0 var(--space-3); max-width: 22ch; }
.page-lead { font-size: var(--text-lead); line-height: var(--leading-lead); color: var(--color-ink-2); max-width: 46ch; }
.page-head .chips, .page-head .actions { margin-top: var(--space-4); }
.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; font-size: var(--text-sm); color: var(--color-ink-3); }
.crumbs a { color: var(--color-ink-2); }
.crumbs a:hover { color: var(--color-accent); }
.crumbs [aria-current] { color: var(--color-ink-3); }

/* ═══ Case-study pages (DESIGN.md §8) ═══
   After rachelchen.tech/projects/figma, told as design research: a quiet
   section list pinned at the left, one centred reading column, and each
   section as eyebrow → big headline (the question or claim) → short text
   → a large image. Lots of air: the page reads like a sequence of slides. */
/* Three columns: list | 44rem reading column | balancing space, so the
   text stays centred on the page the way the reference does. */
.cs { display: grid; grid-template-columns: minmax(11rem, 1fr) minmax(0, 44rem) minmax(0, 1fr); gap: var(--space-5); padding: var(--space-5) var(--layout-gutter) 0; max-width: 1440px; margin: 0 auto; align-items: start; }
.cs-toc { position: sticky; top: 104px; font-size: var(--text-sm); }
.cs-back { display: inline-flex; gap: 0.4rem; align-items: center; color: var(--color-ink-3); text-decoration: none; margin-bottom: var(--space-5); }
.cs-back:hover { color: var(--color-accent); }
.cs-back:hover .arr { transform: translateX(-3px); }
.cs-toc summary { list-style: none; color: var(--color-ink-3); margin-bottom: var(--space-1); cursor: default; }
.cs-toc summary::-webkit-details-marker { display: none; }
.cs-toc ol { display: grid; gap: 0.1rem; }
/* Plain text list; the section being read turns accent with a small dot. */
.cs-toc ol a { position: relative; display: block; padding: 0.3rem 0 0.3rem var(--space-2); color: var(--color-ink-3); text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
.cs-toc ol a:hover { color: var(--color-ink); }
.cs-toc ol a[aria-current="true"] { color: var(--color-accent); }
.cs-toc ol a[aria-current="true"]::before { content: ""; position: absolute; left: 0.2rem; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--color-accent); }

.cs-body { grid-column: 2; min-width: 0; }
.cs-hero { background: var(--color-panel); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-4); display: flex; justify-content: center; }
/* Project shots are portrait; 440px keeps the hero to about half a screen. */
.cs-hero img { max-height: 440px; width: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-image); }
.cs-intro > .mono { margin-top: var(--space-5); color: var(--color-accent); }
.cs-intro h1 { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin: var(--space-2) 0 var(--space-3); }
.cs-lead { font-size: var(--text-md); color: var(--color-ink-2); }
.cs-lead b { color: var(--color-ink); font-weight: var(--weight-semibold); }
.cs-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--color-line); font-size: var(--text-sm); }
.cs-meta dt { color: var(--color-ink-3); margin-bottom: 0.25rem; }
.cs-meta dd { color: var(--color-ink); line-height: var(--leading-lead); }

.cs-sec { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--color-line); }
.cs-eyebrow { font-size: var(--text-sm); color: var(--color-ink-3); font-weight: var(--weight-medium); }
.cs-sec > h2 { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin: var(--space-1) 0 var(--space-3); }
.cs-sec > p, .cs-role p { color: var(--color-ink-2); }
.cs-sec > p + p { margin-top: var(--space-2); }
.cs-role { margin-top: var(--space-6); }
.cs-role h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin: var(--space-1) 0 var(--space-2); }
.cs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-2); margin-top: var(--space-4); }
.cs-cards > li { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: var(--space-3); }
.cs-cards .n { display: block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); margin-bottom: var(--space-2); }
.cs-chips { margin-top: var(--space-1); }
.cs-stat { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-4); background: var(--color-panel); border-radius: var(--radius-lg); }
.cs-stat .num { margin: 0; font-size: var(--text-h2); color: var(--color-accent); }
.cs-stat p { font-size: var(--text-sm); color: var(--color-ink-2); }
.cs-stat b { color: var(--color-ink); font-weight: var(--weight-semibold); }

/* Reflection: lessons as large numbered statements (after the two
   takeaways that close the reference case study). */
.cs-lessons { display: grid; gap: var(--space-5); margin-top: var(--space-4); }
.cs-lessons > li { display: grid; grid-template-columns: 3rem 1fr; gap: 0 var(--space-2); }
.cs-lessons .n { grid-row: 1 / span 2; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); padding-top: 0.5rem; }
.cs-lessons h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin-bottom: var(--space-1); }
.cs-lessons p { color: var(--color-ink-2); }

/* Figures and placeholders sit a full step away from the text. */
.ph, .ph-grid { margin-top: var(--space-5); }
/* "Image to come" placeholders are hidden on the live site and shown only on
   preview builds (site.js adds .show-drafts off sheidamarashi.com). Why:
   Sheida asked (Oct 18, 2026) to keep empty boxes off the live site until
   each image is added. To publish an image, replace its placeholder figure
   with a real <figure> (no .ph class); keep .ph-grid only around placeholders. */
.ph, .ph-grid { display: none; }
html.show-drafts .ph { display: block; }
html.show-drafts .ph-grid { display: grid; }
.ph-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.ph-grid .ph { margin-top: 0; }
/* Placeholder: dashed hairline on the panel, 4:3 (16:9 when wide). */
.ph-box { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); text-align: center; padding: var(--space-3); background: var(--color-panel); border: 1.5px dashed var(--color-line-strong); border-radius: var(--radius-lg); color: var(--color-ink-2); font-weight: var(--weight-medium); }
.ph-wide .ph-box { aspect-ratio: 16 / 9; }
.ph figcaption { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--color-ink-3); }
.bullets { display: grid; gap: var(--space-2); padding-left: 1.2rem; color: var(--color-ink-2); }
.bullets li::marker { color: var(--color-accent); }

/* Research steps: numbered like How I work on the homepage. */
.steps { display: grid; gap: var(--space-4); margin-top: var(--space-4); }
.steps > li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 var(--space-2); border-top: 1px solid var(--color-line); padding-top: var(--space-4); }
.steps .n { grid-row: 1 / span 2; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-accent); padding-top: 0.35rem; }
.steps h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); margin-bottom: var(--space-1); }
.steps p { color: var(--color-ink-2); }

/* Impact: outcome cards with a mono label. */
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-4); }
.outcomes > li { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); }
.outcomes h3 { margin-bottom: var(--space-2); color: var(--color-accent); }

/* End of a case study: back to the list, or on to the next one. */
.cs-next { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--color-line); }
.back { font-weight: var(--weight-semibold); display: inline-flex; gap: var(--space-1); align-items: center; }
.back:hover .arr { transform: translateX(-3px); }
.cs-next-link { display: grid; gap: 0.25rem; text-align: right; text-decoration: none; color: var(--color-ink); padding: var(--space-2) var(--space-3); border-radius: var(--radius-lg); transition: background var(--duration-fast) var(--ease-out); }
.cs-next-link:hover { background: var(--color-accent-soft); }
.cs-next-title { font-size: var(--text-h3); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-head); line-height: var(--leading-head); }
.cs-next-link:hover .arr { transform: translateX(4px); }

/* ═══ Publications ═══
   Same frame as the case studies: browse column on the left (filters +
   year links, sticky), entries on the right as cards, title first so a
   skimming reader sees what the work is before who wrote it. */
.pub-metrics { margin-top: var(--space-5); }
.pubs .cs-toc .mono { margin: var(--space-3) 0 var(--space-1); }
.pubs .cs-toc summary.mono { margin: 0 0 var(--space-1); }
/* Filters do nothing without JavaScript, so they only show with it. */
html:not(.js) .pub-filters { display: none; }
.pub-filters ul { display: grid; gap: 0.35rem; }
.cs-toc .cnt { color: var(--color-ink-3); }
.pub-filter-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--space-1); height: 40px; padding: 0 0.9rem; border-radius: var(--radius-pill); border: 1.5px solid var(--color-line); background: var(--color-surface); color: var(--color-ink); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.pub-filter-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pub-filter-btn[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-on-dark); }
.pub-count { font-family: var(--font-mono); font-size: var(--text-xs); color: inherit; }
.pub-year-group + .pub-year-group { margin-top: var(--space-6); }
.pub-year-label { font-size: var(--text-h2); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-display); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; margin-bottom: var(--space-3); }
.pub-items { display: grid; gap: var(--space-2); }
.pub-item { background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out); }
.pub-item:hover { border-color: var(--color-line-strong); box-shadow: var(--shadow-hover); }
.pub-meta { margin-bottom: var(--space-1); }
.pub-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-lead); letter-spacing: var(--tracking-head); margin-bottom: var(--space-1); max-width: 52ch; }
.pub-authors, .pub-venue { font-size: var(--text-sm); color: var(--color-ink-2); }
.pub-venue { margin-top: 0.25rem; }
.pub-authors .me { color: var(--color-ink); font-weight: var(--weight-semibold); }
.pub-venue strong { font-weight: var(--weight-medium); color: var(--color-ink); }

/* ═══ 404 + Emoji Algebra ═══ */
.page-head.nf { border-bottom: 0; }
.game-sec { padding-top: var(--space-2); }
.game { margin-top: var(--space-2); background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-xl); padding: clamp(1.25rem, 3vw, 2.25rem); max-width: 40rem; }
.game-hud { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-1); }
.game-score { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
/* 6px: a progress hairline, not a control. */
.game-timer { height: 6px; background: var(--color-line); border-radius: var(--radius-pill); overflow: hidden; margin-bottom: var(--space-3); }
.game-timer-bar { height: 100%; width: 100%; background: var(--color-accent-bright); border-radius: var(--radius-pill); }
.game-timer-bar.low { background: var(--color-accent); }
.game-body { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-1); }
.game-big { font-size: var(--text-h2); line-height: var(--leading-tight); }
.game-title { font-size: var(--text-h3); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-head); }
.game-note { font-size: var(--text-sm); color: var(--color-ink-3); max-width: 36ch; }
.game-streak { min-height: 1.5em; }
.game-eq { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.8; }
.game-emoji { font-size: var(--text-h3); vertical-align: middle; }
.game-opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); width: 100%; margin-top: var(--space-1); }
.game-opt { font-family: var(--font-sans); font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--color-ink); background: var(--color-bg); border: 1.5px solid var(--color-line-strong); border-radius: var(--radius-md); padding: 0.6rem 0.4rem; cursor: pointer; line-height: 1.5; transition: border-color var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out); }
.game-opt:hover:not(:disabled) { border-color: var(--color-accent); }
.game-opt:disabled { cursor: default; }
.game-opt.dim { opacity: 0.35; }
.game-opt.ok { background: var(--color-accent-soft); border-color: var(--color-ink); }
.game-opt.bad { border-color: var(--color-accent); }
.game-fb { font-size: var(--text-sm); font-weight: var(--weight-semibold); min-height: 1.6em; }
.game-fb.bad { color: var(--color-accent); }
.game-final { font-size: var(--text-stat); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-display); }
.game-final span { font-size: var(--text-base); font-weight: var(--weight-regular); color: var(--color-ink-2); }
.game-msg { font-weight: var(--weight-semibold); margin-bottom: var(--space-1); }

/* ═══ Shell: footer = contact band + a quiet bottom line ═══ */
.footer { padding: var(--space-6) 0 var(--space-4); }
.footer-cta-block { background: var(--color-ink); color: var(--color-on-dark); border-radius: var(--radius-xl); padding: clamp(2rem, 6vw, 5rem); overflow: hidden; }
.footer-cta-block > * { position: relative; z-index: 1; }
.footer-headline { font-size: var(--text-h2); font-weight: var(--weight-semibold); line-height: var(--leading-head); letter-spacing: var(--tracking-head); }
.footer-headline span { color: var(--color-accent-bright); }
.footer-sub-text { color: var(--color-on-dark-2); font-size: var(--text-lead); line-height: var(--leading-lead); max-width: 36ch; margin-top: var(--space-3); }
.footer-sub-text + .footer-sub-text { font-size: var(--text-base); margin-top: var(--space-2); }
.footer-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: var(--space-4); }
/* Buttons on the dark band: white fill / white outline (DESIGN.md §6). */
.footer-btn { display: inline-flex; align-items: center; gap: var(--space-1); height: 46px; padding: 0 1.25rem; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1; text-decoration: none; border: 1.5px solid var(--color-on-dark); transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.footer-btn-fill { background: var(--color-on-dark); color: var(--color-ink); }
.footer-btn-fill:hover { background: var(--color-accent-soft); border-color: var(--color-accent-soft); }
.footer-btn-outline { background: transparent; color: var(--color-on-dark); }
.footer-btn-outline:hover { border-color: var(--color-accent-bright); color: var(--color-accent-bright); }
.footer-btn:hover .arr { transform: translateX(3px); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2); padding-top: var(--space-3); font-size: var(--text-sm); color: var(--color-ink-3); }
.footer-name { font-weight: var(--weight-semibold); color: var(--color-ink-2); }
.footer-links { display: flex; gap: var(--space-1); }
.footer-link { color: var(--color-ink-2); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: var(--radius-pill); transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out); }
.footer-link:hover { background: var(--color-accent-soft); color: var(--color-ink); }

/* ═══ Responsive (DESIGN.md §4: 900px stacks columns, 560px is phones) ═══ */
/* Under 1100px the left column is too narrow to sit beside the text: the
   section list becomes a collapsible box above it. */
@media (max-width: 1100px) {
  .cs { grid-template-columns: minmax(0, 44rem); justify-content: center; gap: var(--space-3); }
  .cs-body { grid-column: 1; }
  .cs-toc { position: static; background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg); padding: var(--space-2) var(--space-3); }
  .cs-back { margin-bottom: var(--space-1); }
  .cs-toc summary { cursor: pointer; list-style: revert; margin-bottom: 0; color: var(--color-ink-2); }
  .cs-toc details[open] summary { margin-bottom: var(--space-1); }
  .pubs .cs-toc details:not([open]) summary.mono { margin-bottom: 0; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  /* Without JavaScript the menu button can't work, so show the links instead. */
  /* The links get their own row under the name: squeezed beside it they wrapped
     the name onto two lines and pushed Résumé onto a second row (seen on a
     phone with a stale cached site.js, Oct 18, 2026). */
  html:not(.js) .nav-in { height: auto; flex-wrap: wrap; padding-top: var(--space-1); padding-bottom: var(--space-1); }
  html:not(.js) .nav-links { display: flex; flex-wrap: wrap; width: 100%; gap: 0; margin-left: -0.5rem; }
  html:not(.js) .nav-links a { padding-left: 0.5rem; padding-right: 0.5rem; }
  html:not(.js) .nav-links .nav-resume a { margin-left: auto; padding-left: 0.75rem; padding-right: 0.75rem; }
  html:not(.js) .nav-links .nav-resume { margin-left: auto; }
  html:not(.js) .nav-hamburger { display: none; }
  .hero { padding-top: var(--space-5); }
  .hero-grid, .case, .quotes { grid-template-columns: 1fr; }
  .portrait { justify-self: start; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics > li:nth-child(3) { padding-left: 0; border-left: 0; }
  .metrics > li:nth-child(n+3) { border-top: 1px solid var(--color-line); }
  .case:nth-child(even) .case-media { order: 0; }
  .case-media { min-height: 0; padding-top: 0; }
  /* Project shots are portrait (up to 900×1300); uncapped they fill a phone screen. */
  .case-media img { max-height: 320px; }
  .sec { padding-top: var(--space-6); }
  .more-row { grid-template-columns: 1fr auto; padding-left: 0; padding-right: 0; }
  .more-row .mono { grid-column: 1 / -1; }
  .how { grid-template-columns: 1fr; }
  .page-head { padding-top: var(--space-5); }
}
@media (min-width: 901px) {
  .nav-mobile-menu { display: none !important; }
}
@media (max-width: 560px) {
  .logos { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .logos ul { gap: var(--space-3); justify-content: flex-start; }
  .logos img { height: 24px; }
  .now .org { display: block; }
  .now .dot { display: none; }
  .metrics > li { padding-right: var(--space-2); }
  .metrics > li + li { padding-left: var(--space-2); }
  .footer { padding-top: var(--space-5); }
  .steps > li { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .ph-grid, .outcomes { grid-template-columns: 1fr; }
  .cs-sec { margin-top: var(--space-5); padding-top: var(--space-5); }
  .cs-hero { padding: var(--space-3); }
  .pub-item { padding: var(--space-3); }
  .cs-next-link { text-align: left; padding-left: 0; padding-right: 0; }
  .steps .n { grid-row: auto; padding-top: 0; margin-bottom: 0.25rem; }
  .cs-lessons > li { grid-template-columns: 1fr; }
  .cs-lessons .n { grid-row: auto; padding-top: 0; margin-bottom: 0.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  /* Reduced motion: the one allowed literal duration (effectively off). */
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
