/* Saltlight Pictures, showreel with the graded cut */
:root {
  --night: #050506;            /* the bands and the slate */
  --ink: #f4f1ea;              /* text over the film */
  --muted: #8d8a84;            /* small labels */
  --line: rgba(244, 241, 234, 0.16);   /* hairlines on the slate */
  --finder: rgba(244, 241, 234, 0.72); /* the viewfinder corners */
  --accent: #6ff2c4;           /* Saltlight mint: frames of the timecode, the playing work */
  --band: clamp(26px, 7vh, 62px);      /* height of the letterbox bands */
  --pad: clamp(12px, 3.2vw, 36px);     /* margin from the edges */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: "Archivo Variable", "Archivo", system-ui, sans-serif;
  font-variation-settings: "wdth" 100;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.reel {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--night);
}

/* ---------- the film ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--night);
}

.aperture {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
}

.aperture.is-on { visibility: visible; }

.scene {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}

.shot {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  object-fit: cover;
  object-position: var(--fx, 50%) var(--fy, 50%);
  transform-origin: var(--fx, 50%) var(--fy, 50%);
  user-select: none;
  -webkit-user-select: none;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 46%, transparent 52%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 22%, transparent 62%, rgba(0, 0, 0, 0.42));
}

.grain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: var(--grain, 0.1);
  mix-blend-mode: overlay;
}

.grain__noise {
  position: absolute;
  inset: -60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.6 -0.3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ---------- the viewfinder ---------- */
.finder {
  position: absolute;
  inset: calc(var(--band) + 14px) var(--pad);
  pointer-events: none;
}

.finder__frame { position: absolute; inset: 0; }

.corner {
  position: absolute;
  width: clamp(10px, 1.6vw, 18px);
  height: clamp(10px, 1.6vw, 18px);
  border: 0 solid var(--finder);
}

.corner--tl { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.corner--tr { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.corner--bl { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.corner--br { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

.finder__cross {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  opacity: 0.55;
  background:
    linear-gradient(var(--finder), var(--finder)) center / 1px 100% no-repeat,
    linear-gradient(var(--finder), var(--finder)) center / 100% 1px no-repeat;
}

/* ---------- the letterbox bands ---------- */
.band {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--band);
  background: var(--night);
}

.band--top {
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--pad);
  font-size: clamp(9px, 1.05vw, 12px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.band--bottom { bottom: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 760;
  font-variation-settings: "wdth" 82;
  letter-spacing: 0.02em;
}

.brand__mark {
  width: 1.35em;
  height: 1.35em;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
}

.brand__thin { font-weight: 360; color: var(--muted); margin-left: 0.15em; }

.band__mid { color: var(--muted); font-weight: 500; }

.tc {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 560;
  letter-spacing: 0.06em;
}

.tc__ff { color: var(--accent); }

/* ---------- the list of works ---------- */
.works {
  position: absolute;
  left: var(--pad);
  bottom: calc(var(--band) + clamp(16px, 4vh, 40px));
  width: min(300px, 34vw);
  font-size: clamp(10px, 1.05vw, 12.5px);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}

.works__label {
  display: inline-block;
  margin-bottom: 0.7em;
  padding: 0.18em 0.45em 0.12em;
  background: var(--ink);
  color: var(--night);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.works__list { list-style: none; }

.work {
  position: relative;
  display: flex;
  width: 100%;
  gap: 0.9em;
  align-items: baseline;
  padding: 0.36em 0.45em;
  text-align: left;
  text-transform: uppercase;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.work__client {
  flex: 0 0 44%;
  color: rgba(244, 241, 234, 0.62);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work__title {
  white-space: nowrap;
  transition: letter-spacing 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.work.is-on .work__client { color: var(--accent); }

/* the bar that wears away with the film: white in difference, above the words, so they turn dark under it */
.work__bar {
  position: absolute;
  inset: 0;
  background: #fff;
  mix-blend-mode: difference;
  transform-origin: 100% 50%;
  transform: scaleX(0);
  pointer-events: none;
}

/* the soft white sweep that grows from the side the pointer comes in */
.work__sweep {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08) 62%, transparent);
  transform: scaleX(0);
  transform-origin: var(--from, left) 50%;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.work.from-right .work__sweep {
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08) 62%, transparent);
}

.work:active { transform: scale(0.985); }

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

@media (hover: hover) {
  .works__list:has(.work:hover) .work:not(:hover) { opacity: 0.52; }
  .work:hover .work__sweep { transform: scaleX(1); }
  .work:hover .work__title { letter-spacing: 0.025em; }
}

/* ---------- the slate ---------- */
.slate {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(560px, 52vw);
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(12px, 2vw, 28px);
  padding: clamp(12px, 1.6vw, 20px) var(--pad) clamp(12px, 1.8vw, 22px) clamp(12px, 1.4vw, 18px);
  background: var(--night);
  box-shadow: 0 -1px 0 var(--line) inset, 0 30px 80px rgba(0, 0, 0, 0.5);
}

.slate::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04));
}

.slate__credits {
  display: flex;
  flex-direction: column;
  gap: 0.85em;
  font-size: clamp(10px, 1.05vw, 12.5px);
}

.slate__label {
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.2em;
}

.slate__value { font-weight: 650; overflow: hidden; }

.swap { display: inline-block; white-space: nowrap; }

.slate__nav {
  display: flex;
  gap: 1.4em;
  margin-top: auto;
  padding-top: 0.6em;
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.step svg {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.step span { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

.step:active span, .step:active svg { transform: translateY(1px); }

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

@media (hover: hover) {
  .step--back:hover svg { transform: translateX(-3px); }
  .step--next:hover svg { transform: translateX(3px); }
  .step:hover span { transform: translateY(-0.08em); }
}

.slate__head { min-width: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.4vw, 16px); }

.slate__title {
  position: relative;
  font-size: clamp(22px, min(4.4vw, 7vh), 56px);
  font-weight: 820;
  font-variation-settings: "wdth" 72;
  line-height: 0.88;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  overflow: hidden;
  padding-bottom: 0.04em;
}

.next {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
}

.next__frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
  max-height: 18vh;
  width: 100%;
}

.next__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.next__label {
  display: block;
  margin-top: 0.55em;
  color: var(--muted);
  font-size: clamp(9px, 0.95vw, 11.5px);
  font-weight: 500;
}

.next__name { color: var(--ink); font-weight: 650; margin-left: 0.4em; }

@media (hover: hover) {
  .next:hover .next__img { transform: scale(1.06); filter: grayscale(1) contrast(1.2); }
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- narrow: the phone box (341 x 410) and small windows ---------- */
@media (max-width: 640px) {
  .band--top { grid-template-columns: 1fr auto; }
  .band__mid { display: none; }
  .works {
    width: auto;
    right: var(--pad);
    bottom: calc(clamp(96px, 30vh, 150px) + 10px);
    font-size: 10px;
  }
  .works__label { margin-bottom: 0.45em; }
  .work { padding: 0.28em 0.4em; }
  .slate {
    left: 0;
    width: auto;
    height: clamp(96px, 30vh, 150px);
    grid-template-columns: 1fr 1.25fr;
    gap: 12px;
    padding: 12px var(--pad) 12px;
  }
  .slate__credits { font-size: 10px; gap: 0.55em; }
  .slate__title { font-size: clamp(20px, min(7vw, 6.4vh), 32px); }
  .next { display: none; }
  .finder { inset: calc(var(--band) + 10px) var(--pad) calc(clamp(96px, 30vh, 150px) + 10px); }
  .band--bottom { display: none; }
}

@media (max-height: 520px) and (min-width: 641px) {
  .next { display: none; }
}

.swap--title { white-space: normal; max-width: 100%; }

/* a soft shade behind the list, so the words read over foam and sky too */
.works::before {
  content: "";
  position: absolute;
  inset: -40% -30% -30% -20%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.18) 60%, transparent);
  pointer-events: none;
}

.works__label, .works__list { position: relative; }

.work__client, .work__title { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35); }
