/*
 * Teaser. The site's language (ink, cream, red; Times and Arial; crop marks) around the album
 * teaser, with the terminal type from the clip for the details.
 */
:root {
  --ink: #0b090a;
  --cream: #e2d9d0;
  --red: #ba1818;
  --muted: rgb(226 217 208 / 0.55);
  --display: "Times New Roman", Times, serif;
  --body: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-door: cubic-bezier(0.83, 0, 0.17, 1);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 60% 55% at 50% 58%, #161112 0%, transparent 70%),
    radial-gradient(ellipse 40% 35% at 78% 88%, rgb(186 24 24 / 0.16), transparent 70%),
    #050405;
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html.intro-lock,
html.intro-lock body {
  overflow: hidden;
}

h1,
h2,
p,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

ol {
  list-style: none;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 1px solid var(--cream);
  outline-offset: 4px;
}

/* ------------------------------------------------------------ Stage */

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1600ms ease-out;
}

.scene[data-ready] {
  opacity: 1;
}

/* Desktop: the clip plays unseen and feeds the phone's screen. */
html[data-mode="scene"] .film {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

/* Phones (and no WebGL): the clip itself fills the screen. */
html[data-mode="film"] .scene {
  display: none;
}

/* The whole clip, never cropped: its black edges melt into the page's. */
html[data-mode="film"] .film {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ------------------------------------------------------------ Video only (phones) */

html[data-focus] body {
  overflow: hidden;
}

main,
.foot,
.bar__brand,
.grain,
.vignette {
  transition: opacity 600ms ease-out;
}

html[data-focus] :is(main, .foot, .bar__brand, .grain, .vignette) {
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------ Full screen (desktop) */

.theater {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgb(5 4 5 / 0.8);
  -webkit-backdrop-filter: blur(22px) saturate(0.7);
  backdrop-filter: blur(22px) saturate(0.7);
  opacity: 0;
  visibility: hidden;
  cursor: zoom-out;
  transition:
    opacity 600ms ease-out,
    visibility 0s 600ms;
}

html[data-theater] .theater {
  opacity: 1;
  visibility: visible;
  transition: opacity 600ms ease-out;
}

/* Crop marks around the clip, sized like it. */
.theater__frame {
  --mark: 18px;
  position: relative;
  height: calc(100svh - 150px);
  aspect-ratio: 576 / 1024;
  color: rgb(226 217 208 / 0.7);
  translate: 0 12px;
}

.theater__frame::before {
  content: "";
  position: absolute;
  inset: -14px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 0 0 / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 100% 0 / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 100% 0 / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 0 100% / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 0 100% / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 100% 100% / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 100% 100% / 1px var(--mark);
  background-repeat: no-repeat;
  opacity: 0;
  transition:
    inset 900ms var(--ease-out-expo) 150ms,
    opacity 400ms ease-out 150ms;
}

html[data-theater] .theater__frame::before {
  inset: -8px;
  opacity: 1;
}

html[data-mode="scene"][data-theater] .film {
  z-index: 9;
  top: 50%;
  left: 50%;
  bottom: auto;
  width: auto;
  height: calc(100svh - 150px);
  aspect-ratio: 576 / 1024;
  object-fit: contain;
  background: #000;
  opacity: 1;
  pointer-events: none;
  translate: -50% calc(-50% + 12px);
  animation: theater-in 900ms var(--ease-out-expo) both;
}

@keyframes theater-in {
  from {
    opacity: 0;
    scale: 0.92;
  }
}

/* The bar stays over the full-screen clip, for sound and closing. */
html[data-theater] .bar {
  z-index: 12;
}

html[data-theater] .bar__brand {
  opacity: 0.4;
}

/* Over the phone: a small label follows the pointer, and the cursor says it opens. */
html[data-over-phone] body {
  cursor: zoom-in;
}

.pointer-label {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgb(11 9 10 / 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--cream);
  pointer-events: none;
  opacity: 0;
  scale: 0.9;
  transition:
    opacity 250ms ease-out,
    scale 400ms var(--ease-out-expo);
}

.pointer-label span {
  width: 6px;
  height: 6px;
  background: var(--red);
}

html[data-over-phone]:not([data-theater]) .pointer-label {
  opacity: 1;
  scale: 1;
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 900ms steps(5) infinite;
}

@keyframes grain {
  20% {
    transform: translate(-3%, 2%);
  }
  40% {
    transform: translate(2%, -4%);
  }
  60% {
    transform: translate(-4%, -1%);
  }
  80% {
    transform: translate(3%, 3%);
  }
}

/* A faint CRT sweep and a vignette, from the clip's screen. */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.13) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 50%, transparent 45%, rgb(0 0 0 / 0.7) 100%);
}

/* ------------------------------------------------------------ Intro */

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.intro__shutter {
  position: absolute;
  left: 0;
  right: 0;
  height: 50.5%;
  background: #030203;
  transition: transform 1100ms var(--ease-door);
}

.intro__shutter--top {
  top: 0;
}

.intro__shutter--bottom {
  bottom: 0;
}

.intro__line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 90px;
  margin-top: -45px;
  overflow: visible;
  fill: none;
  stroke: var(--red);
  stroke-width: 1.5px;
  stroke-linejoin: round;
  clip-path: inset(-50% 100% -50% 0);
  animation: intro-draw 1500ms cubic-bezier(0.45, 0.05, 0.55, 0.95) 250ms forwards;
  transition:
    stroke 250ms,
    opacity 500ms 250ms;
}

@keyframes intro-draw {
  to {
    clip-path: inset(-50% 0 -50% 0);
  }
}

.intro__caption {
  position: absolute;
  top: calc(50% + 60px);
  left: 50%;
  translate: -50% 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  opacity: 0;
  animation: intro-caption 700ms ease-out 500ms forwards;
  transition: opacity 300ms;
}

.intro__caption span {
  color: var(--red);
}

@keyframes intro-caption {
  to {
    opacity: 1;
  }
}

/* Flat: the line goes white for an instant, like a tube warming up. */
.intro[data-phase="flat"] .intro__line {
  stroke: var(--cream);
}

.intro[data-phase="open"] .intro__line,
.intro[data-phase="open"] .intro__caption {
  opacity: 0;
}

.intro[data-phase="open"] .intro__shutter--top {
  transform: translateY(-100%);
}

.intro[data-phase="open"] .intro__shutter--bottom {
  transform: translateY(100%);
}

.intro[data-phase="done"] {
  display: none;
}

/* Page content waits behind the shutters, then rises in. */
.bar,
.hero__terminal,
.hero__date {
  transition:
    opacity 1200ms ease-out,
    translate 1400ms var(--ease-out-expo);
}

html:not([data-revealed]) .bar,
html:not([data-revealed]) .hero__terminal,
html:not([data-revealed]) .hero__date {
  opacity: 0;
  translate: 0 16px;
}

html[data-revealed] .hero__terminal {
  transition-delay: 350ms;
}

html[data-revealed] .hero__date {
  transition-delay: 200ms;
}

/* ------------------------------------------------------------ Bar */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 3vw, 40px);
}

.bar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.05;
  text-decoration: none;
}

.bar__brand img {
  width: 58px;
  height: auto;
}

@media (max-width: 599px) {
  .bar__brand span {
    display: none;
  }

  .bar__brand img {
    width: 48px;
  }
}

.bar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sound,
.focus {
  --mark: 10px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  background: rgb(11 9 10 / 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--display);
  font-size: 15px;
  text-transform: uppercase;
  color: var(--cream);
  cursor: pointer;
}

.sound::before,
.focus::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 0 0 / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 100% 0 / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 100% 0 / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 0 100% / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 0 100% / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 100% 100% / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 100% 100% / 1px var(--mark);
  background-repeat: no-repeat;
  transition: inset 500ms var(--ease-out-expo);
}

.sound:hover::before,
.focus:hover::before {
  inset: -4px;
}

.focus svg {
  width: 14px;
  height: 14px;
  color: var(--red);
}

.focus__close,
.focus[aria-pressed="true"] .focus__open {
  display: none;
}

.focus[aria-pressed="true"] .focus__close {
  display: block;
  width: 11px;
  height: 11px;
}

/* Narrow phones: the zoom button keeps its icon, the label goes. */
@media (max-width: 479px) {
  .focus {
    padding: 0 15px;
  }

  .focus__label {
    display: none;
  }
}

/* Four bars: still when muted, moving with sound on. */
.sound__bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound__bars i {
  width: 2px;
  height: 3px;
  background: var(--red);
  transition: height 300ms;
}

.sound[aria-pressed="true"] .sound__bars i {
  animation: bars 900ms ease-in-out infinite alternate;
}

.sound[aria-pressed="true"] .sound__bars i:nth-child(2) {
  animation-delay: -300ms;
}

.sound[aria-pressed="true"] .sound__bars i:nth-child(3) {
  animation-delay: -600ms;
}

.sound[aria-pressed="true"] .sound__bars i:nth-child(4) {
  animation-delay: -150ms;
}

.sound__icon {
  display: none;
}

/* Phones: icons only, no frames, a little smaller. A red dot on the muted speaker asks for a tap. */
html[data-mode="film"] .bar__actions {
  gap: 4px;
}

html[data-mode="film"] :is(.sound, .focus) {
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  -webkit-tap-highlight-color: transparent;
}

html[data-mode="film"] :is(.sound, .focus)::before {
  --mark: 6px;
  inset: 6px;
  opacity: 0;
  transition:
    inset 500ms var(--ease-out-expo),
    opacity 300ms;
}

html[data-mode="film"] :is(.sound, .focus):active::before {
  inset: 2px;
  opacity: 0.6;
}

html[data-mode="film"] :is(.sound__label, .focus__label, .sound__bars) {
  display: none;
}

html[data-mode="film"] :is(.focus svg, .sound__icon) {
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.7));
}

html[data-mode="film"] .focus svg {
  width: 17px;
  height: 17px;
  color: var(--cream);
}

html[data-mode="film"] .focus[aria-pressed="true"] .focus__close {
  width: 13px;
  height: 13px;
}

html[data-mode="film"] .sound__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.sound__on,
.sound[aria-pressed="true"] .sound__off {
  display: none;
}

.sound[aria-pressed="true"] .sound__on {
  display: inline;
}

html[data-mode="film"] .sound[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  animation: sound-dot 1.6s ease-in-out infinite alternate;
}

@keyframes sound-dot {
  from {
    opacity: 1;
  }
  to {
    opacity: 0.25;
  }
}

@keyframes bars {
  from {
    height: 3px;
  }
  to {
    height: 12px;
  }
}

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

main {
  position: relative;
  z-index: 3;
}

.hero {
  position: relative;
  min-height: 100svh;
  padding: 0 clamp(16px, 3vw, 40px);
}

.tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag::after {
  content: "";
  width: 40px;
  height: 1px;
  background: rgb(226 217 208 / 0.3);
}

.tag__dot {
  width: 7px;
  height: 7px;
  background: var(--red);
}

.hero__terminal {
  position: absolute;
  left: clamp(16px, 3vw, 40px);
  bottom: clamp(32px, 7vh, 72px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.terminal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  color: rgb(226 217 208 / 0.72);
}

.terminal li {
  opacity: 0;
}

.terminal li::before {
  content: "> ";
  color: var(--muted);
}

.terminal li[data-typed] {
  opacity: 1;
}

.terminal__red {
  color: var(--red);
  text-transform: uppercase;
}

.terminal__red::after {
  content: "_";
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero__date {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  top: 50%;
  translate: 0 -50%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}

html:not([data-revealed]) .hero__date {
  translate: 0 calc(-50% + 16px);
}

.binary {
  max-width: 17em;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  color: var(--red);
  word-spacing: 0.4em;
}

.date {
  font-family: var(--display);
  font-size: clamp(96px, 12vw, 210px);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.05em;
  color: var(--cream);
}

.date__digits {
  display: inline-block;
  min-width: 3.1ch;
}

.date__year {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--muted);
}

/* Phones: the clip carries its own terminal, so only the date sits over it, at the foot. */
@media (max-width: 899px) {
  .hero__terminal {
    display: none;
  }

  .hero__date {
    top: auto;
    bottom: 96px;
    translate: 0 0;
    right: 16px;
  }

  html:not([data-revealed]) .hero__date {
    translate: 0 16px;
  }

  .date {
    font-size: clamp(88px, 28vw, 140px);
  }
}

/* ------------------------------------------------------------ Countdown */

.count {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: 120px clamp(16px, 3vw, 40px) 72px;
}

/* The phone (or the clip) goes dark behind the count. */
.count::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, transparent, rgb(5 4 5 / 0.9) 24%, rgb(5 4 5 / 0.96));
}

.count__inner {
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 7vh, 80px);
  width: 100%;
}

.count__head {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.count__title {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 116px);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.045em;
}

.count__title span:last-child {
  padding-left: 0.9em;
  font-style: italic;
  color: var(--red);
}

/* Four cells between hairlines, the numbers as large as the page allows, crop marks at the corners. */
.countdown {
  --mark: 16px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid rgb(226 217 208 / 0.16);
}

.countdown::before {
  content: "";
  position: absolute;
  inset: -10px;
  pointer-events: none;
  color: rgb(226 217 208 / 0.7);
  background:
    linear-gradient(currentColor, currentColor) 0 0 / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 0 0 / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 100% 0 / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 100% 0 / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 0 100% / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 0 100% / 1px var(--mark),
    linear-gradient(currentColor, currentColor) 100% 100% / var(--mark) 1px,
    linear-gradient(currentColor, currentColor) 100% 100% / 1px var(--mark);
  background-repeat: no-repeat;
}

.countdown div {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2vh, 22px);
  padding: clamp(18px, 3vh, 32px) clamp(10px, 1.6vw, 28px) clamp(16px, 2.6vh, 28px);
}

.countdown div + div {
  border-left: 1px solid rgb(226 217 208 / 0.16);
}

.countdown dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.countdown dd {
  font-family: var(--display);
  font-size: clamp(64px, 15.5vw, 280px);
  line-height: 0.8;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
}

/* Seconds in red, with a small light that blinks on every tick. */
.countdown div:last-child dd {
  color: var(--red);
}

.countdown div:last-child dt::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--red);
  animation: blink 1s steps(1) infinite;
}

.count__foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Rising in when scrolled to. */
.count__inner > * {
  opacity: 0;
  translate: 0 24px;
  transition:
    opacity 900ms ease-out,
    translate 1200ms var(--ease-out-expo);
}

.count[data-inview] .count__inner > * {
  opacity: 1;
  translate: 0 0;
}

.count[data-inview] .count__inner > :nth-child(2) {
  transition-delay: 120ms;
}

.count[data-inview] .count__inner > :nth-child(3) {
  transition-delay: 260ms;
}

/* Phones: the same row, tighter; the date line stacks. */
@media (max-width: 599px) {
  .count {
    padding-bottom: 56px;
  }

  .countdown {
    --mark: 10px;
  }

  .countdown::before {
    inset: -6px;
  }

  .countdown div {
    padding-inline: 8px;
  }

  .countdown dt {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .countdown div:last-child dt::before {
    width: 4px;
    height: 4px;
  }

  .countdown dd {
    font-size: clamp(44px, 15vw, 80px);
  }

  .count__foot {
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
  }
}

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

.foot {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 3vw, 40px) 22px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--cream);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .grain,
  .terminal__red::after,
  .sound::after,
  .countdown div:last-child dt::before {
    animation: none;
  }
}
