:root {
  color-scheme: dark;
  --bg: #23221f;
  --fg: #ede9e0;
  --muted: #b6b0a5;
  --line: #5c5750;
  --edge: clamp(20px, 5vw, 96px);
  --gap: clamp(12px, 1.6vw, 28px);
  --cols: 12;
  --header: 70px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header); }
html.restoring-portfolio { scroll-behavior: auto; overflow-anchor: none; visibility: hidden; }
html.restoring-portfolio #home-nav .home-nav-inner { transition: none; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 Arial, "PingFang SC", sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); padding: 7px 14px; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
a:hover, button:not(:disabled):hover { color: #d2b991; }
:focus-visible { outline: 2px solid #b68a50; outline-offset: 4px; }
img { display: block; max-width: 100%; }
figure, p { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }

.site-header {
  height: var(--header);
  padding: 0 var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #22211ff5;
  border-bottom: 1px solid #ffffff22;
}
.mark { display: inline-flex; align-items: center; padding-block: 10px; }
nav { display: flex; align-items: center; gap: clamp(13px, 3vw, 40px); font-size: .83rem; letter-spacing: .06em; }
nav a { padding-block: 10px; }
.text-button { padding: 3px 0; border: 0; text-decoration: underline; text-underline-offset: .3em; }
nav button { text-decoration: none; }

.display {
  font-family: Impact, "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  font-size: clamp(3.25rem, 7.1vw, 8rem);
  letter-spacing: -.035em;
  line-height: .94;
  margin: 0;
}
.not-found .display { font-size: clamp(2rem, 7vw, 4rem); line-height: 1.15; }
.not-found .text-button { display: inline-flex; align-items: center; min-height: 44px; margin-top: 1rem; }
.section-head, .contact-row, footer { display: flex; justify-content: space-between; gap: 16px; }
.timeline { display: flex; overflow: auto; scrollbar-width: thin; }

.section { padding: clamp(66px, 9vw, 150px) var(--edge); }
.light { background: var(--fg); color: var(--bg); color-scheme: light; }
.light a:hover, .light button:hover { color: #74502e; }
.eyebrow { font-size: .85rem; font-weight: 700; letter-spacing: .13em; margin-bottom: clamp(26px, 4vw, 56px); }
main > :is(#profile, #experience, #work, #contact) > .eyebrow,
#expertise .eyebrow {
  color: #c6a576;
  font-size: clamp(1rem, 1.05vw, 1.18rem);
  letter-spacing: .105em;
}
main > .light:is(#profile, #contact) > .eyebrow { color: #654d34; }
.note { color: var(--muted); font-size: .85rem; }
.light .note { color: #6d655d; }
.profile-grid { align-items: center; }
.portrait {
  grid-column: 1 / span 5;
  display: grid;
  place-items: center;
  padding: clamp(22px, 4vw, 60px);
  background: #dfd9cd;
}
.portrait img {
  display: block;
  width: min(100%, clamp(180px, 23vw, 340px));
  height: auto;
}
.profile-copy { grid-column: 7 / -1; }
.profile-desktop-break { display: none; }
#profile .display { font-size: clamp(2.75rem, 5.6vw, 6.25rem); }
.profile-copy h3 { margin: clamp(20px, 2vw, 34px) 0 9px; font-size: clamp(1.7rem, 2.65vw, 3rem); line-height: 1.2; }
.profile-copy p:not(.note) { font-size: clamp(1.075rem, 1.4vw, 1.35rem); line-height: 1.65; }
.profile-copy h3 + p { font-weight: 600; }
.profile-copy p, .case-copy p { max-width: 540px; margin: .6em 0; }
#experience { background: #1b1a18; }
.section-head { align-items: flex-end; margin-bottom: 36px; }
.timeline-controls { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.timeline-controls button { min-width: 42px; min-height: 42px; font-size: 1.18rem; }
.timeline-controls .rail-rotation { font-size: .875rem; padding-inline: 10px; }
.timeline { position: relative; gap: var(--gap); scroll-snap-type: x mandatory; padding-bottom: 12px; }
.timeline.is-looping { scroll-snap-type: none; cursor: grab; }
.timeline.is-dragging { cursor: grabbing; user-select: none; }
.timeline article {
  flex: 0 0 calc((100% - var(--gap)) / 2);
  min-width: 0;
  scroll-snap-align: start;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.timeline .timeline-date { margin-bottom: 10px; font-size: clamp(1rem, 1.35vw, 1.3rem); font-variant-numeric: tabular-nums; }
.timeline-image {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: end;
  box-sizing: border-box;
  min-height: clamp(245px, 22vw, 350px);
  padding: clamp(16px, 2.1vw, 32px);
  background: #242320;
}
.timeline-image img, .timeline-image::before { position: absolute; inset: 0; width: 100%; height: 100%; }
.timeline-image img { z-index: -2; object-fit: cover; filter: saturate(.65); }
.timeline-image::before {
  content: "";
  z-index: -1;
  background: linear-gradient(180deg, transparent 18%, #1817159c 54%, #121211f5 100%);
}
.timeline-caption h3 { margin: 0 0 5px; font-size: clamp(1.2rem, 2vw, 1.9rem); line-height: 1.25; }
.timeline-role { font-size: clamp(.97rem, 1.3vw, 1.2rem); font-weight: 700; }
.timeline-clients { margin-top: 5px; color: #e2d6c6; font-size: clamp(.9rem, 1.1vw, 1.05rem); overflow-wrap: anywhere; }
#experience > .note { margin-top: 10px; }
.timeline-detail-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: 0;
}
.timeline-detail-trigger .timeline-detail-label {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 10px;
  border: 1px solid #c6a576a6;
  background: #1b1713ba;
  color: var(--fg);
  font-size: .88rem;
}
.timeline-detail-trigger:hover, .timeline-detail-trigger:focus-visible { box-shadow: inset 0 0 0 1px #c6a576; }
.timeline-detail-trigger:focus-visible { outline-offset: -4px; }
.card-view {
  display: none;
  position: absolute;
  inset: 0 auto auto 0;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid #c6a576;
  border-radius: 50%;
  background: #211c17c9;
  color: var(--fg);
  font-size: .72rem;
  letter-spacing: .05em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(var(--view-x, 0px), var(--view-y, 0px)) translate(-50%, -50%);
  transition: opacity .14s ease;
}
@media (any-hover: hover) and (any-pointer: fine) {
  .card-view { display: grid; }
  .is-viewing > .card-view { opacity: 1; }
  .timeline-detail-trigger.is-viewing:not(:focus-visible) .timeline-detail-label { opacity: 0; }
}
#experience:has(#experience-detail[open]) .card-view { visibility: hidden; }

html:has(#experience-detail[open]) { overflow: hidden; scrollbar-gutter: stable; }
#experience-detail {
  --detail-limit: min(86vh, 810px);
  --detail-limit: min(86svh, 810px);
  width: min(1160px, calc(100% - 40px));
  max-width: none;
  max-height: var(--detail-limit);
  padding: 0;
  overflow: hidden;
  border: 1px solid #c6a57670;
  color: var(--fg);
  color-scheme: dark;
  background: linear-gradient(135deg, #332a21f5, #201e1beb 67%);
}
#experience-detail::backdrop { background: #1211109e; backdrop-filter: blur(5px); }
.experience-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 23fr) minmax(0, 77fr);
  grid-template-rows: minmax(0, 1fr);
  max-height: var(--detail-limit);
}
.experience-detail-photo { position: relative; background: #26211b; }
.experience-detail-photo img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 69% 54%; }
.experience-detail-content {
  min-height: 0;
  padding: clamp(24px, 3vw, 44px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.experience-detail-close {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-color: #c6a57655;
  background: #241f1abf;
  font-size: 1.65rem;
  line-height: 1;
}
.experience-detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: end;
  justify-content: space-between;
  padding: 0 28px 20px 0;
  border-bottom: 1px solid #c6a57665;
}
.experience-detail-label { color: #d0c2b0; font-size: .79rem; letter-spacing: .13em; }
#experience-company { margin: 5px 0 7px; font-size: clamp(1.65rem, 2.45vw, 2.25rem); line-height: 1.2; }
.experience-detail-role, .experience-detail-period { font-size: clamp(1rem, 1.35vw, 1.25rem); }
.experience-detail-period { color: #dfd0bc; font-variant-numeric: tabular-nums; }
.experience-detail-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(18px, 3vw, 42px); margin-top: 20px; }
#experience-detail h4 { margin: 0 0 10px; color: #d1ad7a; font-size: 1.075rem; }
.experience-detail-copy p, .experience-detail-clients p { color: #e4dccf; font-size: .96rem; line-height: 1.7; }
.experience-detail-copy p + p { margin-top: 12px; }
.experience-detail-copy ul { list-style: none; margin: 0; padding: 0; }
.experience-detail-copy li { padding-left: 14px; border-left: 1px solid #c6a57680; }
.experience-detail-copy li + li { margin-top: 14px; }
.experience-detail-copy h5 { margin: 0 0 3px; font-size: 1rem; }

@media (max-width: 760px) {
  #experience-detail { width: calc(100% - 24px); }
  .experience-detail-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 100px minmax(0, 1fr); }
  .experience-detail-photo img { object-position: center 63%; }
  .experience-detail-content { padding: 20px; }
  .experience-detail-header { padding-right: 0; }
  .experience-detail-copy { grid-template-columns: minmax(0, 1fr); }
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 26px; }
.filters button { font-size: .83rem; }
.filters .active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.works { row-gap: 42px; }
.work { grid-column: span 4; min-width: 0; }
.work-image { display: block; position: relative; }
.work .card-view { z-index: 1; }
.works.is-filtered .work { grid-column: span 8; }
.works:not(.is-filtered) .work:first-child { grid-column: 1 / -1; }
.work img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; transition: filter .25s; }
.work-media-pending {
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  background: #1c1b19;
  border: 1px solid var(--line);
  color: var(--muted);
}
.works:not(.is-filtered) .work:first-child img { aspect-ratio: 2.25; object-position: center 26%; }
.work[data-category="film"] img { object-position: right 50%; }
.work[data-category="livestream"] img { object-position: center 65%; }
.work:hover img { filter: brightness(1.13); }
.work h3 { font-size: clamp(1.18rem, 2.4vw, 1.65rem); margin: 10px 0 0; }
.work p { margin: 0; color: var(--muted); font-size: .84rem; }
#more-works {
  --case-gap: clamp(10px, 1.15vw, 18px);
  margin-top: clamp(22px, 4vw, 42px);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  min-width: 0;
}
#more-works:empty { display: none; }
#more-works .media-heading { margin-bottom: 7px; }
#more-works h2 { margin: 0; font-size: .96rem; letter-spacing: .07em; }
#more-works .media-heading button:not(.rail-rotation) { font-size: 1.2rem; }
#more-works .more-works-rail {
  --rail-width: calc((100% - 2 * var(--case-gap)) / 3);
  overflow-anchor: none;
}
#more-works .more-works-rail figcaption { overflow-wrap: anywhere; }
#more-works .rail-item.is-portrait img { object-fit: contain; }
@media (min-width: 901px) and (orientation: landscape) and (hover: hover) and (pointer: fine) {
  #profile { padding-block: clamp(36px, 7svh, 76px); }
  #profile > .eyebrow { margin-bottom: clamp(20px, 4svh, 38px); }
  .profile-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .57fr);
    grid-template-rows: auto 1fr;
    column-gap: clamp(26px, 4.7vw, 78px);
    row-gap: clamp(18px, 3svh, 32px);
  }
  .profile-copy { display: contents; }
  #profile .display {
    grid-column: 1;
    grid-row: 1;
    font-size: clamp(3rem, min(6.15vw, 10.5svh), 7rem);
    letter-spacing: -.025em;
  }
  .profile-mobile-break { display: none; }
  .profile-desktop-break { display: initial; }
  .profile-process { font-style: italic; }
  .profile-grid .portrait {
    grid-column: 2;
    grid-row: 1 / 3;
    width: min(100%, clamp(260px, 43svh, 440px));
    justify-self: end;
    padding: 0;
    background: none;
  }
  .profile-grid .portrait img { width: 100%; }
  .profile-bio { grid-column: 1; grid-row: 2; align-self: start; }
  .profile-bio h3 { margin-top: 0; }
  .profile-bio p { max-width: 750px; text-wrap: pretty; }
  #work {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 14px;
    padding-block: clamp(14px, calc((100svh - 800px) / 6), 42px);
  }
  #work > :is(.eyebrow, .works, #more-works) { grid-column: 1 / -1; }
  #work > .eyebrow { margin-bottom: 8px; }
  #work .display {
    margin-bottom: 10px;
    font-size: clamp(2.35rem, min(4.3vw, 5.2svh), 5rem);
  }
  #work .filters { align-self: end; justify-content: flex-end; margin: 0 0 10px; }
  #work .filters button { padding: 5px 11px; }
  #work .works:not(.is-filtered) {
    grid-template-columns: minmax(0, 61fr) minmax(0, 39fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 1.15svh, 13px);
    height: clamp(340px, 48svh, 515px);
  }
  #work .works:not(.is-filtered) .work {
    position: relative;
    isolation: isolate;
    grid-column: 2;
    min-height: 0;
  }
  #work .works:not(.is-filtered) .work:first-child { grid-column: 1; grid-row: 1 / -1; }
  #work .works:not(.is-filtered) .work-image { height: 100%; }
  #work .works:not(.is-filtered) .work img {
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
  }
  #work .works:not(.is-filtered) [data-category="event"] img { object-position: center 26%; }
  #work .works:not(.is-filtered) [data-category="film"] img { object-position: center 14%; }
  #work .works:not(.is-filtered) [data-category="stills"] img { object-position: center 24%; }
  #work .works:not(.is-filtered) [data-category="livestream"] img { object-position: center 65%; }
  #work .work-caption {
    position: absolute;
    inset: auto 0 0;
    padding: clamp(22px, 4svh, 43px) clamp(14px, 2vw, 30px) 12px;
    pointer-events: none;
    background: linear-gradient(28deg, #161513e8, #16151300 77%);
  }
  #work .works.is-filtered .work { position: relative; isolation: isolate; }
  #work .works:not(.is-filtered) .work:first-child h3 {
    font-size: clamp(1.35rem, 2.3vw, 2.2rem);
  }
  #work .work h3 { margin-top: 5px; font-size: clamp(1.04rem, 1.55vw, 1.45rem); line-height: 1.3; }
  #work .work p { line-height: 1.4; }
  #more-works { margin-top: 12px; }
  #more-works .rail-item img { height: clamp(86px, 12svh, 130px); }
  @media (max-height: 800px) {
    #work { padding-block: 8px 6px; }
    #work :is(.display, .filters) { margin-bottom: 8px; }
    #more-works { margin-top: 9px; }
  }
}
@media (min-width: 901px) and (orientation: landscape) {
  @media (hover: none), (pointer: coarse), (pointer: none) {
    #work {
      padding-block: clamp(14px, calc((100svh - 800px) / 6), 42px);
    }
    #work > .eyebrow { margin-bottom: 8px; }
    #work .display { font-size: clamp(2.5rem, min(4.3vw, 6.1svh), 5rem); }
    #work .filters { margin: 8px 0 9px; }
    #work .filters button { padding: 5px 11px; }
    #work .works { row-gap: clamp(10px, 1.5svh, 17px); }
    #work .works:not(.is-filtered) .work img {
      height: clamp(110px, 16svh, 180px);
      display: block;
      aspect-ratio: auto;
    }
    #work .works:not(.is-filtered) .work:first-child img {
      height: clamp(150px, 23svh, 280px);
      object-position: center 26%;
    }
    #work .works:not(.is-filtered) .work:not(:first-child) img {
      object-fit: contain;
      object-position: right;
      background: #24221f;
    }
    #work .works:not(.is-filtered) .work { position: relative; isolation: isolate; }
    #work .works:not(.is-filtered) .work-caption {
      position: absolute;
      inset: auto 0 0;
      display: grid;
      align-content: end;
      min-height: 70%;
      padding: 12px clamp(14px, 2vw, 30px);
      pointer-events: none;
      background: linear-gradient(25deg, #161513e6, #16151300 72%);
    }
    #work .works:not(.is-filtered) .work:first-child .work-caption {
      inset: 0;
      align-content: center;
      background: linear-gradient(90deg, #161513d9, #16151300 52%);
    }
    #work .work h3 { margin-top: 5px; font-size: clamp(1.04rem, 1.55vw, 1.45rem); line-height: 1.3; }
    #work .work p { line-height: 1.4; }
    #more-works { margin-top: 15px; }
  }
  #contact {
    min-block-size: calc(100vh - var(--header));
    min-block-size: calc(100svh - var(--header));
    display: grid;
    align-content: center;
  }
}
@media (min-width: 901px) {
  #more-works .more-works-rail { --rail-width: calc((100% - 4 * var(--case-gap)) / 5); }
}
@media (min-width: 1500px) {
  #more-works .more-works-rail { --rail-width: calc((100% - 5 * var(--case-gap)) / 6); }
}
@media (max-width: 700px) {
  #more-works .more-works-rail { --rail-width: 84%; }
}
.contact-row { margin-top: 44px; }
.contact-links, .cv-links { display: flex; flex-wrap: wrap; column-gap: 20px; }
.cv-links a { display: inline-flex; align-items: center; gap: .35em; }
footer { padding: 26px var(--edge); font-size: .81rem; color: var(--muted); }
dialog { color: var(--bg); background: var(--fg); border: 0; padding: 25px 30px; max-width: calc(100% - 40px); color-scheme: light; }
dialog form { margin-top: 18px; }
dialog::backdrop { background: #000a; }

.case { padding-top: clamp(40px, 7vw, 100px); }
.case h1 { font-size: clamp(2rem, 6vw, 5.5rem); margin: 0; line-height: 1.12; }
.case-figure { margin-top: 26px; }
.case-media { width: 100%; height: auto; max-height: 68vh; object-fit: cover; }
.case-figure figcaption { margin-top: 8px; }
.case-copy h2 { font-size: clamp(1.15rem, 2vw, 1.55rem); margin: 46px 0 6px; }
.video-frame { padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
video { width: min(100%, 920px); background: #161513; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  :root { --cols: 4; --header: 60px; }
  nav { gap: 12px; font-size: .75rem; }
  .mark img { width: 37px; }
  .display { font-size: clamp(2.2rem, 10.5vw, 5rem); }
  .profile-copy, .portrait, .work, .works.is-filtered .work { grid-column: 1 / -1; }
  .profile-copy { margin-top: 12px; }
  #profile .display { font-size: clamp(2.1rem, 9.6vw, 4.75rem); }
  .section-head { display: block; }
  .timeline-controls { margin-top: 18px; }
  .timeline article { flex-basis: 87%; }

  .contact-row, footer { flex-wrap: wrap; }
}

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