/* Gregory Esman. Dark studio: a near-black ground the photographs light up, one volt signal. See DESIGN.md. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/Archivo-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* color: neutral grounds (chroma under 0.006, so nothing tints a photo) and one signal */
  --paper: oklch(0.145 0.004 265);      /* page ground */
  --surface: oklch(0.185 0.005 265);    /* raised: menu panel, phone sheet, controls */
  --surface-2: oklch(0.235 0.006 265);  /* hover on raised */
  --plate: oklch(0.2 0.004 265);        /* behind loading photos */
  --rule: oklch(1 0 0 / 0.1);           /* hairlines */
  --rule-strong: oklch(1 0 0 / 0.22);   /* section lines, control borders */
  --ink: oklch(0.965 0.003 265);        /* text */
  --ink-2: oklch(0.76 0.006 265);       /* secondary text, captions: about 9:1 on paper */
  --ink-3: oklch(0.64 0.006 265);       /* counters, labels: about 5.6:1 on paper */
  --signal: oklch(0.9 0.19 124);        /* volt: current place, focus, primary button */
  --signal-ink: oklch(0.18 0.03 124);   /* text on the signal */
  --viewer: oklch(0.11 0.003 265);
  --viewer-2: oklch(1 0 0 / 0.12);
  --viewer-ink: oklch(0.95 0 0);
  --viewer-ink-2: oklch(0.76 0 0);

  /* type: one family, Archivo; display and interface labels use its wide cut */
  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --wide: 125%;
  --semi: 112%;
  --t-hero: clamp(3rem, 7vw, 8rem);
  --t-display: clamp(2.25rem, 1.45rem + 3.6vw, 5.25rem);
  --t-h2: clamp(1.4rem, 1.2rem + 0.9vw, 2.1rem);
  --t-h3: 1.2rem;
  --t-lede: clamp(1.125rem, 1.04rem + 0.4vw, 1.4rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-micro: 0.75rem;

  /* space (4px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 144px;

  /* frame */
  --margin: clamp(16px, 3.6vw, 64px);
  --gap: clamp(16px, 1.7vw, 28px);
  --max: 1720px;
  --header-h: 72px;
  --row-h: clamp(150px, 19vw, 320px);
  --tile-gap: clamp(6px, 0.7vw, 12px);
  --radius: 14px;
  --pill: 999px;

  /* motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 0.18s;
  --mid: 0.35s;
  --slow: 0.7s;
  color-scheme: dark;
}

@media (max-width: 899px) {
  :root { --header-h: 60px; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--paper);
  scrollbar-color: var(--rule-strong) var(--paper); scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  caret-color: var(--signal);
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
picture { display: contents; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--signal); color: var(--signal-ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: var(--margin); top: 10px; z-index: 100;
  background: var(--signal); color: var(--signal-ink); padding: 10px 18px; border-radius: var(--pill);
  font-weight: 600; text-decoration: none;
  transform: translateY(-180%);
}
.skip:focus { transform: none; }

/* ---------- type ---------- */
.display {
  font-size: var(--t-display);
  font-weight: 640;
  font-stretch: var(--wide);
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h2 { font-size: var(--t-h2); font-weight: 600; font-stretch: var(--semi); line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.lede { font-size: var(--t-lede); line-height: 1.45; letter-spacing: -0.01em; font-weight: 400; }
.meta { font-size: var(--t-small); color: var(--ink-3); font-stretch: var(--semi); }

.prose { max-width: 40rem; color: var(--ink-2); }
.prose strong, .prose h2, .prose h3, .prose .lede { color: var(--ink); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--t-h2); margin-top: 0; }
.prose h2 + * { margin-top: var(--s5); }
.prose h3 { margin-top: var(--s7); }
.prose h3 + * { margin-top: var(--s3); }
.prose .lede + .lede { margin-top: 0.6em; }
.prose a, .figure figcaption a, .reel figcaption a {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in oklch, var(--signal) 70%, transparent);
  transition: text-decoration-color var(--fast), color var(--fast);
}
.prose a:hover, .figure figcaption a:hover, .reel figcaption a:hover { color: var(--signal); text-decoration-color: currentColor; }
.prose strong { font-weight: 640; }
.prose p { text-wrap: pretty; }

hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s7) 0; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklch, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
  transition: transform var(--mid) var(--ease), background-color var(--mid);
}
.masthead.is-hidden { transform: translateY(-100%); }
body.sheet-open .masthead { background: var(--paper); }
.masthead__inner {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--margin);
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s5);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.0625rem; font-weight: 640; font-stretch: var(--wide); letter-spacing: -0.03em;
  text-decoration: none; min-height: 44px; padding: var(--s2) 0; white-space: nowrap;
}
.wordmark__mark { width: 10px; height: 10px; border-radius: 3px; background: var(--signal); flex: none; transition: transform var(--mid) var(--ease); }
.wordmark:hover .wordmark__mark { transform: rotate(45deg); }

/* desktop menu: one pill bar, dropdown panels */
.nav__list {
  display: flex; gap: 2px; align-items: center; position: relative;
  padding: 4px; border: 1px solid var(--rule); border-radius: var(--pill);
  background: color-mix(in oklch, var(--surface) 70%, transparent);
}
.nav__item { position: static; }
.nav__top {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--pill);
  background: none; border: 0; cursor: pointer;
  font-size: 0.9375rem; font-weight: 500; font-stretch: var(--semi); letter-spacing: -0.01em;
  text-decoration: none; color: var(--ink-2);
  transition: background-color var(--fast), color var(--fast);
}
.nav__top:hover, .nav__top[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.nav__top svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform var(--mid) var(--ease); }
.nav__top[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__item.is-current > .nav__top { color: var(--ink); }
.nav__item.is-current > .nav__top::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); flex: none;
}

.panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  display: none; gap: var(--s6);
  padding: var(--s5) var(--s6) var(--s5) var(--s5);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px -20px oklch(0 0 0 / 0.7);
  min-width: 240px;
}
.panel::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 12px; } /* hover bridge */
.nav__top[aria-expanded="true"] + .panel { display: flex; animation: panel-in 0.26s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(0.985); } }
.panel__group { min-width: 160px; }
.panel__label {
  font-size: var(--t-micro); font-weight: 600; font-stretch: var(--semi); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: var(--s2); padding-left: 10px;
}
.panel__group--solo { padding-top: calc(var(--t-micro) * 1.6 + var(--s2)); }
.panel__group--solo + .panel__group--solo { margin-left: calc(var(--s6) * -1 + var(--s2)); }
.panel a {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 0 -2px; border-radius: 8px; white-space: nowrap;
  font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.01em; text-decoration: none;
  transition: background-color var(--fast), color var(--fast);
}
.panel a:hover { background: var(--surface-2); }
.panel a[aria-current="page"] { color: var(--signal); }

/* phone menu button */
.menu-btn {
  display: none; align-items: center; gap: 10px;
  height: 44px; padding: 0 14px 0 16px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--rule-strong); cursor: pointer;
  font-size: 0.9375rem; font-weight: 560; font-stretch: var(--semi);
}
.menu-btn__icon { position: relative; width: 16px; height: 10px; flex: none; }
.menu-btn__icon::before, .menu-btn__icon::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1.5px; border-radius: 2px; background: currentColor;
  transition: transform var(--mid) var(--ease), top var(--mid) var(--ease);
}
.menu-btn__icon::before { top: 0; }
.menu-btn__icon::after { top: 8.5px; }
.menu-btn[aria-expanded="true"] .menu-btn__icon::before { top: 4.25px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__icon::after { top: 4.25px; transform: rotate(-45deg); }
.menu-btn__close { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__open { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__close { display: inline; }

/* phone menu: full-screen sheet, every group open */
.sheet {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 39;
  background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s4) var(--margin) calc(var(--s9) + env(safe-area-inset-bottom));
}
.sheet[hidden] { display: none; }
.sheet__list > li { border-bottom: 1px solid var(--rule); padding: var(--s3) 0; animation: sheet-in 0.5s var(--ease) both; }
.sheet__list > li:nth-child(2) { animation-delay: 0.04s; }
.sheet__list > li:nth-child(3) { animation-delay: 0.08s; }
.sheet__list > li:nth-child(4) { animation-delay: 0.12s; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } }
.sheet__list a {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  font-size: 1.625rem; font-weight: 600; font-stretch: var(--wide); letter-spacing: -0.04em; line-height: 1.1; text-decoration: none;
}
.sheet__group ul a { font-size: 1.375rem; }
.sheet__list a[aria-current="page"] { color: var(--signal); }
.sheet__list a[aria-current="page"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); flex: none; }
.sheet__label {
  font-size: var(--t-micro); font-weight: 600; font-stretch: var(--semi); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); padding-top: var(--s2);
}
.sheet__group--1 { padding-top: var(--s2); }
.sheet__group--1 > ul { padding-left: 0; }
.sheet__group--1 .sheet__label { padding-top: var(--s3); }
body.sheet-open { overflow: hidden; }

@media (max-width: 899px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
}

/* ---------- page frame ---------- */
main { display: block; flex: 1 0 auto; }
.page { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin); }
.page-head { padding: clamp(40px, 7vw, 112px) 0 clamp(32px, 4.5vw, 72px); }
.page-head .display { max-width: 14ch; }
.page--article .page-head .display, .page--split .page-head .display { max-width: 18ch; }

.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }

/* article: a numbered heading in the left rail, content on the right (as the Photography series) */
.sections { padding-bottom: var(--s9); }
.section {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  border-top: 1px solid var(--rule-strong);
  padding: var(--s5) 0 clamp(56px, 7vw, 112px);
}
.section--intro { border-top-color: var(--rule); }
.section__rail { grid-column: 1 / span 4; }
.section__head, .toc { position: sticky; top: calc(var(--header-h) + var(--s5)); padding-bottom: var(--s5); }
.section__head { display: grid; gap: var(--s3); justify-items: start; }
.section__no, .entry__no, .toc__no { font-size: var(--t-small); font-weight: 600; font-stretch: var(--semi); color: var(--signal); letter-spacing: 0.02em; line-height: 1.2; }
.section__head h2 { max-width: 16ch; }
.section__body { grid-column: 5 / span 8; min-width: 0; }
.section__body > * + * { margin-top: var(--s6); }
.section__body > h3 { margin-top: var(--s8); }
.section__body > h3:first-child { margin-top: 0; }
.section__body > h3 + * { margin-top: var(--s4); }
.section__body > hr { margin: var(--s8) 0; }
.section__body > hr + * { margin-top: 0; }
.section__body > .cta, .section__body > .plates { margin-top: var(--s7); }
.section__body > .cta:first-child, .section__body > .plates:first-child { margin-top: 0; }

/* on this page: the sections of a long page, in the intro's rail */
.toc ul { border-top: 1px solid var(--rule); max-width: 19rem; }
.toc li { border-bottom: 1px solid var(--rule); }
.toc a {
  display: flex; align-items: baseline; gap: var(--s3); padding: 11px 0; min-height: 44px;
  font-size: 0.9375rem; font-weight: 520; font-stretch: var(--semi); letter-spacing: -0.01em; line-height: 1.3;
  color: var(--ink-2); text-decoration: none; transition: color var(--fast);
}
.toc a:hover { color: var(--ink); }
.toc__no { color: var(--ink-3); min-width: 1.6em; transition: color var(--fast); }
.toc a:hover .toc__no { color: var(--signal); }

/* sub-parts (level-3 headings): a hairline, the heading in the semi-wide cut, then its content */
.sub { border-top: 1px solid var(--rule); padding-top: var(--s5); }
.section__body > .sub + .sub { margin-top: var(--s8); }
.section__body > .sub:first-child { border-top: 0; padding-top: 0; }
.sub > * + * { margin-top: var(--s5); }
.sub > h3 { font-size: clamp(1.25rem, 1.12rem + 0.45vw, 1.5rem); font-weight: 620; font-stretch: var(--semi); letter-spacing: -0.025em; line-height: 1.2; max-width: 30ch; }
.sub > .prose h3 { font-size: var(--t-h3); margin-top: 0; }
.sub > .figure + .prose, .sub > .squares + .prose, .sub > .rows + .prose { margin-top: var(--s5); }

/* the booking button and its note share one raised panel */
.cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s5) var(--s6);
  padding: var(--s6); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface);
}
.cta__note { flex: 1 1 16rem; min-width: 0; }
.cta__note .prose p { font-size: var(--t-small); color: var(--ink-2); max-width: 34rem; line-height: 1.55; }

/* three or more captioned photos: justified rows, each whole, its caption under it */
.plates { display: flex; flex-wrap: wrap; gap: var(--s6) var(--tile-gap); --row-h: clamp(170px, 17vw, 300px); }
.plates::after { content: ""; flex: 1 1 0; }
.plates > .figure { flex: var(--r) 1 calc(var(--r) * var(--row-h)); min-width: 0; max-width: calc(var(--r) * var(--row-h) * 1.6); }
.plates > .figure .figure__link { width: 100%; }
.plates > .figure img { width: 100%; height: auto; aspect-ratio: var(--r); max-height: none; object-fit: cover; }
.plates > .figure figcaption { padding-top: var(--s3); margin-top: var(--s3); border-top: 1px solid var(--rule); }

@media (max-width: 1099px) and (min-width: 900px) {
  .section__rail { grid-column: 1 / span 3; }
  .section__body { grid-column: 4 / span 9; }
}
@media (max-width: 899px) {
  .section { display: block; padding-top: var(--s4); }
  .section__head { position: static; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: var(--s3); padding: 0 0 var(--s5); }
  .section__head h2 { max-width: none; }
  .section--intro .section__rail { display: none; }
  .section--intro.has-toc .section__rail { display: block; }
  .toc { position: static; padding: 0 0 var(--s6); }
  .toc ul { max-width: none; }
  .plates { --row-h: 150px; }
}
@media (max-width: 599px) {
  /* one photo per line on phones, each at its full width */
  .plates > .figure { flex: 1 1 100%; max-width: 100%; }
}

/* entries: pages with no section headings. Media and words side by side, in the order written */
.entries { padding-bottom: var(--s9); }
.entry {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start;
  border-top: 1px solid var(--rule-strong); padding: var(--s5) 0 clamp(56px, 7vw, 112px);
}
.entry:first-child { border-top-color: var(--rule); }
.entry > *, .entry__text > *, .entry__media > * { min-width: 0; }
.entry--mt > .entry__media { grid-column: 1 / span 7; }
.entry--mt > .entry__text { grid-column: 8 / span 5; }
.entry--tm > .entry__text { grid-column: 1 / span 5; }
.entry--tm > .entry__media { grid-column: 6 / span 7; }
.entry--mt.entry--narrow > .entry__media { grid-column: 1 / span 5; }
.entry--mt.entry--narrow > .entry__text { grid-column: 6 / span 6; }
.entry--tm.entry--narrow > .entry__text { grid-column: 1 / span 6; }
.entry--tm.entry--narrow > .entry__media { grid-column: 7 / span 5; }
.entry--text > * { grid-column: 1 / span 8; }
.entry--media > * { grid-column: 1 / span 9; }
.entry__text { position: sticky; top: calc(var(--header-h) + var(--s5)); }
.entry__text > * + *, .entry__media > * + *, .entry--text > * + * { margin-top: var(--s5); }
.entry__no { display: block; grid-column: 1 / -1; }
.entry--text > .entry__no + *, .entry--media > .entry__no + * { margin-top: var(--s4); }
.entry .prose { font-size: var(--t-body); }
.entry .prose h2 { font-size: var(--t-h3); line-height: 1.3; }
.entry .prose h2 + * { margin-top: var(--s3); }
.entry .figure--tall img { max-height: min(84vh, 1000px); }
.entry .action { margin-top: var(--s6); }
@media (max-width: 599px) {
  .cta { padding: var(--s5); }
  .cta .action, .cta .button { width: 100%; justify-content: center; }
}
@media (max-width: 899px) {
  .entry { display: block; padding-top: var(--s4); }
  .entry > * + * { margin-top: var(--s5); }
  .entry__text { position: static; }
}

/* figures */
.figure { position: relative; }
.figure img, .figure video { width: 100%; background: var(--plate); }
.figure--tall img, .figure--tall video { width: auto; max-height: min(88vh, 1100px); }
.figure figcaption { margin-top: var(--s3); font-size: var(--t-small); color: var(--ink-2); max-width: 40rem; line-height: 1.55; }
.figure__link { display: block; width: fit-content; max-width: 100%; }
.figure__link img { transition: opacity var(--mid); }
.figure__link:hover img { opacity: 0.86; }
.video video { width: 100%; height: auto; background: #000; max-height: 82vh; }
.anim { width: 100%; height: auto; }

/* button: the signal, as a pill */
.button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 var(--s6);
  background: var(--signal); color: var(--signal-ink); text-decoration: none; border-radius: var(--pill);
  font-size: 1rem; font-weight: 640; font-stretch: var(--semi); letter-spacing: -0.01em;
  box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal) 40%, transparent);
  transition: background-color var(--fast), box-shadow var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.button:hover { background: color-mix(in oklch, var(--signal) 88%, white); box-shadow: 0 0 0 6px color-mix(in oklch, var(--signal) 18%, transparent); }
.button:active { transform: translateY(1px); }
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; margin-right: -4px; transition: transform var(--mid) var(--ease); }
.button:hover svg { transform: translateX(3px); }
.button--ghost { background: none; color: var(--ink); border: 1px solid var(--rule-strong); }
.button--ghost:hover { background: var(--surface); border-color: color-mix(in oklch, var(--ink) 45%, transparent); box-shadow: none; }
.button--ghost:focus-visible { outline-color: var(--signal); }
.button:focus-visible { outline-color: var(--ink); }

/* link list (Blockchain) */
.links { border-top: 1px solid var(--rule); max-width: 40rem; }
.links li { border-bottom: 1px solid var(--rule); }
.links a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  min-height: 56px; text-decoration: none; font-size: 1.125rem; font-weight: 520; letter-spacing: -0.01em;
  transition: color var(--fast);
}
.links svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; transition: transform var(--mid) var(--ease); }
.links a:hover { color: var(--signal); }
.links a:hover svg { transform: translate(2px, -2px); }

/* columns inside a section */
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.columns__col > * + * { margin-top: var(--s4); }
@media (max-width: 699px) { .columns { grid-template-columns: 1fr; gap: var(--s6); } }

/* video embeds: the poster whole in its frame until play; the play mark sits on a strip under it */
.embed { width: 100%; background: var(--surface); border: 1px solid var(--rule); }
.embed__play { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.embed__frame { position: relative; display: block; width: 100%; background: #000; overflow: hidden; }
.embed__frame img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--mid); }
.embed__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__bar {
  display: flex; align-items: center; gap: var(--s3); height: 52px; padding: 0 var(--s4) 0 10px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-small); font-weight: 560; font-stretch: var(--semi); line-height: 1; color: var(--ink);
}
.embed__icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  background: var(--signal); color: var(--signal-ink); border-radius: 50%;
  transition: transform var(--mid) var(--ease), box-shadow var(--mid) var(--ease);
}
.embed__icon svg { width: 15px; height: 15px; fill: currentColor; margin-left: 2px; }
.embed__src { margin-left: auto; color: var(--ink-3); }
.embed__play:hover .embed__frame img { opacity: 0.86; }
.embed__play:hover .embed__icon, .embed__play:focus-visible .embed__icon { transform: scale(1.08); box-shadow: 0 0 0 6px color-mix(in oklch, var(--signal) 20%, transparent); }
.embed__play:focus-visible { outline-offset: 2px; }
.embed.is-playing .embed__icon, .embed.is-playing .embed__label { display: none; }
.embed.is-playing .embed__bar { padding-left: var(--s4); }
/* no custom thumbnail: a plain plate with a faint ring */
.embed--plain .embed__frame::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border: 1px solid var(--rule-strong); border-radius: 50%;
}
.embed--plain.is-playing .embed__frame::after { display: none; }
.columns .embed__bar { height: 46px; }

/* ---------- tiles: justified rows (no cropping) ---------- */
.rows { display: flex; flex-wrap: wrap; gap: var(--tile-gap); }
.rows::after { content: ""; flex: 1 1 0; }
.rows > .tile { flex: var(--r) 1 calc(var(--r) * var(--row-h)); min-width: 0; max-width: calc(var(--r) * var(--row-h) * 1.5); }
.tile { position: relative; display: block; text-decoration: none; background: var(--plate); overflow: hidden; aspect-ratio: var(--r); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--mid); }
a.tile:hover img { opacity: 0.84; }
a.tile:focus-visible { outline-offset: 2px; }
.rows--static > .tile { flex-basis: calc(var(--r) * var(--row-h) * 1.25); }

/* square or cropped tiles where SmugMug cropped them */
.squares { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: var(--tile-gap); }
.squares--grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.squares--static { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile--crop { aspect-ratio: var(--r); }
@media (max-width: 699px) {
  .squares { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .squares--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* video tiles: the poster whole inside the tile, play mark and length on a strip under it (nothing on the picture) */
.tile--video { display: flex; flex-direction: column; background: var(--surface); }
.tile--video .tile__frame { position: relative; display: block; flex: 1 1 0; min-height: 0; background: #000; overflow: hidden; }
.tile--video .tile__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tile__meta {
  flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-micro); font-weight: 560; font-stretch: var(--semi); color: var(--ink-2); line-height: 1;
  transition: color var(--fast);
}
.tile__meta svg { width: 12px; height: 12px; fill: var(--signal); flex: none; }
a.tile--video:hover .tile__meta { color: var(--ink); }

/* ---------- gallery pages and Photography ---------- */
.page-head--gallery {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--s5);
  align-items: end; padding-bottom: clamp(28px, 3.6vw, 56px);
}
.page-head--gallery > .counts { grid-column: 1 / -1; }
.page-head--gallery > .display { grid-column: 1 / span 7; max-width: none; }
.page-head__intro { grid-column: 8 / span 5; padding-bottom: 0.2em; }
.page-head__intro > * + * { margin-top: var(--s3); }
.page-head__intro .prose h2 { font-size: var(--t-h3); line-height: 1.3; }
.page-head__intro .prose h2 + * { margin-top: var(--s2); }
.page-head__intro .prose .lede { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); }
.page-head__intro > .lede { color: var(--ink-2); font-size: var(--t-body); line-height: 1.6; }
/* photo and video counts as pills above the title */
.counts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.counts > span[aria-hidden] {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px;
  border: 1px solid var(--rule-strong); border-radius: var(--pill);
  font-size: var(--t-small); font-weight: 560; font-stretch: var(--semi); color: var(--ink-2); line-height: 1;
}
.counts > span[aria-hidden]:first-of-type::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
@media (max-width: 899px) {
  .page-head--gallery { display: block; }
  .page-head--gallery > .counts { margin-bottom: var(--s5); }
  .page-head__intro { margin-top: var(--s5); }
}
.gallery-body { padding-bottom: var(--s9); }

/* Photography: one numbered series per title, the name in a sticky rail, photos in justified rows */
.series { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); border-top: 1px solid var(--rule-strong); padding: var(--s5) 0 clamp(48px, 5vw, 80px); }
.series__rail { grid-column: 1 / span 3; }
.series__head { position: sticky; top: calc(var(--header-h) + var(--s5)); padding-bottom: var(--s5); display: grid; gap: var(--s2); justify-items: start; }
.series__no { font-size: var(--t-small); font-weight: 600; font-stretch: var(--semi); color: var(--signal); letter-spacing: 0.02em; }
.series__head h2 { font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.75rem); font-weight: 620; font-stretch: var(--semi); line-height: 1.12; letter-spacing: -0.03em; max-width: 14ch; }
.series__count { font-size: var(--t-small); font-stretch: var(--semi); color: var(--ink-3); }
.series > .rows { grid-column: 4 / span 9; --row-h: clamp(140px, 16vw, 280px); }
.series--single > .rows > .tile { flex-grow: 0; flex-basis: auto; height: calc(var(--row-h) * 1.5); width: auto; max-width: 100%; }
.series--single > .rows::after { display: none; }
@media (max-width: 899px) {
  .series { display: block; padding: var(--s4) 0 var(--s7); }
  .series__head { position: static; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: var(--s3); row-gap: var(--s1); padding-bottom: var(--s4); }
  .series__head h2 { max-width: none; }
  .series__count { grid-column: 2; }
  .series > .rows { --row-h: 130px; }
  .series--single > .rows > .tile { height: auto; width: 100%; }
}

/* ---------- reel (horizontal sequence) ---------- */
.reel { position: relative; }
.reel__track {
  display: flex; gap: var(--tile-gap); overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; scroll-behavior: smooth;
}
.reel__track::-webkit-scrollbar { display: none; }
.reel__slide { flex: none; scroll-snap-align: start; width: calc(var(--reel-h) * var(--r)); max-width: 100%; --reel-h: clamp(220px, 46vw, 600px); }
.reel__img { display: block; aspect-ratio: var(--r); background: var(--plate); }
.reel__img img { width: 100%; height: 100%; object-fit: cover; }
.reel__slide figcaption { margin-top: var(--s3); font-size: var(--t-small); color: var(--ink-2); line-height: 1.55; max-width: 46ch; }
.reel__bar { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); margin-top: var(--s3); }
.reel__count { font-size: var(--t-small); font-stretch: var(--semi); color: var(--ink-3); margin-right: auto; }
.split-after .reel__slide { --reel-h: clamp(240px, 52vw, 640px); }
@media (max-width: 699px) { .reel__slide { --reel-h: 60vw; } .split-after .reel__slide { --reel-h: 64vw; } }

/* round icon buttons (slideshow, reels, viewer) */
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 50%; cursor: pointer; padding: 0;
  color: var(--ink);
  transition: background-color var(--fast), border-color var(--fast), color var(--fast), transform var(--mid) var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.icon-btn:hover { background: var(--surface-2); border-color: color-mix(in oklch, var(--ink) 45%, transparent); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: var(--surface); border-color: var(--rule); transform: none; }

/* ---------- split pages (Contact Me, Featured In, Blog) ---------- */
.split {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--s6);
  padding: clamp(40px, 7vw, 112px) 0 clamp(48px, 6vw, 96px); align-items: start;
}
.split__col--a { grid-column: 1 / span 6; }
.split__col--b { grid-column: 7 / span 6; }
.split__col--media.split__col--a { grid-column: 1 / span 6; }
.split__col--media.split__col--a + .split__col--b { grid-column: 8 / span 5; }
.split__col > * + * { margin-top: var(--s5); }
.split__col .display { max-width: 12ch; }
.split__col h2 { font-size: var(--t-h2); }
.split__col .figure img { width: 100%; }
.split-after { padding-bottom: var(--s9); }
.split-after > * + * { margin-top: var(--s7); }
.split-after > hr { margin: 0; }
.split-after .video { max-width: 1100px; }
.layout-split .page > h1.visually-hidden + .split { padding-top: clamp(40px, 7vw, 112px); }
/* Contact Me: text first, photo second */
.split__col--b.split__col--media { grid-column: 8 / span 5; }
.split__col--a:not(.split__col--media) { grid-column: 1 / span 6; }
@media (max-width: 899px) {
  .split { display: block; }
  .split__col + .split__col { margin-top: var(--s7); }
}

.crumbs { font-size: var(--t-small); font-stretch: var(--semi); color: var(--ink-3); margin-bottom: var(--s4); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--signal); }
.crumbs a::after { content: " /"; color: var(--ink-3); }

/* ---------- home ---------- */
.is-home main { position: relative; isolation: isolate; overflow-x: clip; }
/* a faint volt glow behind the name, never behind a photo */
.is-home main::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -120px; left: -10vw; width: 70vw; height: 520px; max-width: 1100px;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--signal) 6%, transparent), transparent);
}

.stage {
  max-width: var(--max); margin: 0 auto; padding: clamp(28px, 4.5vw, 72px) var(--margin) var(--s8);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
}
.stage__head {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: subgrid; align-items: end; row-gap: var(--s4);
  padding-bottom: clamp(24px, 3vw, 44px);
}
.stage__name {
  grid-column: 1 / span 9;
  font-size: var(--t-hero); line-height: 0.88; letter-spacing: -0.055em;
  animation: rise 0.9s var(--ease) both;
}
.stage__line {
  grid-column: 10 / span 3; justify-self: end; max-width: 20ch;
  color: var(--ink-2); padding-bottom: 0.35em; text-wrap: balance;
  animation: rise 0.9s 0.12s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.stage__frame {
  grid-column: 1 / -1; position: relative; width: 100%;
  aspect-ratio: 16 / 9;
  max-height: max(360px, calc(100svh - var(--header-h) - 310px));
  min-height: 260px;
  animation: fade 1.2s 0.2s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } }
.stage__slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease); }
.stage__slide.is-active { opacity: 1; }
.stage__slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; }

.stage__controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--s4);
  margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule);
}
.stage__count { font-size: var(--t-small); font-weight: 560; font-stretch: var(--semi); color: var(--ink-2); min-width: 4.5em; }
.stage__progress { flex: 1; display: flex; gap: 4px; min-width: 0; }
.stage__seg { flex: 1; height: 3px; border-radius: 3px; background: var(--rule-strong); overflow: hidden; }
.stage__seg i { display: block; height: 100%; background: var(--ink-2); transform: scaleX(0); transform-origin: left; }
.stage__seg.is-done i { transform: scaleX(1); background: var(--ink-3); }
.stage__seg.is-active i { transform: scaleX(1); background: var(--signal); }
.stage.is-running .stage__seg.is-active i { animation: seg-fill var(--sec, 6s) linear both; }
@keyframes seg-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stage__btns { display: flex; gap: var(--s2); }
[data-stage-toggle] .i-play { display: none; }
[data-stage-toggle][aria-pressed="true"] .i-play { display: block; }
[data-stage-toggle][aria-pressed="true"] .i-pause { display: none; }
.i-play svg, .i-pause svg { width: 20px; height: 20px; }
.i-play svg { fill: currentColor; stroke: none; }

@media (max-width: 1099px) {
  .stage__name { grid-column: 1 / -1; font-size: clamp(3rem, 9.4vw, 7rem); }
  .stage__line { grid-column: 1 / span 8; justify-self: start; padding-bottom: 0; }
}
@media (max-width: 699px) {
  .stage { padding-top: var(--s6); padding-bottom: var(--s7); }
  .stage__name { font-size: clamp(2.75rem, 16.5vw, 5rem); }
  .stage__line { grid-column: 1 / -1; }
  .stage__frame { aspect-ratio: 3 / 2; max-height: none; min-height: 0; margin: 0 calc(var(--margin) * -1); width: auto; }
  .stage__controls { flex-wrap: wrap; row-gap: var(--s4); border-top: 0; padding-top: 0; }
  .stage__progress { order: -1; flex-basis: 100%; }
  .stage__btns { margin-left: auto; }
}

/* home: the menu's sections as large photos with their names under them */
.index { max-width: var(--max); margin: 0 auto; padding: 0 var(--margin) var(--s9); }
.index ul {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: clamp(48px, 6vw, 96px);
  align-items: end;
}
.index__item a { display: block; text-decoration: none; border-radius: 2px; }
.index__img { display: block; aspect-ratio: var(--r); background: var(--plate); overflow: hidden; }
.index__img img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--slow) var(--ease), filter var(--slow) var(--ease); }
.index__item a:hover .index__img img { opacity: 0.82; }
.index__meta {
  display: flex; align-items: center; gap: var(--s4);
  margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--rule);
  transition: border-color var(--mid);
}
.index__no { font-size: var(--t-small); font-weight: 560; font-stretch: var(--semi); color: var(--ink-3); min-width: 2em; }
.index__label { font-size: var(--t-h2); font-weight: 620; font-stretch: var(--wide); letter-spacing: -0.045em; line-height: 1.05; transition: color var(--fast); }
.index__arrow {
  margin-left: auto; width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--rule-strong); border-radius: 50%;
  transition: background-color var(--mid) var(--ease), border-color var(--mid), color var(--mid), transform var(--mid) var(--ease);
}
.index__arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.index__item a:hover .index__meta { border-color: var(--signal); }
.index__item a:hover .index__arrow { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); transform: rotate(-45deg); }
/* slots follow each photo's shape: wide photos take 7 columns, the portrait and the square take 4 or 5 */
.index__item:nth-child(1) { grid-column: 1 / span 7; }
.index__item:nth-child(2) { grid-column: 8 / span 5; }
.index__item:nth-child(3) { grid-column: 1 / span 7; }
.index__item:nth-child(4) { grid-column: 8 / span 4; }
.index__item:nth-child(5) { grid-column: 1 / span 5; }
.index__item:nth-child(6) { grid-column: 6 / span 7; }
@media (max-width: 699px) {
  .index ul { display: block; }
  .index__item + .index__item { margin-top: var(--s7); }
  .index__label { font-size: 1.625rem; }
}

/* ---------- footer ---------- */
.colophon { border-top: 1px solid var(--rule); background: color-mix(in oklch, var(--paper) 60%, black); }
.colophon__inner {
  max-width: var(--max); margin: 0 auto; padding: clamp(48px, 7vw, 112px) var(--margin) calc(var(--s7) + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--s6);
  align-items: end;
}
.colophon a { text-decoration: none; transition: color var(--fast); }
.colophon__name { grid-column: 1 / span 7; }
.colophon__word { font-size: clamp(2.25rem, 1rem + 4.6vw, 5.5rem); font-weight: 640; font-stretch: var(--wide); letter-spacing: -0.055em; line-height: 0.92; }
.colophon__word a:hover { color: var(--signal); }
.colophon__line { margin-top: var(--s4); color: var(--ink-2); font-size: var(--t-lede); }
.colophon__side { grid-column: 8 / span 5; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s5); }
.colophon__mail a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); font-weight: 560; font-stretch: var(--semi); letter-spacing: -0.02em;
  border-bottom: 1px solid var(--rule-strong);
}
.colophon__mail svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; transition: transform var(--mid) var(--ease); }
.colophon__mail a:hover { color: var(--signal); border-color: var(--signal); }
.colophon__mail a:hover svg { transform: translate(2px, -2px); }
.colophon__social { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.colophon__social a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--rule-strong); border-radius: var(--pill);
  font-size: var(--t-small); font-weight: 560; font-stretch: var(--semi); color: var(--ink-2);
  transition: color var(--fast), border-color var(--fast), background-color var(--fast);
}
.colophon__social a:hover { color: var(--ink); border-color: color-mix(in oklch, var(--ink) 45%, transparent); background: var(--surface); }
@media (max-width: 899px) {
  .colophon__inner { display: block; }
  .colophon__side { align-items: flex-start; margin-top: var(--s7); }
  .colophon__social { justify-content: flex-start; }
}

/* ---------- viewer ---------- */
/* The whole photo always fits its stage; Gregory's title and caption sit in a column beside it
   (below it on phones) and the column only appears for photos that have words. */
.viewer {
  --panel: clamp(340px, 28vw, 440px);
  position: fixed; inset: 0; z-index: 80;
  background: var(--viewer); color: var(--viewer-ink);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--panel); grid-template-rows: auto minmax(0, 1fr);
  opacity: 0; visibility: hidden; transition: opacity 0.22s var(--ease), visibility 0s 0.22s;
}
.viewer.is-open { opacity: 1; visibility: visible; transition: opacity 0.22s var(--ease); }
.viewer [hidden] { display: none !important; }
.viewer__bar {
  grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: var(--s4);
  height: 68px; padding: 0 var(--s4) 0 var(--s5); border-bottom: 1px solid var(--viewer-2);
}
.viewer__count { font-size: var(--t-small); font-weight: 560; font-stretch: var(--semi); color: var(--viewer-ink-2); min-width: 5.5em; }
.viewer__progress { flex: 0 1 220px; height: 3px; border-radius: 3px; background: var(--viewer-2); overflow: hidden; }
.viewer__progress i { display: block; height: 100%; width: 100%; background: var(--signal); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform var(--mid) var(--ease); }
.viewer__btns { margin-left: auto; display: flex; gap: var(--s2); }
.viewer__step { display: none; }
.viewer__stage {
  grid-column: 1; grid-row: 2; position: relative; min-width: 0; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center;
  padding: var(--s6) 84px; touch-action: pan-y pinch-zoom;
}
.viewer__stage > .viewer__media, .viewer__stage > picture > .viewer__media { grid-area: 1 / 1; }
.viewer__stage picture { display: contents; }
.viewer__media { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer__media.is-entering { transition: transform 0.32s var(--ease), opacity 0.32s var(--ease); }
video.viewer__media { background: #000; }
.viewer__text {
  grid-column: 2; grid-row: 2; overflow-y: auto; overscroll-behavior: contain;
  border-left: 1px solid var(--viewer-2); padding: var(--s7) var(--s6);
  scrollbar-color: var(--viewer-2) transparent; scrollbar-width: thin;
}
.viewer__title {
  font-size: clamp(1.375rem, 1.1rem + 0.7vw, 1.875rem); line-height: 1.12; font-weight: 620; font-stretch: var(--semi);
  letter-spacing: -0.03em; color: var(--viewer-ink); text-wrap: balance;
}
.viewer__title::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 3px; background: var(--signal); margin-bottom: var(--s5); }
.viewer__caption { font-size: 1rem; line-height: 1.68; color: var(--viewer-ink-2); max-width: 36rem; }
.viewer__caption p { text-wrap: pretty; }
.viewer__title + .viewer__caption { margin-top: var(--s5); }
.viewer__caption p + p { margin-top: 0.9em; }
.viewer__caption a { color: var(--viewer-ink); text-underline-offset: 0.2em; text-decoration-color: var(--signal); }
.viewer .icon-btn { border-color: var(--viewer-2); color: var(--viewer-ink); background: color-mix(in oklch, var(--viewer) 70%, transparent); }
.viewer .icon-btn:hover { border-color: var(--viewer-ink-2); background: oklch(0.2 0 0 / 0.8); }
.viewer__close:hover { border-color: var(--signal) !important; }
.viewer__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; }
.viewer__nav:active { transform: translateY(-50%) scale(0.94); }
.viewer__nav--prev { left: var(--s5); }
.viewer__nav--next { right: var(--s5); }
/* photos with no title or caption: the photo gets the whole width */
.viewer.no-text { grid-template-columns: minmax(0, 1fr); }
.viewer.no-text .viewer__text { display: none; }
body.viewer-open { overflow: hidden; }

@media (max-width: 999px) {
  .viewer, .viewer.no-text { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .viewer__bar { height: 60px; padding: 0 var(--s3) 0 var(--margin); gap: var(--s3); padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .viewer__progress { flex: 1 1 auto; }
  .viewer__count { min-width: 0; }
  .viewer__btns { margin-left: var(--s2); }
  .viewer__step { display: inline-grid; }
  .viewer__stage { grid-column: 1; grid-row: 2; padding: var(--s3) 0; }
  .viewer__text {
    grid-column: 1; grid-row: 3; border: 0; border-top: 1px solid var(--viewer-2);
    max-height: 38svh; padding: var(--s5) var(--margin) calc(var(--s5) + env(safe-area-inset-bottom));
  }
  .viewer__title { font-size: 1.25rem; }
  .viewer__title::before { margin-bottom: var(--s3); width: 22px; }
  .viewer__title + .viewer__caption { margin-top: var(--s3); }
  .viewer__caption { font-size: 0.9375rem; line-height: 1.6; }
  .viewer__nav { display: none; }
}
@media (max-width: 999px) and (max-height: 520px) {
  /* phone on its side: words beside the photo again */
  .viewer { grid-template-columns: minmax(0, 1fr) min(42vw, 340px); grid-template-rows: auto minmax(0, 1fr); }
  .viewer__text { grid-column: 2; grid-row: 2; max-height: none; border-top: 0; border-left: 1px solid var(--viewer-2); padding: var(--s4) var(--s5); }
  .viewer__bar { height: 52px; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .masthead, .colophon, .sheet, .viewer { display: none !important; }
  :root { --paper: #fff; --ink: #000; --ink-2: #333; --ink-3: #555; color-scheme: light; }
}
