@font-face {
  font-family: "Vujahday Script";
  src: url("assets/vujahday-script-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Alumni Sans SC";
  src: url("assets/alumni-sans-sc-light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Alumni Sans SC";
  src: url("assets/alumni-sans-sc-black-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --screen: 100svh;
  --gutter: clamp(1.125rem, 4.65vw, 6rem);
  --episode-duration: 640ms;
  --episode-easing: cubic-bezier(.22, .72, .22, 1);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #f2f1ef;
  background: #121212;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

:root::-webkit-scrollbar { display: none; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
body:has(dialog[open]) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }

.site-header {
  position: fixed;
  z-index: 3;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  padding: max(1rem, env(safe-area-inset-top)) 0 2.75rem;
  font-family: "Vujahday Script", cursive;
  font-size: clamp(1.75rem, 2.6vw, 4.75rem);
  line-height: 1.1;
  background: linear-gradient(180deg, #090909d9, #09090970 48%, transparent);
  pointer-events: none;
}

.site-header a, .site-header button { pointer-events: auto; }
.brand {
  grid-column: 1;
  justify-self: start;
  margin-inline-start: clamp(1rem, 1.3vw, 3rem);
  color: #d9d9d9;
  font-size: clamp(1.1rem, 2.55vw, 4.75rem);
  white-space: nowrap;
}

.site-header nav {
  grid-column: 2 / 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
}

.site-header nav > :is(a, button) {
  position: relative;
  padding: .25em .2em;
  color: #e9e9e9;
  background: none;
  border: 0;
  white-space: nowrap;
}

.site-header nav > :is(a, button)::after {
  content: "";
  position: absolute;
  width: 104%;
  height: .21em;
  inset: auto auto .04em -2%;
  background: center / 100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 9' preserveAspectRatio='none'%3E%3Cpath fill='%23e9e9e9' d='M2 7.6C37 4.3 84 2.1 126 2.2Q174 1.7 198 2.5L177 3.2C102 3.6 46 5.4 3 8.3Z'/%3E%3C/svg%3E");
  pointer-events: none;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 70ms ease-in;
}
.site-header nav > :is(a, button):is(:hover, :focus-visible)::after {
  clip-path: inset(0);
  transition: clip-path 85ms ease-out;
}

#work { overflow-x: clip; touch-action: pan-x pinch-zoom; }
.video-row { position: relative; }
.video-row[data-frame-group], .frame-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.frame {
  position: relative;
  z-index: 0;
  height: var(--screen);
  margin: 0;
  container-type: size;
  background: #212121;
  transform: translateX(var(--episode-shift, 0px));
  transition: z-index 0s linear 140ms, transform var(--episode-duration) var(--episode-easing);
}

.frame-picture {
  position: absolute;
  inset: 0;
  overflow: hidden;
  filter: grayscale(1) brightness(.82);
  transition: filter 220ms ease;
}

.frame.is-active .frame-picture { filter: grayscale(0) brightness(1); }
.frame.episode-source .frame-picture { visibility: hidden; }
.frame:focus-visible { outline: 2px solid white; outline-offset: -5px; }

.frame-media, .episode-player {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.frame-media { object-fit: cover; pointer-events: none; }
.frame-preview { visibility: hidden; }
.frame.is-playing .frame-preview { visibility: visible; }

.frame .frame-picture::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 32%;
  background: linear-gradient(transparent, rgb(0 0 0 / 45%));
}

.frame-caption {
  position: absolute;
  inset: auto 0 max(6svh, calc(env(safe-area-inset-bottom) + 1.25rem));
  display: grid;
  justify-items: center;
  gap: clamp(.4rem, 1.8cqw, .7rem);
  padding-inline: clamp(.75rem, 4cqw, 2rem);
  color: #c7c7c7;
  font-family: "Alumni Sans SC", "Arial Narrow", sans-serif;
  text-align: center;
  text-shadow: 0 1px 5px rgb(0 0 0 / 65%);
  pointer-events: none;
}

.frame-caption-genre {
  margin: 0;
  font-size: clamp(1.375rem, 7.5cqw, 2.85rem);
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  text-wrap: balance;
}

.frame-caption-synopsis {
  max-inline-size: 40ch;
  margin: 0;
  font-size: clamp(1rem, 4.1cqw, 1.65rem);
  font-weight: 300;
  line-height: 1.12;
  text-wrap: balance;
}

.episode-prompt {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: max-content;
  max-width: calc(100% - 1.5rem);
  padding: .65rem .85rem;
  border: 0;
  background: rgb(0 0 0 / 65%);
  color: #f2efeb;
  text-align: left;
  font-family: "Alumni Sans SC", "Arial Narrow", sans-serif;
  font-weight: 300;
  font-size: clamp(.875rem, 1.15vw, 1.0625rem);
  line-height: 1.1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease-out, visibility 0s linear 140ms;
}

.episode-prompt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(242 239 235 / 28%);
  opacity: 0;
  pointer-events: none;
}

.episode-prompt span { display: block; position: relative; }
.frame.has-episode-prompt { z-index: 1; transition-delay: 0s; }
.frame.has-episode-prompt .episode-prompt {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 60ms ease-out, visibility 0s;
}

.frame.has-episode-prompt .episode-prompt::before { animation: episode-glint 720ms; }
.frame.has-episode-prompt .episode-prompt.cursor-attached { pointer-events: none; }

@keyframes episode-glint {
  0% { opacity: 0; animation-timing-function: ease-out; }
  8% { opacity: 1; animation-timing-function: ease-out; }
  100% { opacity: 0; }
}

.transition {
  --visibility: 0;
  --band: clamp(13rem, 34svh, 24rem);
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  align-items: center;
  min-height: var(--band);
  padding: 2.25rem var(--gutter);
  background: linear-gradient(to bottom, transparent, #080808e8 41%, #080808e8 59%, transparent);
  opacity: var(--visibility);
  transform: translateY(-50%);
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.transition-copy p, .overlay-panel p, .contact-links {
  color: #c7c7c7;
  font-family: "Alumni Sans SC", "Arial Narrow", sans-serif;
  font-weight: 300;
}

.transition-copy p {
  max-inline-size: 112rem;
  margin: 0 auto;
  font-size: clamp(1.5rem, 1.6vw, 3.125rem);
  line-height: 1.22;
  text-align: center;
  text-wrap: balance;
}

.transition-copy p::first-letter {
  font-size: 1.92em;
  font-style: italic;
  font-weight: 900;
  line-height: .75;
}

.overlay-panel, .overlay-panel::backdrop {
  opacity: 0;
  transition: opacity 180ms ease-out;
  transition: opacity 180ms ease-out, display 180ms allow-discrete, overlay 180ms allow-discrete;
}

.overlay-panel[open], .overlay-panel[open]::backdrop { opacity: 1; }

@starting-style {
  .overlay-panel[open], .overlay-panel[open]::backdrop { opacity: 0; }
}

.overlay-panel {
  width: min(42rem, 50vw);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.75rem, 4.5vw, 4rem);
  color: inherit;
  border: 0;
  background: rgb(0 0 0 / 82%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.overlay-panel::backdrop { background: rgb(0 0 0 / 14%); }
.overlay-panel h2 {
  margin: 0;
  color: #e9e9e9;
  font: 400 clamp(2.25rem, 3.3vw, 3.5rem) / 1.1 "Vujahday Script", cursive;
}

.overlay-panel p, .contact-links {
  line-height: 1.28;
}

.overlay-panel p { margin: 1rem 0 0; font-size: clamp(1.375rem, 1.65vw, 1.75rem); }
.overlay-panel p:has(+ .contact-links) { margin-bottom: 1.4rem; }

.about-panel {
  width: min(46.5rem, calc(100% - 2rem));
  padding: clamp(1.375rem, 5.7vw, 3.125rem);
  padding-block-end: clamp(1.75rem, 9.5vw, 5rem);
}

.about-panel h2 {
  margin-inline-start: .1em;
  font-size: clamp(2.5rem, 6.5vw, 3.5rem);
}

.about-layout {
  --portrait-size: 8.25rem;
  display: grid;
  grid-template-columns: min(25%, var(--portrait-size)) minmax(0, 1fr);
  gap: clamp(.75rem, 3.3vw, 1.75rem);
  align-items: start;
  margin-block-start: clamp(1rem, 3.25vw, 1.75rem);
}

.about-layout p {
  margin: -.42em 0 0;
  font-size: clamp(1.125rem, 3vw, 1.625rem);
  line-height: 1.43;
}

.about-cv { margin-block-start: 1.5rem; }
.about-cv-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.about-cv-actions :is(a, button) {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .25rem .7rem;
  border: 1px solid #6a6a6a;
  background: #141414;
  color: #e9e9e9;
  font: 300 1.2rem/1.2 "Alumni Sans SC", "Arial Narrow", sans-serif;
}
.about-cv-actions :is(a, button):hover { background: #303030; }
.about-cv-fallback:not([hidden]) { display: grid; gap: .35rem; margin-block-start: .75rem; font-size: .9rem; }
.about-cv-fallback input { min-width: 0; width: 100%; padding: .45rem; font: inherit; }

@supports (text-box: trim-both cap alphabetic) {
  .about-layout p { margin: 0; text-box: trim-both cap alphabetic; }
}

@media (min-width: 660px) {
  /* The four lines span the portrait: one capital-letter height and three line advances. */
  .about-layout p {
    font-size: clamp(1.125rem, 3.25vw, 1.625rem);
    line-height: calc((var(--portrait-size) - 1cap) / 3);
  }
}

.about-portrait {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 10%);
}

.contact-links {
  display: grid;
  gap: .4rem;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: clamp(1.25rem, 1.4vw, 1.5rem);
}
.contact-entry { display: inline-flex; align-items: center; gap: .65rem; max-inline-size: 100%; }
.contact-icon { flex: none; width: 1.15rem; height: 1.15rem; fill: currentColor; }
.contact-links a { overflow-wrap: anywhere; }
.contact-links a:hover { color: #e9e9e9; }

.overlay-close {
  position: absolute;
  inset: .5rem .5rem auto auto;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
}

.overlay-close:hover { background: rgb(255 255 255 / 10%); }

.episode-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  color: inherit;
  background: transparent;
  transition: background-color var(--episode-duration) var(--episode-easing);
}

.episode-viewer::backdrop { background: transparent; }
.episode-viewer.is-expanded { background: #000; }

.episode-screen {
  position: absolute;
  overflow: hidden;
  container-type: size;
  background: #121212;
  transition: left var(--episode-duration) var(--episode-easing),
    top var(--episode-duration) var(--episode-easing),
    width var(--episode-duration) var(--episode-easing),
    height var(--episode-duration) var(--episode-easing);
}

.episode-screen .frame-picture { filter: none; transition: none; }

.episode-player {
  object-fit: contain;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.episode-player.is-ready { opacity: 1; pointer-events: auto; }

.video-controls {
  position: absolute;
  inset: 0;
  color: #fff;
  pointer-events: none;
}

.video-play-toggle {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.video-controls .video-play-toggle:focus-visible { outline-offset: -4px; }

.video-transport {
  position: absolute;
  inset: auto 0 0;
  height: 6.5rem;
  background: linear-gradient(to top, #080808cb, transparent);
}

.video-mute {
  position: absolute;
  right: 0;
  bottom: 2rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.video-mute svg { width: 1.2rem; height: 1.2rem; filter: drop-shadow(0 1px 2px #0009); }
.video-mute .video-sound-off,
.video-mute[aria-pressed="true"] .video-sound-waves { visibility: hidden; }
.video-mute[aria-pressed="true"] .video-sound-off { visibility: visible; }
.video-controls .video-mute:focus-visible { outline-offset: -3px; }

.video-timestamps {
  position: absolute;
  inset: auto .65rem .5rem;
  display: flex;
  justify-content: space-between;
  font: 300 clamp(1.125rem, 5.6cqw, 1.5rem)/1 "Alumni Sans SC", "Arial Narrow", sans-serif;
  font-variant-numeric: tabular-nums;
}

.video-scrubber {
  --video-progress: 0%;
  position: absolute;
  inset: auto 0 0;
  height: 1.5rem;
  background: linear-gradient(90deg, #ffffffab var(--video-progress), #ffffff42 var(--video-progress)) bottom / 100% 2px no-repeat;
}

.video-scrubber::after {
  content: "";
  position: absolute;
  left: clamp(0px, calc(var(--video-progress) - 2px), calc(100% - 4px));
  bottom: 0;
  width: 4px;
  height: 2px;
  background: #fff;
}

.video-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
}

.video-scrubber:has(.video-progress:focus-visible)::after { height: 6px; }

.episode-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  isolation: isolate;
  width: min(56%, 11rem);
  transform: translate(-50%, -50%);
  color: #c7c7c7;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 170ms ease, visibility 0s linear 170ms;
}

.episode-loading.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.episode-loading::before {
  content: "";
  position: absolute;
  inset: -2rem -2.5rem;
  z-index: -1;
  background: radial-gradient(ellipse, rgb(0 0 0 / 72%), transparent 74%);
}

.episode-loading-track { height: 2px; background: rgb(199 199 199 / 35%); }

.episode-loading-track span {
  display: block;
  height: 100%;
  background: currentColor;
  transform: scaleX(var(--buffer-progress, 0));
  transform-origin: left;
  transition: transform 160ms ease-out;
}

.episode-loading p {
  margin: .55rem 0 0;
  font: 300 1rem/1.1 "Alumni Sans SC", "Arial Narrow", sans-serif;
  letter-spacing: .08em;
}

.episode-error {
  position: absolute;
  inset: 50% 1rem auto;
  transform: translateY(-50%);
  margin: 0;
  padding: .65rem .8rem;
  color: #fff;
  background: rgb(0 0 0 / 80%);
}

.episode-close {
  inset: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) auto auto;
  background: rgb(0 0 0 / 45%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.episode-close:hover { background: rgb(0 0 0 / 70%); }
.episode-viewer.is-expanded .episode-close { opacity: 1; }

.portfolio-consent {
  margin-top: 1rem;
  color: #c7c7c7;
  font: 400 .8rem/1.4 Inter, "Segoe UI", sans-serif;
}
.portfolio-consent summary { width: fit-content; cursor: pointer; }
.portfolio-consent-panel {
  width: min(20rem, 100%);
  padding: .85rem;
  margin-top: .35rem;
  border: 1px solid #5a5a5a;
  background: #151515;
}
.portfolio-consent-panel p { margin: 0 0 .65rem; font: inherit; }
.portfolio-consent button {
  padding: .42rem .55rem;
  color: inherit;
  border: 1px solid #777;
  background: #141414;
}
.portfolio-consent-panel button + button { margin-inline-start: .35rem; }
.portfolio-consent button:hover { background: #333; }

@media (max-width: 700px) {
  .video-row[data-frame-group], .frame-group { grid-template-columns: minmax(0, 1fr); }
  .site-header {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: .15rem;
    padding-inline: var(--gutter);
    font-size: clamp(1.15rem, 4.8vw, 2rem);
  }
  .brand { justify-self: center; margin-inline-start: 0; font-size: clamp(1.55rem, 5.8vw, 2.3rem); }
  .site-header nav { grid-column: 1; width: min(100%, 27rem); }
  .transition { --band: clamp(18rem, 44svh, 25rem); }
  .overlay-panel { width: calc(100% - 2rem); }
}

@media (max-width: 560px) {
  .about-layout { grid-template-columns: min(27%, 6rem) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .site-header nav > :is(a, button)::after,
  .site-header nav > :is(a, button):is(:hover, :focus-visible)::after { transition: none; }
  .frame, .frame-picture, .episode-prompt, .episode-viewer, .episode-screen, .episode-player, .episode-close { transition: none; }
  .episode-loading, .episode-loading.is-visible, .episode-loading-track span { transition: none; }
  .frame.has-episode-prompt .episode-prompt { transition: none; }
  .frame.has-episode-prompt .episode-prompt::before { animation: none; }
  .overlay-panel, .overlay-panel::backdrop { transition: none; }
}
