:root {
  color-scheme: dark;
  --black: #050505;
  --ink: #0a0a0a;
  --paper: #f3f2ec;
  --muted: #a4a49f;
  --line: rgba(255, 255, 255, 0.14);
  --acid: #d9ff43;
  --cyan: #5ef2e1;
  --topbar: 68px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 25% 20%, rgba(73, 46, 133, 0.12), transparent 28rem),
    var(--black);
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.12;
  filter: blur(100px);
}

.ambient-a {
  top: 18%;
  left: 18%;
  background: #5d38ff;
}

.ambient-b {
  right: 10%;
  bottom: 4%;
  background: #02bfa9;
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--topbar);
  padding: 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 18px;
  height: 20px;
  object-fit: contain;
}

.brand-name {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-edition,
.eyebrow {
  color: var(--acid);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.feed-mode {
  color: #777;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.feed-mode span {
  margin-left: 8px;
  color: var(--acid);
}

.about-button,
.phone-button,
.install-button {
  border: 0;
  cursor: pointer;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 16px;
}

.about-button,
.phone-button {
  justify-self: end;
  padding: 8px 0;
  color: #aaa;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.phone-button {
  color: var(--acid);
}

.about-button:hover,
.phone-button:hover {
  color: white;
}

.layout {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(320px, 490px) minmax(180px, 1fr);
  height: 100svh;
  padding-top: var(--topbar);
}

.left-rail,
.right-rail {
  position: relative;
  height: calc(100svh - var(--topbar));
}

.left-rail {
  align-self: center;
  width: min(245px, calc(100% - 40px));
  margin-left: clamp(24px, 6vw, 96px);
}

.left-rail h1 {
  margin: 16px 0 18px;
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.rail-copy {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.rail-rule {
  width: 100%;
  height: 1px;
  margin: 27px 0 18px;
  background: var(--line);
}

.rail-stat {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.rail-stat strong {
  color: var(--acid);
  font-size: 25px;
  font-weight: 700;
}

.rail-stat span {
  color: #82827e;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.keyboard-guide {
  position: absolute;
  bottom: 28px;
  margin: 0;
  color: #696967;
  font-size: 10px;
  line-height: 2.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

kbd {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-right: 4px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
  color: #9b9b98;
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
}

.feed {
  height: calc(100svh - var(--topbar));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  touch-action: pan-y;
}

.feed::-webkit-scrollbar {
  display: none;
}

.feed-item {
  display: grid;
  min-height: calc(100svh - var(--topbar));
  padding: 14px 0;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.film {
  position: relative;
  width: min(100%, calc((100svh - var(--topbar) - 28px) * 0.5625));
  max-width: 470px;
  height: calc(100svh - var(--topbar) - 28px);
  max-height: 836px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #111;
  box-shadow:
    0 35px 80px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  transform: translateZ(0);
}

.film-backdrop {
  position: absolute;
  inset: -5%;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.52)),
    var(--poster);
  background-position: center;
  background-size: cover;
  filter: blur(30px) saturate(0.8);
  transform: scale(1.12);
}

.film-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  cursor: pointer;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.08);
}

.film.is-portrait .film-video {
  object-fit: cover;
}

.sound-start {
  position: absolute;
  z-index: 4;
  top: 62px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(5, 5, 5, 0.58);
  backdrop-filter: blur(14px);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  white-space: nowrap;
  transform: translate(-50%, -8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.sound-start strong {
  color: var(--acid);
  font-size: inherit;
}

.awaiting-audio .feed-item.is-active .sound-start {
  opacity: 1;
  transform: translate(-50%, 0);
}

.fullscreen-backdrop {
  position: absolute;
  z-index: 0;
  inset: -5%;
  display: none;
  width: 110%;
  height: 110%;
  pointer-events: none;
  object-fit: cover;
  opacity: 0.82;
  filter: blur(30px) saturate(1.15) brightness(0.62);
  transform: scale(1.08);
}

.film:fullscreen,
.film:-webkit-full-screen {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #050505;
}

.film.is-fallback-fullscreen {
  position: fixed;
  z-index: 200;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  background: #050505;
}

.has-fallback-fullscreen {
  overflow: hidden;
}

.film:fullscreen .film-backdrop,
.film:-webkit-full-screen .film-backdrop,
.film.is-fullscreen .film-backdrop {
  display: none;
}

.film:fullscreen .fullscreen-backdrop,
.film:-webkit-full-screen .fullscreen-backdrop,
.film.is-fullscreen .fullscreen-backdrop {
  display: block;
}

.film:fullscreen .film-video,
.film:-webkit-full-screen .film-video,
.film.is-fullscreen .film-video {
  object-fit: contain;
  background: transparent;
}

.film:fullscreen .film-topline,
.film:-webkit-full-screen .film-topline,
.film.is-fullscreen .film-topline {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  left: max(18px, env(safe-area-inset-left));
}

.film:fullscreen .film-copy,
.film:-webkit-full-screen .film-copy,
.film.is-fullscreen .film-copy {
  bottom: max(35px, calc(20px + env(safe-area-inset-bottom)));
  left: max(20px, env(safe-area-inset-left));
}

.film:fullscreen .actions,
.film:-webkit-full-screen .actions,
.film.is-fullscreen .actions {
  right: max(12px, env(safe-area-inset-right));
  bottom: max(34px, calc(20px + env(safe-area-inset-bottom)));
}

.film::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.86) 0, rgba(0, 0, 0, 0.17) 32%, transparent 55%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.43), transparent 20%);
}

.film-topline,
.film-copy,
.actions,
.progress-wrap,
.center-play {
  position: absolute;
  z-index: 3;
}

.film-topline {
  inset: 18px 18px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.film-category {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.film-number {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.film-copy {
  right: 76px;
  bottom: 35px;
  left: 20px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.film-copy h2 {
  max-width: 340px;
  margin: 8px 0 7px;
  font-size: clamp(27px, 4vh, 41px);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.film-copy p {
  max-width: 315px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.cut-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--acid);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cut-label::before {
  width: 15px;
  height: 1px;
  content: "";
  background: currentColor;
}

.actions {
  right: 9px;
  bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-unit {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.action {
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  place-items: center;
  cursor: pointer;
  color: white;
  background: rgba(8, 8, 8, 0.42);
  backdrop-filter: blur(12px);
  transition:
    transform 150ms ease,
    color 150ms ease,
    background 150ms ease;
}

.action:hover {
  transform: scale(1.07);
  background: rgba(255, 255, 255, 0.15);
}

.action.is-on {
  color: #050505;
  background: var(--acid);
}

.action[data-action="dislike"].is-on {
  color: white;
  background: #ff4f6d;
}

.action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.action-caption {
  max-width: 58px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.center-play {
  top: 50%;
  left: 50%;
  display: grid;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  color: white;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(15px);
  transform: translate(-50%, -50%) scale(0.82);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.film.is-paused .center-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.center-play svg {
  width: 24px;
  margin-left: 4px;
  fill: currentColor;
}

.progress-wrap {
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
}

.progress {
  width: 0%;
  height: 100%;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(217, 255, 67, 0.55);
}

.retry-button {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: none;
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  cursor: pointer;
  color: white;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 800;
  transform: translate(-50%, -50%);
}

.film.has-error .retry-button {
  display: block;
}

.film.has-error .center-play {
  display: none;
}

.right-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-left: clamp(38px, 4vw, 76px);
}

.position {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #757572;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.position #currentPosition {
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
}

.position-rule {
  width: 28px;
  height: 1px;
  background: #555;
}

.mini-track {
  display: flex;
  flex-direction: column;
  width: 2px;
  height: min(42vh, 320px);
  margin: 18px 0 15px 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.mini-segment {
  flex: 1;
  background: transparent;
  transition: background 180ms ease;
}

.mini-segment.is-past {
  background: rgba(217, 255, 67, 0.28);
}

.mini-segment.is-current {
  background: var(--acid);
}

.right-rail p {
  margin: 0;
  color: #5f5f5c;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
}

.about-dialog,
.phone-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  color: var(--paper);
  background: #111;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
}

.phone-dialog {
  width: min(780px, calc(100vw - 32px));
}

.about-dialog::backdrop,
.phone-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
}

.about-dialog h2,
.phone-dialog h2,
.details-sheet h2 {
  margin: 14px 0 20px;
  font-size: 42px;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.about-dialog p,
.phone-dialog p,
.details-sheet p {
  color: #a9a9a4;
  font-size: 14px;
  line-height: 1.65;
}

.phone-dialog-grid {
  display: grid;
  grid-template-columns: 270px 1fr;
  align-items: center;
  gap: 38px;
}

.phone-qr-wrap {
  padding: 18px;
  border-radius: 18px;
  background: white;
}

.phone-qr-wrap img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.phone-dialog strong {
  color: var(--paper);
}

.phone-dialog code {
  display: block;
  margin-top: 18px;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--cyan);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
}

.phone-dialog .phone-note {
  margin-bottom: 0;
  color: #777;
  font-size: 11px;
}

.install-button {
  margin-top: 8px;
  padding: 11px 14px;
  border-radius: 999px;
  color: #050505;
  background: var(--acid);
  font-size: 11px;
  font-weight: 800;
}

.dialog-close,
.sheet-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: #aaa;
  background: transparent;
  font-size: 28px;
  font-weight: 200;
}

dl {
  margin: 28px 0 0;
  border-top: 1px solid var(--line);
}

dl div {
  display: grid;
  grid-template-columns: 100px 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

dt {
  color: #777;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

dd {
  margin: 0;
  color: #d5d5d0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.details-sheet {
  position: fixed;
  z-index: 51;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #0c0c0c;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
  transform: translateX(105%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.details-sheet.is-open {
  transform: translateX(0);
}

.sheet-poster {
  height: 42vh;
  min-height: 300px;
  background-image:
    linear-gradient(to top, #0c0c0c, transparent 55%),
    var(--sheet-poster);
  background-position: center;
  background-size: cover;
}

.sheet-copy {
  margin-top: -45px;
  padding: 0 34px 40px;
}

.sheet-copy h2 {
  font-size: 46px;
}

.sheet-scrim {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  padding: 0;
  border: 0;
  cursor: default;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(7px);
}

.sheet-scrim.is-open {
  display: block;
}

.toast {
  position: fixed;
  z-index: 80;
  bottom: 24px;
  left: 50%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  color: #111;
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  font-weight: 700;
  transform: translate(-50%, 14px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 30px;
  place-items: center;
  color: white;
  background: black;
}

@media (max-width: 960px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 18px;
  }

  .brand-edition,
  .left-rail,
  .right-rail {
    display: none;
  }

  .layout {
    display: block;
  }

  .feed {
    width: 100%;
  }

  .film {
    width: min(470px, 100%);
  }
}

@media (max-width: 620px) {
  :root {
    --topbar: calc(54px + env(safe-area-inset-top));
  }

  .topbar {
    display: flex;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 13px 0;
  }

  .brand-name {
    font-size: 17px;
  }

  .about-button {
    display: none;
  }

  .feed-mode {
    position: absolute;
    left: 50%;
    white-space: nowrap;
    transform: translateX(-50%);
  }

  .phone-button {
    font-size: 0;
  }

  .phone-button::after {
    color: var(--acid);
    content: "INSTALL";
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
  }

  .feed-item {
    padding: 0;
  }

  .film {
    width: 100%;
    height: calc(100svh - var(--topbar));
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .film-topline {
    top: 65px;
  }

  .sound-start {
    top: 103px;
  }

  .film-copy {
    bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .actions {
    bottom: calc(31px + env(safe-area-inset-bottom));
  }

  .about-dialog {
    padding: 38px 25px 28px;
  }

  .about-dialog h2,
  .phone-dialog h2 {
    font-size: 36px;
  }

  .phone-dialog {
    max-height: calc(100svh - 24px);
    padding: 38px 24px 24px;
  }

  .phone-dialog-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 22px;
  }

  .phone-qr-wrap {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
