:root {
  --bg: #050505;
  --panel: #0b0b0c;
  --text: #f4f1ee;
  --muted: #9e9995;
  --dim: #5f5b59;
  --line: rgba(255, 255, 255, 0.14);
  --red: #ed1d32;
  --red-deep: #8d0715;
  --glow: rgba(237, 29, 50, 0.25);
  --display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);
}

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

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font: inherit;
}

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

button {
  color: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #050505;
  background: #fff;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.68);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 28px;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.brand__word {
  color: #d9d4d1;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--dim);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.header-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

.motion-story {
  position: relative;
  height: 420svh;
}

.motion-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 44%, rgba(237, 29, 50, 0.12), transparent 23rem),
    radial-gradient(circle at 75% 50%, rgba(95, 15, 22, 0.17), transparent 30rem),
    #050505;
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.48;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 0%, transparent 75%);
}

.stage-glow {
  position: absolute;
  width: 35vw;
  height: 35vw;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.18;
  pointer-events: none;
}

.stage-glow--left {
  top: 20%;
  left: -18%;
  background: var(--red);
}

.stage-glow--right {
  right: -18%;
  bottom: 5%;
  background: #70101d;
}

.stage-topline {
  position: absolute;
  z-index: 5;
  top: 105px;
  right: clamp(20px, 4vw, 64px);
  left: clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 13px;
}

.eyebrow {
  margin: 0;
  color: var(--red);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.stage-index {
  color: var(--dim);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.motion-visual {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 6%;
  width: min(53vw, 760px);
  height: min(78svh, 820px);
  transform: translateY(-46%);
}

.visual-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent 42%),
    #090909;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48), 0 0 90px rgba(237, 29, 50, 0.1);
}

.visual-frame::before {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  color: rgba(255, 255, 255, 0.26);
  content: "CAT / 01";
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

#motion-canvas,
#frame-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#frame-fallback {
  opacity: 1;
  transition: opacity 360ms ease;
}

#frame-fallback.is-hidden {
  opacity: 0;
}

#motion-canvas {
  opacity: 0;
  transition: opacity 360ms ease;
}

#motion-canvas.is-ready {
  opacity: 1;
}

.visual-scanline {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.045) 50%, transparent 100%);
  mix-blend-mode: screen;
  opacity: 0.2;
  animation: scan 5s linear infinite;
}

@keyframes scan {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(100%);
  }
}

.visual-corner {
  position: absolute;
  z-index: 4;
  width: 18px;
  height: 18px;
  border-color: var(--red);
  border-style: solid;
  opacity: 0.86;
}

.visual-corner--tl {
  top: 13px;
  left: 13px;
  border-width: 1px 0 0 1px;
}

.visual-corner--br {
  right: 13px;
  bottom: 13px;
  border-width: 0 1px 1px 0;
}

.visual-caption {
  display: flex;
  justify-content: space-between;
  padding: 13px 2px 0;
  color: var(--dim);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.17em;
}

.copy-stack {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: clamp(8%, 11vw, 17%);
  width: min(34vw, 430px);
  min-height: 260px;
  transform: translateY(-42%);
}

.copy-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(32px);
  filter: blur(5px);
  pointer-events: none;
  transition: opacity 500ms var(--ease), transform 700ms var(--ease), filter 500ms ease;
}

.copy-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.copy-panel h1,
.copy-panel h2,
.after-story h2 {
  margin: 19px 0 0;
  font: 900 clamp(3.5rem, 6.4vw, 7.5rem)/0.79 var(--display);
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.copy-panel h2 {
  font-size: clamp(3.2rem, 5.5vw, 6.4rem);
}

em {
  color: var(--red);
  font-style: normal;
}

.copy-panel__text {
  max-width: 34ch;
  margin: 27px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.75;
}

.motion-controls {
  position: absolute;
  z-index: 6;
  right: clamp(20px, 4vw, 64px);
  bottom: 60px;
  left: clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: auto auto minmax(120px, 1fr);
  align-items: center;
  gap: 22px;
}

.control-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 37px;
  border: 1px solid rgba(237, 29, 50, 0.58);
  padding: 0 14px;
  color: #fff;
  background: rgba(237, 29, 50, 0.09);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.control-button:hover {
  border-color: var(--red);
  background: rgba(237, 29, 50, 0.18);
}

.control-icon {
  color: var(--red);
  font-size: 0.65rem;
}

.frame-readout {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: var(--dim);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.frame-readout strong {
  color: #fff;
  font: 700 1.2rem/1 var(--display);
  letter-spacing: 0.06em;
}

.frame-seek {
  width: 100%;
  accent-color: var(--red);
  cursor: ew-resize;
}

.scroll-cue {
  position: absolute;
  z-index: 5;
  bottom: 141px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  transform: translateX(-50%);
  transition: opacity 260ms ease;
}

.scroll-cue.is-hidden {
  opacity: 0;
}

.scroll-cue__line {
  display: block;
  width: 1px;
  height: 28px;
  background: linear-gradient(var(--red), transparent);
  animation: cue 1.5s ease-in-out infinite;
}

@keyframes cue {
  50% {
    transform: translateY(7px);
  }
}

.story-meter {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.story-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red-deep), var(--red));
  box-shadow: 0 0 18px rgba(237, 29, 50, 0.72);
  transition: width 80ms linear;
}

.after-story {
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 82% 35%, rgba(237, 29, 50, 0.1), transparent 24rem),
    #080808;
}

.after-story__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 60px;
  width: min(100% - 48px, 1320px);
  margin: 0 auto;
  padding: clamp(90px, 12vw, 170px) 0;
}

.after-story h2 {
  max-width: 9ch;
  margin-top: 20px;
  font-size: clamp(3.8rem, 7vw, 8rem);
}

.after-story__copy {
  align-self: end;
  max-width: 44ch;
}

.after-story__copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.back-link {
  display: inline-flex;
  gap: 12px;
  margin-top: 28px;
  border-bottom: 1px solid var(--red);
  padding-bottom: 8px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .motion-story {
    height: 360svh;
  }

  .motion-stage {
    min-height: 680px;
  }

  .stage-topline {
    top: 92px;
  }

  .motion-visual {
    top: 55%;
    left: 50%;
    width: min(72vw, 520px);
    height: min(58svh, 570px);
    transform: translate(-50%, -50%);
  }

  .copy-stack {
    top: 19%;
    right: 24px;
    left: 24px;
    width: auto;
    min-height: 150px;
    transform: none;
  }

  .copy-panel h1,
  .copy-panel h2 {
    margin-top: 12px;
    font-size: clamp(3rem, 12vw, 5.5rem);
  }

  .copy-panel__text {
    display: none;
  }

  .motion-controls {
    grid-template-columns: auto auto;
    bottom: 39px;
    gap: 13px;
  }

  .frame-seek {
    grid-column: 1 / -1;
  }

  .scroll-cue {
    display: none;
  }

  .after-story__inner {
    grid-template-columns: 1fr;
    gap: 45px;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 64px;
  }

  .brand__word,
  .header-meta span:not(:last-child),
  .header-dot {
    display: none;
  }

  .stage-topline {
    top: 81px;
  }

  .motion-visual {
    top: 56%;
    width: calc(100vw - 38px);
    height: min(55svh, 520px);
  }

  .copy-stack {
    top: 16%;
  }

  .motion-controls {
    right: 19px;
    bottom: 25px;
    left: 19px;
  }

  .control-button {
    padding: 0 11px;
    font-size: 0.5rem;
  }

  .after-story__inner {
    width: min(100% - 38px, 1320px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
