/* Trispace, self-hosted (no request to Google on page load) */
@font-face { font-family: "Trispace"; font-weight: 100 800; font-stretch: 75% 125%; font-display: swap; src: url(assets/fonts/trispace-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Trispace"; font-weight: 100 800; font-stretch: 75% 125%; font-display: swap; src: url(assets/fonts/trispace-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0d0d0d;
  --ink: #ecebe6;
  --ink-2: #a9a8a2;
  --line: rgb(236 235 230 / .18);
  --green: #2cc70a;
  --pad: clamp(20px, 4vw, 56px);
  --sec: clamp(72px, 10vw, 128px);
  --max: 1120px; /* content width cap for every section except the header and the projects */
  --pad-x: max(var(--pad), (100% - var(--max)) / 2);
  --fs-display: clamp(2.5rem, 5.2vw, 4.75rem);
  --fs-h2: clamp(2.5rem, 5vw, 4.25rem);
  --fs-h3: clamp(1.375rem, 2.1vw, 2rem);
  --fs-lead: clamp(1.125rem, 1.5vw, 1.375rem);
  --sans: "Trispace", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --slide: 4s;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: #3a3a38 var(--bg); scroll-behavior: smooth; }
/* the page never scrolls sideways; clip, unlike hidden, creates no scroll container */
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  font-variation-settings: "wdth" 90;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--green); color: var(--bg); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
a { color: inherit; text-underline-offset: .25em; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; }
h1, p { margin: 0; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px var(--pad);
  border-bottom: 2px solid transparent;
  transition: background .35s var(--ease), border-color .35s var(--ease);
}
.bar.is-solid { background: var(--bg); border-color: rgb(236 235 230 / .28); } /* a grey rule separates the bar from the page */
.lockup { display: inline-flex; text-decoration: none; }
/* laid out at the compact size and scaled up at the top, so the shrink animates transform, not width */
.lockup svg { width: 78px; height: auto; color: var(--ink); transform: scale(1.872); transform-origin: left top; transition: transform .35s var(--ease); }
.bar.is-solid .lockup svg { transform: none; }
.bar-end { display: flex; align-items: center; gap: 24px; }
.bar-nav { opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s; }
.bar-nav { display: flex; gap: 4px; }
.bar.is-solid .bar-nav { opacity: 1; visibility: visible; transform: none; }
.bar-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; text-decoration: none; font-size: .9375rem; color: var(--ink-2); transition: color .2s; }
.bar-nav a:hover { color: var(--ink); }
.bar-nav a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: .5em; }
/* a jump lands the heading just under the fixed bar: bar height + gap, minus the section top padding */
section[id] { scroll-margin-top: calc(130px - var(--sec)); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
  align-items: end;
  align-content: end;
  gap: 32px 48px;
  padding: 120px var(--pad) clamp(28px, 5vh, 56px);
  overflow: hidden;
  isolation: isolate;
}
.slides { position: absolute; inset: 0; z-index: -1; background: #151515; }
.slides::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgb(13 13 13 / .97), rgb(13 13 13 / .6) 110px, rgb(13 13 13 / 0) 280px),
    linear-gradient(to bottom, rgb(13 13 13 / .8), rgb(13 13 13 / 0) 200px);
}
/* the outgoing photo fades faster and the next one starts late, so the change dips through the dark page */
.slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.3s ease; }
.slide.is-on { transition: opacity 1.3s ease .3s; }
.slide img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 0s 1.6s; } /* reset the zoom only once the fade-out is over */
.slide.is-on { opacity: 1; }
.slide.is-on img { transform: scale(1); transition: transform calc(var(--slide) + 2s) linear; }

.intro { display: flex; flex-direction: column; align-items: center; gap: clamp(24px, 3vw, 40px); text-align: center; padding-block: clamp(24px, 5vw, 72px); margin-bottom: clamp(56px, 8vw, 96px); }.intro h1 {
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: .98;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.typed .punct { color: var(--green); }
.typed .ghost { visibility: hidden; }
.typed .caret { position: absolute; height: 1.1em; margin-left: .5em; border-left: .09em solid var(--green); /* out of flow at its static spot, so the balanced line breaks never change while typing */ animation: caret-blink 1.1s steps(1) infinite; }
.typed.is-typing .caret { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }
.intro-lede { color: var(--ink); opacity: .82; font-size: var(--fs-lead); text-wrap: pretty; }

.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px;
  font: 500 .9375rem/1 var(--sans); text-decoration: none; color: var(--ink);
  border: 1px solid rgb(236 235 230 / .45);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--bg); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); }

.hero-caption { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; padding-bottom: 6px; font: 400 .9375rem/1.4 var(--sans); }
.hero-caption p { display: flex; gap: 12px; }
.cap-name { color: var(--ink); }
.cap-meta { color: var(--ink-2); }
.hero-zone { position: absolute; inset: 0 auto 0 0; width: 30%; cursor: pointer; }
.hero-zone.is-next { inset: 0 0 0 auto; }
.hero-caption { position: relative; } /* above the tap areas */
.cap-name { padding: 0; background: none; border: 0; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: .3em; transition: text-decoration-color .2s; }
.cap-name:hover { text-decoration-color: var(--green); }
.steps { display: flex; gap: 6px; }
.steps button { width: 44px; height: 24px; padding: 0; background: none; border: 0; cursor: pointer; display: grid; align-items: center; }
.steps i { display: block; height: 3px; background: var(--line); position: relative; overflow: hidden; }
.steps i::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.steps [aria-selected="true"] i::after { animation: fill var(--slide) linear forwards; }
.steps .done i::after { transform: scaleX(1); }
.hero.is-paused .steps [aria-selected="true"] i::after { animation-play-state: paused; }
@keyframes fill { to { transform: scaleX(1); } }

/* ---------- section 2: projects ---------- */
.work { padding: var(--sec) var(--pad) 0; }
.sec-head { display: flex; flex-direction: column; gap: 20px; margin-bottom: clamp(40px, 6vw, 72px); }
/* the projects grid runs full width; its heading lines up with the capped sections */
.work .sec-head { margin-inline: max(0px, (100% + 2 * var(--pad) - var(--max)) / 2 - var(--pad)); }
.work .sec-head { flex-flow: row wrap; align-items: baseline; justify-content: space-between; column-gap: clamp(20px, 3vw, 40px); }
.filters { display: flex; flex-wrap: wrap; margin-right: -12px; }
.filters button { all: unset; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: .9375rem; color: var(--ink-2); transition: color .2s; }
.filters button:hover, .filters button[aria-pressed="true"] { color: var(--ink); }
.filters button[aria-pressed="true"] { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: .5em; }
.filters button:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.sec-head h2 { margin: 0; font-weight: 500; font-size: var(--fs-h2); line-height: 1; letter-spacing: -.03em; }
.sec-head p { max-width: 56ch; color: var(--ink-2); text-wrap: pretty; }
/* headings fade in once on screen; main.js sets .rv, so without JS they are simply visible */
.sec-head.rv { opacity: 0; transform: translateY(8px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.sec-head.rv.in { opacity: 1; transform: none; }

/* bento: tiles are placed by layoutGrid() in main.js; square cells, --cols per breakpoint */
.grid-wrap { container-type: inline-size; }
.grid { --cols: 5; --gap: clamp(12px, 1.6vw, 22px); --cell: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
  list-style: none; margin: 0; padding: 0; position: relative; overflow: hidden;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: var(--cell); gap: var(--gap); }
.grid:not(.open) { --show: 3.5; max-height: calc(var(--show) * var(--cell) + (var(--show) - 1) * var(--gap)); }
.grid:not(.open)::after { content: ""; position: absolute; inset: auto 0 0 0; height: 35%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.card { all: unset; position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: #161616; cursor: pointer; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s var(--ease); }
.card:hover img, .card:focus-visible img { transform: scale(1.04); filter: brightness(.8); }
.card-cap { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 64px 18px 16px;
  background: linear-gradient(transparent, rgb(0 0 0 / .55) 45%, rgb(0 0 0 / .9)); opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.card:hover .card-cap, .card:focus-visible .card-cap { opacity: 1; transform: none; }
.card-title { font-size: 1.125rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.card-year { font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.card:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
@media (hover: none) { .card-cap { opacity: 1; transform: none; } }
.grid-more { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 48px; height: 48px; margin: 28px auto 0; border: 1px solid var(--line); transition: border-color .3s; }
.grid-more:hover { border-color: var(--ink); }
.grid-more svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; transition: transform .35s var(--ease); }
.grid-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.grid-more:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
@media (max-width: 1000px) { .grid { --cols: 3; } }
@media (max-width: 640px) { .grid { --cols: 2; } .grid:not(.open) { --show: 4.5; } }

/* ---------- section 3: profile ---------- */
.about { padding: var(--sec) var(--pad-x) 0; }
/* one column: portrait beside the facts, then the lead, then the experience */
.about-body { display: grid; gap: clamp(32px, 4vw, 56px); max-width: 52rem; }
.about-side { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); } /* the facts span the photo's height, never more */
.portrait { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 40%; filter: grayscale(1) contrast(1.05); }
.facts { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.facts div { display: grid; gap: 2px; font-size: .9375rem; }
.facts dt, .exp-when { font: 400 .75rem/1.9 var(--sans); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0; white-space: pre-line; }
.about-lead span { display: block; }
.about-lead span + span { margin-top: .5lh; }
.about-lead { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.3; letter-spacing: -.01em; text-wrap: pretty; }
/* multi-line body copy: justified, hyphenated (per <html lang>) to avoid wide gaps */
.about-lead, .svc-body p, .pj-points li, .pj-text p { text-align: justify; hyphens: auto; }
p.ragged, li.ragged { text-align: start; } /* set by fitJustify when justifying would leave wide gaps */
.exp { list-style: none; margin: clamp(32px, 4vw, 56px) 0 0; padding: 0; }
/* dates in a centred left column, role and company stacked beside them */
.exp li { display: grid; grid-template-columns: 11ch minmax(0, 1fr); align-items: center; gap: 6px 36px; padding: 16px 0; }
.exp-org { grid-column: 2; }
.exp-when { grid-row: span 2; text-align: center; color: var(--ink); font-size: 1rem; letter-spacing: .06em; white-space: nowrap; }
.exp-when .now { color: var(--green); }
.exp-role { font-size: 1.25rem; font-weight: 500; }
.exp-org { color: var(--ink-2); }

/* ---------- section 4: services ---------- */
.services { padding: var(--sec) var(--pad-x) 0; }
/* desktop: accordion on the left, one large drawing of the open service on the right */
.svc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(32px, 6vw, 96px); }
.svc-list { list-style: none; margin: 0; padding: 0; position: relative; }
/* timer: one line through all the markers, sized and filled by svcTick() in main.js */
.svc-track { position: absolute; width: 1.25px; background: var(--line); pointer-events: none; }
.svc-track i { position: absolute; left: 0; width: 100%; background: var(--green); }
.svc { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 16px; cursor: pointer; }
.svc h3, .svc-body { grid-column: 1; margin: 0; }
.svc-head {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 20px; padding: 14px 0;
  font: 500 var(--fs-h3)/1.1 var(--sans); letter-spacing: -.03em; color: var(--ink-2);
  transition: color .4s var(--ease);
}
.svc-head::before { content: ""; position: relative; z-index: 1; width: 11px; height: 11px; flex: none; border: 1.25px solid currentColor; background: var(--bg); transition: background .4s var(--ease), border-color .4s var(--ease); }
.svc-head:hover, .is-open .svc-head { color: var(--ink); }
.is-open .svc-head::before { background: var(--green); border-color: var(--green); }
.svc-head:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.svc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s var(--ease); }
.svc-body > div { min-height: 0; overflow: hidden; padding-left: 31px; }
.is-open .svc-body { grid-template-rows: 1fr; }
.svc-body p { color: var(--ink-2); max-width: 60ch; text-wrap: pretty; margin-bottom: 20px; }
.svc-stage { order: -1; display: grid; place-items: center; } /* drawing on the left, accordion on the right */
.svc-stage svg { grid-area: 1 / 1; width: min(100%, 460px); height: auto; overflow: visible; color: var(--ink); opacity: 0; scale: .94; transition: opacity .6s var(--ease), scale .8s var(--ease); }
.svc-stage svg.is-on { opacity: 1; scale: 1; }
.svc-icon { display: none; }
.svc-icon *, .svc-stage svg * { vector-effect: non-scaling-stroke; }
.svc-icon .a, .svc-stage .a { stroke: var(--green); }

/* ---------- section 5: contact and footer ---------- */
.contact { padding: var(--sec) var(--pad-x); }
.contact h2 { margin: 0; font-weight: 500; font-size: var(--fs-display); line-height: .98; letter-spacing: -.035em; }
.contact-lede { margin-top: 24px; color: var(--ink-2); font-size: var(--fs-lead); text-wrap: pretty; }
.ct-open { all: unset; cursor: pointer; display: flex; width: fit-content; align-items: center; gap: .3em; margin-top: 24px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 2px; text-underline-offset: .25em; transition: color .2s; }
.ct-open svg { width: .8em; height: .8em; flex: none; fill: none; stroke: var(--green); stroke-width: 1.5; transition: transform .35s var(--ease); }
.ct-open:hover svg { transform: translate(3px, -3px); }
.ct-open[aria-expanded="true"] svg { transform: rotate(135deg); } /* points down at the open form */
.ct-open:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
/* the pane is always laid out; the 0fr to 1fr row unfolds it */
.ct-pane { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.ct-pane > div > .ct-win { margin-top: clamp(28px, 4vw, 40px); } /* inside the clipped row, so it opens with it */
.ct-pane > div { min-height: 0; overflow: hidden; visibility: hidden; transition: visibility 0s .6s; }
.ct-pane.open > div { visibility: visible; transition-delay: 0s; }
.ct-pane.open { grid-template-rows: 1fr; }
/* TUI dialog: title set into the top border */
.ct-win { position: relative; margin: 0; padding: 4px 0 0; min-width: 0; border: 1px solid var(--ink-2); }
.ct-win legend { margin-left: 16px; padding: 0 8px; color: var(--ink); }
.ct-win legend span { margin-right: 6px; color: var(--green); }
.ct-win .ct-close { position: absolute; top: -25px; right: 16px; min-height: 0; padding: 0 8px; background: var(--bg); font-size: 1.5rem; line-height: 1; color: var(--green); } /* centred on the border, like the legend */
.ct-win .ct-close:hover { color: var(--ink); }
.ct-form { padding: 20px 16px 16px; font-size: 1.0625rem; line-height: 1.9; }
.ct-field { display: flex; gap: 1ch; align-items: baseline; }
.ct-field label { flex: none; width: 9ch; color: var(--ink-2); }
.ct-field input, .ct-field textarea { all: unset; flex: 1; min-width: 0; color: var(--ink); caret-color: var(--green); white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-field textarea { min-height: 7.6em; overflow: hidden; resize: none; } /* grows with the text, see main.js */
.ct-field:has(textarea) { margin-top: 1lh; } /* one blank line before the message */
.ct-hp { position: absolute; left: -9999px; }
/* clear the fixed bar above and keep [ send ] visible above the on-screen keyboard when a field scrolls into view */
.ct-pane, .ct-field { scroll-margin: 96px 0 120px; }
.ct-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 12px; }
.ct-out { color: var(--ink-2); }
.ct-out.err { color: #ff6b5e; }
.ct-out.ok { color: var(--green); }
.ct-actions { display: flex; gap: 20px; margin-left: auto; }
.ct-btn { all: unset; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); transition: color .2s; }
.ct-btn:hover, .ct-btn:focus-visible { color: var(--green); }
.ct-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
/* columns share one top and one bottom edge: first item at the top, last at the bottom */
.foot { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 32px; padding: 32px var(--pad-x); border-top: 2px solid var(--line); font: 400 .8125rem/1.4 var(--sans); color: var(--ink-2); }
.foot a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.foot a:hover { color: var(--ink); }
.foot ul a { color: var(--ink); }
.foot ul a:hover { color: var(--green); }
.foot-col { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.foot-logo { width: 56px; color: var(--ink); }
.foot-h { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.foot ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.foot li, .foot-col > span { white-space: nowrap; }
.foot-col > span a { color: var(--ink-2); text-decoration: underline; text-underline-offset: .2em; }
.ct-note { margin: 12px 0 0; font-size: .75rem; color: var(--ink-2); }
.ct-note a { color: var(--ink-2); text-underline-offset: .2em; }
.ct-note a:hover, .foot-col > span a:hover { color: var(--green); }
.foot-col > span { font-size: .6875rem; }
.foot-top { align-self: end; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); transition: border-color .3s; }
.foot-top:hover { border-color: var(--ink); }
.foot-top svg { width: 20px; height: 20px; fill: none; stroke: var(--green); stroke-width: 1.5; transition: transform .35s var(--ease); }
.foot-top:hover svg { transform: translateY(-3px); }
@media (max-width: 800px) { .foot { grid-template-columns: 1fr 1fr; justify-content: stretch; } }

/* ---------- project dialog ---------- */
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; background: none; border: 0; color: var(--ink); cursor: pointer; }
.icon-btn svg, .pj-step svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; }
.project {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--bg); color: var(--ink);
}
.project::backdrop { background: var(--bg); }
.project[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: pj-in .5s var(--ease); }
@keyframes pj-in { from { opacity: 0; transform: translateY(12px); } }
/* top row: counter, previous / next project, close */
.pj-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px calc(var(--pad) - 10px) 10px var(--pad); border-bottom: 1px solid var(--line); }
.pj-count { font: 400 .8125rem/1 var(--sans); color: var(--ink-2); }
.pj-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 30rem); min-height: 0; }
.pj-media { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; border-right: 1px solid var(--line); }
.pj-stage { position: relative; min-height: 0; background: #111; }
.pj-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pj-arrow { position: absolute; top: 50%; translate: 0 -50%; background: rgb(13 13 13 / .7); }
.pj-arrow:hover { background: var(--ink); color: var(--bg); }
.pj-prev-img { left: 12px; } .pj-next-img { right: 12px; }
.pj-thumbs { display: flex; gap: 8px; padding: 12px; overflow-x: auto; scrollbar-width: thin; }
.pj-thumbs button { flex: none; width: 88px; height: 60px; padding: 0; border: 1px solid transparent; background: none; cursor: pointer; opacity: .5; transition: opacity .2s; }
.pj-thumbs button:hover { opacity: .85; }
.pj-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--ink); }
.pj-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pj-text { display: flex; flex-direction: column; gap: 28px; padding: clamp(24px, 3vw, 44px); overflow-y: auto; }
.pj-text h2 { margin: 0; font-weight: 500; font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.pj-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 20px; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9375rem; }
.pj-meta dt { font: 400 .75rem/1.9 var(--sans); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.pj-meta dd { margin: 0; }
.pj-points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; color: var(--ink); opacity: .88; }
.pj-points li { padding-left: 20px; position: relative; text-wrap: pretty; }
.pj-points li::before { content: ">" / ""; position: absolute; left: 0; top: 0; color: var(--green); }
.pj-top #pj-close { justify-self: end; }
.pj-nav { display: flex; gap: clamp(16px, 4vw, 48px); min-width: 0; }
.pj-step { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; padding: 0; background: none; border: 0; color: var(--ink-2); font: 400 .9375rem/1.2 var(--sans); cursor: pointer; }
.pj-step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.pj-step:hover { color: var(--ink); }
.pj-step[hidden] { visibility: hidden; display: inline-flex; } /* keeps the pair centred at the first and last project */

@media (max-width: 760px) {
  .bar { padding: 14px var(--pad); }
  .lockup svg { transform: scale(1.154); }
  .hero { justify-items: start; padding-top: 96px; }
  .hero-caption { align-items: flex-start; }
  .about-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .portrait { height: 100%; aspect-ratio: auto; } /* too narrow to match the facts as a square: grow taller instead */
  .svc-wrap { display: block; }
  .svc-stage { display: none; }
  /* phones: the open row shows its drawing on the right, the title centred on it, the text below */
  .svc { grid-template-columns: minmax(0, 1fr) min(30%, 140px); column-gap: 16px; padding-inline: 12px; } /* content inset from the ends of the lines */
  .svc h3 { grid-column: 1; grid-row: 1; align-self: center; }
  .svc-body { grid-column: 1 / -1; grid-row: 2; }
  .svc-icon { display: block; grid-column: 2; grid-row: 1; width: 100%; height: auto; margin: 12px 0; color: var(--ink); overflow: visible; }
  .svc:not(.is-open) .svc-icon { display: none; }
  .is-open .svc-icon { animation: svc-icon-in .6s var(--ease); }
  @keyframes svc-icon-in { from { opacity: 0; scale: .9; } }
  .svc-body p { margin-bottom: 20px; }
  .project[open] { overflow-y: auto; display: block; }
  .pj-top { position: sticky; top: 0; z-index: 1; background: var(--bg); } /* the dialog scrolls as one page here: keep the project nav in reach */
  .pj-top { grid-template-columns: minmax(0, 1fr) auto; }
  .pj-count { display: none; } /* too narrow for counter + both names */
  .pj-nav { justify-content: space-between; }
  .pj-step { gap: 6px; font-size: .8125rem; }
  .pj-step span { max-width: 14ch; }
  .pj-body { display: block; }
  .pj-media { border-right: 0; border-bottom: 1px solid var(--line); }
  .pj-stage { height: 62vh; }
}

@media (max-width: 600px) {
  .foot-col:nth-child(2) { grid-column: 1 / -1; } /* the email is too long to share a row */
}
/* below ~490px logo and links no longer fit on one row: the links drop to a second row */
@media (max-width: 489px) {
  .bar { flex-wrap: wrap; row-gap: 0; }
  .bar-end { display: contents; }
  .bar:not(.is-solid) .bar-nav { display: none; }
  .bar-nav { order: 3; flex-basis: 100%; margin: 4px -12px -8px; }
  .bar-nav a { min-height: 40px; }
  section[id] { scroll-margin-top: calc(133px - var(--sec)); } /* two-row bar */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide, .slide img, .slide.is-on img { transition: none; transform: none; }
  .steps [aria-selected="true"] i::after { animation: none; transform: scaleX(1); }
  .project[open] { animation: none; }
}
