/* Instrument Serif is self-hosted so the serif never falls back. */
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #0c0c0c;
  --fg: #ffffff;
  /* 48px top/bottom; 147px sides at 1440px, scaling with viewport width */
  --pad-y: 48px;
  --pad-x: calc(147 / 1440 * 100vw);
  --nav-gap: 20px;
  --logo-w: calc(672 / 1440 * 100vw);
  --ease: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --cream: #f1ede6;
  --ink: #161412;
}

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

html { scroll-behavior: smooth; }

body { margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
  text-transform: uppercase;
  -webkit-font-smoothing: antialiased;
}

/* No scrolling while the preloader or the mobile menu is up. */
.js:not(.is-loaded),
.js:not(.is-loaded) body,
body.menu-open { overflow: hidden; }

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

/* ---------- Background video ---------- */

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.bg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The video itself must stay visible: mobile browsers refuse to autoplay
   a video with opacity 0. Fade a solid cover off it instead. */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  transition: opacity 1.2s ease;
}

.bg.is-playing::after { opacity: 0; }

.bg__shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

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

/* Fixed header: white over the hero, ink once the cream section
   reaches it (JS toggles .is-dark). */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: var(--pad-y) var(--pad-x) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg);
  pointer-events: none;
  transition: color 0.4s ease, opacity 0.4s ease;
}

.site-header.is-dark { color: var(--ink); }

/* The footer carries its own links, so the header steps aside there. */
.site-header.is-away {
  opacity: 0 !important;
  pointer-events: none;
}

.site-header.is-away > * { pointer-events: none; }
.menu-open .site-header { color: var(--fg); }

.site-header > * { pointer-events: auto; }

/* The hero stays pinned while the about section slides up over it. */
.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: calc(var(--pad-y) + 15px) var(--pad-x) var(--pad-y);
  display: grid;
  grid-template-rows: 1fr auto;
  transform: scale(calc(1 - var(--p, 0) * 0.06));
  opacity: calc(1 - var(--p, 0));
}

.nav {
  display: flex;
  gap: var(--nav-gap);
}

.hero__logo {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 0;
}

.hero__logo img {
  display: block;
  width: min(var(--logo-w), calc((100svh - 2 * var(--pad-y) - 120px) * 672 / 351));
  max-width: 100%;
  height: auto;
  opacity: 0.75;
}

.hero__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}

.tagline {
  margin: 0;
  text-align: center;
}

.mail { justify-self: end; }

/* Hover: a hairline draws in from the left, then leaves to the right. */
.link {
  position: relative;
  display: inline-block;
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}

.link:hover::after,
.link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu a { transition: opacity 0.2s ease; }

.burger,
.menu { display: none; }

/* ---------- Preloader ---------- */

.preloader { display: none; }

.js .preloader {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.preloader__bg {
  position: absolute;
  inset: 0;
  background: var(--bg);
  transition: opacity 0.9s var(--ease);
}

/* Same size as the hero logo, centred in the viewport; JS slides it into place. */
.preloader__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(var(--logo-w), calc((100svh - 2 * var(--pad-y) - 120px) * 672 / 351));
  max-width: calc(100vw - 2 * var(--pad-x));
  height: auto;
  opacity: 0.75;
  overflow: visible;
  transform: translate(-50%, -50%);
  transform-origin: 0 0;
}

.preloader__logo path {
  fill: var(--fg);
  fill-opacity: 0;
  stroke: var(--fg);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation:
    logo-draw 1.6s var(--ease) calc(var(--i) * 0.12s) forwards,
    logo-fill 0.8s ease calc(1.2s + var(--i) * 0.08s) forwards;
}

@keyframes logo-draw { to { stroke-dashoffset: 0; } }
@keyframes logo-fill { to { fill-opacity: 1; stroke-opacity: 0; } }

.preloader__count {
  position: absolute;
  right: var(--pad-x);
  bottom: var(--pad-y);
  font-variant-numeric: tabular-nums;
  transition: opacity 0.4s ease;
}

.preloader.is-leaving .preloader__bg,
.preloader.is-leaving .preloader__count { opacity: 0; }

/* Hero waits behind the preloader, then settles in. */
.js .hero__logo img { visibility: hidden; }
.js.is-loaded .hero__logo img { visibility: visible; }

.js .site-header,
.js .hero__bottom {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease);
}

.js.is-loaded .site-header,
.js.is-loaded .hero__bottom {
  opacity: 1;
  transform: none;
}

.js.is-loaded .hero__bottom { transition-delay: 0.12s; }

/* ---------- About ---------- */

.about {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 140px var(--pad-x) 120px;
  background: var(--cream);
  color: var(--ink);
  isolation: isolate;
}

/* Paper grain */
.about::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

.about__inner {
  width: max(400px, calc(400 / 1440 * 100vw));
  max-width: 100%;
  margin: 0 auto;
}

.about__title {
  margin: 0 0 40px;
  display: flex;
  justify-content: center;
  gap: 0.22em;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: max(76px, calc(136 / 1440 * 100vw));
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: none;
}

/* Serif titles: each word rises out of a mask that clips only its bottom edge. */
.split .word {
  display: block;
  flex-shrink: 0;
  padding-bottom: 0.12em;
  clip-path: inset(-50% -20% 0 -20%);
}

.split .word > span { display: block; }

.about__media {
  margin: 0;
  aspect-ratio: 1400 / 812;
  overflow: hidden;
  border-radius: 6px;
  background: #d9d3c9;
}

.about__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__sig {
  display: block;
  width: 112px;
  height: auto;
  margin: 28px 0 36px;
  overflow: visible;
  color: var(--ink);
}

.about__sig path { fill: currentColor; }

.about__text p {
  margin: 0 0 14px;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.about__links {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
}

/* ----- Scroll reveals (only when JS can undo them) ----- */

.js .split .word > span {
  transform: translateY(105%);
  transition: transform 1.1s var(--ease-out);
}

.js .split .word:nth-child(2) > span { transition-delay: 0.08s; }
.js .split .word:nth-child(3) > span { transition-delay: 0.16s; }

.js .split.is-in .word > span { transform: none; }

.js .about__media {
  clip-path: inset(100% 0 0 0 round 6px);
  transition: clip-path 1.3s var(--ease);
}

.js .about__media img {
  transform: scale(1.25);
  transition: transform 1.8s var(--ease-out);
}

.js .about__media.is-in { clip-path: inset(0 0 0 0 round 6px); }
.js .about__media.is-in img { transform: scale(1); }

/* "made with passion" writes itself, letter by letter, left to right. */
.js .about__sig path {
  clip-path: inset(-20% 100% -20% -20%);
  transition: clip-path 0.42s cubic-bezier(0.55, 0.1, 0.45, 0.95);
  transition-delay: calc(0.5s + var(--i) * 0.11s);
}

.js .about__sig.is-in path { clip-path: inset(-20% -20% -20% -20%); }

.js .about__text p,
.js .about__links {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s ease, transform 1.2s var(--ease-out);
}

.js .about__text p:nth-child(2) { transition-delay: 0.1s; }
.js .about__text p:nth-child(3) { transition-delay: 0.2s; }

.js .about__text.is-in p,
.js .about__links.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Portfolio ---------- */

.work {
  position: relative;
  z-index: 1;
  padding: 160px var(--pad-x) 180px;
  background: var(--bg);
  color: var(--fg);
  overflow-x: clip;
}

.work__title,
.cat__title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.22em;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: none;
}

.work__title {
  justify-content: center;
  margin-bottom: 140px;
  font-size: max(76px, calc(136 / 1440 * 100vw));
}

.cat + .cat { margin-top: 180px; }

.cat__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 48px;
}

.cat__title { font-size: max(52px, calc(88 / 1440 * 100vw)); }

.cat__desc {
  max-width: 300px;
  margin: 0 0 0.6em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

.js .cat__desc {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1s ease 0.25s, transform 1.2s var(--ease-out) 0.25s;
}

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

/* ----- Short-form: a rail of vertical frames that drifts with the scroll ----- */

.reels { margin: 0 calc(var(--pad-x) * -1); }

.reels__track {
  display: flex;
  gap: 20px;
  padding: 0 var(--pad-x) 56px;
  width: max-content;
  transform: translateX(calc(var(--drift, 0) * -1px));
  will-change: transform;
}

.reel {
  position: relative;
  flex: none;
  width: max(200px, calc(232 / 1440 * 100vw));
  aspect-ratio: 9 / 16;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1b1a;
  transition: opacity 0.5s ease, transform 0.8s var(--ease-out);
}

.reel:nth-child(even) { margin-top: 56px; }

.reel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}

.reel__time {
  position: absolute;
  top: 14px;
  right: 14px;
  font-variant-numeric: tabular-nums;
}

/* Progress bar along the bottom edge, like a story. */
.reel__bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.reel__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fg);
  transform: scaleX(0);
  transform-origin: left;
}

@media (hover: hover) {
  .reels__track:hover .reel:not(:hover) { opacity: 0.45; }
  .reel:hover img { transform: scale(1.06); }
  .reel:hover .reel__bar::after { animation: reel-play 3.2s linear forwards; }
}

@keyframes reel-play { to { transform: scaleX(1); } }

.js .reel {
  opacity: 0;
  transform: translateY(80px);
  transition:
    opacity 0.9s ease calc(var(--i) * 0.07s),
    transform 1.2s var(--ease-out) calc(var(--i) * 0.07s);
}

.js .reels.is-in .reel { opacity: 1; transform: none; }

@media (hover: hover) {
  .js .reels.is-in .reels__track:hover .reel:not(:hover) { opacity: 0.45; transition-delay: 0s; }
}

/* ----- Medium-form: an edit timeline driving a viewer ----- */

/* Frame + controls fit in one screen, centred under the heading. */
.timeline {
  max-width: calc((100svh - 280px) * 16 / 9);
  margin-inline: auto;
}

.timeline__viewer {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1b1a;
}

.timeline__viewer img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  visibility: hidden;
}

.timeline__viewer img.is-prev { visibility: visible; z-index: 1; }

/* The incoming clip wipes in from the right, like a cut landing. */
.timeline__viewer img.is-active {
  visibility: visible;
  z-index: 2;
  animation: clip-in 0.9s var(--ease) both;
}

@keyframes clip-in {
  from { clip-path: inset(0 0 0 100%); transform: scale(1.04); }
  to { clip-path: inset(0 0 0 0); transform: scale(1); }
}

.timeline__meta {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 14px;
}

.timeline__tc {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.62);
}

.timeline__track {
  position: relative;
  display: flex;
  gap: 3px;
  height: 64px;
}

.clip {
  flex: var(--w) 1 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--img) left center / auto 100% repeat-x;
  cursor: pointer;
  opacity: 0.45;
  filter: grayscale(0.6);
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: opacity 0.4s ease, filter 0.4s ease, outline-color 0.4s ease;
}

.clip:hover { opacity: 0.8; filter: none; }

.clip.is-active {
  opacity: 1;
  filter: none;
  outline-color: rgba(255, 255, 255, 0.85);
}

.clip:focus-visible { outline-color: var(--fg); }

/* Playhead: a hairline with a small cap, travelling across the track. */
.timeline__head {
  position: absolute;
  top: -10px;
  bottom: -6px;
  left: 0;
  width: 1px;
  background: var(--fg);
  pointer-events: none;
  transform: translateX(var(--ph, 0px));
}

.timeline__head::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border: 5px solid transparent;
  border-top: 7px solid var(--fg);
}

.js .timeline {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease, transform 1.3s var(--ease-out);
}

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

/* ----- VFX & SFX: a simple grid of frames, each wiping open on view ----- */

.fx-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.fx {
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1b1a;
}

.fx img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}

@media (hover: hover) {
  .fx:hover img { transform: scale(1.05); }
}

.js .fx {
  clip-path: inset(100% 0 0 0 round 10px);
  transition: clip-path 1.3s var(--ease) calc(var(--i) % 2 * 0.12s);
}

.js .fx img { transform: scale(1.2); }

.js .fx.is-in { clip-path: inset(0 0 0 0 round 10px); }
.js .fx.is-in img { transform: scale(1); }

@media (hover: hover) {
  .js .fx.is-in:hover img { transform: scale(1.05); }
}

/* ---------- Marquee ---------- */

.mq {
  position: relative;
  z-index: 1;
  padding: 120px 0 132px;
  background: var(--cream);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.mq::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

.mq__row {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.mq__row--a { font-size: max(72px, calc(150 / 1440 * 100vw)); line-height: 1.1; }

.mq__row--b {
  margin-top: 28px;
  font-size: max(30px, calc(56 / 1440 * 100vw));
  font-style: italic;
  line-height: 1.2;
  color: rgba(22, 20, 18, 0.55);
}

.mq__inner {
  display: flex;
  width: max-content;
  will-change: transform;
}

.mq__group {
  display: flex;
  align-items: center;
  flex: none;
}

.mq__word { padding: 0 0.28em; }
.mq__phrase { padding: 0 0.5em; }

/* Little film frames between the words. */
.mq__frame {
  flex: none;
  height: 0.62em;
  border-radius: 0.08em;
  overflow: hidden;
  background: #d9d3c9;
  transform: rotate(var(--r, -4deg));
  transition: transform 0.6s var(--ease-out);
}

.mq__frame--h { aspect-ratio: 16 / 9; --r: 3deg; }
.mq__frame--v { aspect-ratio: 9 / 16; height: 0.8em; }

.mq__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mq:hover .mq__frame { transform: rotate(0deg) scale(1.08); }

.mq__dot {
  flex: none;
  width: 0.22em;
  height: 0.22em;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Testimonials ---------- */

/* Continues the marquee's cream band. The section is tall; its content pins
   while scrolling lights up each quote and then slides to the next.
   JS sets the height (--tst-h). */
.tst {
  position: relative;
  z-index: 1;
  height: var(--tst-h, auto);
  background: var(--cream);
  color: var(--ink);
  isolation: isolate;
}

.tst::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

.tst__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: calc(var(--pad-y) + 72px) var(--pad-x) var(--pad-y);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tst__title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.22em;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: max(64px, calc(112 / 1440 * 100vw));
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: none;
}

.tst__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  min-height: 0;
}

.tst__stage {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 0;
}

/* Quotes fade at the column edges while they slide past. */
@media (min-width: 768px) {
  .tst__stage {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  }
}

.tst__track {
  display: flex;
  gap: 80px;
  width: 100%;
  transform: translateX(calc(var(--tx, 0) * (-100% - 80px)));
  will-change: transform;
}

.tst__item {
  flex: none;
  width: 100%;
  margin: 0;
  padding: 0 2px;
  text-align: center;
}

.tst__quote {
  margin: 0;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: max(30px, calc(52 / 1440 * 100vw));
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-transform: none;
  text-wrap: balance;
}

/* Words light up as you scroll, like a subtitle being read. */
.tst__quote .w {
  opacity: 0.16;
  transition: opacity 0.35s ease;
}

.tst__quote .w.is-lit { opacity: 1; }

/* Attribution is read by screen readers; the tabs show it visually. */
.tst__who {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tst__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tst__tab {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.4s ease;
}

.tst__tab:hover,
.tst__tab.is-active { opacity: 1; }

.tst__tab:focus-visible { outline: 1px solid var(--ink); outline-offset: 6px; }

.tst__role { color: rgba(22, 20, 18, 0.6); }

/* Progress through each testimonial, driven by the scroll. */
.tst__bar {
  position: relative;
  height: 1px;
  margin-bottom: 12px;
  background: rgba(22, 20, 18, 0.2);
  overflow: hidden;
}

.tst__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

.js .tst__body {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease 0.2s, transform 1.2s var(--ease-out) 0.2s;
}

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

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

.contact {
  position: relative;
  z-index: 1;
  padding: 160px var(--pad-x) 180px;
  background: var(--bg);
  color: var(--fg);
}

.contact__title {
  margin: 0 0 120px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.22em;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: max(64px, calc(136 / 1440 * 100vw));
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: none;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 120px;
  max-width: 1146px;
  margin: 0 auto;
}

.contact__intro {
  max-width: 300px;
  margin: 0 0 56px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

.contact__details { margin: 0; }

.contact__details div + div { margin-top: 32px; }

.contact__details dt { color: rgba(255, 255, 255, 0.5); }

.contact__details dd {
  margin: 10px 0 0;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: max(28px, calc(40 / 1440 * 100vw));
  line-height: 1.1;
  text-transform: none;
}

.contact__details .link::after { bottom: 0; }

/* ----- Form: hairline fields, label lifts on focus ----- */

.form { display: grid; gap: 40px; }

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.field {
  position: relative;
  display: grid;
  gap: 12px;
}

.field__label { color: rgba(255, 255, 255, 0.5); transition: color 0.3s ease; }

.field:focus-within .field__label { color: var(--fg); }

.field__input {
  width: 100%;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.2;
  outline: none;
  resize: vertical;
  /* Underline: dim hairline, a bright one draws across on focus. */
  background-image:
    linear-gradient(var(--fg), var(--fg)),
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25));
  background-size: 0 1px, 100% 1px;
  background-position: left bottom, left bottom;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease);
}

.field__input:focus { background-size: 100% 1px, 100% 1px; }

.field__input--area { min-height: 120px; }

.field.is-invalid .field__label { color: #ff8a7a; }
.field.is-invalid .field__input {
  background-image:
    linear-gradient(#ff8a7a, #ff8a7a),
    linear-gradient(rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.25));
  background-size: 100% 1px, 100% 1px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.chips legend { float: left; width: 100%; margin-bottom: 14px; }

.chip { position: relative; cursor: pointer; }

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip span {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, transform 0.35s var(--ease-out);
}

.chip:hover span { border-color: var(--fg); }
.chip input:checked + span { background: var(--fg); color: var(--ink); border-color: var(--fg); }
.chip input:active + span { transform: scale(0.96); }
.chip input:focus-visible + span { outline: 1px solid var(--fg); outline-offset: 3px; }

.form__foot {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Submit: white fills in from the bottom on hover. */
.form__submit {
  position: relative;
  overflow: hidden;
  padding: 18px 32px;
  border: 1px solid var(--fg);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
  isolation: isolate;
  transition: color 0.45s var(--ease);
}

.form__submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--fg);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
}

.form__submit:hover,
.form__submit:focus-visible { color: var(--ink); outline: none; }

.form__submit:hover::before,
.form__submit:focus-visible::before { transform: none; }

.form__status { margin: 0; color: rgba(255, 255, 255, 0.62); }

.form__note {
  margin: -12px 0 0;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.5);
}

.js .contact__info,
.js .form {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1.2s var(--ease-out);
}

.js .form { transition-delay: 0.12s; }

.js .contact__info.is-in,
.js .form.is-in { opacity: 1; transform: none; }

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

/* Transparent: the fixed background video from the hero shows through.
   No z-index here, so the logo can blend with that video. */
.footer {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad-y) var(--pad-x) 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--fg);
  overflow: hidden;
}

.footer__links {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.footer__links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  align-content: start;
}

.footer__links ul:last-child { justify-items: end; }

/* The logo, full width and cropped by the bottom edge, rises as you arrive.
   It's a white mask in difference mode, so the letters show the video
   behind them as a negative. */
.footer__logo {
  position: relative;
  margin-top: 80px;
  height: calc((100vw - 2 * var(--pad-x)) * 351 / 672 * 0.78);
  overflow: hidden;
}

.footer__ink {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 672 / 351;
  -webkit-mask: url("assets/logo.svg") center / 100% 100% no-repeat;
  mask: url("assets/logo.svg") center / 100% 100% no-repeat;
  background: #fff;
  mix-blend-mode: difference;
  transform: translateY(calc((1 - var(--f, 1)) * 35%));
}


/* ---------- Legal pages ---------- */

.legal-page {
  background: var(--cream);
  color: var(--ink);
}

.legal-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .25 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

/* Long pages scroll under the header, so give it a soft cream backing. */
.legal-page .site-header {
  padding-bottom: 32px;
  background: linear-gradient(var(--cream) 65%, rgba(241, 237, 230, 0));
}

.legal { padding: 180px var(--pad-x) 140px; }

.legal__title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.22em;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: max(52px, calc(112 / 1440 * 100vw));
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: none;
}

.legal__meta {
  margin: 28px 0 96px;
  text-align: center;
  color: rgba(22, 20, 18, 0.55);
}

/* Long-form reading: sentence case, regular weight, comfortable measure. */
.legal__body {
  max-width: 680px;
  margin: 0 auto;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  text-transform: none;
}

.legal__lead {
  margin: 0 0 24px;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.25;
}

.legal__body h2 {
  margin: 56px 0 14px;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
}

.legal__body p { margin: 0 0 14px; }

.legal__body ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.legal__body li + li { margin-top: 8px; }

.legal__body strong { font-weight: 700; }

.legal__body .link::after { bottom: 0; }

/* Details still to fill in: easy to spot, easy to search for "[". */
.ph {
  padding: 0 4px;
  border-radius: 3px;
  background: #f2d98b;
  color: var(--ink);
  font-weight: 700;
}

.legal__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  max-width: 680px;
  margin: 88px auto 0;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  :root {
    --pad-y: 32px;
    --pad-x: 20px;
  }

  .nav,
  .social,
  .mail { display: none; }

  .hero__bottom { grid-template-columns: 1fr; }

  .br-desktop { display: none; }

  .hero__logo img { width: 100%; }

  .preloader__logo { width: calc(100vw - 2 * var(--pad-x)); }

  .about { padding-top: 112px; padding-bottom: 72px; }
  .about__inner { width: 100%; }
  .about__title { margin-bottom: 28px; }

  .work { padding: 112px var(--pad-x) 120px; }
  .work__title { margin-bottom: 80px; }
  .cat + .cat { margin-top: 120px; }

  .cat__head {
    display: block;
    margin-bottom: 28px;
  }

  .cat__desc { margin: 16px 0 0; }

  /* The rail pins in place and vertical scrolling slides it sideways.
     JS sets the section height (--pin-h) and the offset (--drift). */
  .reels { height: var(--pin-h, auto); }

  .reels__track {
    position: sticky;
    top: max(96px, calc((100svh - 62vw * 16 / 9 - 32px) / 2));
    gap: 12px;
    padding-bottom: 32px;
  }

  .reel { width: 62vw; }
  .reel:nth-child(even) { margin-top: 32px; }

  .reel__time { top: 10px; right: 10px; }
  .reel__bar { left: 10px; right: 10px; bottom: 10px; }

  .fx-grid { grid-template-columns: 1fr; gap: 12px; }

  .mq { padding: 80px 0 88px; }

  .tst__pin { padding-top: calc(var(--pad-y) + 56px); }

  .contact { padding: 112px var(--pad-x) 120px; }
  .contact__title { margin-bottom: 64px; }
  .contact__grid { grid-template-columns: 1fr; gap: 72px; }
  .contact__intro { margin-bottom: 36px; }
  .form { gap: 32px; }
  .form__row { grid-template-columns: 1fr; gap: 32px; }
  .field__input { font-size: 22px; }

  .footer { min-height: 80svh; }

  .legal { padding: 128px var(--pad-x) 96px; }
  .legal__meta { margin-bottom: 64px; }
  .legal__body { font-size: 15px; }
  .legal__lead { font-size: 24px; }
  .legal__body h2 { font-size: 28px; margin-top: 44px; }
  .footer__links { grid-template-columns: 1fr 1fr; row-gap: 32px; }
  .footer__links ul:last-child { grid-column: 1 / -1; justify-items: start; }
  .tst__item { text-align: left; }
  .tst__tabs { gap: 12px; }
  .tst__role { display: none; }
  .tst__bar { margin-bottom: 8px; }
  .mq__row--b { margin-top: 16px; }

  .timeline__track { height: 48px; }

  /* ----- Hamburger: two lines that cross into an X ----- */

  .burger {
    display: block;
    width: 28px;
    height: 20px;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .burger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition:
      top 0.3s var(--ease) 0.3s,
      width 0.3s var(--ease) 0.3s,
      transform 0.3s var(--ease);
  }

  .burger span:first-child { top: 5px; }
  .burger span:last-child { top: 13px; width: 65%; left: auto; right: 0; }

  .menu-open .burger span {
    top: 9px;
    width: 100%;
    transition:
      top 0.3s var(--ease),
      width 0.3s var(--ease),
      transform 0.3s var(--ease) 0.3s;
  }

  .menu-open .burger span:first-child { transform: rotate(45deg); }
  .menu-open .burger span:last-child { transform: rotate(-45deg); }

  /* ----- Menu panel: wipes down from the top ----- */

  .menu {
    position: fixed;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    background: rgba(12, 12, 12, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition:
      clip-path 0.7s var(--ease) 0.25s,
      visibility 0s linear 0.95s;
  }

  .menu-open .menu {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition:
      clip-path 0.7s var(--ease),
      visibility 0s;
  }

  /* ----- Menu links: each line rises out of a mask, staggered ----- */

  .menu__links {
    display: grid;
    gap: 12px;
    text-align: center;
    font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: 44px;
    line-height: 1.05;
  }

  .menu__links a {
    display: block;
    overflow: hidden;
    padding: 0 4px 2px;
  }

  .menu__links span {
    display: block;
    transform: translateY(110%) rotate(4deg);
    transform-origin: left bottom;
    transition: transform 0.35s var(--ease) calc((3 - var(--i)) * 0.04s);
  }

  .menu-open .menu__links span {
    transform: none;
    transition: transform 0.8s var(--ease) calc(0.3s + var(--i) * 0.08s);
  }

  .menu__links a:hover { opacity: 1; }
  .menu__links a:hover span,
  .menu__links a:focus-visible span { font-style: italic; }

  /* ----- Page content steps back while the menu is open ----- */

  .hero__logo,
  .hero__bottom {
    transition: opacity 0.5s var(--ease), transform 0.7s var(--ease), filter 0.5s var(--ease);
  }

  .menu-open .hero__logo,
  .menu-open .hero__bottom {
    opacity: 0;
    transform: scale(0.96);
    filter: blur(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .about__sig path { clip-path: none; }

  .preloader__logo path {
    animation: none;
    fill-opacity: 1;
    stroke: none;
  }
}
