/* ==========================================================================
   A THING BY — design system
   Black ground, Crimson Text display, mono micro-labels, full-bleed video.
   ========================================================================== */

:root {
  --ink:        #000000;
  --ink-2:      #0A0A0A;
  --ink-3:      #121212;
  --paper:      #EFEDE8;
  --paper-dim:  #A5A29B;
  --paper-faint:#6E6B65;
  --line:       rgba(239, 237, 232, 0.14);
  --line-soft:  rgba(239, 237, 232, 0.08);
  --accent:     #EFEDE8;

  --serif: "Crimson Text", "Times New Roman", Times, serif;
  --sans: "Helvetica Neue", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
  --max: 1560px;
  --rule: 1px solid var(--line);

  /* Micro-label: the signature of the whole layout. */
  --label-size: 0.625rem;      /* 10px */
  --label-track: 0.14em;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

/* Must beat any component `display` declaration. */
[hidden] { display: none !important; }

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

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

::selection { background: var(--paper); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
}
.skip:focus { left: 1rem; top: 1rem; }

/* --------------------------------------------------------------------------
   Type primitives
   -------------------------------------------------------------------------- */

.label {
  font-family: var(--mono);
  font-size: var(--label-size);
  font-weight: 400;
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  line-height: 1;
  color: var(--paper-dim);
}

.label--bright { color: var(--paper); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 0.95em;
  border: var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  color: var(--paper);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

a.pill:hover, button.pill:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.display {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  font-weight: 400;
}

.display--xl { font-size: clamp(2.75rem, 8.2vw, 7.5rem); }
.display--lg { font-size: clamp(2.25rem, 5.6vw, 4.75rem); }
.display--md { font-size: clamp(1.75rem, 3.2vw, 2.75rem); }

.lede {
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.5;
  letter-spacing: -0.015em;
  color: var(--paper-dim);
  max-width: 46ch;
  margin: 0;
}

.shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(5rem, 12vh, 11rem);
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: var(--rule);
}

.section__head .label { flex: 0 0 auto; }
.section__count { margin-left: auto; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.masthead {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1rem, 2.2vw, 1.6rem) var(--gutter);
  mix-blend-mode: normal;
  transition: transform 0.45s var(--ease), background 0.45s var(--ease), border-color 0.45s var(--ease);
  border-bottom: 1px solid transparent;
}

.masthead.is-stuck {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line-soft);
}

.masthead.is-hidden { transform: translateY(-102%); }

.wordmark {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.15vw, 1.05rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.masthead__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Keep Work reachable on small screens; only Studio folds away. */
@media (max-width: 560px) {
  .masthead__nav .pill--secondary { display: none; }
  .masthead__nav { gap: 0.35rem; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  isolation: isolate;
}

.hero__stage {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--ink-2);
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
}

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

.hero__slide img,
.hero__slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Slight desaturation keeps wildly different source footage feeling like one site. */
  filter: saturate(0.88) contrast(1.04);
}

.hero__slide video { position: absolute; inset: 0; }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.45) 38%, rgba(0,0,0,0.25) 62%, rgba(0,0,0,0.6) 100%),
    radial-gradient(120% 80% at 50% 100%, rgba(0,0,0,0.5), transparent 60%);
  pointer-events: none;
}

.hero__body {
  position: relative;
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(2rem, 5vh, 3.5rem);
  display: grid;
}

/* Panes share one grid cell so the hero never jumps between slides. */
.hero__pane {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(1.5rem, 4vw, 4rem);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), visibility 0.7s;
  pointer-events: none;
}

.hero__pane.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .hero__pane { transition: opacity 0.2s linear, visibility 0.2s; transform: none; }
}

.hero__lockup { min-width: 0; }

.hero__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}

.hero__meta .label { color: var(--paper); }

.hero__rule {
  width: clamp(1.5rem, 4vw, 4rem);
  height: 1px;
  background: var(--line);
}

.hero__client {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 7.4vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 0.35rem;
  text-wrap: balance;
}

.hero__title {
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1.05vw, 0.82rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-dim);
  margin: 0 0 1.6rem;
}

.hero__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.hero__credits {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: right;
  padding-bottom: 0.4rem;
}

.hero__credits .label { color: var(--paper-faint); }
.hero__credits li { color: var(--paper-dim); }

.hero__credits ul {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  line-height: 1.85;
}

@media (max-width: 900px) {
  .hero__pane { grid-template-columns: 1fr; }
  .hero__credits { text-align: left; }
}

.hero__ticker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem var(--gutter);
  border-top: var(--rule);
  max-width: var(--max);
  margin-inline: auto;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.hero__ticker::-webkit-scrollbar { display: none; }

.hero__dot {
  position: relative;
  flex: 0 0 auto;
  padding: 0.55rem 0;
  font-family: var(--mono);
  font-size: var(--label-size);
  letter-spacing: var(--label-track);
  text-transform: uppercase;
  color: var(--paper-faint);
  transition: color 0.4s var(--ease);
  white-space: nowrap;
}

.hero__dot::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--paper);
}

.hero__dot:hover { color: var(--paper-dim); }
.hero__dot.is-active { color: var(--paper); }
.hero__dot.is-active::after { width: 100%; }

.hero__dot.is-active.is-timing::after {
  animation: sweep var(--hero-dwell, 7s) linear forwards;
}

@keyframes sweep { from { width: 0; } to { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .hero__dot.is-active.is-timing::after { animation: none; width: 100%; }
}

/* --------------------------------------------------------------------------
   Statement
   -------------------------------------------------------------------------- */

.statement__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

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

.statement__body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding-top: 0.75rem;
}

.statement__body p {
  margin: 0;
  color: var(--paper-dim);
  font-size: clamp(0.95rem, 1.15vw, 1.075rem);
  line-height: 1.62;
  max-width: 44ch;
}

/* Numbers strip */

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  border-top: var(--rule);
  margin-top: clamp(3.5rem, 8vw, 6rem);
}

.figure {
  padding: clamp(1.75rem, 3vw, 2.5rem) 0;
  border-bottom: var(--rule);
}

.figure + .figure { border-left: var(--rule); padding-left: clamp(1.25rem, 2.5vw, 2.25rem); }

@media (max-width: 640px) {
  .figure + .figure { border-left: 0; padding-left: 0; }
}

.figure__num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.5rem, 4.6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 0.6rem;
  font-variant-numeric: tabular-nums;
}

.figure__cap { color: var(--paper-faint); max-width: 24ch; }

/* Client / press marquee */

.marquee {
  overflow: hidden;
  border-block: var(--rule);
  padding-block: clamp(1.25rem, 2.5vw, 2rem);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  gap: clamp(2.5rem, 6vw, 5rem);
  width: max-content;
  animation: drift 42s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee__track { flex-wrap: wrap; width: auto; justify-content: center; }
}

.marquee__item {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.9vw, 1.6rem);
  letter-spacing: -0.02em;
  color: var(--paper-faint);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Work index
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.filter[aria-pressed="true"] {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.filter__n {
  font-size: 0.85em;
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: clamp(1.75rem, 3vw, 3rem) clamp(1.25rem, 2vw, 2rem);
}

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  min-width: 0;
}

.card[hidden] { display: none; }

/* First card of each view reads as the feature. */
.grid .card.is-feature { grid-column: span 2; }

@media (max-width: 860px) {
  .grid .card.is-feature { grid-column: span 1; }
}

.card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink-3);
  border: var(--rule);
}

.card__frame img,
.card__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.03);
  transition: transform 1.2s var(--ease), opacity 0.5s var(--ease), filter 0.6s var(--ease);
}

.card__frame video { opacity: 0; }
.card.is-playing .card__frame video { opacity: 1; }
.card.is-playing .card__frame img { opacity: 0; }

.card:hover .card__frame img,
.card:hover .card__frame video,
.card:focus-visible .card__frame img,
.card:focus-visible .card__frame video {
  transform: scale(1.035);
  filter: saturate(1) contrast(1.03);
}

.card__badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
}

.card__play {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.card:hover .card__play,
.card:focus-visible .card__play { opacity: 1; transform: none; }

.card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 45%);
  opacity: 0.9;
  pointer-events: none;
}

.card__meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding-top: 0.9rem;
}

.card__meta .card__year { margin-left: auto; color: var(--paper-faint); font-variant-numeric: tabular-nums; }

.card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0.45rem 0 0;
}

.card__client {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  color: var(--paper-dim);
  letter-spacing: -0.01em;
}

.card.is-feature .card__title { font-size: clamp(1.6rem, 2.8vw, 2.6rem); }

.grid__empty {
  padding: 4rem 0;
  color: var(--paper-faint);
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
}

.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}

@media (max-width: 860px) {
  .contact__inner { grid-template-columns: 1fr; align-items: start; }
}

.contact__mail {
  display: inline-block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 3.25rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-top: 1.5rem;
  background-image: linear-gradient(var(--paper), var(--paper));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 0.5s var(--ease);
  word-break: break-word;
}

.contact__mail:hover { background-size: 0 1px; }

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.colophon {
  border-top: var(--rule);
  padding-block: 2rem 2.5rem;
}

.colophon__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.colophon .label { color: var(--paper-faint); }

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  /* visibility flips instantly on open (so focus can land immediately) and only
     after the fade on close (so the panel doesn't vanish mid-transition). */
  transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0s;
}

.lightbox__panel {
  width: min(1200px, 100%);
  max-height: 100%;
  overflow-y: auto;
  transform: translateY(12px) scale(0.99);
  transition: transform 0.45s var(--ease);
}

.lightbox.is-open .lightbox__panel { transform: none; }

.lightbox__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  /* Constrain by viewport height so the frame stays exactly 16:9 rather than
     letterboxing the embed, and title + credits stay visible. */
  width: min(100%, calc(62vh * 16 / 9));
  margin-inline: auto;
  background: var(--ink-3);
  border: var(--rule);
}

@supports (height: 1svh) {
  .lightbox__frame { width: min(100%, calc(62svh * 16 / 9)); }
}

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

.lightbox__info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  padding-top: 1.5rem;
}

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

.lightbox__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0.6rem 0 0.4rem;
}

.lightbox__client { color: var(--paper-dim); margin: 0 0 1rem; }

.lightbox__desc {
  color: var(--paper-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  max-width: 62ch;
}

.lightbox__credits {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  line-height: 1.95;
  color: var(--paper-dim);
}

.lightbox__close {
  position: fixed;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  z-index: 2;
}

.lightbox__unavailable {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
  padding: 2rem;
  color: var(--paper-faint);
}

/* noscript / no-JS fallback: show everything, no filtering */
.no-js .filters { display: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Works whose source upload is gone: a typographic plate, not a broken thumbnail. */
.card__plate {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(239,237,232,0.035) 0 1px, transparent 1px 9px),
    var(--ink-3);
}

.card__plate-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--paper-faint);
  transition: color var(--dur) var(--ease);
}

.card__plate-sub {
  display: block;
  margin-top: 0.9rem;
  color: var(--paper-faint);
}

.card.is-plate:hover .card__plate-title,
.card.is-plate:focus-visible .card__plate-title { color: var(--paper); }

/* Dashed edge marks "no longer online"; posterMode:'plate' keeps the solid rule. */
.card.is-archive .card__frame { border-style: dashed; }
.card.is-archive .card__plate-title { color: var(--paper-faint); }
.card.is-plate:not(.is-archive) .card__plate-title { color: var(--paper-dim); }

/* Long-tail music videos sit quieter than the documentary and top-tier work,
   and come forward on hover. */
.card.is-minor .card__frame img { opacity: 0.62; filter: saturate(0.6) contrast(1.02); }
.card.is-minor:hover .card__frame img,
.card.is-minor:focus-visible .card__frame img { opacity: 1; filter: saturate(1) contrast(1.03); }
.card.is-minor .card__title { font-size: clamp(1.1rem, 1.5vw, 1.4rem); }
.card.is-minor .card__client { color: var(--paper-faint); }
