/* CHBS FILMS — site styles */

@font-face {
  font-family: "Departure Mono";
  src: url("fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --orange: #ff5b00;
  --red: #aa0000;
  --ice: #a6d6d4;
  --ink: #000;
  --paper: #e6e6e3;
  --muted: rgba(230, 230, 227, .62);
  --pixel: "Departure Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --gutter: clamp(18px, 3.2vw, 44px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --dim: brightness(.28) saturate(.35);
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--orange); color: #000; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 14px;
  font: 11px/1 var(--pixel); letter-spacing: .04em; text-transform: uppercase;
  color: var(--paper);
  mix-blend-mode: difference;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar__mark { display: flex; align-items: center; gap: 10px; text-decoration: none; opacity: 0; transform: translateY(-4px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.bar__mark svg { width: 13px; height: 16px; fill: none; stroke: currentColor; stroke-width: 6; }
body.is-scrolled .bar__mark { opacity: 1; transform: none; }
.bar__nav { display: flex; gap: 22px; }
.bar__nav a { text-decoration: none; }
.bar__nav a:hover, .bar__sound:hover { text-decoration: underline; text-underline-offset: 3px; }
.bar__sound b { font-weight: 400; }
.bar__sound[aria-pressed="true"] b::before { content: "● "; }

/* ---------- hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 480px;
  display: grid; place-items: center; overflow: hidden; background: #000;
}
.hero__media { position: absolute; inset: 0; }
.hero__media video, .hero__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: brightness(.38) saturate(.6);
  transform: scale(1.04);
  transition: opacity 1.2s var(--ease);
}
.hero__media video { opacity: 0; }
.hero__media video.is-ready { opacity: 1; }
.hero__logo {
  position: relative; z-index: 1; color: var(--orange);
  display: flex; flex-direction: column; align-items: flex-start;
  width: min(240px, 52vw);
  animation: rise 1.4s var(--ease) both .15s;
}
.hero__mark { width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 6.5; overflow: visible; }
.hero__mark path { stroke-dasharray: 1100; stroke-dashoffset: 1100; animation: draw 1.6s var(--ease) forwards .2s; }
.hero__word {
  margin: .5em 0 0; font: 400 clamp(48px, 9.2vw, 84px)/.92 var(--pixel);
  letter-spacing: -.01em; text-transform: uppercase; white-space: nowrap;
}
.hero__tag { margin: 1.4em 0 0; font: 400 clamp(15px, 2vw, 21px)/1.25 var(--pixel); }
.hero__down {
  position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  font: 14px/1 var(--pixel); color: var(--paper); text-decoration: none; opacity: .7;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translate(-50%, 5px); } }

/* ---------- strips ---------- */
.reel { display: block; }
.strip {
  --h: 78vh;
  --focus: 50%;
  position: relative; overflow: hidden;
  height: var(--h); min-height: 340px;
  background: #050505;
  cursor: default;
  isolation: isolate;
}
.strip[data-size="s"] { --h: 58vh; }
.strip[data-size="m"] { --h: 78vh; }
.strip[data-size="l"] { --h: 100vh; }
.strip__link { position: absolute; inset: 0; z-index: 3; cursor: pointer; }
.strip__link:focus-visible { outline: 1px solid var(--orange); outline-offset: -8px; }

.strip__media { position: absolute; inset: 0; z-index: 0; transition: filter .7s var(--ease); }
.strip__poster, .strip__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--focus) 50%;
  transform: scale(1.015);
  transition: opacity .6s var(--ease), transform 1.6s var(--ease);
}
.strip__video { opacity: 0; }
.strip.is-playing .strip__video { opacity: 1; }
.strip.is-active .strip__poster,
.strip.is-active .strip__video { transform: scale(1); }

/* dim everything that is not the focused strip */
body.has-active .strip:not(.is-active) .strip__media { filter: var(--dim); }
body.has-active .strip:not(.is-active) .strip__text { opacity: .35; }

/* legibility scrim on the text side */
.strip::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: .9; transition: opacity .7s var(--ease);
}
.strip[data-side="left"]::after  { background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,0) 42%); }
.strip[data-side="right"]::after { background: linear-gradient(270deg, rgba(0,0,0,.55), rgba(0,0,0,0) 42%); }
.strip[data-side="center"]::after { background: radial-gradient(ellipse at center, rgba(0,0,0,.45), rgba(0,0,0,0) 60%); }

.strip__text {
  position: absolute; z-index: 2;
  top: 50%; transform: translateY(-50%);
  width: min(300px, 34vw);
  transition: opacity .7s var(--ease);
}
.strip[data-side="left"]  .strip__text { left: var(--gutter); }
.strip[data-side="right"] .strip__text { right: var(--gutter); }
.strip[data-side="center"] .strip__text { left: 50%; transform: translate(-50%, -50%); text-align: center; width: min(420px, 80vw); }
.strip[data-pos="top"]    .strip__text { top: calc(var(--gutter) + 44px); transform: none; }
.strip[data-pos="bottom"] .strip__text { top: auto; bottom: calc(var(--gutter) + 8px); transform: none; }
.strip[data-side="center"][data-pos="top"] .strip__text,
.strip[data-side="center"][data-pos="bottom"] .strip__text { transform: translateX(-50%); }

.strip__index, .strip__meta, .strip__tc {
  margin: 0; font: 11px/1.4 var(--pixel); letter-spacing: .04em; text-transform: uppercase;
}
.strip__index { color: var(--orange); margin-bottom: 10px; }
.strip__title {
  margin: 0 0 6px; font: 400 22px/1.1 var(--pixel); text-transform: uppercase; letter-spacing: -.005em;
}
.strip__meta { color: var(--muted); margin-bottom: 16px; }
.strip__body p { margin: 0 0 .8em; font-size: 15px; line-height: 1.5; color: var(--paper); }
.strip__body p:last-child { margin-bottom: 0; }
.strip__body:empty { display: none; }

/* timecode + progress */
.strip__tc {
  position: absolute; z-index: 2; top: calc(var(--gutter) + 40px);
  display: flex; align-items: center; gap: 8px; color: var(--paper);
  opacity: 0; transition: opacity .4s var(--ease);
}
.strip[data-side="left"] .strip__tc, .strip[data-side="center"] .strip__tc { right: var(--gutter); }
.strip[data-side="right"] .strip__tc { left: var(--gutter); }
.strip__tc i { width: 7px; height: 7px; background: var(--orange); display: block; }
.strip.is-playing .strip__tc { opacity: .9; }
.strip.is-playing .strip__tc i { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.strip__progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 2px; opacity: 0; transition: opacity .4s; }
.strip__progress i { display: block; height: 100%; width: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }
.strip.is-playing .strip__progress { opacity: 1; }

/* ---------- footer ---------- */
.contact {
  background: var(--red); color: var(--ice);
  min-height: 70vh; min-height: 70svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 34px; padding: 96px var(--gutter) calc(40px + env(safe-area-inset-bottom));
  font-family: var(--pixel); text-align: center; position: relative;
}
.contact__tag { margin: 0; font-size: clamp(20px, 2.6vw, 32px); line-height: 1.2; }
.contact__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.contact__links a { text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .3s; }
.contact__links a:hover { border-color: currentColor; }
.contact__copy { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); margin: 0; font-size: 11px; opacity: .6; }

/* ---------- film grain ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 30; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); }
  60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .strip[data-size="s"] { --h: 62svh; }
  .strip[data-size="m"] { --h: 76svh; }
  .strip[data-size="l"] { --h: 90svh; }
  .strip { min-height: 420px; }
  .strip::after { background: linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,0) 58%) !important; }
  .strip__text,
  .strip[data-pos] .strip__text {
    top: auto; bottom: 26px; transform: none;
    left: var(--gutter); right: var(--gutter); width: auto;
  }
  .strip[data-side="right"] .strip__text { left: 24%; }
  .strip[data-side="left"]  .strip__text { right: 22%; }
  .strip[data-side="center"] .strip__text { left: var(--gutter); transform: none; width: auto; }
  .strip__title { font-size: 22px; }
  .strip__body p { font-size: 14px; }
  .strip__tc { display: none; }
  body.has-active .strip:not(.is-active) .strip__text { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .hero__down { animation: none; }
  .hero__mark path { animation: none; stroke-dashoffset: 0; }
}
