/* Joel May — redesign prototype
   Editorial monochrome (after jonenoch.com) + warm canvas, one accent,
   pill CTAs and big condensed type (after axclub.co.uk).
   Motion follows Apple's fluid-interface guidance: critically damped
   springs, interruptible gestures, reduced-motion fallbacks. */

/* Self-hosted display font (Latin subset, SIL Open Font License, see fonts/OFL-InterTight.txt).
   Body text uses the device's system font: no download, and it is what each platform tunes best. */
@font-face {
  font-family: "Inter Tight";
  src: url("/assets/fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
  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: #f3f1ec;
  --bg-elev: #ffffff;
  --ink: #121212;
  --ink-2: #5e5c57;
  --rule: rgba(18, 18, 18, 0.14);
  --accent: #c4321a;
  --accent-ink: #ffffff;
  --material: rgba(243, 241, 236, 0.72);
  --scrim: rgba(10, 10, 10, 0.94);

  --font-display: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(12px, 1.6vw, 24px);
  --maxw: 1520px;
  --radius: 20px;
  --radius-sm: 12px;
  --header-h: 64px;

  /* Critically damped spring (damping 1.0, response 0.45s) sampled into CSS */
  --spring: linear(0, 0.0484, 0.1552, 0.2816, 0.4069, 0.5207, 0.6189, 0.7009,
    0.7676, 0.821, 0.8631, 0.8959, 0.9213, 0.9408, 0.9556, 0.9668, 0.9753,
    0.9816, 0.9864, 0.9899, 0.9926, 0.9945, 0.996, 0.9971, 1);
  --spring-dur: 600ms;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f0e;
    --bg-elev: #1a1a18;
    --ink: #f3f1ec;
    --ink-2: #a5a29b;
    --rule: rgba(243, 241, 236, 0.16);
    --accent: #ff5a3c;
    --accent-ink: #121212;
    --material: rgba(15, 15, 14, 0.7);
  }
}

@media (prefers-contrast: more) {
  :root { --ink-2: var(--ink); --rule: currentColor; }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */

.display-xl, .display-l, .display-m {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-optical-sizing: auto;
}
.display-xl {
  font-size: clamp(5.25rem, 25vw, 8rem);
  line-height: 0.84;
  letter-spacing: -0.05em;
}
.display-l {
  font-size: clamp(2.75rem, 8vw, 7rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
}
.display-m {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.lede {
  font-size: clamp(1.25rem, 1.9vw, 1.625rem);
  line-height: 1.32;
  letter-spacing: -0.012em;
  font-weight: 450;
}
.label {
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.label .num { color: var(--accent); margin-right: 0.75em; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }

/* ---------- Buttons & links ---------- */

.pill {
  --pill-bg: transparent;
  --pill-fg: var(--ink);
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 48px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--pill-bg); color: var(--pill-fg);
  font-weight: 600; font-size: 0.875rem;
  letter-spacing: 0.04em; text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 100ms ease-out, background-color 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.pill--accent { --pill-bg: var(--accent); --pill-fg: var(--accent-ink); border-color: var(--accent); }
.pill--plain { padding-right: 22px; }
.pill-icon {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: transform var(--spring-dur) var(--spring);
}
.pill-icon svg { width: 14px; height: 14px; }
/* Feedback on press, not release */
.pill:active, .link-arrow:active { transform: scale(0.97); }
@media (hover: hover) {
  .pill:hover .pill-icon { transform: rotate(45deg); }
  .pill:not(.pill--accent):hover { --pill-bg: var(--ink); --pill-fg: var(--bg); }
}

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-weight: 600; text-decoration: none;
  border-bottom: 1.5px solid var(--rule);
  transition: border-color 200ms ease, transform 100ms ease-out;
}
.link-arrow svg { width: 14px; height: 14px; transition: transform var(--spring-dur) var(--spring); }
@media (hover: hover) {
  .link-arrow:hover { border-color: var(--ink); }
  .link-arrow:hover svg { transform: translate(3px, -3px); }
}

/* ---------- Header (translucent material) ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
/* Scroll-edge effect instead of a hard divider: only once content is underneath */
.site-header::after {
  content: ""; position: absolute; inset: 100% 0 auto; height: 24px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), transparent);
  opacity: 0; transition: opacity 300ms ease; pointer-events: none;
}
.is-scrolled .site-header::after { opacity: 1; }

.site-header .wrap {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.25rem;
  letter-spacing: -0.03em; text-transform: uppercase;
  text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav-links { display: none; align-items: center; gap: 4px; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 12px;
  font-size: 0.8125rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
}
.nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }
.nav-links .nav-cta {
  margin-left: 8px; padding: 0 18px;
  background: var(--accent); color: var(--accent-ink);
}
.nav-links .nav-cta:active { transform: scale(0.97); }
.clock { font-variant-numeric: tabular-nums; }

.menu-button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 4px 0 14px;
  border: 0; background: none; cursor: pointer;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.menu-button .bars { display: grid; gap: 5px; width: 22px; }
.menu-button .bars span { height: 2px; background: currentColor; border-radius: 2px; }

@media (min-width: 900px) {
  .nav-links { display: flex; }
  .menu-button { display: none; }
}

/* Mobile menu sheet: grows from the button that opened it */
.menu-sheet {
  position: fixed; inset: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(0, 0, 0, 0); color: var(--ink);
  transition: background-color 300ms ease;
}
/* Modal, so dim what's behind it */
.menu-sheet.is-open { background: rgba(0, 0, 0, 0.28); }
.menu-sheet::backdrop { background: transparent; }
.menu-panel {
  position: absolute; inset: 8px 8px auto 8px;
  padding: 12px 16px 28px;
  border-radius: var(--radius);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  backdrop-filter: saturate(180%) blur(30px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  transform-origin: calc(100% - 40px) 24px;
  transform: scale(0.94); opacity: 0;
  filter: blur(6px);
  transition: transform 450ms var(--spring), opacity 250ms ease, filter 300ms ease;
}
.menu-sheet.is-open .menu-panel { transform: none; opacity: 1; filter: none; }
.menu-top { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.menu-close {
  min-width: 44px; min-height: 44px; border: 0; background: none; cursor: pointer;
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.menu-list { margin-top: 12px; }
.menu-list a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.25rem, 11vw, 3rem); line-height: 1; letter-spacing: -0.04em;
  text-transform: uppercase; text-decoration: none;
}
.menu-list a span { font-family: var(--font-body); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--ink-2); }
.menu-list a[aria-current="page"] { color: var(--accent); }
.menu-meta { margin-top: 20px; display: grid; gap: 4px; }

/* ---------- Hero (split, after Jon Enoch) ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
}
.hero-copy {
  display: flex; flex-direction: column; gap: 20px;
  padding: 28px var(--gutter) 32px;
}
/* The h1 carries the role for search engines; the role line still sits above the name */
.hero-title { display: flex; flex-direction: column; gap: 20px; }
.hero-title .hero-role { order: -1; }
.hero-title .display-xl { margin-top: 4px; }

.page-title { display: flex; flex-direction: column; gap: 10px; }
.page-title-sub {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1; letter-spacing: -0.02em;
  font-weight: 500; text-transform: uppercase;
  color: var(--ink-2);
}
.hero-sub {
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.4vw, 2.25rem);
  line-height: 1.05; letter-spacing: -0.025em;
  color: var(--ink-2);
  text-transform: uppercase; font-weight: 500;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-media { position: relative; overflow: hidden; background: #1b1b1b; }
.hero-media img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.v-caption {
  position: absolute; left: 14px; bottom: 16px;
  writing-mode: vertical-rl; transform: rotate(180deg);
  color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1fr 1fr;
    height: calc(100svh - var(--header-h));
    min-height: 620px; max-height: 1100px;
  }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: auto; height: 100%; }
  .hero-copy { justify-content: space-between; padding: clamp(24px, 4vw, 56px) var(--gutter) clamp(24px, 4vw, 48px); }
  .hero-copy .display-xl { font-size: clamp(6rem, 12.5vw, 13rem); }
}

/* ---------- Statement (after AxClub) ---------- */

.statement {
  text-align: center;
  padding-block: clamp(80px, 14vw, 200px) clamp(64px, 10vw, 140px);
}
.statement .display-l { margin: 18px auto 28px; max-width: 14ch; }
.statement .lede { max-width: 34ch; margin-inline: auto; color: var(--ink-2); }
.statement .cta-row { justify-content: center; margin-top: 36px; }

/* ---------- Ticker (moves with scroll, not on its own) ---------- */

.ticker {
  overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
  padding-block: clamp(10px, 1.4vw, 18px);
}
.ticker-track {
  display: flex; width: max-content;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 6rem); line-height: 1; letter-spacing: -0.04em;
  text-transform: uppercase; white-space: nowrap;
  will-change: transform;
}
.ticker-track span { padding-right: 0.5em; }
.ticker-track span::after { content: "●"; font-size: 0.35em; vertical-align: middle; padding-left: 0.6em; }

/* ---------- Selected work ---------- */

.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px;
  padding-top: clamp(72px, 10vw, 160px);
  padding-bottom: clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--rule);
}
.section-head p:last-child { margin: 0; max-width: 36ch; }

.discipline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "text text"
    "main main"
    "a b"
    "more more";
  gap: 16px var(--gap);
  padding-block: clamp(40px, 6vw, 96px);
  border-bottom: 1px solid var(--rule);
}
.d-text { grid-area: text; }
.d-text .display-m { margin: 14px 0 0; }
.d-main { grid-area: main; }
.d-a { grid-area: a; }
.d-b { grid-area: b; }
.d-more { grid-area: more; display: grid; gap: 16px; }
.d-more p { margin: 0; color: var(--ink-2); max-width: 46ch; }

.d-main, .d-a, .d-b {
  display: block; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--rule);
}
.d-main img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.d-a img, .d-b img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

@media (hover: hover) {
  .d-main img, .d-a img, .d-b img { transition: transform 900ms var(--spring); }
  .d-main:hover img, .d-a:hover img, .d-b:hover img { transform: scale(1.03); }
}

@media (min-width: 900px) {
  .discipline {
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: none;
    row-gap: var(--gap);
    align-items: start;
  }
  .d-text { grid-area: auto; grid-column: 1 / span 4; grid-row: 1; }
  .d-main { grid-area: auto; grid-column: 5 / -1; grid-row: 1 / span 3; }
  .d-a { grid-area: auto; grid-column: 1 / span 2; grid-row: 2; }
  .d-b { grid-area: auto; grid-column: 3 / span 2; grid-row: 2; margin-top: 30%; }
  .d-more { grid-area: auto; grid-column: 1 / span 4; grid-row: 3; align-self: end; }

  .discipline:nth-of-type(even) .d-text,
  .discipline:nth-of-type(even) .d-more { grid-column: 9 / -1; }
  .discipline:nth-of-type(even) .d-main { grid-column: 1 / span 8; }
  .discipline:nth-of-type(even) .d-a { grid-column: 9 / span 2; }
  .discipline:nth-of-type(even) .d-b { grid-column: 11 / span 2; }
}

/* ---------- About ---------- */

.about {
  display: grid; gap: clamp(28px, 4vw, 64px);
  padding-block: clamp(72px, 10vw, 160px);
}
.about-media { border-radius: var(--radius); overflow: hidden; background: var(--rule); }
.about-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about-copy .display-m { margin: 14px 0 28px; max-width: 16ch; }
.about-copy > p { max-width: 58ch; }
.about-copy .lede { color: var(--ink); }

.services { margin-top: 40px; border-top: 1px solid var(--ink); }
.services details { border-bottom: 1px solid var(--rule); }
.services summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 64px; padding: 12px 0;
  cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.625rem); letter-spacing: -0.02em; text-transform: uppercase;
}
.services summary::-webkit-details-marker { display: none; }
.services summary .plus {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid currentColor; display: grid; place-items: center;
  transition: transform var(--spring-dur) var(--spring);
}
.services summary .plus svg { width: 12px; height: 12px; }
.services details[open] summary .plus { transform: rotate(45deg); }
.services details p { margin: 0 0 20px; max-width: 56ch; color: var(--ink-2); }

@media (min-width: 900px) {
  .about { grid-template-columns: repeat(12, 1fr); align-items: start; }
  .about-media { grid-column: 1 / span 5; position: sticky; top: calc(var(--header-h) + 24px); }
  .about-copy { grid-column: 7 / -1; }
}

/* ---------- Contact footer (after both references) ---------- */

.contact {
  position: relative; isolation: isolate;
  color: #f3f1ec;
  background: #0d0d0c;
  overflow: hidden;
  /* Dark in both themes, so it carries its own colour tokens */
  --ink: #f3f1ec;
  --ink-2: #b9b6ae;
  --rule: rgba(243, 241, 236, 0.18);
  --accent: #ff5a3c;
  --accent-ink: #121212;
}
.contact-bg { position: absolute; inset: 0; z-index: -1; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.32; }
.contact-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13, 13, 12, 0.2), rgba(13, 13, 12, 0.85));
}
.contact-inner { padding-block: clamp(80px, 12vw, 180px) 32px; }
.contact .display-l { margin: 16px 0 clamp(28px, 4vw, 48px); }
.email-link {
  display: inline-block;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.75rem, 7.4vw, 7.25rem);
  line-height: 1; letter-spacing: -0.045em; text-transform: uppercase;
  text-decoration: none; overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 3px no-repeat;
  transition: background-size 600ms var(--spring);
  padding-bottom: 6px;
}
@media (hover: hover) { .email-link:hover { background-size: 100% 3px; } }
.contact-rows {
  display: grid; gap: 24px;
  margin-top: clamp(40px, 6vw, 80px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.contact-rows a { text-decoration: none; }
.contact-rows .big { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
@media (min-width: 700px) { .contact-rows { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .contact-rows { grid-template-columns: repeat(4, 1fr); } }

.giant-wordmark {
  margin: clamp(48px, 8vw, 120px) 0 0;
  font-family: var(--font-display); font-weight: 800;
  /* Sized so "JOEL MAY" spans the content width: with the kerning below it is 4.61× its font size wide */
  font-size: calc((min(100vw, var(--maxw)) - 2 * var(--gutter)) / 4.68);
  line-height: 0.76; letter-spacing: -0.06em;
  text-transform: uppercase; white-space: nowrap;
  color: var(--accent);
  user-select: none;
}
.legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding-block: 20px 28px;
  font-size: 0.8125rem; color: var(--ink-2);
}
.legal a { text-decoration: none; }
.legal nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ---------- Gallery pages ---------- */

.page-intro {
  padding-top: clamp(40px, 7vw, 120px);
  padding-bottom: clamp(32px, 5vw, 72px);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.page-intro .page-title { margin: 18px 0 clamp(24px, 3vw, 40px); }
.page-intro .display-l { max-width: 16ch; }
.intro-cols { display: grid; gap: 8px 48px; }
.intro-cols p { max-width: 60ch; }
.intro-cols .lede { color: var(--ink); }
.intro-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--rule);
}
@media (min-width: 900px) {
  .intro-cols { grid-template-columns: 5fr 6fr; }
}

.masonry {
  columns: 2; column-gap: 8px;
  padding-bottom: clamp(64px, 8vw, 120px);
}
.masonry li { break-inside: avoid; margin-bottom: 8px; }
@media (min-width: 700px) { .masonry { column-gap: var(--gap); } .masonry li { margin-bottom: var(--gap); } }
@media (min-width: 1100px) { .masonry { columns: 3; } }

.g-item {
  display: block; position: relative; overflow: hidden;
  border-radius: 8px; background: var(--rule);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms ease-out;
}
.g-item img { width: 100%; height: auto; transition: opacity 400ms ease; }
.g-item:active { transform: scale(0.985); }
@media (hover: hover) {
  .g-item img { transition: opacity 400ms ease, transform 900ms var(--spring); }
  .g-item:hover img { transform: scale(1.025); }
}
.g-item.is-lifted { visibility: hidden; }
.js .g-item img[loading="lazy"]:not(.is-loaded) { opacity: 0; }

.next-page {
  display: block; text-decoration: none;
  padding-block: clamp(48px, 8vw, 120px);
  border-top: 1px solid var(--rule);
}
.next-page .display-l { display: flex; align-items: center; gap: 0.25em; margin-top: 16px; }
.next-page svg { width: 0.6em; height: 0.6em; flex: none; transition: transform var(--spring-dur) var(--spring); }
@media (hover: hover) { .next-page:hover svg { transform: translateX(0.12em); } }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0;
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: #f3f1ec;
  overflow: hidden;
}
.lightbox::backdrop { background: transparent; }
.lb-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; }
.lb-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.lb-stage.is-dragging { cursor: grabbing; }
.lb-img {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  will-change: transform;
  user-select: none; -webkit-user-drag: none;
  border-radius: 2px;
}
.lb-chrome { position: absolute; inset: 0; pointer-events: none; transition: opacity 250ms ease; }
.lb-chrome > * { pointer-events: auto; }
.lightbox.is-dragging-y .lb-chrome,
.lightbox.is-transitioning .lb-chrome,
.lightbox.chrome-hidden .lb-chrome { opacity: 0; }
.lightbox.chrome-hidden .lb-chrome > * { pointer-events: none; }
.lb-top {
  position: absolute; inset: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px 20px;
}
.lb-count { font-variant-numeric: tabular-nums; color: #b9b6ae; }
.lb-btn {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(40, 40, 38, 0.55); color: #f3f1ec;
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  transition: transform 100ms ease-out, background-color 200ms ease;
}
.lb-btn:active { transform: scale(0.92); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-btn[disabled] { opacity: 0.3; cursor: default; }
.lb-prev, .lb-next { position: absolute; top: 50%; margin-top: -24px; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
@media (pointer: coarse) { .lb-prev, .lb-next { display: none; } }
.lb-caption {
  position: absolute; inset: auto 0 0;
  padding: 16px 20px max(18px, env(safe-area-inset-bottom));
  text-align: center; font-size: 0.875rem; color: #d8d5cd;
}

/* ---------- Reveal on scroll (only when JS runs) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 900ms var(--spring);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Accessibility preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  .js .reveal { transform: none; transition: opacity 300ms ease !important; }
  .menu-panel { transform: none; filter: none; transition: opacity 200ms ease !important; }
  .g-item:hover img, .d-main:hover img, .d-a:hover img, .d-b:hover img { transform: none; }
  .ticker-track { transform: none !important; }
}

@media (prefers-reduced-transparency: reduce) {
  :root { --material: var(--bg); }
  .site-header, .menu-panel, .lb-btn { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .lb-btn { background: #2a2a28; }
}

/* ---------- Optical kerning for "Joel May" (spans added by build.py's kerned()) ---------- */

.k-oe { margin-right: 0.012em; }
.k-el { margin-right: 0.028em; }
.k-ma { margin-right: 0.035em; }
/* The footer wordmark is tracked tighter still, and needs a clearer word space */
.giant-wordmark { word-spacing: 0.08em; }
.giant-wordmark .k-oe { margin-right: 0.016em; }
.giant-wordmark .k-el { margin-right: 0.034em; }
.giant-wordmark .k-ma { margin-right: 0.048em; }
