/* ==========================================================================
   deviantmovie.com
   Animaxxing tokens (monochrome editorial) plus the film's own mark: the
   title glitch. The two glitch hues are the only colour on the site and
   are used by nothing but the title treatment.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --canvas: #0a0a0a;
  --foreground: #ededed;
  --muted: #a3a3a3;
  --border: #262626;
  --surface: #171717;
  --surface-hover: #262626;
  --inverse: #ededed;
  --inverse-hover: #d4d4d4;
  --inverse-foreground: #0a0a0a;
  --focus: #ededed;
  --selection: #ededed;
  --selection-foreground: #0a0a0a;

  /* The film's title glitch. Chromatic aberration, nowhere else. */
  --glitch-a: #ff1fd0;
  --glitch-b: #19e4ff;

  --font-sans: "Rethink Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --spacing-gutter: 1.5rem;
  --spacing-gutter-lg: 2.5rem;
  --spacing-section: 4rem;

  --radius-xs: 0.125rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;

  --border-width-hairline: 1px;
  --border-width-strong: 2px;

  --text-poster: clamp(3.25rem, 18cqi, 15rem);
  --text-statement: clamp(2.75rem, 7cqi, 4.5rem);
  --text-display: 2.25rem;
  --text-title: 1.5rem;
  --text-lead: 1.125rem;
  --text-body: 1rem;
  --text-caption: 0.75rem;
  --text-annotation: 0.6875rem;

  --max-width: 80rem;
}

/* Dark is the default; light is the pinned exception. */
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #ffffff;
  --foreground: #171717;
  --muted: #525252;
  --border: #d4d4d4;
  --surface: #fafafa;
  --surface-hover: #f0f0f0;
  --inverse: #171717;
  --inverse-hover: #404040;
  --inverse-foreground: #ffffff;
  --focus: #171717;
  --selection: #171717;
  --selection-foreground: #ffffff;
}

/* Blend colours only while the scheme switches. */
:root.theme-transitioning,
:root.theme-transitioning *,
:root.theme-transitioning *::before,
:root.theme-transitioning *::after {
  transition-duration: 0.25s !important;
  transition-property: background-color, border-color, color, fill, outline-color, stroke, text-decoration-color !important;
  transition-timing-function: linear !important;
}

@media (prefers-reduced-motion: reduce) {
  :root.theme-transitioning,
  :root.theme-transitioning *,
  :root.theme-transitioning *::before,
  :root.theme-transitioning *::after {
    transition-duration: 0s !important;
  }
}

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

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1,
h2,
h3,
p {
  margin: 0;
}

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

button {
  cursor: pointer;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

code,
pre {
  font-variant-ligatures: none;
}

img,
canvas,
iframe {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: var(--border-width-strong) solid var(--focus);
  outline-offset: 2px;
}

::selection {
  background: var(--selection);
  color: var(--selection-foreground);
}

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

/* --------------------------------------------------------------------------
   Pre-paint hiding. Only under the JavaScript mark, only in the initial
   phase. Without JavaScript nothing is hidden.
   -------------------------------------------------------------------------- */
html[data-motion="js"] [data-page][data-phase="initial"] [data-intro],
html[data-motion="js"] [data-page][data-phase="initial"] [data-page-transition],
html[data-motion="js"] [data-page][data-phase="initial"] [data-speak-intro],
html[data-motion="js"] [data-page][data-phase="initial"] [data-particle-button],
html[data-motion="js"] [data-page][data-phase="initial"] [data-reveal],
html[data-motion="js"] [data-page][data-phase="initial"] [data-split-heading] {
  visibility: hidden;
}

/* --------------------------------------------------------------------------
   Type roles
   -------------------------------------------------------------------------- */
.poster {
  font-family: var(--font-sans);
  font-size: var(--text-poster);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.045em;
  font-kerning: none;
  text-wrap: balance;
  margin-inline-start: -0.055em;
}

.statement {
  max-width: 18ch;
  font-family: var(--font-sans);
  font-size: var(--text-statement);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-kerning: none;
  text-wrap: balance;
}

.display {
  font-family: var(--font-sans);
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.045em;
  font-kerning: none;
}

.title {
  font-family: var(--font-sans);
  font-size: var(--text-title);
  line-height: 2rem;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.lead {
  font-size: var(--text-lead);
  line-height: 1.75rem;
  max-width: 42ch;
  text-wrap: pretty;
}

.body {
  font-size: var(--text-body);
  line-height: 1.5rem;
  max-width: 68ch;
  text-wrap: pretty;
}

.body--narrow {
  max-width: 42ch;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  line-height: 1rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.label--strong {
  color: var(--foreground);
}

.annotation {
  font-family: var(--font-mono);
  font-size: var(--text-annotation);
  line-height: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 46ch;
}

.figure {
  font-family: var(--font-mono);
  font-size: var(--text-annotation);
  line-height: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Chips and buttons
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.625rem;
  border-radius: var(--radius-xl);
  border: var(--border-width-strong) solid var(--foreground);
  padding: 0 1.25rem;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--foreground);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover {
  background: var(--surface-hover);
}

.chip--small {
  height: 2.5rem;
  border-radius: var(--radius-lg);
  padding: 0 1rem;
  font-size: var(--text-caption);
}

.chip--quiet {
  border-color: var(--border);
  color: var(--muted);
}

.chip--quiet:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.button:focus-visible {
  outline-offset: 4px;
}

.button--solid {
  background: var(--inverse);
  color: var(--inverse-foreground);
  border: var(--border-width-strong) solid var(--inverse);
}

.button--solid:hover {
  background: var(--inverse-hover);
  border-color: var(--inverse-hover);
}

.button--outline {
  background: transparent;
  color: var(--foreground);
  border: var(--border-width-strong) solid var(--foreground);
}

.button--outline:hover {
  background: var(--surface-hover);
}

@media (min-width: 40rem) {
  .button {
    padding: 1rem 2rem;
    font-size: 3rem;
  }
}

/* A particle-treated control: the canvas bleeds out past its target. */
.particle {
  position: relative;
  isolation: isolate;
  display: inline-block;
}

.particle > canvas {
  position: absolute;
  max-width: none;
  pointer-events: none;
  color: var(--foreground);
}

.particle--under > canvas {
  z-index: 0;
}

.particle--over > canvas {
  z-index: 2;
}

.particle > .button,
.particle > .chip,
.particle > a {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.section {
  padding: 2.5rem var(--spacing-gutter) var(--spacing-section);
}

.section__inner {
  margin: 0 auto;
  width: 100%;
  max-width: var(--max-width);
}

.section--ruled {
  border-top: var(--border-width-hairline) solid var(--border);
}

@media (min-width: 40rem) {
  .section {
    padding-left: var(--spacing-gutter-lg);
    padding-right: var(--spacing-gutter-lg);
  }
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: var(--border-width-hairline) solid var(--border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 2rem;
  margin-top: 2rem;
}

.col-12 {
  grid-column: span 12;
}

@media (min-width: 64rem) {
  .lg\:col-4 {
    grid-column: span 4;
  }
  .lg\:col-5 {
    grid-column: span 5;
  }
  .lg\:col-7 {
    grid-column: span 7;
  }
  .lg\:col-8 {
    grid-column: span 8;
  }
}

.shell-footer {
  margin-top: auto;
  border-top: var(--border-width-hairline) solid var(--border);
  padding: 2.5rem var(--spacing-gutter);
}

.shell-footer__row {
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: var(--max-width);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.shell-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.shell-footer a {
  transition: color 0.2s;
}

.shell-footer a:hover {
  color: var(--foreground);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  margin: -0.5rem -0.25rem;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.toggle:hover {
  color: var(--foreground);
}

.toggle__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1px solid currentColor;
}

:root:not([data-theme="light"]) .toggle__dot {
  background: currentColor;
}

@media (min-width: 40rem) {
  .shell-footer {
    padding-left: var(--spacing-gutter-lg);
    padding-right: var(--spacing-gutter-lg);
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

@media (min-width: 48rem) {
  .hero {
    padding-top: 4rem;
  }
}

.hero__inner {
  container-type: inline-size;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: var(--border-width-hairline) solid var(--border);
}

@media (min-width: 48rem) {
  .hero__meta > span + span::before {
    content: "·";
    margin-right: 1.5rem;
    color: var(--border);
  }
}

/* The title mark, shared by every page that carries it. The film's title
   card is tall and tight: the line is stretched from its top and the extra
   height reserved below so nothing under it moves. */
.mark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 1.5rem;
  font-size: clamp(4.5rem, 26cqi, 26rem);
  transform: scaleY(1.22);
  transform-origin: 50% 0;
  margin-bottom: 0.2em;
}

.mark__title {
  position: relative;
  z-index: 1;
  font-size: 1em;
  line-height: 0.84;
  padding: 0.03em 0;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Glitch layers: clones of the title, clipped to bands and pushed sideways.
   Ink bands sit over the heading; the two fringe copies sit under it, so
   their colour shows only where they peek past the letter edges. */
.glitch-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
  will-change: transform, clip-path;
}

.glitch-layer--ink {
  z-index: 2;
  color: var(--foreground);
}

.glitch-layer--a {
  z-index: 0;
  color: var(--glitch-a);
}

.glitch-layer--b {
  z-index: 0;
  color: var(--glitch-b);
}

.glitch-bits {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.glitch-bit {
  position: absolute;
  visibility: hidden;
  background: var(--foreground);
}

.glitch-bit--erase {
  background: var(--canvas);
}

.glitch-bit--a {
  background: var(--glitch-a);
}

.glitch-bit--b {
  background: var(--glitch-b);
}

.hero__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
  row-gap: 2.5rem;
  margin-top: 2.5rem;
}

.hero__logline {
  grid-column: span 12;
  font-family: var(--font-sans);
  font-size: clamp(1.375rem, 2.6cqi, 2rem);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.01em;
  max-width: 34ch;
  text-wrap: pretty;
}

.hero__logline strong {
  font-weight: 800;
}

.hero__actions {
  grid-column: span 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.5rem;
}

@media (min-width: 64rem) {
  .hero__logline {
    grid-column: span 8;
  }
  .hero__actions {
    grid-column: span 12;
  }
}

/* --------------------------------------------------------------------------
   Watch
   -------------------------------------------------------------------------- */
.player {
  position: relative;
  margin-top: 1.5rem;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--surface);
  border: var(--border-width-strong) solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.player__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.player__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.4s;
}

.player__poster:hover img,
.player__poster:focus-visible img {
  filter: grayscale(0.6) contrast(1.05);
}

.player__play {
  position: absolute;
  left: var(--spacing-gutter);
  bottom: var(--spacing-gutter);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--canvas);
  color: var(--foreground);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.player__play svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.player__meta {
  position: absolute;
  right: var(--spacing-gutter);
  bottom: var(--spacing-gutter);
  background: var(--canvas);
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
}

.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (min-width: 40rem) {
  .player__play {
    left: var(--spacing-gutter-lg);
    bottom: var(--spacing-gutter-lg);
    font-size: 2.25rem;
    padding: 1rem 1.5rem;
  }
  .player__meta {
    right: var(--spacing-gutter-lg);
    bottom: var(--spacing-gutter-lg);
  }
}

.watch__note {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  justify-content: space-between;
  align-items: center;
}

.watch__note .annotation {
  max-width: none;
}

/* --------------------------------------------------------------------------
   Story
   -------------------------------------------------------------------------- */
.story__statement {
  margin-top: 2rem;
  container-type: inline-size;
}

.story__copy {
  display: grid;
  gap: 1.25rem;
}

.story__copy p + p {
  margin-top: 0;
}

.comps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   Ledgers
   -------------------------------------------------------------------------- */
.ledger {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.ledger__row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 1.5rem;
  align-items: start;
  border-bottom: var(--border-width-hairline) solid var(--border);
  padding: 1rem 0;
}

.ledger__num {
  padding-top: 0.35rem;
}

.ledger__name {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.ledger__role {
  margin-top: 0.35rem;
}

.ledger__desc {
  grid-column: 2;
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 52ch;
  text-wrap: pretty;
}

@media (min-width: 64rem) {
  .ledger__row {
    grid-template-columns: 4rem 18rem minmax(0, 1fr);
    align-items: baseline;
    padding: 1.25rem 0;
  }
  .ledger__role {
    margin-top: 0.5rem;
  }
  .ledger__desc {
    grid-column: auto;
    margin-top: 0;
  }
  .ledger__name {
    font-size: 2.25rem;
  }
}

/* Facts: label left, value right. */
.facts {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.facts__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  border-bottom: var(--border-width-hairline) solid var(--border);
  padding: 0.75rem 0;
}

.facts__value {
  margin: 0;
  font-weight: 800;
  text-align: right;
  letter-spacing: -0.01em;
}

.comps > .label {
  align-self: center;
}

.credits__copy {
  padding-top: 1.5rem;
}
