/* ==========================================================================
   Marcelo Seguí Gill — Portfolio
   Design tokens
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f2f2f2;
  --fg: #0a0a0a;
  --fg-muted: #6b6b6b;
  --fg-faint: #a8a8a8;
  --accent: #c41e1e;
  --line: #e6e6e6;

  /* the lightbox and video player stay on a dark surface regardless of
     the page theme, so their text uses fixed light colours rather than
     the page tokens above */
  --lightbox-bg: rgba(0, 0, 0, 0.97);
  --lightbox-fg: #ffffff;
  --lightbox-fg-muted: #b3b3b3;

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --nav-h: 84px;
  --gutter: clamp(20px, 4vw, 56px);
  --max-w: 1440px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: var(--accent);
  color: #fff;
}

::-moz-selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* the lightbox receives focus when it opens so that Escape, the arrows and
   the space bar reach it — but it is a container, not a control, so it
   shouldn't show a focus ring */
.lightbox:focus,
.lightbox:focus-visible {
  outline: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  z-index: 100;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.94) 60%, rgba(255, 255, 255, 0));
}

.site-nav__name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.site-nav__name {
  /* keeps the wordmark on one line while the scramble runs */
  display: inline-block;
  white-space: nowrap;
}

.site-nav__links {
  display: flex;
  gap: clamp(20px, 3vw, 44px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  font-size: 14px;
  color: var(--fg-muted);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.25s var(--ease);
}

.site-nav__links a:hover,
.site-nav__links a.is-active {
  color: var(--fg);
}

/* the rule wipes in from the left on hover and simply sits there when
   the link is the current page */
.site-nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.site-nav__links a:hover::after,
.site-nav__links a:focus-visible::after,
.site-nav__links a.is-active::after {
  transform: scaleX(1);
}

.site-nav__links a.is-active:hover::after {
  transform-origin: right;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--fg);
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 210;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--fg);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-toggle span {
  top: 50%;
}

.nav-toggle span::before {
  top: -8px;
}

.nav-toggle span::after {
  top: 8px;
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .site-nav__name {
  /* keeps the wordmark on one line while the scramble runs */
  display: inline-block;
  white-space: nowrap;
}

.site-nav__links {
    position: fixed;
    inset: 0;
    height: 100vh;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: var(--gutter);
    gap: 22px;
    transform: translateY(-100%);
    transition: transform 0.45s var(--ease);
    z-index: 200;
  }

  .site-nav__links.is-open {
    transform: translateY(0);
  }

  .site-nav__links a {
    font-family: var(--font-display);
    font-size: 34px;
    color: var(--fg);
  }
}

/* ==========================================================================
   Section headings
   ========================================================================== */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(24px, 3vw, 34px);
  margin: 0;
}

.section-head p {
  color: var(--fg-muted);
  font-size: 14px;
  margin: 0;
  max-width: 38ch;
  text-align: right;
}

@media (max-width: 640px) {
  .section-head {
    flex-direction: column;
    text-align: left;
  }
  .section-head p {
    text-align: left;
  }
}

/* ==========================================================================
   Work grid
   ========================================================================== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 100px;
  gap: 2px;
}

.work-grid.work-grid--single {
  grid-template-columns: 1fr;
}

@media (max-width: 720px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

.work-item {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.work-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.7s var(--ease);
}

.work-item:hover img {
  transform: scale(1.05);
}

.work-item__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 26px;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.86), rgba(10, 10, 10, 0));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.work-item:hover .work-item__caption,
.work-item:focus-visible .work-item__caption {
  opacity: 1;
  transform: translateY(0);
}

.work-item__caption h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: #ffffff;
  margin: 0 0 4px;
}

.work-item__caption p {
  margin: 0;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  color: var(--accent);
}

/* ==========================================================================
   Page intro (motion / still / contact headers)
   ========================================================================== */

.page-intro {
  padding: calc(var(--nav-h) + 28px) var(--gutter) 20px;
  max-width: var(--max-w);
  margin: 0 auto 24px;
  border-bottom: 1px solid var(--line);
}

/* small letterspaced index line, with a hairline leading into it */
.page-intro__index {
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 0.35s forwards;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: clamp(16px, 2.6vw, 30px);
}

.page-intro__index::before {
  content: "";
  width: clamp(28px, 5vw, 64px);
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: rule-draw 0.9s var(--ease) 0.15s forwards;
}

/* title left, description tucked into the baseline on the right */
.page-intro__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(24px, 6vw, 80px);
}

.page-intro h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(48px, 8.6vw, 116px);
  line-height: 0.84;
  letter-spacing: -0.035em;
  margin: 0;
}

/* without this, browsers fall back to their own sup default (font-size:
   smaller), which on a 148px heading is roughly 120px — hence the giant
   numbers. This keeps the count as a quiet marginal note. */
.page-intro h1 sup {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  vertical-align: top;
  position: relative;
  top: 0.35em;
  margin-left: 0.7em;
}

/* the word sits inside a mask and rises into view on load */
.page-intro__mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* line-height 1 here so the mask is tall enough for the caps; the h1's
     tighter leading would otherwise clip the tops of the letters */
  line-height: 1;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.page-intro__word {
  display: inline-block;
  transform: translateY(110%);
  animation: word-rise 1.1s var(--ease) 0.1s forwards;
}

.page-intro__dot {
  color: var(--accent);
  opacity: 0;
  animation: dot-in 0.5s var(--ease) 0.8s forwards;
}

@keyframes word-rise {
  to {
    transform: translateY(0);
  }
}

@keyframes rule-draw {
  to {
    transform: scaleX(1);
  }
}

@keyframes dot-in {
  from {
    opacity: 0;
    transform: translateY(-0.1em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-intro p {
  opacity: 0;
  animation: fade-up 0.8s var(--ease) 0.55s forwards;
  color: var(--fg-muted);
  max-width: 30ch;
  font-size: 15px;
  line-height: 1.5;
  text-align: right;
  margin: 0 0 0.5em;
  flex: 0 1 auto;
}

@media (max-width: 760px) {
  .page-intro__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .page-intro p {
    text-align: left;
    max-width: 46ch;
  }
}

/* ==========================================================================
   Still — masonry-ish grid (3 col)
   ========================================================================== */

.still-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 100px;
}

.still-grid .work-item {
  aspect-ratio: 1 / 1;
}

/* Still is a plain, flat grid — no captions, no zoom/hover motion */
.still-grid .work-item img {
  transform: none;
  filter: none;
  transition: none;
}

.still-grid .work-item:hover img {
  transform: none;
}

@media (max-width: 1100px) {
  .still-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .still-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* phones stay at two across — a single column made the photographs huge
   and the section endless to scroll */
@media (max-width: 420px) {
  .still-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--lightbox-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px var(--gutter);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__inner {
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.lightbox__inner img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.lightbox__inner img[hidden] {
  display: none;
}

.lightbox__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 65vh;
  background: #000;
}

.lightbox__video[hidden] {
  display: none;
}

.lightbox__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lightbox__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(16px, 4vh, 32px);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  color: var(--lightbox-fg-muted);
  font-size: 14px;
}

.lightbox__caption h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--lightbox-fg);
  font-size: 20px;
  margin: 0 0 4px;
}

.lightbox__caption p {
  color: var(--accent);
}

.lightbox__close {
  position: absolute;
  top: 28px;
  right: var(--gutter);
  z-index: 2;
  background: none;
  border: 0;
  color: var(--lightbox-fg);
  font-size: 15px;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.lightbox__close:hover {
  color: var(--accent);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: none;
  border: 0;
  color: var(--lightbox-fg);
  font-size: 40px;
  line-height: 1;
  padding: 12px 16px;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.lightbox__nav:hover {
  color: var(--accent);
}

.lightbox__prev {
  left: clamp(4px, 2vw, 28px);
}

.lightbox__next {
  right: clamp(4px, 2vw, 28px);
}

@media (max-width: 640px) {
  .lightbox__nav {
    font-size: 30px;
    padding: 10px;
  }
}

/* ==========================================================================
   Contact
   ========================================================================== */

.page-intro--contact {
  margin-bottom: 44px;
}

.contact {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 60px 80px;
}

@media (max-width: 860px) {
  .contact {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

.contact__intro p {
  color: var(--fg-muted);
  max-width: 46ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
}

/* Nudges the form's first label onto the same line as the photo's top edge */
.contact__form {
  padding-top: 6px;
}

@media (max-width: 860px) {
  .contact__form {
    padding-top: 0;
  }
}

.contact__figure {
  margin: 0 0 34px;
  max-width: 460px;
}

.contact__bio {
  font-size: 17px;
  line-height: 1.65;
}

/* secondary route in: outlined, so the red send button stays the primary one */
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--fg);
  color: var(--fg);
  padding: 14px 30px;
  font-size: 15px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.ghost-btn span {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  background: var(--fg);
  border-color: var(--fg);
  color: #fff;
}

.ghost-btn:hover span {
  transform: translate(3px, -3px);
}

.contact__headshot {
  display: block;
  width: 100%;
  max-width: 460px;
  /* height:auto keeps the photo at its own aspect ratio — without it the
     img height attribute stretches the frame and crops the picture */
  height: auto;
  margin: 0 0 30px;
  background: var(--bg-alt);
}

.field {
  margin-bottom: 26px;
}

.field label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.field label em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.25s var(--ease);
}

.field:focus-within label em {
  color: var(--accent);
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 10px 2px;
  resize: vertical;
  transition: border-color 0.25s var(--ease);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.field textarea {
  min-height: 120px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

/* the label and the WhatsApp button are one flex item, so a narrow window
   never strands the label on its own line next to Send message */
.form-actions__alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

/* tells people the two buttons are alternatives, not a sequence */
.form-actions__or {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.form-actions__or::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 15px 32px;
  font-family: var(--font-body);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s var(--ease);
}

.submit-btn span {
  display: inline-block;
  transition: transform 0.3s var(--ease);
}

.submit-btn:hover {
  background: #0a0a0a;
}

.submit-btn:hover span {
  transform: translate(3px, -3px);
}

.form-note {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg-faint);
}

/* ==========================================================================
   404 — page not found
   ========================================================================== */

.error-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter) 140px;
}

.error-page__links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.error-page__links a {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(22px, 3.2vw, 34px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.4s var(--ease);
}

/* a red rule wipes in from the left, the same move as the nav */
.error-page__links a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.error-page__links a:hover::before,
.error-page__links a:focus-visible::before {
  transform: scaleX(1);
}

.error-page__links a:hover,
.error-page__links a:focus-visible {
  padding-left: 14px;
}

.error-page__num {
  flex: 0 0 auto;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
}

.error-page__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 42px);
  letter-spacing: -0.025em;
  line-height: 1;
  flex: 0 0 auto;
}

.error-page__desc {
  color: var(--fg-muted);
  font-size: 14px;
  flex: 1 1 auto;
}

.error-page__arrow {
  flex: 0 0 auto;
  color: var(--fg-faint);
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
}

.error-page__links a:hover .error-page__arrow {
  transform: translate(3px, -3px);
  color: var(--accent);
}

@media (max-width: 640px) {
  .error-page__links a {
    flex-wrap: wrap;
    gap: 6px 16px;
  }

  .error-page__desc {
    flex: 1 0 100%;
  }

  .error-page__arrow {
    position: absolute;
    right: 0;
    top: clamp(22px, 3.2vw, 34px);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  color: var(--fg-faint);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a:hover {
  color: var(--accent);
}

/* running timecode, 25fps — a quiet nod to the day job */
.site-footer__tc {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
}

/* ==========================================================================
   Focus reticle — replaces the cursor over the work grids
   ========================================================================== */

.reticle {
  position: fixed;
  top: 0;
  left: 0;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  pointer-events: none;
  z-index: 95;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0) scale(0.85);
  transition: opacity 0.22s var(--ease), scale 0.22s var(--ease);
  will-change: transform;
}

.reticle.is-visible {
  opacity: 1;
  scale: 1;
}

.reticle span {
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
}

/* only the two edges that make each corner */
.reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.reticle span:nth-child(5) {
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border: 0;
  background: var(--accent);
}

/* hide the arrow only while the reticle is doing its job */
body.has-reticle .work-item,
body.has-reticle .work-item * {
  cursor: none;
}

@media (prefers-reduced-motion: reduce) {
  .reticle {
    transition: none;
  }
}

/* ==========================================================================
   Lightbox — project panel (used when a project has no playable video)
   ========================================================================== */

/* ---- clip set: one project made of several short films ---- */

.lightbox.has-clips .lightbox__inner > img {
  max-height: 54vh;
  width: auto;
}

.lightbox.has-clips .lightbox__video {
  aspect-ratio: 4 / 3;
  max-height: 54vh;
  max-width: 760px;
  margin: 0 auto;
}

.clip-set[hidden] {
  display: none;
}

.lightbox__clips {
  width: 100%;
  max-width: 760px;
}

.lightbox__cliphead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lightbox-fg-muted);
}

.lightbox__clipcount {
  color: var(--lightbox-fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.lightbox__cliprow {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
}

.lightbox__cliprow::-webkit-scrollbar {
  height: 4px;
}

.lightbox__cliprow::-webkit-scrollbar-thumb {
  background: #444;
}

/* only fades the right edge when there is genuinely more to scroll to */
.lightbox__clips.is-scrollable .lightbox__cliprow {
  mask-image: linear-gradient(to right, #000 84%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 84%, transparent 100%);
}

.lightbox__clips[hidden] {
  display: none;
}

.lightbox__clip {
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #1a1a1a;
  color: var(--lightbox-fg);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  opacity: 0.4;
  overflow: hidden;
  transition: opacity 0.25s var(--ease);
}

.lightbox__clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the number sits on the thumbnail so the strip reads as a numbered set */
.lightbox__clipnum {
  position: absolute;
  left: 6px;
  bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.lightbox__clip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.lightbox__clip:hover,
.lightbox__clip:focus-visible {
  opacity: 0.8;
}

.lightbox__clip.is-film::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  margin: -7px 0 0 -4px;
  border-left: 11px solid rgba(255, 255, 255, 0.92);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
  z-index: 1;
}

.lightbox__clip.is-active {
  opacity: 1;
}

.lightbox__clip.is-active::after {
  transform: scaleX(1);
}

@media (max-width: 720px) {
  .lightbox.has-clips .lightbox__inner > img {
  max-height: 54vh;
  width: auto;
}

.lightbox.has-clips .lightbox__video {
    max-height: 42vh;
  }

  .lightbox__clip {
    width: 74px;
  }
}

.lightbox__caption-main {
  min-width: 0;
}

.lightbox__caption-aside {
  text-align: right;
  max-width: 34ch;
}

.lightbox__caption-aside[hidden] {
  display: none;
}

.lightbox__note {
  color: var(--lightbox-fg-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

.lightbox__link {
  display: inline-block;
  border: 1px solid var(--lightbox-fg-muted);
  color: var(--lightbox-fg);
  padding: 9px 18px;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.lightbox__link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lightbox__link[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .lightbox__caption {
    flex-direction: column;
    gap: 14px;
  }

  .lightbox__caption-aside {
    text-align: left;
    max-width: none;
  }
}
