:root {
  color-scheme: dark;
  --background: #101210;
  --text: #f4f3ea;
  --muted: #b7baa9;
  --line: #393c32;
  --accent: #ddff51;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; }

.wrap {
  width: min(100% - 2 * clamp(1.25rem, 4vw, 4.5rem), 84rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 1;
  top: max(0.75rem, env(safe-area-inset-top));
  left: max(0.75rem, env(safe-area-inset-left));
  padding: 0.75rem;
  color: var(--background);
  background: var(--accent);
  transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.top {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.top nav { display: flex; gap: clamp(1.25rem, 4vw, 3rem); }

.monogram {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--background);
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  text-decoration: none;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.top-link span, h1 span { color: var(--accent); }
.top-link:hover { text-decoration: underline; text-underline-offset: 0.24em; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 3rem);
  padding: clamp(1.5rem, 3vw, 2.5rem) 0;
  border-bottom: 1px solid var(--line);
}

h1 {
  font-size: clamp(2.5rem, 8.5vw, 8.25rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.075em;
}

.portrait {
  display: block;
  width: clamp(5.25rem, 13vw, 10rem);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 0.1875rem;
  background: #1c1f19;
}

.links { padding: clamp(1.625rem, 3.5vw, 3.125rem) 0 4rem; scroll-margin-top: 1rem; }

h2 {
  font-size: clamp(1.8rem, 4vw, 3.375rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.works {
  --gallery-gap: clamp(0.75rem, 2vw, 1.5rem);
  --row-width: calc(100% - 2 * var(--gallery-gap));
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.25rem, 2.5vw, 2.5rem) var(--gallery-gap);
  list-style: none;
  padding: 0;
  margin: clamp(1rem, 2vw, 1.75rem) 0 0;
}

.works li {
  flex: 0 0 calc(var(--row-width) * var(--poster-share, 0.23));
  min-width: 0;
}

/* Match the poster heights within each desktop row without cropping the frames. */
.works li:is(:nth-child(1), :nth-child(3)) { --poster-share: 0.4315; --poster-ratio: 16 / 9; }
.works li:nth-child(2) { --poster-share: 0.137; }
.works li:nth-child(4) { --poster-share: 0.54; --poster-ratio: 4 / 3; }
.works li:is(:nth-child(7), :nth-child(8)) {
  --poster-ratio: 16 / 9;
  flex-basis: calc((100% - var(--gallery-gap)) / 2);
}

.poster {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: var(--poster-ratio, 9 / 16);
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #1c1f19;
}

.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.play-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(2.75rem, 4vw, 3.5rem);
  aspect-ratio: 1;
  border: 1px solid #ffffff94;
  border-radius: 50%;
  background: #101210da;
  color: var(--text);
}

.play-icon::before {
  content: "";
  margin-left: 0.15rem;
  border-top: 0.42rem solid transparent;
  border-bottom: 0.42rem solid transparent;
  border-left: 0.7rem solid currentColor;
}

.poster:hover .play-icon, .poster:focus-visible .play-icon { background: var(--accent); color: var(--background); }

.work-caption { padding: 0.75rem 0 1rem; border-bottom: 1px solid var(--line); }
.works h3 { font-size: clamp(1rem, 1.8vw, 1.45rem); line-height: 1.18; letter-spacing: -0.035em; }
.work-caption a { text-decoration-color: var(--line); text-underline-offset: 0.2em; }
.work-caption a:is(:hover, :focus-visible) { text-decoration-color: var(--accent); }

.about {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 5vw, 5rem);
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--line);
}

.about p { max-width: 35rem; color: var(--muted); line-height: 1.6; }
.about p + p { margin-top: 0.75rem; }
.about a { color: var(--text); text-underline-offset: 0.24em; }

.video-heading button {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 99rem;
  background: transparent;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.video-heading button:hover { background: var(--accent); color: var(--background); }

.contact a, .video-file:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
  text-underline-offset: 0.24em;
}

.contact a span, .video-file span { color: var(--accent); }
.contact a:hover, .video-file:hover { color: var(--text); }

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.75rem, 5vw, 5rem);
  padding: 2.5rem 0 4.5rem;
  border-top: 1px solid var(--line);
}

.contact-details { display: grid; gap: 1rem; }
.contact address { display: grid; justify-items: start; font-style: normal; }
.contact-form { min-width: 0; }
.contact-note { color: var(--muted); line-height: 1.5; }
.contact-form .contact-note { margin-bottom: 1rem; }

.contact-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
}

.contact-field { display: grid; gap: 0.5rem; min-width: 0; font-size: 0.9375rem; font-weight: 600; }
.contact-message { grid-column: 1 / -1; }

.contact-field input, .contact-field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: #1c1f19;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.contact-field textarea { resize: vertical; }
.contact-field :is(input, textarea):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.contact-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 0.25rem;
  background: var(--accent);
  color: var(--background);
  font-weight: 700;
  cursor: pointer;
}

.contact-submit:focus-visible { outline-offset: 3px; }
.contact-submit:hover { background: var(--text); border-color: var(--text); }
.contact-submit[aria-disabled="true"] { opacity: 0.68; cursor: wait; }
.contact-status { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.contact-status:not(:empty) { margin-top: 0.75rem; }
.contact-status[data-state="success"] { color: var(--accent); }
.contact-status[data-state="error"] { color: #ffc0b4; }

html:has(.video-modal[open]) { overflow: hidden; }

.video-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #090a09;
  color: var(--text);
}

.video-modal::backdrop { background: #090a09; }

.video-shell {
  position: relative;
  width: 100%;
  height: 100%;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  background: #000;
}

.video-heading {
  position: absolute;
  z-index: 1;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    1.5rem max(1rem, env(safe-area-inset-left));
  background: linear-gradient(#000c, transparent);
  pointer-events: none;
}

.video-heading .video-close { flex: none; pointer-events: auto; background: #101210e6; }
.video-heading .video-close:hover { background: var(--accent); }
.video-heading h2 { font-size: clamp(1.25rem, 3vw, 2rem); line-height: 1.1; }
.video-shell video { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; background: #000; }
.video-shell video::-webkit-media-controls-fullscreen-button { display: none; }

.video-feedback {
  position: absolute;
  inset: auto max(1rem, env(safe-area-inset-right)) calc(3.5rem + env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  width: fit-content;
  margin-inline: auto;
  color: var(--text);
  background: #101210ee;
  line-height: 1.4;
}

.video-status:not(:empty) { padding: 0.75rem; }
.video-feedback .video-file:not([hidden]) { margin-inline: 0.75rem; }

@media (max-width: 760px), (orientation: landscape) and (max-width: 960px) and (max-height: 500px) {
  body { padding-top: env(safe-area-inset-top); }

  .wrap {
    width: auto;
    margin-left: max(1rem, env(safe-area-inset-left));
    margin-right: max(1rem, env(safe-area-inset-right));
  }

  .top { min-height: 4rem; }
  .top nav { gap: 0.375rem; }
  .top-link { min-height: 3rem; padding-inline: 0.625rem; }
  .top-link:last-child { padding-inline-end: 0.25rem; }
  .intro { gap: 0.875rem; padding: 1.125rem 0; }
  h1 { font-size: clamp(2.375rem, 10.5vw, 4.5rem); line-height: 0.94; letter-spacing: -0.06em; }
  .portrait { width: clamp(4.5rem, 23vw, 6.25rem); }
  .links { padding-bottom: 2.5rem; }
  .works li { flex-basis: calc((100% - var(--gallery-gap)) / 2); }
  .poster { aspect-ratio: 4 / 5; }
  .play-icon { width: 3.125rem; }
  .about { grid-template-columns: 1fr; gap: 1rem; padding-block: 1.75rem; }

  .contact {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.75rem 0 max(2.5rem, calc(1.25rem + env(safe-area-inset-bottom)));
  }

  .contact address { justify-items: stretch; gap: 0.5rem; }
  .contact a { min-height: 3rem; padding: 0.5rem 0.875rem; border: 1px solid var(--line); border-radius: 0.25rem; }
  .video-heading { gap: 0.625rem; }
  .video-heading h2 { font-size: clamp(1.05rem, 4.5vw, 1.375rem); }
  .video-heading .video-close { min-width: 4.25rem; min-height: 3rem; }
}

@media (max-width: 520px) {
  .works { display: grid; gap: 1.5rem; }
  .poster { aspect-ratio: var(--poster-ratio, 9 / 16); max-height: 30rem; max-height: min(68svh, 30rem); }
  .works h3 { font-size: 1.125rem; }
  .contact-fields { grid-template-columns: 1fr; }
  .contact-submit { width: 100%; justify-content: space-between; }
}

@media (orientation: landscape) and (max-width: 960px) and (max-height: 500px) {
  .top { min-height: 3.5rem; }
  .intro { padding-block: 0.875rem; }
  .portrait { width: 5rem; }
  .poster { max-height: 72svh; }
  .video-heading { padding-bottom: 0.75rem; }
}
