/* ─────────────────────────────────────────────────────────────────────────
   Jeremias Schlegel — editing portfolio

   Direction: THE CUTTING ROOM, not the magazine. The previous skin was bone
   paper + editorial serif — the look every portfolio template ships with this
   year. This one is the room the work is actually made in: neutral graphite
   (grading suites are painted mid-grey for a reason — you never judge a film
   against white), a condensed grotesque for the slate, mono for timecode.

   THE PAGE HAS NO PALETTE OF ITS OWN. Every colour on it was measured out of a
   film by tools/colors.py and arrives per project as --f. Nothing is tinted
   that the work did not tint.

   Signature: the cut list. A project's master runs as a bar to scale; the cuts
   that shipped stand under it as ticks, at their true length. It is the one
   thing an editor is paid for — choosing what survives — drawn from real data.
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 400 600;
  font-stretch: 75% 125%;          /* the width axis does the shouting */
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plexmono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --room:      #141618;            /* the wall of the suite */
  --room-lift: #1b1e21;            /* anything that sits on it */
  --edge:      #282c30;
  --edge-hi:   #3c4248;
  --ink:       #e9e7e4;            /* warm white — pure white glares next to film */
  --ink-dim:   #969b9f;
  --ink-faint: #61676c;

  --f: #8d949a;                    /* a project's own colour, set per tile */

  --sans: "Archivo", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: 40px;
  --ease: cubic-bezier(.22, .7, .2, 1);
  --stage-cap: 74vh;               /* one number for the stage height — CSS and JS read it */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--room);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; }

/* The slate: condensed, wide-tracked, small. Every label, format chip and
   count on the page speaks in it — the way a shot list does. */
.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.tc {                                /* timecode and any other number */
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.wrap { max-width: 1460px; margin: 0 auto; padding: 0 var(--pad); }

/* ── Head rail ─────────────────────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px var(--pad);
  background: color-mix(in srgb, var(--room) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.top .name {
  font-stretch: 82%;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.top nav { display: flex; gap: 22px; align-items: center; }
.top nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color .18s var(--ease);
}
.top nav a:hover { color: var(--ink); }

/* ── Masthead ──────────────────────────────────────────────────────────────
   The thesis, and beside it the same claim as measurable fact: the whole body
   of work drawn on one scale. Six long conversations, fifty-eight short things
   that shipped. No autoplay hero — the grid below is the film.               */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 72px;
  align-items: end;
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--edge);
}
.masthead h1 {
  font-stretch: 76%;                /* condensed: a title card, not a headline */
  font-weight: 600;
  font-size: clamp(38px, 4.9vw, 74px);
  line-height: 1.0;
  letter-spacing: .004em;
  text-transform: uppercase;
}
.masthead h1 .thin {
  font-stretch: 76%;
  font-weight: 400;
  color: var(--ink-dim);
}
.masthead .sub {
  margin: 28px 0 0;
  max-width: 40ch;
  color: var(--ink-dim);
  line-height: 1.62;
  font-size: 15px;
}

/* The lead film: the whole teaser, running silent, one click from its case. */
.hero-film {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.hero-film:focus-visible { outline: 2px solid var(--f); outline-offset: 5px; }

.hero-shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--room-lift);
}
.hero-shot img,
.hero-shot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Two tracks: one on screen, one already parked on its in-point. The swap is a
   cut, not a dissolve — 140 ms only to cover the first decoded frame. */
.hero-shot video { opacity: 0; transition: opacity .14s linear; }
.hero-shot video.on { opacity: 1; }
.hero-shot img { transition: opacity .3s var(--ease); }
.hero-shot img.gone { opacity: 0; }

/* The hairline is the segment's clock: it runs out, the reel cuts. */
.hero-prog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--f);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 2;
}

.hero-cap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 12px;
}
.hero-cap .t {
  font-stretch: 88%;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hero-cap .tc { color: var(--ink-faint); font-size: 11px; }
.hero-film:hover .hero-cap .tc { color: var(--ink-dim); }

/* ── Filter rail ───────────────────────────────────────────────────────── */
.rail {
  position: sticky;
  top: 53px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 0;
  margin-bottom: 30px;
  background: var(--room);
  border-bottom: 1px solid var(--edge);
}
.strands, .formats-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px;
  border: 1px solid var(--edge);
  background: none;
  cursor: pointer;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color .16s var(--ease), border-color .16s var(--ease),
              background .16s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--edge-hi); }
.chip[aria-pressed="true"] {
  color: var(--room);
  background: var(--ink);
  border-color: var(--ink);
}
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip .n { opacity: .5; margin-left: 6px; }

/* ── Work grid ─────────────────────────────────────────────────────────────
   Three columns on an 8-pixel row grid: each card spans the rows it needs, so a
   9:16 promo stands full height beside a 16:9 episode and nothing tears a hole
   under it. The vertical work is most of what he ships — it does not get to sit
   pillarboxed in a letterbox any more.                                        */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 8px;
  column-gap: 26px;
  align-items: start;
}

.proj {
  position: relative;
  color: inherit;
}

/* The frame takes the shape of the film in it. */
.shot {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--room-lift);
}
.proj[data-shape="tall"] .shot { aspect-ratio: 9 / 16; }

.shot img,
.shot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Grab the picture to scrub it — without this, Chrome grabs the poster and
     drags it around as an image instead. */
  -webkit-user-drag: none;
  user-select: none;
}

/* Poster paints at once; the preview is only fetched on hover (preload="none")
   and dissolves in over it. */
.shot video { opacity: 0; transition: opacity .4s var(--ease); }
.proj.rolling .shot video { opacity: 1; }

/* The whole frame opens the case. It sits under the sound switch and the
   playhead, which have jobs of their own. */
.shot .open {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  /* Sideways belongs to the scrub, up and down still scrolls the page. */
  touch-action: pan-y;
}
.proj.rolling .shot .open { cursor: ew-resize; }
.shot .open:focus-visible { outline: 2px solid var(--f); outline-offset: -3px; }

/* The sound switch: top right, small, and only there while the film is
   running — a control for a picture that is not moving is a lie. */
.snd {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  background: color-mix(in srgb, var(--room) 62%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .2s var(--ease), background .2s var(--ease);
}
.proj.rolling .snd,
.snd:focus-visible { opacity: 1; }
.snd:hover { background: color-mix(in srgb, var(--room) 85%, transparent); }
.snd:focus-visible { outline: 2px solid var(--f); outline-offset: 2px; }
.snd svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; }
.proj.loud .snd { opacity: 1; color: var(--f); }

.shot .chips {
  position: absolute;
  left: 9px;
  bottom: 12px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.fmt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  line-height: 1;
  padding: 4px 5px;
  color: var(--ink);
  background: color-mix(in srgb, var(--room) 78%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.fmt.more { color: var(--ink-faint); }

/* The playhead — a hairline in the film's own colour, and the only place the
   grid admits colour at all. It shows where you are in the preview, and you can
   drag it: the hit area is taller than the line, because a 2-pixel target is a
   joke on a trackpad. */
.seek {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  cursor: ew-resize;
  touch-action: none;
  transition: opacity .2s var(--ease);
}
.seek::before {                        /* the track it runs on */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}
.seek i {
  position: relative;
  height: 2px;
  width: 100%;
  background: var(--f);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.proj.rolling .seek { opacity: 1; }

.meta { padding: 13px 0 0; }
.meta h3 {
  font-stretch: 88%;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .01em;
  line-height: 1.3;
  text-transform: uppercase;
}
.meta .client {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* ── The cut list ──────────────────────────────────────────────────────────
   The signature, stated small on every tile: the master as a rule to scale,
   the cuts that shipped as ticks under it, each at its true length. Where
   there is no master, the ticks stand alone — that job shipped short only. */
.cuts {
  margin-top: 14px;
  display: grid;
  gap: 4px;
}
/* The master: the whole conversation, full width. */
.cuts .master {
  position: relative;
  height: 5px;
  background: var(--edge);
}
.cuts .master i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: var(--f);
  opacity: .38;
}
/* Under it, what survived — each cut at its true length against that master. */
.cuts .ticks {
  display: flex;
  align-items: stretch;
  gap: 3px;
  height: 5px;
}
.cuts .ticks i {
  display: block;
  width: var(--w);
  min-width: 2px;
  background: var(--f);
}
.cuts .sum {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 11px;
}
.cuts .sum .tc { font-size: 11px; }

/* ── Info ──────────────────────────────────────────────────────────────── */
.info {
  margin-top: 110px;
  border-top: 1px solid var(--edge);
  padding: 72px 0 100px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 64px;
}
.info h2 {
  font-stretch: 78%;
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.06;
  text-transform: uppercase;
  max-width: 14ch;
}
.info p { color: var(--ink-dim); line-height: 1.66; max-width: 44ch; font-size: 15px; }
.info dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0;
  margin: 26px 0 0;
  border-top: 1px solid var(--edge);
}
.info dt, .info dd {
  padding: 11px 0;
  margin: 0;
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 12px;
}
.info dt { color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase; }
.info a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--edge-hi); }
.info a:hover { border-bottom-color: var(--ink); }

/* ── Case view ─────────────────────────────────────────────────────────────
   One job: the player, and every version that shipped — switchable, with each
   version's length drawn to scale against the master. That linked set is the
   thing this niche does not show.                                            */
.case {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--room);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility 0s linear .28s;
}
.case[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity .28s var(--ease), visibility 0s;
}

.case-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 15px var(--pad);
  background: var(--room);
  border-bottom: 1px solid var(--edge);
}
.case-bar .who { display: flex; align-items: baseline; gap: 12px; }
.case-bar .dot {
  width: 8px; height: 8px;
  background: var(--f);
  flex: none;
  align-self: center;
}
.case-nav { display: flex; gap: 7px; }
.ibtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--edge);
  background: none;
  cursor: pointer;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.ibtn:hover { border-color: var(--ink); color: var(--ink); }
.ibtn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.case-body {
  max-width: 1460px;
  margin: 0 auto;
  padding: 34px var(--pad) 90px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 46px;
  align-items: start;
}

/* The monitor: a surround mixed from the film's own colour, so a 9:16 cut sits
   in a deliberate frame instead of a hole. */
.monitor {
  display: grid;
  place-items: center;
  min-height: min(var(--stage-cap), 640px);
  padding: 20px;
  background: color-mix(in srgb, var(--f) 7%, var(--room-lift));
}

/* The stage never grows past the viewport: a 9:16 cut used to render a
   1700-pixel-tall face you had to scroll through. */
.stage {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  max-height: var(--stage-cap);
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
.stage video,
.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  object-fit: contain;
}
.stage [hidden] { display: none; }

/* PUBLIC edition: an Instagram/LinkedIn deliverable cannot embed, so its stage is
   a poster that links out to the official post. */
.stage .case-link:not([hidden]) {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-decoration: none;
  background: #0d0e10;
}
.stage .case-link img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.case-link .cta {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font: 600 14px/1 'Archivo', system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #141618;
  background: var(--f, #c99e6e);
  padding: 11px 18px;
  border-radius: 999px;
  white-space: nowrap;
}
.stage .case-link:hover .cta { filter: brightness(1.07); }

.case-side h2 {
  font-stretch: 82%;
  font-weight: 600;
  font-size: 26px;
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.case-side .note {
  color: var(--ink-dim);
  line-height: 1.62;
  font-size: 14.5px;
  margin: 14px 0 0;
}

/* Quality: the heights that exist, in the page's own mono. No "auto", no gear
   icon — a menu of three numbers is the whole feature. */
.quality[hidden] { display: none; }   /* `display: flex` below beats the browser's
                                        own [hidden] rule — an episode was showing an
                                        empty "QUALITY" heading with nothing under it */
.quality {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.qlist { display: flex; gap: 5px; }
.qbtn {
  padding: 5px 9px;
  border: 1px solid var(--edge);
  background: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  transition: color .16s var(--ease), border-color .16s var(--ease);
}
.qbtn:hover { color: var(--ink); border-color: var(--edge-hi); }
.qbtn[aria-pressed="true"] { color: var(--f); border-color: var(--f); }
.qbtn:focus-visible { outline: 2px solid var(--f); outline-offset: 2px; }

/* The version switcher, as a cut list: length is drawn, not just written. */
.vhead {
  margin-top: 30px;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--edge);
}
.vlist { display: grid; }
.vbtn {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--edge);
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background .16s var(--ease);
}
.vbtn:hover { background: var(--room-lift); }
.vbtn[aria-pressed="true"] .vname { color: var(--ink); }
.vbtn[aria-pressed="true"] .vlen i { background: var(--f); opacity: 1; }
.vbtn:focus-visible { outline: 2px solid var(--f); outline-offset: -2px; }

/* A miniature of the real frame shape: 16:9, 9:16 or a full episode. */
.vshape { display: grid; place-items: center; }
.vshape i { display: block; border: 1px solid var(--ink-faint); }
.vshape.h i { width: 18px; height: 10px; }
.vshape.v i { width: 8px; height: 14px; }
.vshape.e i { width: 18px; height: 10px; background: var(--ink-faint); }
.vbtn[aria-pressed="true"] .vshape i { border-color: var(--f); }
.vbtn[aria-pressed="true"] .vshape.e i { background: var(--f); }

.vname {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-dim);
  min-width: 0;
}
.vfmt {
  display: inline-block;
  margin-left: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.vlen { display: grid; gap: 5px; justify-items: end; }
.vlen .rule { width: 108px; height: 3px; background: var(--edge); position: relative; }
.vlen .rule i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  min-width: 2px;
  background: var(--ink-faint);
  opacity: .8;
}
.vlen .tc { font-size: 11px; color: var(--ink-faint); }

.credits {
  display: grid;
  grid-template-columns: 92px 1fr;
  margin: 30px 0 0;
  border-top: 1px solid var(--edge);
}
.credits dt, .credits dd {
  padding: 10px 0;
  margin: 0;
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 12px;
}
.credits dt { color: var(--ink-faint); letter-spacing: .08em; text-transform: uppercase; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* No hover on a touch screen: the switch and the playhead stay visible. */
  .snd, .seek { opacity: 1; }
  .masthead { grid-template-columns: 1fr; gap: 48px; padding: 64px 0 56px; }
  .case-body { grid-template-columns: 1fr; gap: 30px; }
  .info { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 720px) {
  :root { --pad: 20px; }
  .grid { grid-template-columns: 1fr; }
  .masthead { padding: 48px 0 44px; }
  .rail { top: 51px; padding: 14px 0; }
  :root { --stage-cap: 64vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
