/* rackhub.dev/work: the Rack Focus look, taken from the channel's logo.
   Dark on purpose and in one theme only: video is judged against a dark surround. */

@font-face { font-family: "Anton"; src: url(/assets/fonts/anton.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; font-weight: 400; src: url(/assets/fonts/manrope-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; font-weight: 500; src: url(/assets/fonts/manrope-500.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; font-weight: 600; src: url(/assets/fonts/manrope-600.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/assets/fonts/jetbrains-400.woff2) format("woff2"); font-display: swap; }

:root {
  --ground: #0e0f14;
  --raised: #191a23;
  --ink: #f3f3f5;
  --muted: #a5a6b2;
  --line: #2b2c37;
  --accent: #f0385d;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
/* The light behind the player spills past the screen edge. Clip, because hidden would break the sticky opening */
main { overflow-x: clip; }
p { margin: 0; }
a { color: inherit; text-underline-offset: .18em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  /* The notch of an iPhone held sideways */
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Viewfinder corners, the frame around the logo */
.corners, .rf {
  --len: 22px;
  --wid: 2px;
  --c: linear-gradient(var(--accent), var(--accent));
  background:
    var(--c) 0 0 / var(--len) var(--wid), var(--c) 0 0 / var(--wid) var(--len),
    var(--c) 100% 0 / var(--len) var(--wid), var(--c) 100% 0 / var(--wid) var(--len),
    var(--c) 0 100% / var(--len) var(--wid), var(--c) 0 100% / var(--wid) var(--len),
    var(--c) 100% 100% / var(--len) var(--wid), var(--c) 100% 100% / var(--wid) var(--len);
  background-repeat: no-repeat;
}

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: max(18px, env(safe-area-inset-top)) 18px; }
.bar-over { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.rf {
  --len: 7px;
  --wid: 1.5px;
  display: inline-block;
  padding: 6px 9px 5px;
  font: 400 24px/1 var(--display);
  letter-spacing: .04em;
}
.rf i { font-style: normal; filter: blur(.6px); }
.brand-name { font: 400 13px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; }
.bar-link { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; font-size: 15px; text-decoration: none; }
.bar-link::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.bar-link:hover { text-decoration: underline; }

/* The opening is a rack focus: the headline sharp over a soft picture, and scrolling
   pulls focus through to the footage. --f runs from 0 to 1 and everything follows it. */
.rack-stage {
  --f: clamp(0, calc((var(--p, 0) - .06) / .7), 1);
  position: relative;
  height: 100vh;
  height: 100svh;
}
.pull-ready .rack-stage { height: 190vh; height: 190svh; }
.stage-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--ground); }
.reel { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel-soft { opacity: calc(1 - var(--f)); }
/* Focus peaking: the outlines a camera paints over what is sharp, only while focus moves */
.peak {
  display: none;
  position: absolute;
  inset: 0;
  isolation: isolate;
  mix-blend-mode: screen;
  opacity: min(calc(var(--f) * 1.8), calc((1 - var(--f)) * 1.8));
  pointer-events: none;
}
.pull-ready .peak { display: block; }
.peak video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.peak::after { content: ""; position: absolute; inset: 0; background: var(--accent); mix-blend-mode: multiply; }
.shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(14 15 20 / .55) 0%, rgb(14 15 20 / .35) 45%, rgb(14 15 20 / .86) 100%);
  opacity: calc(1 - var(--f));
}
.stage-pin .stage-corners { inset: clamp(70px, 9vh, 88px) var(--gutter) clamp(18px, 3vh, 32px); }
.hud {
  position: absolute;
  top: clamp(84px, 11vh, 108px);
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding-inline: calc(var(--gutter) + clamp(12px, 1.6vw, 22px));
  font: 400 12.5px/1 var(--mono);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.hud-rec { display: inline-flex; align-items: center; gap: .5em; }
.hud-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .hud-rec i { animation: rec 1.6s steps(2, jump-none) infinite; }
}
@keyframes rec { from { opacity: 1; } to { opacity: .2; } }
.stage-copy {
  position: absolute;
  inset: auto 0 clamp(78px, 13vh, 132px) 0;
  z-index: 2;
  filter: blur(calc(var(--f) * 26px));
  opacity: calc(1 - var(--f) * 1.15);
}
.stage-copy h1 {
  margin: 0;
  /* The second limit is for a phone held sideways, where height runs out first */
  font: 400 min(10.2vw, 7.75rem, 17vh)/1.05 var(--display);
  letter-spacing: .005em;
  text-transform: uppercase;
}
.pull { display: block; }
.lede { max-width: 60ch; margin-top: clamp(12px, 2vw, 26px); color: #d4d4dc; font-size: clamp(1rem, 1.3vw, 1.2rem); }
.ring {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(30px, 5vh, 52px);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font: 400 11.5px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: calc(1 - var(--f));
}
.ring i {
  position: relative;
  display: block;
  width: min(260px, 46vw);
  height: 10px;
  background: repeating-linear-gradient(90deg, rgb(243 243 245 / .55) 0 1px, transparent 1px 13px);
}
.ring b { position: absolute; top: -3px; bottom: -3px; left: calc(var(--f) * 100%); width: 2px; background: var(--accent); }
.lead { padding-top: clamp(28px, 4vw, 60px); }

/* The focus pull on the headline: soft for a second, then sharp and staying sharp */
@media (prefers-reduced-motion: no-preference) {
  .pull { animation: focus-in .9s cubic-bezier(.2, .7, .2, 1) both; }
  .pull-late { animation-delay: .25s; }
}
@keyframes focus-in {
  from { filter: blur(20px); opacity: .3; }
  to { filter: blur(0); opacity: 1; }
}

/* Player */
.player { position: relative; isolation: isolate; margin: 0; padding: clamp(10px, 1.2vw, 16px); }
/* The picture's own light on the wall behind it */
.glow {
  position: absolute;
  top: -8%;
  left: -6%;
  z-index: -1;
  width: 112%;
  height: 116%;
  filter: blur(clamp(36px, 6vw, 96px)) saturate(1.5);
  opacity: .5;
  pointer-events: none;
  transition: opacity .8s ease;
}
.lights-down .glow { opacity: .9; }
/* House lights: everything but the film dims while it plays */
:is(.bar, .case, .shelf, .next, .brief, .foot, .lead-caption) { transition: opacity .7s ease; }
.lights-down :is(.bar, .case, .shelf, .next, .brief, .foot, .lead-caption) { opacity: .12; }
.player video { display: block; width: 100%; height: auto; background: #000; }
.corners { position: absolute; inset: 10px; z-index: 2; opacity: 0; pointer-events: none; transition: opacity .2s ease, inset .3s cubic-bezier(.2, .7, .2, 1); }
.corners-on { inset: 0; opacity: 1; --len: clamp(22px, 3vw, 46px); --wid: clamp(2px, .25vw, 3px); }
.play {
  position: absolute;
  inset: clamp(10px, 1.2vw, 16px);
  z-index: 1;
  display: flex;
  /* In the corner, so the button never sits on the title of the frame */
  align-items: flex-end;
  justify-content: flex-start;
  padding: clamp(12px, 1.6vw, 24px);
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.play[hidden] { display: none; }
.play svg {
  width: clamp(56px, 6vw, 84px);
  height: clamp(56px, 6vw, 84px);
  padding: clamp(14px, 1.5vw, 21px);
  border-radius: 50%;
  background: var(--accent);
  fill: var(--ground);
  transition: transform .2s ease;
}
.play:hover svg { transform: scale(1.08); }
.play span { position: absolute; right: 14px; bottom: 12px; padding: 2px 7px; background: rgb(14 15 20 / .72); font: 400 13px/1.5 var(--mono); }
.stage { padding-top: 4px; }
.stage .player { max-width: min(100%, calc((100svh - 104px) * 16 / 9)); margin-inline: auto; }
.stage .player-tall { max-width: min(100%, calc((100svh - 104px) * 9 / 16)); }
.lead-caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; padding-inline: clamp(10px, 1.2vw, 16px); }
.lead-caption a { font: 400 clamp(1.3rem, 2vw, 1.75rem)/1.2 var(--display); letter-spacing: .01em; text-transform: uppercase; text-decoration: none; }
.lead-caption a:hover { text-decoration: underline; }
.lead-caption span, .card-meta, .eyebrow { color: var(--muted); font: 400 12.5px/1.5 var(--mono); }

/* Shelves of work */
.shelf { padding-top: clamp(56px, 7vw, 108px); }
.shelf h2 { margin: 0 0 clamp(16px, 2vw, 28px); font: 400 clamp(1.7rem, 2.8vw, 2.6rem)/1.15 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.rack { display: grid; gap: clamp(26px, 2.4vw, 34px) clamp(14px, 1.8vw, 26px); }
.rack-1 { grid-template-columns: minmax(0, 1fr); }
.rack-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rack-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rack-v { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rack-1 .frame { aspect-ratio: 21 / 9; }
.rack .frame-tall { aspect-ratio: 9 / 16; }
.card { display: flex; flex-direction: column; min-width: 0; text-decoration: none; }
.frame { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--raised); }
.frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame video { opacity: 0; transition: opacity .25s ease; }
.frame video.on { opacity: 1; }
.tc { position: absolute; right: 8px; bottom: 8px; z-index: 2; padding: 1px 6px; background: rgb(14 15 20 / .72); font: 400 12px/1.5 var(--mono); }
.card-title { margin-top: 12px; font: 400 clamp(1.3rem, 1.85vw, 1.65rem)/1.18 var(--display); letter-spacing: .012em; text-transform: uppercase; }
.card-meta { margin-top: 3px; }
.card:hover .corners, .card:focus-visible .corners { opacity: 1; inset: 14px; }

/* The rack focus itself: the one you point at stays sharp, the rest of the row goes soft */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .card { transition: filter .35s ease, opacity .35s ease; }
  .rack:has(.card:hover) .card:not(:hover),
  .rack:has(.card:focus-visible) .card:not(:focus-visible) { filter: blur(5px); opacity: .55; }
}

/* Headings pull into focus as they arrive, once, and then stay sharp */
.pull-ready .shelf h2:not(.sharp), .pull-ready .brief h2:not(.sharp) { filter: blur(9px); opacity: .35; }
.shelf h2, .brief h2 { transition: filter .7s cubic-bezier(.2, .7, .2, 1), opacity .7s ease; }

/* A single work */
.case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(18px, 4vw, 72px); padding-top: clamp(20px, 2.8vw, 40px); }
.case h1 { margin: 6px 0 0; font: 400 clamp(2.7rem, 6.2vw, 5.75rem)/1.06 var(--display); letter-spacing: .008em; text-transform: uppercase; text-wrap: balance; }
.case-text { max-width: 62ch; padding-top: 4px; }
.case-text h2 { margin: 1.6em 0 .35em; color: var(--muted); font: 400 12.5px/1.5 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.all { margin-top: 26px; font-weight: 500; }

/* The way on to the next work: soft until you reach for it */
.next { position: relative; display: block; margin-top: clamp(56px, 7vw, 104px); overflow: hidden; height: clamp(190px, 30vw, 420px); text-decoration: none; }
.next img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(16px) brightness(.5); transform: scale(1.08); transition: filter .5s cubic-bezier(.2, .7, .2, 1); }
.next:hover img, .next:focus-visible img { filter: none; }
.next-copy { position: absolute; inset: auto 0 clamp(18px, 3vw, 40px) 0; display: flex; flex-direction: column; gap: 4px; }
.next-copy .eyebrow { color: var(--ink); }
.next-title { font: 400 clamp(2rem, 5.4vw, 4.75rem)/1.08 var(--display); letter-spacing: .008em; text-transform: uppercase; text-shadow: 0 2px 24px rgb(14 15 20 / .6); }

/* Asking for the brief */
.brief { margin-top: clamp(72px, 9vw, 136px); padding-block: clamp(32px, 4vw, 56px) clamp(40px, 5vw, 72px); border-top: 1px solid var(--line); }
.brief h2 { margin: 0; font: 400 clamp(2.3rem, 6vw, 5.25rem)/1.08 var(--display); letter-spacing: .008em; text-transform: uppercase; text-wrap: balance; }
.brief p { max-width: 60ch; margin-top: 14px; color: var(--muted); }
.brief { scroll-margin-top: 12px; }
.brief-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 24px; }
.brief-actions .button { margin-top: 0; }
.copy { padding: .8em 1.2em; border: 1px solid var(--line); background: none; color: var(--ink); font: 500 1em/1.6 var(--body); cursor: pointer; }
.copy:hover { border-color: var(--muted); }
.copy[hidden] { display: none; }
.button {
  display: inline-block;
  margin-top: 24px;
  padding: .8em 1.35em;
  background: var(--accent);
  color: var(--ground);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.button:hover { background: #ff5577; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding-block: 18px 28px; color: var(--muted); font: 400 12.5px/1.5 var(--mono); }
.foot-links { display: inline-flex; gap: 1.25rem; }

/* Pressing a card grows its picture into the player of the next page. Browsers without
   this simply change page. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
}

.missing { min-height: 62svh; padding-block: clamp(48px, 10vw, 140px); }
.missing h1 { margin: 0; font: 400 clamp(3.4rem, 12vw, 10rem)/1.05 var(--display); text-transform: uppercase; }
.soft { display: inline-block; filter: blur(5px); }
.missing p { margin-top: 12px; color: var(--muted); }

/* Reduced motion gets the sharp picture and no pull at all */
@media (prefers-reduced-motion: reduce) {
  .reel-soft, .ring { display: none; }
}

/* Tablets: three in a row get too small, so one wide over two */
@media (max-width: 1024px) {
  .rack-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rack-3 .card:first-child { grid-column: 1 / -1; }
  .rack-3 .card:first-child .card-title { font-size: clamp(1.6rem, 3.6vw, 2.2rem); }
  .rack-v { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .case { grid-template-columns: minmax(0, 1fr); }
  .rack-1 .frame { aspect-ratio: 16 / 9; }
}
/* Phones: one column, and tall videos in a row you swipe */
@media (max-width: 720px) {
  .rack-2, .rack-3 { grid-template-columns: minmax(0, 1fr); }
  .rack-3 .card:first-child .card-title { font-size: inherit; }
  .player .corners-on { inset: 2px; }
  .bar-link, .card { -webkit-tap-highlight-color: transparent; }
  .bar-link { min-height: 44px; }
  .rack-v {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .rack-v .card { flex: 0 0 58vw; scroll-snap-align: center; }
  .card-title { font-size: 1.45rem; }
  .button { display: block; text-align: center; }
  .brief-actions { flex-direction: column; align-items: stretch; }
  .pull-ready .peak { display: none; }
}
/* A phone held sideways has room for the headline only */
@media (max-height: 480px) {
  .stage-copy { bottom: 46px; }
  .lede, .hud, .ring span { display: none; }
  .ring { bottom: 24px; }
}
