:root {
  --bg: #f7f4ef;
  --ink: #1f1c18;
  --soft: #7a7268;
  --line: #e2ddd4;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p a, .site-footer a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
p a:hover, .site-footer a:hover { border-color: var(--ink); }

/* ── Header ───────────────────────────── */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--gutter);
}
.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 34px;
  line-height: 1;
  letter-spacing: .01em;
}
.site-header nav { display: flex; gap: 28px; }
.site-header nav a {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header nav a:hover,
.site-header nav a[aria-current] { border-color: currentColor; }

.site-header.overlay {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
.site-header.overlay .wordmark { font-size: clamp(40px, 6vw, 64px); }
.site-header.overlay nav a,
.hero-text { font-weight: 400; font-size: 14px; text-shadow: 0 0 2px rgba(0,0,0,.5), 0 1px 14px rgba(0,0,0,.6); }

/* ── Home hero ───────────────────────── */
.home { background: var(--bg); }
.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.hero img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: settle 1.4s ease-out both;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(20,14,8,.55), rgba(20,14,8,0) 30%, rgba(20,14,8,0) 62%, rgba(20,14,8,.6));
  pointer-events: none;
}
.hero-text {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(28px, 6vh, 56px);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #fff;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0,0,0,.4);
}
.hero-kicker { margin: 0; }
.hero-link { border-bottom: 1px solid rgba(255,255,255,.6); padding-bottom: 3px; }
.hero-link:hover { border-color: #fff; }
@keyframes settle { from { transform: scale(1.04); } to { transform: none; } }

/* ── Layout ──────────────────────────── */
.wrap { padding: 24px var(--gutter) 80px; max-width: 1400px; margin: 0 auto; }
.page-title {
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  margin: 0 0 40px;
}
.back, .kind, .tile-meta, figcaption span, .more-label, .site-footer {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--soft);
}
.back { display: inline-block; margin-bottom: 28px; }
.back:hover { color: var(--ink); }

/* ── Work index ──────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 56px 32px;
}
.tile { display: block; }
.tile-img { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--line); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease, opacity .4s; }
.tile:hover .tile-img img { transform: scale(1.03); }
.tile-title { display: block; font-size: 26px; margin-top: 16px; line-height: 1.2; }
.tile-meta { display: block; margin-top: 4px; }

/* ── Project page ────────────────────── */
.project {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2.3fr);
  column-gap: clamp(32px, 5vw, 96px);
  align-items: start;
}
.project-info { position: sticky; top: 28px; padding-bottom: 24px; }
.project-info .page-title { margin: 0 0 10px; }
.subtitle { font-style: italic; font-size: 22px; margin: 0 0 12px; }
.kind { margin: 0 0 28px; }
.statement p { margin: 0 0 1em; font-size: 18px; line-height: 1.65; max-width: 44ch; }

.project-works { display: flex; flex-direction: column; gap: clamp(48px, 8vh, 96px); }
.project-works figure { margin: 0; }
.zoom {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.zoom img {
  display: block;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
  -webkit-user-drag: none;
}
.zoom.on { cursor: zoom-out; touch-action: none; }
.zoom.on img { transform: scale(var(--zoom, 2.6)); }
/* Fill the column, but never taller than ~86% of the screen */
.project-works .zoom { width: min(100%, calc(86vh * var(--ar, 0.75))); }
.project-works img { width: 100%; height: auto; }
.project-works figcaption { margin-top: 10px; font-style: italic; font-size: 17px; }
.project-works figcaption span { display: block; font-style: normal; margin-top: 2px; }
.project + .more-work { margin-top: clamp(64px, 10vh, 120px); }

@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .project-info { position: static; padding-bottom: 40px; }
  .statement p { max-width: none; }
}

.more-work {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin-top: 32px;
}
.more-label { margin: 0 0 16px; }
.more-work ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.more-work ul::-webkit-scrollbar { display: none; }
.more-work li { flex: 0 0 auto; }
.more-work a { display: block; width: 88px; }
.more-img {
  display: block;
  width: 88px;
  height: 88px;
  overflow: hidden;
  background: var(--line);
}
.more-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.75);
  transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s;
}
.more-title {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.25;
  color: var(--soft);
  transition: color .2s;
}
.more-work a:hover .more-img img { transform: scale(1.06); filter: none; }
.more-work a:hover .more-title { color: var(--ink); }

/* ── About ───────────────────────────── */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}
.about-img { position: sticky; top: 32px; }
.about-text p { margin: 0 0 1em; max-width: 60ch; }
.about-text .lede { font-size: 24px; line-height: 1.35; font-style: italic; margin-top: -0.25em; margin-bottom: .8em; }
.about-text h2 { font-weight: 400; font-size: 28px; margin: 48px 0 12px; }

/* ── Footer ──────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  text-transform: none;
  letter-spacing: .04em;
  font-size: 13px;
}

/* ── Small screens ───────────────────── */
@media (max-width: 760px) {
  body { font-size: 18px; }
  .site-header { padding-top: 20px; padding-bottom: 20px; }
  .site-header nav { gap: 18px; }
  .wordmark { font-size: 28px; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .about-img { position: static; }
  .tiles { gap: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero img { animation: none; }
  .tile-img img { transition: none; }
}

/* ── CV ──────────────────────────────── */
.cv { list-style: none; margin: 0; padding: 0; max-width: 60ch; }
.cv li {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 17px;
  line-height: 1.45;
}
.cv li:last-child { border-bottom: 1px solid var(--line); }
.cv-year { font-family: var(--sans); font-weight: 300; font-size: 13px; letter-spacing: .08em; color: var(--soft); padding-top: 3px; }
@media (max-width: 760px) { .cv li { grid-template-columns: 4.5em 1fr; gap: 12px; } }

/* ── Work carousel ───────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.work-page { overflow-x: clip; }
.carousel { overflow-x: clip; overflow-y: visible; }
.work { padding: 0 0 56px; }

.stage { list-style: none; margin: 0; padding: 0; }
.card, .card-img { display: block; }

/* Fallback grid when JavaScript is off */
.carousel:not(.is-ready) .stage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 48px 28px;
  padding: 24px var(--gutter);
}
.carousel:not(.is-ready) .card-img { aspect-ratio: 4 / 5; overflow: hidden; background: var(--line); }
.carousel:not(.is-ready) .card-img img { width: 100%; height: 100%; object-fit: cover; }
.carousel:not(.is-ready) .caption { display: none; }

/* Carousel */
.carousel.is-ready:not(.is-grid) .stage {
  --card-h: clamp(300px, 62svh, 720px);
  --card-maxw: min(70vw, 980px);
  position: relative;
  height: calc(var(--card-h) + 56px);
  margin-top: 12px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.carousel.is-dragging .stage { cursor: grabbing; }
.carousel.is-ready:not(.is-grid) .slide {
  position: absolute;
  left: 50%;
  top: 50%;
  will-change: transform, opacity;
}
.carousel.is-ready:not(.is-grid) .tile-title,
.carousel.is-ready:not(.is-grid) .tile-meta { display: none; }
.carousel.is-ready:not(.is-grid) .card-img img {
  height: min(var(--card-h), calc(var(--card-maxw) / var(--ar)));
  width: auto;
  max-width: none;
  box-shadow: 0 40px 70px -40px rgba(40, 30, 18, .45), 0 2px 6px rgba(40, 30, 18, .06);
  transition: filter .5s;
  -webkit-user-drag: none;
}
.carousel.is-ready:not(.is-grid) .slide:not(.is-current) .card-img img { filter: saturate(.7) brightness(1.04); }
.carousel .slide.is-current .card { cursor: pointer; }

.caption { text-align: center; padding: 4px var(--gutter) 0; min-height: 84px; }
.caption.swap > * { animation: capIn .55s cubic-bezier(.2,.7,.2,1) both; }
.caption.swap > :nth-child(2) { animation-delay: .06s; }
@keyframes capIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cap-title { font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; margin: 0 0 8px; }
.cap-meta {
  font: 300 12px/1.4 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--soft);
  margin: 0;
}

@media (max-width: 760px) {
  .carousel.is-ready:not(.is-grid) .stage { --card-h: clamp(260px, 48svh, 480px); --card-maxw: 60vw; }
}

/* List view: scattered, uncropped, scrolling */
.carousel.is-grid .caption { display: none; }
.carousel.is-grid .stage {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 40px);
  row-gap: clamp(56px, 11vh, 140px);
  align-items: start;
  padding: clamp(24px, 6vh, 72px) var(--gutter) clamp(80px, 16vh, 200px);
}
.carousel.is-grid .slide {
  grid-column: var(--c, 1) / span var(--s, 4);
  margin-top: var(--mt, 0);
  will-change: transform;
}
.carousel.is-grid .card-img { overflow: hidden; background: var(--line); }
.carousel.is-grid .card-img img {
  width: 100%;
  height: auto;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1), filter .6s;
}
.carousel.is-grid .card:hover .card-img img { transform: scale(1.035); }
.carousel.is-grid .stage:has(.card:hover) .card:not(:hover) .card-img img { filter: saturate(.6) opacity(.75); }
.carousel.is-grid .tile-title {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  margin-top: 9px;
}
.carousel.is-grid .tile-meta {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: .16em;
}
/* Reveal on scroll */
.carousel.is-grid.reveal .card {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.2,.7,.2,1);
}
.carousel.is-grid.reveal .slide.in .card { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .carousel.is-grid .stage {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    row-gap: 56px;
  }
  .carousel.is-grid .slide { grid-column: var(--mc, 1) / span var(--ms, 5); margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .carousel.is-grid.reveal .card { opacity: 1; transform: none; transition: none; }
}

/* Slide / List annotation, bottom left */
.work-controls {
  display: none;
  position: sticky;
  bottom: 22px;
  z-index: 5;
  margin: 0 var(--gutter);
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  pointer-events: none; /* the empty middle shouldn't block the artwork */
  font: 300 11px/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--soft);
}
.work.js .work-controls { display: flex; }
.view-switch {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.view-switch, .cat-filter { pointer-events: auto; }
.view-switch button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 4px 0 3px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }

/* ── Home: quote and practice ────────── */
@media (prefers-reduced-motion: no-preference) {
  html:has(body.home) { scroll-behavior: smooth; }
}
.quote {
  min-height: 86vh;
  display: grid;
  place-items: center;
  padding: 16vh var(--gutter);
}
.quote blockquote { margin: 0; }
.quote p {
  margin: 0 auto;
  max-width: 17ch;
  text-align: center;
  font-style: italic;
  font-size: clamp(38px, 6.2vw, 92px);
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.practice {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(80px, 14vh, 160px);
}
.cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 36px);
  align-items: start;
}
.cat-img { aspect-ratio: 3 / 4; overflow: hidden; background: var(--line); }
.cat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.cat:hover .cat-img img { transform: scale(1.04); }
.cat { display: block; }
.cat-img { display: block; }
.cat h2 {
  font-weight: 400;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.1;
  margin: 14px 0 0;
  transition: opacity .3s;
}
.cats:has(.cat:hover) .cat:not(:hover) { opacity: .55; }
.cat { transition: opacity .4s; }

/* Fade up on scroll (only once JS is running) */
.js-reveal .reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.js-reveal .reveal-up.in { opacity: 1; transform: none; }
.js-reveal .cat:nth-child(2) { transition-delay: .08s; }
.js-reveal .cat:nth-child(3) { transition-delay: .16s; }
.js-reveal .cat:nth-child(4) { transition-delay: .24s; }

@media (max-width: 1000px) {
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
}
@media (max-width: 760px) {
  .quote { min-height: 70vh; padding: 12vh var(--gutter); }
  .js-reveal .cat:nth-child(odd) { transition-delay: 0s; }
  .js-reveal .cat:nth-child(even) { transition-delay: .08s; }
}

/* ── About: CV dropdowns ─────────────── */
.about-text .cv-section:first-of-type { margin-top: 40px; }
.cv-section { border-top: 1px solid var(--line); max-width: 60ch; }
.cv-section .cv { max-width: none; }
.cv-section:last-of-type { border-bottom: 1px solid var(--line); }
.cv-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
.cv-section summary::-webkit-details-marker { display: none; }
.cv-section summary h2 { margin: 0; font-weight: 400; font-size: 26px; transition: opacity .2s; }
.cv-section summary:hover h2 { opacity: .65; }
.cv-section summary::after {
  content: "+";
  font: 300 22px/1 var(--sans);
  color: var(--soft);
  transition: transform .3s;
}
.cv-section[open] summary::after { content: "−"; }
.cv-section .cv { padding-bottom: 20px; }
.cv-section .cv li:last-child { border-bottom: 0; }
.cv-section[open] .cv { animation: cvOpen .45s cubic-bezier(.2,.7,.2,1); }
@keyframes cvOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ── Larger tap areas (invisible) ────── */
.back, .view-switch button, .site-header nav a { position: relative; }
.back::before,
.view-switch button::before,
.site-header nav a::before {
  content: "";
  position: absolute;
  inset: -12px -8px;
}

/* Category filter (opens upward from the bottom-left controls) */
.cat-filter { position: relative; }
.cat-toggle, .cat-menu button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 4px 0 3px;
  cursor: pointer;
  transition: color .2s;
}
.cat-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); position: relative; }
.cat-toggle::before { content: ""; position: absolute; inset: -12px -8px; }
.cat-toggle:hover { color: var(--ink); }
.cat-caret {
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .3s;
}
.cat-toggle[aria-expanded="true"] .cat-caret { transform: translateY(1px) rotate(-135deg); }
.cat-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  align-items: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
  animation: menuUp .35s cubic-bezier(.2,.7,.2,1);
}
.cat-menu[hidden] { display: none; }
@keyframes menuUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cat-menu button { padding: 7px 0; border-bottom: 1px solid transparent; }
.cat-menu button:hover { color: var(--ink); }
.cat-menu button[aria-pressed="true"] { color: var(--ink); }
.cat-menu button[aria-pressed="true"]::before { content: "· "; }

.slide.is-filtered { display: none !important; }

/* ── Home: cinematic category bands ──── */
.practice { max-width: none; padding: 0 0 clamp(64px, 12vh, 140px); }
.bands { display: flex; flex-direction: column; gap: 4px; }
.band {
  position: relative;
  display: block;
  height: clamp(220px, 40vh, 460px);
  overflow: hidden;
  color: #fff;
  background: #1f1c18;
  isolation: isolate;
}
.band-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  filter: brightness(.82) saturate(.95);
  transition: transform 1.6s cubic-bezier(.2,.7,.2,1), filter .9s ease;
  will-change: transform;
}
.band:hover .band-img img {
  transform: scale(1.05);
  filter: brightness(.95) saturate(1.05);
}
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(15, 10, 6, .55), rgba(15, 10, 6, 0) 55%);
  pointer-events: none;
}
.band-label {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: clamp(18px, 4vh, 40px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.band-label h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(26px, 3vw, 46px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .25);
}


@media (max-width: 760px) {
  .band { height: clamp(180px, 30vh, 280px); }
}

/* Quote: left-aligned block, centred on the page, with a lead-in note */
.quote-inner {
  margin: 0 auto;
  width: fit-content;
  max-width: 100%;
  text-align: left;
}
.quote .quote-inner p { text-align: left; margin: 0; }
.quote-lead {
  margin: 0 0 clamp(16px, 2.6vh, 28px);
  font: 400 clamp(15px, 1.25vw, 18px)/1.5 var(--sans);
  letter-spacing: .06em;
  color: #5c554c;
}
