:root {
  color-scheme: dark;
  --text-color: #FFFFFF;
  --space: 12px;
  --service-font-size: 12px;
  --service-line-height: 1.25;
  --header-space: calc(max(var(--space), env(safe-area-inset-top)) + var(--service-font-size) * var(--service-line-height) + var(--space) * 2 + 1px);
  --footer-space: calc(max(var(--space), env(safe-area-inset-bottom)) + var(--service-font-size) * var(--service-line-height) + var(--space) * 2);
}

* { box-sizing: border-box; }
body { margin: 0; background: #000; color: var(--text-color); font-family: Helvetica, Arial, sans-serif; letter-spacing: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; text-transform: uppercase; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--text-color); outline-offset: 6px; }
.portfolio-track:focus-visible, .archive-projects:focus-visible { outline: 1px solid var(--text-color); outline-offset: -2px; }
main:focus { outline: none; }
[hidden] { display: none !important; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.accessibility-link { position: fixed; top: var(--space); left: var(--space); z-index: 20; transform: translateY(calc(-100% - var(--header-space))); padding: var(--space); border: 1px solid var(--text-color); background: #000; }
.accessibility-link:focus { transform: none; }
.video-pause { top: var(--header-space); }

.site-header { position: fixed; inset: 0 0 auto; z-index: 10; padding: max(var(--space), env(safe-area-inset-top)) var(--space) 0; }
.site-header nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space); padding-bottom: var(--space); border-bottom: 1px solid rgba(255, 255, 255, 0.65); font-size: var(--service-font-size); font-weight: 700; line-height: var(--service-line-height); text-transform: uppercase; }
.site-header[data-featured-progress] nav { position: relative; border-bottom-color: #333; }
.site-header[data-featured-progress] nav::after { content: ""; position: absolute; inset: auto 0 -1px; height: 1px; background: var(--text-color); transform: scaleX(var(--featured-progress)); transform-origin: left; pointer-events: none; }
.site-name { font-weight: 700; }
.site-header a, .about-contact a { text-underline-offset: 4px; }
.site-header a:focus-visible, .about-contact a:focus-visible, .archive-filters button:focus-visible { text-decoration: underline; }
.site-footer { position: fixed; inset: auto 0 0; z-index: 10; padding: var(--space) var(--space) max(var(--space), env(safe-area-inset-bottom)); font-size: var(--service-font-size); line-height: var(--service-line-height); text-align: center; pointer-events: none; }
.site-footer p { margin: 0; }
.site-footer small { font-size: inherit; }

html:has(.portfolio-track) { overscroll-behavior-y: none; scroll-padding: 0; scroll-snap-type: y mandatory; scroll-behavior: smooth; scrollbar-width: none; }
html:has(.portfolio-track)::-webkit-scrollbar { display: none; }
html.is-featured-horizontal { overflow-y: hidden; }
html.is-wheel-scrolling-vertical { scroll-snap-type: none; }
.portfolio-track { display: flex; width: 100%; height: 100vh; height: 100dvh; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-snap-align: start; scroll-snap-stop: always; scroll-behavior: smooth; scrollbar-width: none; }
.portfolio-track::-webkit-scrollbar, .archive-projects::-webkit-scrollbar { display: none; }
.featured-sequence, .featured-stage, .featured-panels { display: contents; }
.featured-panels > article { flex: 0 0 100%; width: 100%; height: 100%; min-width: 0; min-height: 0; scroll-snap-align: start; }
.portfolio-track.is-wheel-scrolling { scroll-snap-type: none; scroll-behavior: auto; }
.is-featured-horizontal .portfolio-track { touch-action: pan-x pinch-zoom; }
.portfolio-track.is-vertical-gesture { overflow-x: hidden; overscroll-behavior-x: auto; }
.featured-project { position: relative; isolation: isolate; display: grid; place-items: center; padding: var(--header-space) var(--space) var(--footer-space); background: #000; }
.project-media { position: absolute; inset: 0; z-index: -1; display: block; width: 100%; height: 100%; object-fit: cover; }
.project-title { width: 100%; max-width: 1100px; margin: 0; text-align: center; font-size: 64px; line-height: 1.1; overflow-wrap: anywhere; text-wrap: balance; }
/* Keep the overlay in the native scroll chain without adding a horizontal panel. */
.featured-titles { position: sticky; left: 0; z-index: 5; flex: 0 0 0; width: 0; min-width: 0; height: 100%; pointer-events: none; }
.featured-titles .project-title { position: absolute; top: calc((100% + var(--header-space) - var(--footer-space)) / 2); left: 50vw; width: calc(100vw - var(--space) * 2); translate: -50% -50%; opacity: 0; }
.featured-titles .project-title:first-child { opacity: 1; }
.project-title a { display: inline-block; max-width: 100%; }
.project-title:not([inert]) a { pointer-events: auto; }
.project-arrow { display: inline-block; width: 0.75em; height: 0.75em; vertical-align: -0.025em; }
.project-arrow .st0 { fill: currentColor; }
.project-tooltip { position: fixed; z-index: 30; width: max-content; max-width: calc(100vw - var(--space) * 2); padding: calc(var(--space) / 2); border-radius: 2px; background: #FFFFFF; color: #000000; font-size: var(--service-font-size); font-weight: 700; line-height: var(--service-line-height); pointer-events: none; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .project-title a { transition: transform 180ms ease; }
  .project-title a:is(:hover, :focus-visible) { transform: scale(1.015); }
}

.archive { position: relative; isolation: isolate; contain: paint; display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; padding: var(--header-space) var(--space) var(--footer-space); background: #000; }
.archive-scroll { display: contents; }
.archive-empty { display: none; }
.archive-projects { display: flex; flex-wrap: wrap; align-items: center; align-content: safe center; justify-content: center; align-self: stretch; gap: 0; width: 100%; min-height: 0; margin: 0; padding: 0; overflow-y: auto; scrollbar-width: none; list-style: none; }
.archive-projects li { display: contents; text-align: center; font-size: clamp(0.9375rem, 1.5vw + 0.5rem, 1.625rem); font-weight: 700; line-height: 1.1; text-transform: uppercase; overflow-wrap: anywhere; text-wrap: balance; }
.archive-projects li:nth-child(odd):not(:last-child)::after { content: "|"; margin: 0 0.5em; }
/* End each pair without changing the list markup or project order. */
.archive-projects li:nth-child(even)::after { content: ""; flex-basis: 100%; height: calc(var(--space) / 2); }
.archive-projects a { display: block; max-width: calc((100% - 1.5em) / 2); padding: calc(var(--space) / 3) 0; }
.archive-projects li:last-child:nth-child(odd) > a { max-width: 100%; }
.archive-cover { display: none; position: fixed; inset: 0; z-index: -1; width: 100vw; height: 100vh; height: 100dvh; object-fit: cover; pointer-events: none; }
.archive-projects a:focus-visible + .archive-cover { display: block; }
@media (hover: hover) and (pointer: fine) {
  .site-header a:hover, .about-contact a:hover, .archive-filters button:hover { text-decoration: underline; }
  .archive-projects:has(a:hover) .archive-cover { display: none; }
  .archive-projects a:hover + .archive-cover { display: block; }
}
.archive-filters, .featured-scroll-hint { display: flex; align-items: center; justify-content: center; font-size: var(--service-font-size); font-weight: 700; line-height: var(--service-line-height); }
.archive-filters { gap: calc(var(--space) / 2); margin-top: var(--space); }
.archive-filters button, .featured-scroll-hint { min-height: 44px; }
.featured-scroll-hint { position: absolute; inset: auto var(--space) var(--footer-space); margin: 0; text-align: center; pointer-events: none; }
.archive-filters button { padding: 0; border: 0; background: transparent; cursor: pointer; text-underline-offset: 5px; }
.archive-filters button[aria-pressed="true"] { text-decoration: underline; }
#archive[data-active-filter="commercial"] li[data-category]:not([data-category="commercial"]) > a,
#archive[data-active-filter="documentary"] li[data-category]:not([data-category="documentary"]) > a { opacity: 0.25; }

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
  #archive:is(:not([data-active-filter="all"]), :has(.archive-projects a:hover, .archive-projects a:focus-visible)) .archive-projects li::after,
  #archive .archive-projects:has(a:hover, a:focus-visible) li[data-category] > a { opacity: 0.25; }
  #archive .archive-projects:has(a:hover) li[data-category] > a:hover,
  #archive .archive-projects:not(:has(a:hover)):focus-within li[data-category] > a:focus-visible { opacity: 1; }
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  html:has(.archive) { overflow: hidden; overscroll-behavior: none; scroll-snap-type: none; scroll-behavior: auto; }
  html:has(.archive) body, html:has(.archive) main { height: var(--mobile-height, 100dvh); overflow: clip; touch-action: pinch-zoom; }
  .featured-sequence { position: fixed; inset: 0 0 auto; display: block; height: var(--mobile-height, 100dvh); }
  .featured-stage { display: block; height: 100%; }
  .portfolio-track { position: relative; display: block; height: 100%; overflow: clip; scroll-snap-type: none; scroll-snap-align: none; touch-action: pinch-zoom; }
  .featured-panels { display: flex; width: 100%; height: 100%; transform: translate3d(calc(-1 * var(--featured-x, 0px)), 0, 0); }
  .featured-panels > article { scroll-snap-align: none; }
  .featured-titles { position: absolute; inset: 0; width: 100%; }
  .archive { --archive-row: clamp(4.5rem, calc(var(--mobile-height, 100dvh) * 0.12), 7.5rem); position: fixed; inset: 0 0 auto; display: block; height: var(--mobile-height, 100dvh); padding: 0; scroll-snap-align: none; transform: translate3d(0, 100%, 0); }
  .archive-scroll { display: block; width: 100%; height: 100%; padding: calc((var(--mobile-height, 100dvh) - var(--archive-row)) / 2) 0; overflow: clip; }
  .archive-empty { display: block; height: var(--archive-row); }
  .archive-projects { flex-direction: column; flex-wrap: nowrap; align-items: stretch; align-content: normal; align-self: auto; justify-content: flex-start; overflow: visible; }
  .archive-projects li { display: flex; align-items: center; justify-content: center; flex: 0 0 var(--archive-row); min-width: 0; font-size: clamp(0.8125rem, 4vw, 1.125rem); line-height: 1.2; }
  .archive-projects li::after { display: none; }
  .archive-projects a { width: 100%; max-width: 100%; padding: 0 var(--space); }
  #archive .archive-projects li > a { opacity: 0.25; }
  #archive .archive-projects li[data-category].is-active > a { opacity: 1; }
  #archive .archive-cover, .archive-filters { display: none; }
  #archive .archive-cover.is-cover-visible { display: block; }
}

.text-page { min-height: 100vh; min-height: 100dvh; padding: var(--header-space) var(--space) var(--footer-space); }
.text-page h1 { margin: 0 0 var(--space); font-size: 40px; }
.text-content { font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.text-content a { text-decoration: underline; }

.about-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--space); min-height: 100vh; min-height: 100dvh; padding: var(--header-space) var(--space) var(--space); }
.about-portrait { min-width: 0; height: calc(100vh - var(--header-space) - var(--space)); height: calc(100dvh - var(--header-space) - var(--space)); margin: 0; }
.about-portrait img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: calc(100vh - var(--header-space) - var(--space)); max-height: calc(100dvh - var(--header-space) - var(--space)); object-fit: cover; }
.about-description { min-width: 0; }
.about-copy { width: 100%; overflow-wrap: anywhere; }
.about-text { font-size: 16px; line-height: 1.6; }
.about-text p { margin: 0 0 var(--space); }
.about-text > :last-child { margin-bottom: 0; }
.about-text a { text-decoration: underline; text-underline-offset: 4px; }
.about-contact { margin-top: var(--space); font-size: 16px; font-style: normal; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  html:has(.portfolio-track), .portfolio-track { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .project-title { font-size: 44px; }
}

@media (max-width: 767px) {
  .about-layout { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(var(--space) * 10); }
  .about-portrait { height: auto; }
}

@media (max-width: 600px) {
  .project-title { font-size: 30px; }
  .text-page h1 { font-size: 30px; }
}
