/* Strange Practice — design system */

@font-face {
  font-family: "Franklin Gothic Book";
  src: url("../fonts/franklingothic-book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-paper: #ffffff;
  --c-ink: #111111;
  --c-ink-soft: rgba(0, 0, 0, 0.6);
  --c-smoke: #e9e9e9;
  --c-line: rgba(17, 17, 17, 0.12);
  --c-rule: rgba(0, 0, 0, 0.12); /* 12% opacity black divider lines */

  --p-red: #e0331e;
  --p-green: #1f9e4c;
  --p-blue: #1c3fd6;
  --p-yellow: #f2c400;

  --font-sans: "Franklin Gothic Book", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(24px, 3vw, 52px);
  --margin: clamp(16px, 12.8px + 0.8vw, 24px);
  --gap: calc(var(--margin) * 2); /* standard section gap, used below every page header */
  --max: 1360px;
  --fz: 18px;                     /* body text size — match font-size on body */
  --ease: cubic-bezier(.16, 1, .3, 1); /* site-wide easing curve */
  --c-placeholder: var(--c-smoke);  /* image placeholder while loading */
  --page-bottom: 130px;           /* scroll breathing room at page bottom */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-sans);
  font-size: var(--fz);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.info-availability {
  font-size: 0.667em !important;
}

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

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1400;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  padding: 0.556em 0.889em;
  background: var(--c-ink);
  color: var(--c-paper);
}
.skip-link:focus {
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--margin);
}

/* iOS rubber-band overscroll at the top/bottom edge shows black, not white paper */
body.page-home {
  background: var(--c-ink);
}


/* ---------- view transitions ----------
   @view-transition opts the whole site in via CSS — most reliable placement.
   UA default crossfade is killed; new page fades in on all devices.
   Same-document filter/view toggles use html.vt-filter (higher specificity). */

@view-transition { navigation: auto; }

/* Kill UA default crossfade on every device */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
/* New page fades in on all devices */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-new(root) {
    animation: 180ms ease both vt-filter-in;
  }
}

/* Same-document filter/view crossfade — higher specificity overrides root */
@media (prefers-reduced-motion: no-preference) {
  html.vt-filter::view-transition-old(root) {
    animation: 160ms ease-out both vt-filter-out;
  }
  html.vt-filter::view-transition-new(root) {
    animation: 160ms ease-out both vt-filter-in;
  }
}

@keyframes vt-filter-out { to { opacity: 0; } }
@keyframes vt-filter-in { from { opacity: 0; } }

/* ---------- tap feedback ---------- */
.row:active { opacity: 0.7; }
.card:active { opacity: 0.7; }

/* ---------- page top spacing ---------- */
/* Single source of truth — all non-home, non-404 pages start at the same
   distance below the nav. Individual page templates must not set their own
   top padding; strip any legacy ones below. */
body:not(.page-home):not(.page-404) #main {
  padding-top: var(--margin);
}

/* ---------- masthead ---------- */

.masthead {
  padding: var(--margin) 0;
  position: sticky;
  top: 0;
  z-index: 1200;
  transition: transform 0.3s var(--ease);
}

.masthead--hidden {
  transform: translateY(-100%);
}

.masthead .wrap {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--margin);
}

.masthead-name a { display: flex; flex-direction: column; align-items: center; }

/* Homepage business card logo — square box, text anchored to bottom */
.masthead-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  border: 1px solid currentColor;
  padding: 0.5em 0.8em;
  aspect-ratio: 1;
  line-height: 1.3;
}

/* "New York" sits below the box at slide-count scale */
.masthead-location {
  display: block;
  text-align: center;
  font-size: 0.85em;
  margin-top: 0.4em;
}

.masthead-nav {
  display: flex;
  gap: var(--margin);
  letter-spacing: normal;
}

.masthead-nav a {
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: opacity 0.2s var(--ease);
}

.masthead-name a {
  position: relative;
  transition: opacity 0.2s var(--ease);
}

.masthead-nav a:hover,
.masthead-name a:not(:has(.masthead-card)):hover {
  opacity: 0.5;
}

/* ---------- category nav (homepage) ---------- */

.filterbar .wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--gutter);
  padding: 0 var(--margin) var(--gap);
  flex-wrap: wrap;
}

.filterbar-categories {
  display: flex;
  gap: var(--gutter);
  flex-wrap: wrap;
}

/* ---------- category filter: a caret that expands an in-flow list below
   it on click, pushing the grid down, rather than a floating dropdown
   panel. No native <select> chrome. ---------- */

.filter-dropdown {
  position: relative;
}

.filter-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5em;
  letter-spacing: normal;
  background: transparent;
  border: none;
  color: var(--c-ink);
  cursor: pointer;
  padding: 0;
  transition: none;
}
.filter-dropdown-trigger:hover,
.filter-dropdown.is-open .filter-dropdown-trigger {
  opacity: 0.6;
}

.filter-dropdown-caret {
  width: 0.5em;
  height: 0.333em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  translate: 0 -1px;
  transition: transform 0.22s var(--ease);
}
.filter-dropdown.is-open .filter-dropdown-caret { transform: rotate(180deg); }

.filter-dropdown-menu {
  display: flex;
  flex-direction: column;
  gap: 0.444em;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  transition: max-height 0.28s var(--ease), opacity 0.22s var(--ease), padding 0.28s var(--ease);
}
.filter-dropdown.is-open .filter-dropdown-menu {
  max-height: 15.556em;
  opacity: 1;
  padding: var(--margin) 0 0;
}

.filter-dropdown-menu .filter-btn {
  text-align: left;
}

/* ---------- work / personal view toggle — same .filter-dropdown component
   as the category picker on the left, just preselected to "Commissions"
   (see data-view-dropdown in main.js) ---------- */

.view-toggle-btn {
  display: block;
  width: 100%;
  text-align: right;
  letter-spacing: normal;
  background: none;
  border: none;
  color: var(--c-ink-soft);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s var(--ease);
}
.view-toggle-btn:hover { color: var(--c-ink); }
.view-toggle-btn.active { color: var(--c-ink); }
.view-toggle-btn.active::before {
  content: "";
  display: inline-block;
  width: 0.333em;
  height: 0.333em;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0.444em;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* keeps the view-dropdown pinned right even when it's the only flex child */
.view-dropdown {
  margin-left: auto;
}

/* trigger content right-aligned so label+caret don't drift left when the
   dropdown expands to fit a wider option (e.g. "Commissions" > "Archive") */
.view-dropdown .filter-dropdown-trigger {
  /* Shrink to own content so "Archive" trigger doesn't inherit the wider
     container width set by "Commissions" in the menu below. Right-align. */
  width: max-content;
  margin-left: auto;
}

.filter-btn {
  display: flex;
  align-items: center;
  letter-spacing: normal;
  text-transform: none;
  background: none;
  border: none;
  color: var(--c-ink-soft);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s var(--ease);
}

.filter-btn:hover { color: var(--c-ink); }
.filter-btn.active { color: var(--c-ink); }

/* active-state indicator — circle across all toggle types and the nav */
.filter-btn.active::before,
.masthead-nav a.is-current::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 0.333em;
  height: 0.333em;
  margin-right: 0.444em;
  transform: translateY(-2px);
  border-radius: 50%;
  background: currentColor;
}

/* ---------- homepage slideshow ---------- */

body.page-home .masthead {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  background: transparent;
  color: var(--c-paper);
  pointer-events: none; /* let slideshow cursor + clicks pass through */
}
body.page-home .masthead.theme-light { color: var(--c-ink); }
/* restore interactivity on the actual links only */
body.page-home .masthead-name a,
body.page-home .masthead-nav a { pointer-events: auto; }

/* 404: lift masthead out of flow so .error-page centers against full viewport */
body.page-404 .masthead {
  position: absolute;
  top: 0; left: 0; right: 0;
}

body.page-home .slideshow {
  height: 100vh;
  height: 100dvh;
}

.slideshow {
  position: relative;
  height: calc(100vh - 3.889em);
  min-height: 23.333em;
  overflow: hidden;
  background: var(--c-ink);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.slideshow img {
  -webkit-user-drag: none;
  user-drag: none;
}

@media (hover: hover) and (pointer: fine) {
  .slideshow { cursor: none; }
}
.slide-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 4;
  width: 2.222em;
  height: 2.222em;
  pointer-events: none;
  opacity: 0;
  --x: 0px;
  --y: 0px;
  transform: translate(var(--x), var(--y)) translate(-50%, -50%);
  transition: opacity 0.2s var(--ease);
}
.slide-cursor.is-visible { opacity: 1; }
.slide-cursor-arrow {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* matches the active slide's own type color, flipped below for light slides */
  color: var(--c-paper);
  font-size: 1.556em;
  line-height: 1;
  transition: color 0.3s var(--ease);
}
.slide-cursor.theme-light .slide-cursor-arrow { color: var(--c-ink); }
.slide-cursor.is-prev .slide-cursor-arrow { transform: scaleX(-1); }

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  color: var(--c-paper);
  transition: opacity 0.85s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide[data-theme="light"] { color: var(--c-ink); }

/* dead-center text fallback for an image that hasn't loaded yet. main.js
   removes this element outright on the image's load/error event — not
   just covered by the photo, since a contained/letterboxed slide doesn't
   fill this box edge-to-edge and would leave the label peeking out at the
   sides forever otherwise. No spinner, no animation, just the literal
   state, matter-of-fact. */
.slide-media { position: relative; overflow: hidden; }

.slide-video-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.2) 0.8px, transparent 0.8px);
  background-size: 2px 2px;
  pointer-events: none;
  z-index: 1;
}
.video-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.2) 0.8px, transparent 0.8px);
  background-size: 2px 2px;
  pointer-events: none;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes ken-burns {
    from { transform: scale(1); }
    to   { transform: scale(1.05); }
  }
  @media (min-width: 701px) {
    .slide--desktop-full.is-active img:not(.slide-video-poster) { animation: ken-burns 7s ease-in-out forwards; }
    .slide--desktop-full:nth-child(4n+1).is-active img:not(.slide-video-poster) { transform-origin: center center; }
    .slide--desktop-full:nth-child(4n+2).is-active img:not(.slide-video-poster) { transform-origin: top left; }
    .slide--desktop-full:nth-child(4n+3).is-active img:not(.slide-video-poster) { transform-origin: bottom right; }
    .slide--desktop-full:nth-child(4n+0).is-active img:not(.slide-video-poster) { transform-origin: top right; }
  }
  @media (max-width: 700px) {
    .slide--mobile-full.is-active img:not(.slide-video-poster) { animation: ken-burns 7s ease-in-out forwards; }
    .slide--mobile-full:nth-child(4n+1).is-active img:not(.slide-video-poster) { transform-origin: center center; }
    .slide--mobile-full:nth-child(4n+2).is-active img:not(.slide-video-poster) { transform-origin: top left; }
    .slide--mobile-full:nth-child(4n+3).is-active img:not(.slide-video-poster) { transform-origin: bottom right; }
    .slide--mobile-full:nth-child(4n+0).is-active img:not(.slide-video-poster) { transform-origin: top right; }
  }
}
.slide-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: normal;
  font-size: 0.85em;
  opacity: 1;
}

/* Desktop fit — applies above 700px */
@media (min-width: 701px) {
  .slide--desktop-full .slide-media { position: absolute; inset: 0; }
  .slide--desktop-full .slide-media img:not(.slide-video-poster),
  .slide--desktop-full .slide-media video { width: 100%; height: 100%; object-fit: cover; }

  /* contained: image/video floats dead-center on a definite box (vw/vh, not a
     percentage of an auto-height ancestor) so it can never overflow */
  .slide--desktop-contained .slide-media {
    width: calc(var(--slide-size-desktop, 56) * 1vw);
    height: calc(var(--slide-size-desktop, 56) * 1.143vh);
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .slide--desktop-contained .slide-media img:not(.slide-video-poster) {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
  }
  /* Video fills the container box; object-fit: contain letterboxes the
     content inside. This prevents the element from snapping to a new
     size when HLS ABR switches quality levels (which changes videoWidth/
     videoHeight but should never change the element's layout dimensions). */
  .slide--desktop-contained .slide-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
}

/* Mobile fit — applies at/below 700px */
@media (max-width: 700px) {
  .slide--mobile-full .slide-media { position: absolute; inset: 0; }
  .slide--mobile-full .slide-media img:not(.slide-video-poster),
  .slide--mobile-full .slide-media video { width: 100%; height: 100%; object-fit: cover; }

  .slide--mobile-contained .slide-media {
    width: calc(var(--slide-size-mobile, 56) * 1vw);
    height: calc(var(--slide-size-mobile, 56) * 1.143vh);
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .slide--mobile-contained .slide-media img:not(.slide-video-poster) {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
  }
  .slide--mobile-contained .slide-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
}

.slide-caption {
  position: absolute;
  left: var(--margin);
  right: var(--margin);
  width: 100%;
  bottom: var(--margin);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.slide-caption .slide-count { letter-spacing: normal; opacity: 1; font-size: 0.85em; }
.slide-caption .slide-title { max-width: 50ch; }

@media (max-width: 700px) {
  .slide-caption .slide-title {
    max-width: 62vw;
  }
}

/* ---------- work grid ---------- */

.error-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
/* decorative (aria-hidden) — monospace + perspective tilt, not an image */
.error-ascii {
  display: inline-block;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: clamp(0.722em, 4.2vw, 1.222em);
  line-height: 1.2;
  margin: 0 0 1.6em;
  white-space: pre;
  transform: perspective(420px) rotateX(22deg);
  transform-origin: 50% 100%;
}
.error-label {
  letter-spacing: normal;
}

.work-section .wrap { max-width: none; }

.work-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: calc(var(--margin) * 2);
  overflow: hidden; /* clips ::before bleed on outer edges */
  padding: 0;
  position: relative;
}

/* Bottom rule closing the last row */
.work-list::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--c-rule);
  pointer-events: none;
}

/* Odd number of visible items: last item is alone in left column — extend its
   top rule across the full grid so the empty right cell isn't open-topped.
   JS sets .is-grid-tail--odd because :last-child can't see hidden rows. */
.work-list > .row.is-grid-tail--odd::before {
  right: -9999px;
}

/* Vertical rule between columns */
.work-list::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--c-rule);
  pointer-events: none;
}

.row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--margin);
  width: 100%;
  margin: 0;
  background: none;
  border: none;
  padding: var(--margin) 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.row.is-hidden { display: none; }

/* Horizontal rule — extends var(--margin) beyond the row on each side so it
   bridges the column gap. overflow:hidden on .work-list clips the outer bleed,
   leaving a continuous rule that stops at the padding boundary on both sides. */
.row::before {
  content: '';
  position: absolute;
  top: 0;
  left: calc(-1 * var(--margin));
  right: calc(-1 * var(--margin));
  height: 1px;
  background: var(--c-rule);
}

.empty-state {
  margin: 0;
  padding: clamp(1.111em, 0.978em + 0.6vw, 1.444em) 0;
  color: var(--c-ink-soft);
}

/* ---------- archive empty state ---------- */

.personal-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15vh 0;
}

.personal-soon-ascii {
  font-family: monospace;
  font-size: clamp(0.444em, 1.5vw, 0.778em);
  line-height: 1.2;
  color: var(--c-ink-soft);
  margin: 0;
  white-space: pre;
}

.row-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.row-client {
  display: block;
  letter-spacing: normal;
  line-height: 1.45;
  color: var(--c-ink);
}

.row-title {
  display: block;
  letter-spacing: normal;
  line-height: 1.45;
}

.row-medium,
.row-year {
  display: block;
  font-size: 0.85em;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.6);
}

.row-medium { max-width: 70%; }

.row-nda {
  align-self: flex-start;
  margin-top: 0.222em;
  background: transparent;
  color: var(--c-ink);
  border: 1px solid var(--c-ink);
  font-size: 0.667em;
  letter-spacing: 0.06em;
  padding: 0.167em 0.278em 0.056em;
  line-height: 1;
}

.row-thumb {
  flex-shrink: 0;
  height: clamp(5.944em, 2.611em + 12vw, 13.111em);
  width: auto;
  overflow: hidden;
  background: var(--c-placeholder);
}

.row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* hidden by default to prevent pre-JS flash of multiple panels */
.grid[data-view-panel="archive"] {
  display: none;
}

/* auto-fill, not auto-fit: lone cards (Personal may have just one) stay at
   normal card width with trailing empty tracks, not stretched full-bleed. */
.grid {
  grid-template-columns: repeat(auto-fill, minmax(min(15.556em, 100%), 1fr));
  column-gap: var(--margin);
  row-gap: 3em;
  align-items: start;
  padding: 0 0 var(--page-bottom);
}

/* archive: denser, smaller floor (170px vs 280px) — more items at a glance */
.grid--archive {
  grid-template-columns: repeat(auto-fill, minmax(min(9.444em, 100%), 1fr));
  column-gap: 2em;    /* 1em each side of vertical rule = matches padding-top: 1em */
  row-gap: 0;         /* spacing moved to card padding-top so rules land cleanly */
  overflow: hidden;   /* clips the ±9999px card rule bleed */
  position: relative;
  padding-bottom: 0;        /* override .grid — ::after handles bottom closure */
  margin-bottom: var(--page-bottom); /* footer spacing outside the vline area */
}

/* Closing bottom rule — sits as the last grid item, spanning all columns.
   margin-top matches the card margin-top so spacing above is symmetric.
   Hidden when grid is empty (personal-soon placeholder present). */
.grid--archive:not(:has(.personal-soon))::after {
  content: '';
  grid-column: 1 / -1;
  height: 1px;
  background: var(--c-rule);
  margin-top: 1em;
}

/* Per-row rules on each card: extend far left/right, clipped by overflow:hidden
   on the grid. All cards in the same row share the same top Y, so their ::before
   elements overlap into one continuous line across the full width.
   margin-top gives space ABOVE the rule; padding-top gives space BELOW. */
.grid--archive .card {
  position: relative;
  margin-top: 1em;
  padding-top: 1em;
}
/* JS marks the first card in each visual row with is-row-start.
   Only that card draws the rule — prevents opacity stacking across columns. */
.grid--archive .card::before {
  content: none;
}
.grid--archive .card.is-row-start::before {
  content: '';
  position: absolute;
  top: 0;
  left: -9999px;
  right: -9999px;
  height: 1px;
  background: var(--c-rule);
}
/* All first-row cards sit flush at top — no gap before the opening rule.
   JS marks every card in row 1 with is-first-row. */
.grid--archive .card.is-first-row {
  margin-top: 0;
}

.grid--archive .card-meta {
  margin-top: 0.444em;
  display: flex;
  flex-direction: column;
  gap: 0.111em;
}

.grid--archive .card-meta .title {
  font-size: 0.85em;
  color: var(--c-ink);
}

.grid--archive .card-meta-title {
  font-size: 0.85em;
  color: rgba(0, 0, 0, 0.6);
}

.grid--archive .card-meta-sub {
  font-size: 0.65em;
  color: rgba(0, 0, 0, 0.6);
  letter-spacing: 0.03em;
}

.card {
  display: block;
  margin: 0;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* Archive-only items (not commissions) are non-clickable */
.card--static { cursor: default; }
.card--static:active { opacity: 1; }

.card-frame {
  overflow: hidden;
  background: var(--c-placeholder);
}

.card-frame img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.42s var(--ease);
}

.card:hover .card-frame img { opacity: 0.86; }

.card-meta {
  margin-top: calc(var(--margin) / 2);
}

.card-meta .title {
  display: block;
  letter-spacing: normal;
}

/* ---------- information page ----------
   Bio, contact, and clientele stack in a left column; portrait sits right.
   Plain two-column grid, single column on mobile with portrait first. */

.info-page .wrap {
  max-width: none;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(21.111em, 38%);
  gap: calc(var(--gutter) * 2);
  padding-bottom: 0;
}

.info-left > * + * {
  margin-top: var(--gap);
}

.info-bio p {
  max-width: 50ch;
  margin: 0 0 var(--margin);
  color: var(--c-ink);
}
.info-bio p:last-child {
  margin-bottom: 0;
}

.info-contact {
  max-width: 50ch;
}
.info-contact p {
  margin: 0;
}
.info-contact p:last-child {
  margin-top: var(--margin);
}
.info-contact a {
  color: var(--c-ink);
  text-decoration: underline; /* only links on the site that underline */
  transition: opacity 0.2s var(--ease);
}
.info-contact a:hover {
  opacity: 0.6;
}

.info-address {
  color: var(--c-ink);
}
.info-availability {
  display: inline-block;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-ink);
}

.info-facts {
  max-width: 50ch;
}

.info-facts p.info-facts-label {
  margin: 0 0 var(--margin);
  color: var(--c-ink);
}

.info-facts p {
  margin: 0;
  color: var(--c-ink);
}

.info-facts .no-wrap {
  white-space: nowrap;
}

.info-portrait {
  display: flex;
  justify-content: flex-end;
}

.info-portrait img {
  width: min(75vw, 21.444em);
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--c-placeholder); /* same placeholder fill as .card-frame */
  transition: width 0.25s var(--ease);
}

@media (max-width: 760px) {
  .info-grid {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .info-right {
    order: -1;
    margin-top: var(--margin);
  }
  .info-portrait {
    display: flex;
    justify-content: center;
    margin-bottom: var(--margin);
  }
  /* width handled by min(75vw, 386px) on the base rule */
  .info-left > * + * {
    margin-top: var(--gap);
  }
}

/* ---------- project page ---------- */

:root { --about-w: 46vw; }

.project-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--gutter);
  padding: 0 var(--margin) var(--gap);
}

.project-topbar-left {
  display: flex;
  flex-direction: column;
  gap: 0.222em;
}

.project-header-client,
.project-header-title,
.project-header-desc {
  margin: 0;
  font-size: var(--fz);
  font-weight: normal;
}

.about-dropdown { flex-shrink: 0; }


.project-body {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.project-canvas {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 var(--margin) var(--margin);
  display: flex;
  flex-direction: column;
  gap: calc(var(--margin) / 2);
}

.about-panel {
  flex: 0 0 0;
  min-width: 0;
  max-width: 0; /* Safari stale-cache guard — see resize handler in main.js */
  overflow: hidden;
  background: var(--c-paper);
  will-change: opacity;
  transition: flex-basis 0.3s 0.15s var(--ease),
              max-width 0.3s 0.15s var(--ease);
}

body.about-open .about-panel {
  flex-basis: var(--about-w);
  max-width: var(--about-w);
  transition: flex-basis 0.3s var(--ease),
              max-width 0.3s var(--ease);
}

/* pre-laid at full panel width so text wraps correctly before reveal */
.about-panel-inner {
  width: var(--about-w);
  padding: 0 var(--gutter) var(--margin) var(--gutter);
  color: var(--c-ink);
  display: flex;
  flex-direction: column;
  gap: var(--margin);
  opacity: 0;
  transition: opacity 0.15s;
}

body.about-open .about-panel-inner {
  opacity: 1;
  transition: opacity 0.2s 0.2s;
}

.about-panel-inner p,
.about-panel-inner h3 { margin: 0; }
.about-panel-inner h3 { font-size: var(--fz); font-weight: normal; }

.pt-img { margin: 0; width: 100%; }
.pt-img img { width: 100%; display: block; }
.pt-img figcaption { color: var(--c-ink-soft); margin-top: 0.444em; }

@media (max-width: 700px) {
  :root { --about-w: 100vw; --fz: 17px; }
  body { font-size: 17px; }
  .project-body {
    position: relative;
    flex-direction: column;
    overflow: visible;
  }
  /* DOM order is canvas-first; flip on mobile so the panel opens between
     topbar and images. z-index:1 needed — order:1 paints before order:2
     (canvas), so without it the panel falls behind the hero image. */
  .project-canvas { order: 2; }
  .about-panel {
    order: 1;
    position: relative;
    z-index: 1;
    flex-basis: auto;
    max-width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.28s var(--ease),
                opacity 0.22s var(--ease);
  }
  body.about-open .project-canvas { pointer-events: none; }
  body.about-open .about-panel {
    flex-basis: auto; /* override desktop rule's flex-basis: var(--about-w) which = 100vw here */
    max-height: 2000px;
    opacity: 1;
    pointer-events: auto;
    /* Specificity 0,1,1 overrides the closed rule (0,0,1) — transition must
       be re-declared here or opening gets no animation. */
    transition: max-height 0.28s var(--ease),
                opacity 0.22s var(--ease);
  }
  .about-panel-inner {
    width: 100%;
    padding: 0 var(--margin) calc(var(--margin) * 2);
    opacity: 1;
    transition: none;
  }
}

.blk { margin: 0; position: relative; isolation: isolate; }

/* percentage-width variants — desktop only; always full-width on mobile */
.blk--pct {
  max-width: var(--blk-width, 100%);
  margin-left: auto;
  margin-right: auto;
}
.blk--pct.blk--left  { margin-left: 0; }
.blk--pct.blk--right { margin-right: 0; }
@media (max-width: 700px) {
  .blk--pct { max-width: 100%; margin-left: 0; margin-right: 0; }
}

.blk figcaption {
  position: absolute;
  bottom: 0.5em;
  left: 0.9em;
  margin: 0;
  color: white;
  mix-blend-mode: difference;
  font-size: 0.85em;
  pointer-events: none;
}

/* rich text block — full-width on mobile, centered column on desktop.
   Vertical padding on both breakpoints so the text breathes the same amount
   against the image blocks above and below it. */
.blk-rich-text {
  padding-top: calc(var(--margin) * 2);
  padding-bottom: calc(var(--margin) * 2);
}
.blk-rich-text p { margin: 0; max-width: 60ch; }
.blk-rich-text p + p { margin-top: 0.75em; }
.blk-rich-text h2,
.blk-rich-text h3,
.blk-rich-text h4 {
  margin: 1.2em 0 0.3em;
  font-size: inherit;
  font-weight: normal;
  letter-spacing: normal;
}
.blk-rich-text ul,
.blk-rich-text ol {
  margin: 0.5em 0;
  padding-left: 1.3em;
  max-width: 60ch;
}
.blk-rich-text li { margin-bottom: 0.2em; }
.blk-rich-text li:last-child { margin-bottom: 0; }
.blk-rich-text ul { list-style: disc; }
.blk-rich-text ol { list-style: decimal; }
.blk-rich-text a { text-decoration: underline; transition: opacity 0.2s var(--ease); }
.blk-rich-text a:hover { opacity: 0.6; }
.blk-rich-text strong { font-weight: bold; }
/* desktop only: center column */
@media (min-width: 701px) {
  .blk-rich-text {
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
  }
}

/* about panel portable text */
.about-panel-inner ul,
.about-panel-inner ol { margin: 0; padding-left: 1.3em; }
.about-panel-inner li { margin-bottom: 0.2em; }
.about-panel-inner li:last-child { margin-bottom: 0; }
.about-panel-inner ul { list-style: disc; }
.about-panel-inner ol { list-style: decimal; }
.about-panel-inner a { text-decoration: underline; }
.about-panel-inner a:hover { opacity: 0.6; }

.blk-full-bleed img { width: 100%; display: block; }

.two-up-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--margin) / 2);
}
.two-up-row img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) {
  .two-up-row { grid-template-columns: 1fr; }
}

/* contact sheet — gap matches block spacing, no outer padding */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(var(--cs-cols, 3), 1fr);
  align-items: center;
  gap: calc(var(--margin) / 2);
}
.contact-frame { position: relative; }
.contact-frame img { width: 100%; display: block; }
.contact-frame--lb {
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: none;
  display: block;
  width: 100%;
  text-align: left;
  isolation: isolate; /* contains mix-blend-mode on .contact-expand to within the button */
}

.contact-expand {
  position: absolute;
  bottom: 0.5em;
  right: 0.5em;
  width: 0.722em;
  height: 0.722em;
  color: white;
  mix-blend-mode: difference;
  pointer-events: none;
  line-height: 0;
}
.contact-expand svg { width: 0.722em; height: 0.722em; display: block; }

.blk-slideshow { overflow: hidden; cursor: pointer; }
.slideshow-track {
  display: flex;
  transition: transform 0.4s var(--ease);
  will-change: transform;
}
.slideshow-slide {
  flex: 0 0 100%;
  min-width: 100%;
  position: relative;
}
.slideshow-slide img { width: 100%; display: block; }
.slideshow-counter {
  position: absolute;
  bottom: 1em;
  right: 1em;
  color: var(--c-paper);
  font-size: 0.85em;
  opacity: 1;
  mix-blend-mode: difference;
  pointer-events: none;
}

.blk-spec-callout p {
  max-width: 56ch;
  margin: 0;
  padding: var(--margin) 0 var(--margin) var(--margin);
  color: var(--c-ink-soft);
  border-left: 2px solid var(--c-line);
}

.video-frame { position: relative; }
.video-frame video { width: 100%; display: block; aspect-ratio: 16 / 9; }
.video-toggle {
  position: absolute;
  bottom: 0; right: 0;
  border: none;
  background: none;
  color: white;
  mix-blend-mode: difference;
  cursor: pointer;
  padding: 0.5em;
  line-height: 0;
}
.video-toggle svg { width: 0.722em; height: 0.722em; display: block; }
.video-toggle .icon-play { display: none; }
.video-toggle[data-playing="false"] .icon-pause { display: none; }
.video-toggle[data-playing="false"] .icon-play { display: block; }

/* Poster image for video slides — absolutely overlaid so it obeys the same
   object-fit: contain as the video element below it. Fades out on play. */
.slide-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  z-index: 1;
}
.slide-video-poster.is-hidden { display: none; }

.slide-play-toggle {
  position: absolute;
  bottom: 0; right: 0;
  z-index: 3;
  border: none;
  background: none;
  color: white;
  mix-blend-mode: difference;
  cursor: pointer;
  padding: 0.5em;
  line-height: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.slide-play-toggle.is-visible { opacity: 1; }
.slide-play-toggle svg { width: 0.722em; height: 0.722em; display: block; }
.slide-play-toggle .icon-play { display: none; }
.slide-play-toggle[data-playing="false"] .icon-pause { display: none; }
.slide-play-toggle[data-playing="false"] .icon-play { display: block; }


/* ---------- page shell ---------- */

html, body {
  overflow-x: hidden;
}

/* Load animation: page rises from black to white, then images/videos stagger in.
   Images are kept hidden via CSS during the black phase; JS reveals them in order. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes page-pulse {
    0%   { background-color: #000; opacity: 0; }
    25%  { background-color: #000; opacity: 1; }
    100% { background-color: transparent; opacity: 1; }
  }
  [data-page-shell].is-cycling {
    animation: page-pulse 0.7s ease-out forwards;
  }
  [data-page-shell].is-cycling img,
  [data-page-shell].is-cycling video,
  [data-page-shell].is-cycling .row-thumb,
  [data-page-shell].is-cycling .card-frame {
    opacity: 0;
  }
}

/* isolation:isolate for stacking context without a GPU compositor layer */
.page-shell {
  isolation: isolate;
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#main {
  flex: 1;
}


/* ---------- mobile nav ---------- */

.nav-short { display: none; }

@media (max-width: 700px) {
  .work-list { grid-template-columns: 1fr; column-gap: 0; overflow: visible; }
  .work-list::after { display: none; }
  .work-list > .row.is-grid-tail--odd::before { right: 0; }
  .row::before { left: 0; right: 0; }

  .masthead .wrap { align-items: flex-start; }
  .masthead-nav {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.333em;
  }
  .masthead-nav .nav-overview { display: none; }
  .nav-full { display: none; }
  .nav-short { display: inline; }

  .grid--archive { grid-template-columns: 1fr 1fr; } /* always 2 columns */
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-paper);
  color: var(--c-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
  z-index: 1100;
  cursor: pointer;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: var(--margin);
  right: var(--margin);
  z-index: 2;
  background: none;
  border: none;
  color: inherit;
  letter-spacing: normal;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s var(--ease);
}
.lightbox-close:hover { opacity: 0.6; }

.lightbox-media {
  width: 56vw;
  height: 64vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: default;
}

.lightbox-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  cursor: default;
}

.lightbox-caption {
  position: absolute;
  left: var(--margin);
  right: var(--margin);
  width: 100%;
  bottom: var(--margin);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.222em;
  pointer-events: none;
}

/* Archive: split layout — image left, details right */
.lightbox.is-split {
  gap: 5vw;
  padding: 0 6vw;
}
.lightbox.is-split .lightbox-media {
  width: auto;
  max-width: 55vw;
}
.lightbox.is-split .lightbox-caption {
  display: none;
}
.lightbox-info {
  flex: 0 0 12.222em;
  display: flex;
  flex-direction: column;
  gap: 0.333em;
  cursor: default;
  align-self: center;
}
.lightbox:not(.is-split) .lightbox-info {
  display: none;
}
.lightbox-info-client {
  font-weight: 500;
}
.lightbox-info-title {
  color: var(--c-ink-soft);
}
.lightbox-info-year {
  font-size: 0.85em;
  color: var(--c-ink-soft);
}
.lightbox-info-details {
  margin-top: 0.333em;
  line-height: 1.55;
  color: var(--c-ink-soft);
  font-size: 0.9em;
}

/* ---------- 404 ---------- */

#main:has(.not-found) {
  display: flex;
  flex-direction: column;
}

.not-found {
  flex: 1;
  padding: var(--gap) var(--margin);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--margin);
}

.not-found-ascii {
  font-family: var(--font-sans);
  font-size: clamp(0.55rem, 1.8vw, 1.1rem);
  line-height: 1.25;
  letter-spacing: 0;
  white-space: pre;
  margin: 0;
  user-select: none;
}

.not-found-message {
  font-size: 1.1em;
}

/* ---------- site footer ----------
   Single bar: Newsletter toggle (left) swaps in-place for the signup form;
   email address sits on the right. */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--gap) var(--margin);
  padding-bottom: max(var(--gap), calc(env(safe-area-inset-bottom) + var(--gap)));
}

.footer-left {
  display: flex;
  align-items: baseline;
}

/* newsletter-wrap is the height anchor — toggle button stays in flow always.
   Form and success float absolutely over it so the footer height never shifts. */
.newsletter-wrap {
  position: relative;
}

.newsletter-form {
  display: flex;
  align-items: baseline;
  gap: 0.556em;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.newsletter-input {
  background: none;
  border: none;
  border-bottom: 1px solid var(--c-ink);
  border-radius: 0;
  padding: 0;
  margin-bottom: 0.167em; /* visual gap between text and underline */
  line-height: inherit;
  color: var(--c-ink);
  width: 11.111em;
  outline: none;
}
.newsletter-input::placeholder { color: var(--c-ink-soft); }

.newsletter-submit {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--c-ink);
  transition: opacity 0.2s var(--ease);
}
.newsletter-submit:hover { opacity: 0.6; }

.newsletter-success {
  margin: 0;
  color: var(--c-ink-soft);
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

/* open states — class-toggled by JS */
.newsletter-form.is-open,
.newsletter-success.is-open {
  opacity: 1;
  pointer-events: auto;
}
.footer-toggle.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.footer-email {
  color: var(--c-ink);
  transition: opacity 0.2s var(--ease);
}
.footer-email:hover { opacity: 0.6; }

.footer-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--c-ink);
  transition: opacity 0.2s var(--ease);
}
.footer-toggle:hover { opacity: 0.6; }


