/* Self-hosted latin subsets of two variable fonts. Big Shoulders Display and Instrument Sans are
   both published under the SIL Open Font License 1.1. */
@font-face { font-family: 'Big Shoulders Display'; font-style: normal; font-weight: 700 900; font-display: swap; src: url('/fonts/BigShouldersDisplay.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/InstrumentSans.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: italic; font-weight: 400 700; font-display: swap; src: url('/fonts/InstrumentSans-Italic.woff2') format('woff2'); }

/* Alex Martin, lighting design.
   Ground black, ink warm white, one amber accent on the single control (Go).
   Two faces: Big Shoulders Display for the name and headings, Instrument Sans for everything else.
   Five sizes. Surfaces step in tone; nothing is drawn with a line. Square corners throughout.
   Layout: a full-screen cue stack, then full-bleed panels, then narrow flowing sections on one grid. */
:root {
  --bg: #000000;
  --field: #161513;
  --field-2: #211f1c;
  --ink: #ecebe8;
  --muted: #a39e94;
  --accent: #d9a24f;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --s-1: 0.9375rem;                                   /* captions, nav, footer: 15px */
  --s0: 1.0625rem;                                    /* running text: 17px */
  --s1: clamp(1.375rem, 1.05rem + 1.2vw, 1.875rem);   /* statements, panel titles */
  --s2: clamp(2.5rem, 1.4rem + 4.2vw, 4.75rem);       /* section headings */
  --s3: clamp(3.25rem, 1.1rem + 7.6vw, 8.25rem);      /* the name */
  --m: clamp(20px, 3.2vw, 48px);                      /* the one pair of page margins */
  --gap: clamp(112px, 12vw, 176px);                   /* between sections */
  --bar-h: 68px;                                      /* the bar's height; it overlaps what follows */
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }

/* Page changes are animated by js/router.js with the Web Animations API (the same in every engine):
   the content fades and rises, the bar persists, and the name morphs between its two forms. */
.page { position: relative; will-change: opacity, transform; }

.skip {
  position: absolute; left: var(--m); top: -100px; z-index: 10;
  background: var(--accent); color: #000; padding: 10px 14px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* spacing utilities, so pages carry no inline styles (the content-security policy forbids them) */
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mt-28 { margin-top: 28px; } .mt-32 { margin-top: 32px; } .mt-1em { margin-top: 1em; }
.u { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.u:hover { color: var(--accent); }
.bleed--spaced { margin-top: clamp(32px, 4vw, 56px); }
html { background: var(--bg); overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--s0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
p + p { margin-top: 1em; }
.prose a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#main:focus, #main:focus-visible { outline: none; }   /* focus moves here after a page change; it is a landmark, not a control */

h1, h2, h3, .title {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .88;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--s3); }
h2 { font-size: var(--s2); }
h3 { font-size: var(--s1); font-weight: 700; letter-spacing: 0; }
.statement { font-size: var(--s1); line-height: 1.25; max-width: 34ch; text-wrap: pretty; }
.intro p { font-size: clamp(1.25rem, 1.05rem + .7vw, 1.5rem); line-height: 1.3; text-wrap: pretty; }   /* the two bio paragraphs, one size */
.intro p + p { margin-top: 1.6em; }
.intro-rows .grid + .grid, .intro-rows .grid + .gallery { margin-top: clamp(64px, 7vw, 104px); }   /* Work introduction: one paragraph and one photograph per row */
.small { font-size: var(--s-1); }
.muted { color: var(--muted); }
.prose { max-width: 60ch; }

/* ---------- navigation: a fixed plain bar, tabs left, name right ---------- */
.nav {
  position: sticky;              /* sticky rather than fixed: in flow, so view transitions snapshot it reliably */
  top: 0;
  z-index: 6;
  height: var(--bar-h);
  margin-bottom: calc(-1 * var(--bar-h));
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 22px var(--m);
  font-size: var(--s-1);
  font-weight: 600;
  color: var(--hero-ink, var(--ink));
  background: transparent;
  transition: color 1.6s var(--ease), background .5s var(--ease);
}
.nav.is-solid { background: var(--bg); color: var(--ink); }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav a { padding-bottom: 2px; border-bottom: 2px solid transparent; transition: border-color .3s; }
.nav ul a:hover, .nav a[aria-current="page"] { border-bottom-color: currentColor; }
.wordmark { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 1.5rem; line-height: 1; letter-spacing: -.01em; white-space: nowrap; transition: opacity .5s var(--ease); }
@media (pointer: coarse) {
  .nav a { padding: 12px 0; margin: -12px 0; }   /* a finger-sized target without changing the bar's layout */
  .nav__home { margin-top: -12px; margin-bottom: -12px; }   /* the folding tab clips to its own box, so the finger room moves onto it */
  .nav__home a { margin: 0; }
}
@media (max-width: 520px) {
  :root { --bar-h: 54px; }
  .nav { padding: 16px var(--m); font-size: .8125rem; gap: 12px; }
  .nav ul { gap: 12px; }
  .wordmark { font-size: 1rem; }
  .nav.is-home .nav__home { margin-left: -12px; }
  .nav:not(.is-home) .wordmark { display: none; }   /* five tabs and the name do not fit a phone; the Home tab stands in */
}
@media (max-width: 350px) { .nav .wordmark { display: none; } .nav ul { gap: 10px; } }   /* the narrowest phones: four tabs fill the bar */
.nav a.wordmark { transition: opacity .5s var(--ease), border-color .3s; }      /* the link rule above would otherwise drop the fade */
.nav a.wordmark.is-tracked { transition: border-color .3s; }                 /* its opacity is being set from the scroll position (main.js) */
.nav.is-home:not(.is-solid) .wordmark { opacity: 0; visibility: hidden; }   /* only the landing page hides it: the big name is right there */
.hero--static .hero__name { top: calc(var(--bar-h) + 18px); }                /* an inner page's title clears the name in the bar */
.hero--static .hero__credit { max-width: min(72vw, 80ch); }                   /* one line per fact */
/* an inner page's title rises in after the page has arrived; the credit and scroll hint are fixed to the page and
   ride in with it, as on the landing page */
.hero--static.is-arriving .hero__name { opacity: 0; transform: translateY(14px); transition: none; }
.hero--static .hero__name { transition-delay: .25s; }
/* the Home tab: on the landing page the name is the way home, so the tab folds away sideways instead of blinking out */
.nav__home { max-width: 3.25em; overflow: hidden; transition: max-width .5s var(--ease), opacity .4s .1s var(--ease), margin-left .5s var(--ease), visibility 0s; }
.nav__home a { display: inline-block; }
.nav.is-home .nav__home { max-width: 0; opacity: 0; margin-left: -24px; visibility: hidden; pointer-events: none; transition: max-width .5s var(--ease), opacity .25s var(--ease), margin-left .5s var(--ease), visibility 0s .5s; }

/* ---------- the landing photographs ---------- */
.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #000;
  color: var(--hero-ink, var(--ink));
}
.hero__media { position: absolute; inset: 0; will-change: transform; }
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 1.6s var(--ease);
}
.hero__img img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero__img.is-on { opacity: 1; }
.hero--static .hero__media picture { position: absolute; inset: 0; display: block; }
.hero--static .hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* a second frame over the first, the same picture with the board's traces drawn in; a soft band lets it through and
   crosses the header now and then, like a light passed over the board */
.hero__trace { position: absolute; inset: 0; opacity: .9;
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, transparent 40%, #000 50%, transparent 60%, transparent 100%);
          mask-image: linear-gradient(100deg, transparent 0%, transparent 40%, #000 50%, transparent 60%, transparent 100%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  animation: trace-pass 11s cubic-bezier(.45, 0, .55, 1) 1.5s infinite; }
/* ...and the top is eased down so the bar and the page title read over the drawing */
.hero--fade .hero__media::before { content: ""; position: absolute; z-index: 1; left: 0; right: 0; top: 0; height: 40%; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .62) 45%, rgba(0, 0, 0, 0) 100%); }
/* the board runs off the bottom of the header: it sinks into the page's black there, which also gives the credit and scroll hint a quiet ground */
.hero--fade .hero__media::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 34%; pointer-events: none;
  background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .9) 22%, rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, 0) 100%); }
@keyframes trace-pass { 0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; } 88%, 100% { -webkit-mask-position: 0% 0; mask-position: 0% 0; } }
.hero__name {
  position: absolute;
  top: calc(22px + 2.6rem);
  right: var(--m);
  text-align: right;
  transition: color 1.6s var(--ease), opacity 1.2s var(--ease), transform 1.2s var(--ease);
}
.hero__name.is-pending { opacity: 0; transform: translateY(14px); }
.hero__name h1 { line-height: .84; }
.hero__role {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--s1);
  letter-spacing: .06em;
  margin-top: .4em;
}
.hero__credit {
  position: absolute;
  right: var(--m);
  bottom: 24px;
  text-align: right;
  font-size: var(--s-1);
  line-height: 1.4;
  max-width: min(62vw, 46ch);
  color: var(--hero-ink-2, var(--hero-ink, var(--ink)));
  transition: color 1.6s var(--ease);
}
@media (max-width: 520px) { .hero__credit { font-size: .875rem; max-width: 60vw; } }
.hero__credit strong { font-weight: 600; }

/* a quiet scroll hint: a thin line at the bottom centre with a fade running down it; the word arrives after two seconds */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--hero-ink-2, var(--hero-ink, var(--ink)));
  transition: opacity .6s var(--ease), color 1.6s var(--ease);
}
.scroll-hint__word {
  font-size: .8125rem;
  letter-spacing: .04em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease);
}
.hero.is-late .scroll-hint__word { opacity: .9; transform: none; }
.scroll-hint__line { position: relative; display: block; width: 1px; height: 56px; overflow: hidden; }
.scroll-hint__line span { position: absolute; left: 0; width: 1px; background: currentColor; }
.scroll-hint__track { top: 0; height: 100%; opacity: .7; }
.scroll-hint__run { top: -28px; height: 28px; opacity: 1; animation: scroll-hint 2.4s cubic-bezier(.45, 0, .2, 1) infinite; }
@keyframes scroll-hint { 0% { transform: translateY(0); } 70%, 100% { transform: translateY(90px); } }
.hero.is-scrolled .scroll-hint { opacity: 0; }

/* ---------- sections and the grid ---------- */
.section { padding: 0 var(--m); margin-top: var(--gap); }
.section--first { margin-top: calc(var(--gap) * .75); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(16px, 2vw, 32px); row-gap: 32px; align-items: start; }
.c4 { grid-column-end: span 4; } .c5 { grid-column-end: span 5; } .c6 { grid-column-end: span 6; } .c7 { grid-column-end: span 7; } .c8 { grid-column-end: span 8; } .c12 { grid-column-end: span 12; }
.from6 { grid-column-start: 6; } .from7 { grid-column-start: 7; } .from8 { grid-column-start: 8; }
.section h2 { margin-bottom: clamp(28px, 4vw, 56px); }
@media (max-width: 860px) {
  .grid > * { grid-column: 1 / -1; }
  .grid > .m-first { order: -1; }   /* the photograph leads once the columns stack */
  .grid > .m-last { order: 1; }     /* ...or follows, when it sat left of the text */
  .statement { max-width: none; }
}

/* ---------- full-bleed panels (the series) ---------- */
.panels { margin-top: clamp(32px, 4vw, 56px); }
.panel {
  position: relative;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: #000;
  display: block;
  color: var(--ink);
}
.panel img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--ease); }
.panel:hover img { transform: scale(1.0); }
.panel__row {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 28px var(--m);
  background: rgba(0, 0, 0, .55);       /* the one scrim: under text on a photograph */
  font-size: var(--s-1);
}
.panel__row .title { font-size: var(--s1); text-align: center; }
.panel__row .fact { text-align: right; }
@media (max-width: 860px) {
  .panel { height: 82svh; }
  .panel__row { grid-template-columns: auto 1fr; padding: 18px var(--m) 20px; }
  .panel__row .title { grid-column: 1 / -1; text-align: left; }
  .panel__row .fact { text-align: left; }
}

/* ---------- credit rows: no lines, a step in tone on hover ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 6rem 1fr 1fr 11rem;
  gap: 24px;
  align-items: baseline;
  padding: 18px 16px;
  margin: 0 -16px;
  transition: background .3s;
}
.row:hover, .row:focus-within { background: var(--field); }
.row .title { font-size: var(--s1); font-weight: 700; }
.row .role { text-align: right; }
.row > :nth-child(3):last-child { grid-column: 3 / -1; }   /* a row with no role cell lets the third cell run to the edge */
@media (max-width: 860px) {
  .row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; padding: 14px 12px; margin: 0 -12px; font-size: var(--s-1); }
  .row .title { flex-basis: 100%; order: -1; font-size: 1.25rem; }
  .row .role { text-align: left; flex-basis: 100%; }   /* always its own line, so every row has the same shape */
}

/* ---------- leads: the home page's four rows, each one whole link ---------- */
.leads { list-style: none; margin: 0; padding: 0; }
.lead {
  display: grid;
  grid-template-columns: 3fr 9fr;
  column-gap: clamp(16px, 2vw, 32px);
  align-items: center;
  padding: 16px;
  margin: 0 -16px;
  color: var(--ink);
  transition: background .3s;
}
.lead:hover, .lead:focus-visible { background: var(--field); }
.lead picture, .lead .tocome { display: block; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.lead picture img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.0); transition: transform 1.2s var(--ease); }
.lead:hover picture img { transform: scale(1.04); }
.lead .tocome { display: grid; }
.lead__text { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 1.1rem + 2.8vw, 3.5rem); line-height: .95; text-transform: uppercase; letter-spacing: .005em; }
.lead:hover .lead__text { color: var(--accent); transition: color .3s; }
@media (max-width: 860px) {
  .leads li + li { margin-top: 16px; }
  .lead { grid-template-columns: 1fr; row-gap: 10px; padding: 12px; margin: 0 -12px; }
  .lead__text { font-size: 1.75rem; }
}

/* ---------- credit tiles: small squares, the credit beneath. On a desktop the photograph fades down and the
   whole credit comes up in its place, like a cue; on a touch screen the whole credit simply shows. ---------- */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: clamp(20px, 2.4vw, 36px) clamp(14px, 1.6vw, 28px); }
.tiles--4 { --cols: 4; }
.tiles--6 { --cols: 6; }
.tile__in { display: block; position: relative; color: var(--ink); }
.tile__media { display: block; aspect-ratio: 1; overflow: hidden; background: var(--field); }
.tile__media picture { display: block; width: 100%; height: 100%; }
.tile__media img { width: 100%; height: 100%; object-fit: cover; }
.tile--doc .tile__media { position: relative; }
.tile--doc .tile__media picture { position: absolute; inset: 8%; width: auto; height: auto; display: flex; align-items: center; justify-content: center; }
.tile--doc .tile__media img { width: auto; height: auto; max-width: 100%; max-height: 100%; outline: 1px solid rgba(236, 235, 232, .22); }
.tile--none .tile__media .tocome { aspect-ratio: 1; width: 100%; }
.tile__text { display: block; margin-top: 10px; font-size: var(--s-1); line-height: 1.35; }
.tile__text > .tile__title, .tile__text > .tile__line { transition: opacity .3s var(--ease); }
.tile__title { display: block; font-size: var(--s0); font-weight: 600; }
.tiles--6 .tile__text { font-size: .8125rem; }
.tiles--6 .tile__title { font-size: var(--s-1); }
.tile__line { display: block; }
.tile__more { display: block; }
.tile__more-title { display: none; }                 /* the caption already says this; only the hover card repeats it */
.tile__role { margin-top: 8px; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .tile__in { transition: transform .5s var(--ease); transform-origin: 50% 50%; }
  .tile__in:hover, .tile__in:focus-within { z-index: 3; transform: scale(1.03); }   /* lifts a little over its neighbours; a long credit may also run past the square */
  .tiles--4 .tile__in:hover, .tiles--4 .tile__in:focus-within { transform: scale(1.02); }
  .tile__more { position: absolute; top: 0; left: 0; right: 0; min-height: 100%; padding: 8%; opacity: 0; display: flex; flex-direction: column; gap: 1px; font-size: var(--s-1); line-height: 1.3; background: rgba(10, 10, 10, .9); transition: opacity .45s var(--ease); }
  .tiles--6 .tile__more { font-size: .8125rem; padding: 7%; }
  .tile__more-title { display: block; }
  .tile__more strong.tile__more-title { font-size: 1.1em; }
  .tile__in:hover .tile__more, .tile__in:focus-within .tile__more { opacity: 1; }
  .tile__in:hover .tile__text > .tile__title, .tile__in:hover .tile__text > .tile__line, .tile__in:focus-within .tile__text > .tile__title, .tile__in:focus-within .tile__text > .tile__line { opacity: 0; }
}
@media (max-width: 1100px) { .tiles--4 { --cols: 3; } .tiles--6 { --cols: 4; } }
@media (max-width: 860px) { .tiles--4, .tiles--6 { --cols: 2; } .tiles--6 .tile__text { font-size: var(--s-1); } .tiles--6 .tile__title { font-size: var(--s0); } }
@media (max-width: 700px) { .tile__text, .tiles--6 .tile__text { font-size: .8125rem; } .tile__title, .tiles--6 .tile__title { font-size: .9375rem; } }

/* ---------- the portfolio spread: three columns of 3:2 frames, a wide one taking two columns and two rows ---------- */
.spread { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; gap: clamp(20px, 2.4vw, 36px) clamp(16px, 2vw, 32px); align-items: start; }
.spread__wide { grid-column: span 2; grid-row: span 2; }
.spread__tall { grid-row: span 2; }                       /* a near-square frame: one column, two rows, 3:4 */
.spread .spread__tall figure picture { aspect-ratio: 3 / 4; }
.spread figure picture { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--field); }
.spread figure img { width: 100%; height: 100%; object-fit: cover; }
.spread__open { all: unset; display: block; width: 100%; cursor: pointer; }
.spread__open:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  /* a hovered frame comes forward a little: it grows, rises, brightens as if nearer the light, and the rest of the spread eases back */
  .spread__open { transition: transform .55s var(--ease), filter .55s var(--ease); will-change: transform; }
  .spread__open:hover, .spread__open:focus-visible { transform: translateY(-4px) scale(1.035); filter: brightness(1.08); }
  .spread li { transition: opacity .55s var(--ease); }
  .spread li:has(.spread__open:hover), .gallery li:has(.spread__open:hover) { z-index: 2; position: relative; }
  .spread:has(.spread__open:hover) li:not(:has(.spread__open:hover)) { opacity: .82; }
  /* the photography gallery keeps every picture at its true brightness: a hovered one lifts a little and a faint,
     feathered glow gathers around its edge, as if the light on it had come up a touch; the rest of the wall is left alone */
  /* the glow is one soft shadow per side, each as strong as that side of the picture needs: --gt/--gb/--gl/--gr come
     from pieces.css, measured from the picture's own edges, so a glow beside a bright sky gets more light than one
     beside a night sky and the halo reads evenly all round */
  .gallery .spread__open { box-shadow: 0 0 16px 6px rgba(236, 235, 232, 0), 0 -8px 16px 0 rgba(236, 235, 232, 0), 0 8px 16px 0 rgba(236, 235, 232, 0), -8px 0 16px 0 rgba(236, 235, 232, 0), 8px 0 16px 0 rgba(236, 235, 232, 0); transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
  .gallery .spread__open:hover, .gallery .spread__open:focus-visible { transform: translateY(-4px) scale(1.03); filter: none;
    /* an all-round base, spread past the frame so it carries round the corners, at the picture's average strength;
       the four side shadows then add each side's own share */
    box-shadow: 0 0 16px 6px rgba(236, 235, 232, calc(var(--ga, .14) * .5)), 0 -8px 16px 0 rgba(236, 235, 232, calc(var(--gt, .14) * .5)), 0 8px 16px 0 rgba(236, 235, 232, calc(var(--gb, .14) * .5)), -8px 0 16px 0 rgba(236, 235, 232, calc(var(--gl, .14) * .5)), 8px 0 16px 0 rgba(236, 235, 232, calc(var(--gr, .14) * .5)); }
}

/* ---------- the viewer: the portfolio as a full-page rotation, opened from a frame and closed back to the same scroll position ---------- */
.lightbox { position: fixed; inset: 0; z-index: 40; background: #000; color: var(--ink); opacity: 0; transition: opacity .3s var(--ease); display: flex; flex-direction: column; }
.lightbox.is-open { opacity: 1; }
.lightbox__strip { flex: 1 1 auto; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.lightbox__strip::-webkit-scrollbar { display: none; }
.lightbox__item { flex: 0 0 100%; width: 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: calc(var(--bar-h) + 8px) var(--m) 12px; box-sizing: border-box; min-height: 0; }
.lightbox__item picture { display: flex; align-items: center; justify-content: center; flex: 1 1 auto; min-height: 0; width: 100%; }
.lightbox__item img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox__item figcaption { flex: 0 0 auto; margin-top: 12px; text-align: center; max-width: 70ch; }
.lightbox__bar { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 6px var(--m) 18px; font-size: var(--s-1); color: var(--muted); }
.lightbox__btn { all: unset; cursor: pointer; padding: 6px 10px; color: var(--ink); letter-spacing: .04em; }
.lightbox__btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.lightbox__close { position: absolute; top: 0; right: calc(var(--m) - 10px); height: var(--bar-h); display: flex; align-items: center; }
.lightbox__count { min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .lightbox__item { padding-left: 0; padding-right: 0; } .lightbox__item figcaption { padding: 0 var(--m); } }
@media (max-width: 860px) { .spread { grid-template-columns: 1fr; } .spread__wide { grid-column: auto; grid-row: auto; } }

/* ---------- the photography gallery: justified rows that keep every picture's own crop ----------
   Each row is a flex line; a picture's share of the width is its aspect ratio (--ar, from pieces.css), so
   the row comes out one height with nothing cropped. Rows are chosen in the template so their ratios add up. */
.gallery { display: flex; flex-direction: column; gap: clamp(16px, 2vw, 32px); }
.gallery__row { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(16px, 2vw, 32px); align-items: flex-start; }
.gallery__item { flex: var(--ar, 1) 1 0%; min-width: 0; }
.gallery figure { margin: 0; }
.gallery picture, .gallery img { display: block; width: 100%; height: auto; }
@media (max-width: 860px) { .gallery__row { flex-direction: column; } .gallery__item { flex: none; width: 100%; } }

/* ---------- the Backscatter demo: one clip, six renderings, switched with a diagonal wipe ---------- */
.demo__screen { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--field); }
.demo__screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo__wipe { position: absolute; top: 0; bottom: 0; width: 14%; pointer-events: none; z-index: 2;
  background: linear-gradient(to bottom right, transparent calc(50% - 1px), var(--ink) calc(50% - 1px), var(--ink) calc(50% + 1px), transparent calc(50% + 1px)); }
.demo__list { list-style: none; margin: 0; padding: 0; counter-reset: fx -1; }
.demo__list button { all: unset; cursor: pointer; display: block; width: 100%; padding: 7px 0; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); line-height: 1; color: var(--muted); transition: color .3s; }
.demo__list button:hover, .demo__list button:focus-visible { color: var(--ink); }
.demo__list button.is-on { color: var(--accent); }
.demo__hint { margin-top: 18px; }

/* the render and the exploded view share a row at one height: the row stretches and the exploded view is fitted inside its cell */
.exploded__stack { position: relative; aspect-ratio: var(--ar, 1.12); max-width: 100%; max-height: 100%; }
.exploded__stack picture { position: absolute; inset: 0; mix-blend-mode: lighten; transition: opacity .45s var(--ease); }   /* each sheet is drawn on black */
.exploded__stack img { width: 100%; height: 100%; }
.exploded.is-hot picture { opacity: .6; }
.exploded.is-hot picture.is-on { opacity: 1; }
@media (min-width: 861px) {
  .grid--pair { align-items: stretch; }
  .grid--pair .exploded { position: relative; }
  .grid--pair .exploded__stack { position: absolute; inset: 0; margin: auto; height: 100%; width: auto; }
}

/* OpenXMT: a 1-bit screen recording set into a render of the case front, a render that comes apart when selected,
   and columns that stack a text or picture above another picture */
.stack { display: flex; flex-direction: column; gap: clamp(28px, 3.4vw, 52px); }
.stack figure { margin: 0; }
.bezel { position: relative; }
.bezel .pixel { position: absolute; left: 16.6%; top: 16.7%; width: 66.8%; height: auto; background: #000; }   /* shown below its native size, so smooth scaling reads better than hard pixels */
.explode__btn { all: unset; display: block; width: 100%; cursor: pointer; }
.explode__btn:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.explode__btn canvas { display: block; width: 100%; height: auto; }
.explode__btn canvas { aspect-ratio: 1; }
@media (min-width: 861px) {
  .grid--fill { align-items: stretch; }
  .grid--fill .stack { justify-content: space-between; }     /* the text sits at the photograph's top, the render at its foot */
  .grid--mid { align-items: center; }
  .grid--mid .explode { margin-top: -6%; }             /* the render carries empty black around the case; draw the rows closer */
}

/* ---------- fields: a step in tone instead of a box ---------- */
.field { background: var(--field); padding: clamp(20px, 2.4vw, 36px); }
.credits { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; }
.credits dt { font-weight: 600; }
.credits dd { margin: 0; }
.credits dt { color: var(--muted); font-weight: 400; }   /* the label recedes; the fact is what is read */
.credits a { color: var(--ink); border-bottom: 1px solid var(--muted); }
@media (max-width: 520px) { .credits { grid-template-columns: 1fr; gap: 2px 0; } .credits dd { margin-bottom: 12px; } }

/* a picture that is still to come: a field with a sentence, never a grey box with a label */
.tocome {
  background: var(--field);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: var(--s-1);
  max-width: 100%;
}
.r32 { aspect-ratio: 3 / 2; } .r45 { aspect-ratio: 4 / 5; } .r21 { aspect-ratio: 2 / 1; } .r169 { aspect-ratio: 16 / 9; }
.portrait { aspect-ratio: 4 / 5; overflow: hidden; background: var(--field); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
figure { margin: 0; }
figcaption { margin-top: 10px; font-size: var(--s-1); color: var(--muted); }
.bleed { width: 100%; }
.bleed img { width: 100%; height: auto; }
.bleed picture { display: block; }
.grid figure picture, .grid figure img { width: 100%; }
.bleed figcaption { padding: 10px var(--m) 0; }

/* ---------- entrances: hidden only if JS saw the element below the fold ---------- */
[data-enter].is-pending { opacity: 0; transform: translateY(20px); }
[data-enter].is-pending.from-above { transform: translateY(-20px); }
[data-enter].is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); }

/* ---------- page head for inner pages ---------- */
.page-head { padding: calc(var(--bar-h) + clamp(40px, 7vw, 96px)) var(--m) 0; }
.page-head p { margin-top: 20px; max-width: 48ch; font-size: var(--s1); line-height: 1.25; }

/* ---------- footer: one quiet line after a rest ---------- */
.footer {
  margin-top: 120px;
  padding: 0 var(--m) 30px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  font-size: var(--s-1);
  color: var(--muted);
}
.footer ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.footer a { color: var(--ink); }
@media (max-width: 700px) { .footer { grid-template-columns: 1fr; gap: 12px; } .footer ul { flex-wrap: wrap; gap: 10px 22px; } }

@media (prefers-reduced-motion: reduce) {
  .hero__img, .hero__name, .nav, .nav__home, .hero__credit, [data-enter] { transition: none !important; }
  .scroll-hint__run { animation: none; top: 20px; }
  .hero__trace { animation: none; -webkit-mask-image: none; mask-image: none; opacity: .3; }   /* no pass of light: the traces rest faintly over the whole board */
  .lightbox, .spread__open { transition: none !important; }
  .panel img { transform: none; }
}

/* ---------- the phone: its own scale and rhythm ---------- */
@media (max-width: 700px) {
  :root {
    --s0: 1rem;
    --s-1: .875rem;
    --s1: 1.25rem;
    --s2: 1.875rem;
    --s3: clamp(3rem, 2rem + 6vw, 4rem);
    --gap: 72px;
  }
  body { line-height: 1.45; }
  .hero__name h1 { font-size: clamp(3.25rem, 14vw, 4.5rem); }
  .hero__role { font-size: 1rem; letter-spacing: .08em; }
  .hero__credit { font-size: .8125rem; max-width: 70vw; right: auto; left: var(--m); text-align: left; }
  .scroll-hint { left: auto; right: calc(var(--m) + 10px); transform: none; align-items: flex-end; }
  .section h2 { margin-bottom: 20px; }
  .section--first { margin-top: 56px; }
  .grid { row-gap: 20px; }
  .page-head { padding-top: calc(var(--bar-h) + 32px); }
  .page-head p { font-size: 1.125rem; margin-top: 14px; }
  .statement { font-size: 1.25rem; line-height: 1.3; }
  .prose p + p { margin-top: .8em; }
  figcaption { font-size: .8125rem; margin-top: 8px; }
  .field { padding: 18px; }
  .credits { gap: 6px 16px; font-size: .9375rem; }
  .tocome { font-size: .8125rem; }
  .tocome.r45, .tocome.r21, .tocome.r169 { aspect-ratio: 3 / 2; }   /* nothing waiting for content towers over the phone */
  .portrait { aspect-ratio: 3 / 2; }
  .footer { margin-top: 72px; padding-bottom: 24px; }
  .bleed img { aspect-ratio: 4 / 5; object-fit: cover; }   /* the inner pages' full-bleed photograph, held to a portrait block */
}
