@font-face {
  font-family: DM Sans;
  src: url(/static/fonts/dm-sans.woff2) format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: Space Mono;
  src: url(/static/fonts/space-mono.woff2) format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #11111a;
  --panel: #181823;
  --line: #323242;
  --ink: #f9f8ff;
  --muted: #bbb9cb;
  --accent: #cabbff;
  --blue: #a4d5fa;
  --display: "DM Sans", sans-serif;
  --mono: "Space Mono", monospace;
  font: 1rem/1.5 var(--display);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
.shell { width: min(100% - 5rem, 1280px); margin-inline: auto; }

.masthead { border-bottom: 1px solid #252536; background: #14141e; }
.mast-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; gap: .75rem; align-items: center; font-weight: 650; font-size: 1.15rem; text-decoration: none; letter-spacing: -.025em; }
.brand b { color: var(--accent); font-weight: 750; }
.brand-mark { display: flex; align-items: center; width: 31px; height: 27px; }
.brand-mark i { width: 18px; height: 24px; flex: none; background: var(--accent); border-radius: 2px; clip-path: polygon(100% 0, 100% 100%, 0 50%); }
.brand-mark i + i { margin-left: -5px; background: var(--blue); }

.button {
  min-height: 48px;
  min-width: 44px;
  padding: .67rem 1.12rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  font-weight: 750;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease;
}
.primary { background: var(--accent); color: #1b142c; }
.primary:hover { background: #e2d9ff; }
.secondary { background: #191925; color: var(--ink); border-color: #49475c; }
.secondary:hover { background: #29283a; border-color: var(--accent); }
.compact { min-height: 42px; font-size: .9rem; }
.text-button { background: transparent; padding-inline: .5rem; color: var(--muted); }
.text-button:hover { color: var(--ink); }
.play-icon { display: inline-block; width: 11px; height: 12px; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }

.hero {
  position: relative;
  isolation: isolate;
  margin-top: 2.25rem;
  min-height: clamp(480px, 42vw, 590px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #333448;
  border-radius: .85rem;
  background: #212636 url(/static/media/hero.webp) center 54% / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, #12121ef2 0%, #171725df 25%, #17172582 53%, #10131d15 100%),
              linear-gradient(0deg, #10111c99, transparent 46%);
}
.hero-content { padding: clamp(2rem, 6vw, 5.2rem); max-width: 760px; }
.eyebrow { font: 400 .8rem/1.5 var(--mono); letter-spacing: .105em; text-transform: uppercase; }
.hero-label { display: flex; align-items: center; gap: .75rem; color: #ded7ff; margin-bottom: 1.2rem; }
.hero-label span { width: 1.65rem; height: 1px; background: var(--accent); }
.hero h1 { font-size: clamp(3.75rem, 7.7vw, 7.3rem); font-weight: 800; letter-spacing: -.086em; line-height: .96; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-description { margin-top: 1.4rem; max-width: 29rem; color: #dedbea; font-size: clamp(1rem, 1.5vw, 1.2rem); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero .secondary { background: #1b1b2ac9; }
.hero .secondary:hover { background: #33304b; }
.home-note { max-width: 29rem; margin-top: 1rem; color: #d3cfdf; font-size: .9rem; }
.hero-edge { position: absolute; inset: auto 1.3rem 1.3rem auto; width: 20px; height: 20px; border-right: 1px solid #d5cdff9c; border-bottom: 1px solid #d5cdff9c; }

.inside { margin-block: 2.3rem 2rem; }
.inside h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); letter-spacing: -.045em; margin-bottom: .9rem; }
.preview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; }
.preview-card { display: flex; align-items: center; gap: 1.05rem; padding: 1rem; min-width: 0; border: 1px solid var(--line); background: var(--panel); border-radius: .65rem; }
.preview-card h3 { font-size: 1.04rem; letter-spacing: -.025em; margin-bottom: .2rem; }
.preview-card p { color: var(--muted); font-size: .92rem; }
.preview-art { position: relative; flex: 0 0 75px; height: 76px; border-radius: .35rem; overflow: hidden; }
.favorites-art { background: #292540; }
.favorites-art :is(span, i, b) { position: absolute; display: block; width: 26px; height: 42px; border-radius: 2px; border: 1px solid #cabbff7a; background-size: cover; background-position: center; }
.favorites-art span { top: 18px; left: 10px; transform: rotate(-13deg); background-image: url(/static/media/woodland.jpg); }
.favorites-art i { top: 13px; left: 24px; z-index: 1; background-image: url(/static/media/orbital.jpg); }
.favorites-art b { top: 18px; left: 38px; transform: rotate(13deg); background-image: url(/static/media/city.jpg); }
.rhythm-art { display: flex; justify-content: center; align-items: end; gap: 3px; padding: 14px; background: #202e44; }
.rhythm-art i { width: 6px; height: 32%; background: #a4d5fa; border-radius: 2px 2px 0 0; }
.rhythm-art i:nth-child(2n) { height: 58%; background: #697db0; }
.rhythm-art i:nth-child(3n) { height: 77%; }
.rhythm-art i:nth-child(5) { height: 98%; background: #d3eaff; }
.company-art { display: grid; place-content: center; background: #30253f; }
.company-art i { grid-area: 1/1; width: 50px; height: 50px; border: 1px solid #d4b8ff65; border-radius: 50%; align-self: center; justify-self: center; }
.company-art i:nth-child(2) { width: 34px; height: 34px; }
.company-art i:nth-child(3) { width: 17px; height: 17px; background: #cabbff; }

.journey { max-width: 1050px; margin: 1.4rem auto 2rem; }
.journey-tools { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.journey-tools .eyebrow, .chapter-nav .eyebrow { color: var(--muted); text-align: center; }
.journey-tools label { display: flex; align-items: center; gap: .4rem; font-size: .9rem; color: var(--muted); }
select { min-height: 42px; border: 1px solid var(--line); border-radius: .35rem; background: var(--panel); padding: .25rem .4rem; color: var(--ink); }
.chapter-steps { display: flex; gap: .34rem; margin: .2rem 0 .45rem; }
.chapter-steps button { flex: 1; border: 0; border-radius: 2px; height: 32px; padding: 12px 0; background: transparent; }
.chapter-steps button::after { content: ""; height: 5px; display: block; background: #45445a; border-radius: 3px; }
.chapter-steps .complete::after { background: #887bb5; }
.chapter-steps button[aria-current="step"]::after { background: var(--accent); }
.chapter-steps button:hover::after { background: var(--blue); }
html:has(#journey:not([hidden])) { overscroll-behavior-x: none; }
.scene {
  --scene-height: min(590px, 72vh);
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: var(--scene-height);
  padding: clamp(1.45rem, 6vw, 4.5rem);
  border: 1px solid #3a374d;
  border-radius: .85rem;
  overflow: hidden;
  background: #1a1928;
  touch-action: pan-y pinch-zoom;
}
.scene ::selection { background: var(--accent); color: var(--bg); }
.scene-backdrops { position: absolute; inset: 0 0 auto; height: var(--scene-height); z-index: -1; pointer-events: none; mask-image: linear-gradient(#000 65%, transparent); }
.scene-frame { position: absolute; inset: 0; opacity: 0; }
.scene-frame.is-current { z-index: 1; opacity: 1; }
.scene-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #141320f5 4%, #141320da 40%, #1413206b), linear-gradient(0deg, #141320d9, transparent); }
.scene-art { width: 100%; height: 100%; object-fit: cover; }
.scene .eyebrow { color: var(--accent); margin-bottom: .8rem; }
.scene h1, .scene h2 { font-size: clamp(2.2rem, 6vw, 5rem); line-height: .99; font-weight: 800; letter-spacing: -.075em; overflow-wrap: anywhere; max-width: 48rem; }
.scene p:not(.eyebrow) { color: #ddd9ed; max-width: 43rem; margin-top: .9rem; font-size: clamp(1rem, 2vw, 1.15rem); }
.scene .display { color: var(--accent); font-size: clamp(3.6rem, 11vw, 8rem); line-height: .96; letter-spacing: -.095em; }
.scene .watcher-rank { font-size: clamp(2.4rem, 8vw, 5.75rem); letter-spacing: -.075em; }
.scene .button { justify-self: start; margin-top: 1.1rem; }
.scene .footnote { font-size: .9rem !important; color: var(--muted) !important; }
.scene[data-theme="rhythm"] { background: #182437; border-color: #314760; }
.scene[data-theme="rhythm"] .eyebrow { color: var(--blue); }
.scene[data-theme="genres"] { align-content: start; background: #25213a; }
.scene[data-theme="server"] { background: #1f2035; }
.scene[data-theme="credits"] {
  padding-inline: clamp(.85rem, 3vw, 2rem);
  background: radial-gradient(ellipse at 50% 30%, #302941, #161622 78%);
}
.scene:has(.poster-wall) { padding-block: clamp(6.7rem, 12vw, 9.5rem) clamp(6rem, 10vw, 8rem); }
.wrap-summary {
  position: relative;
  max-width: 39rem;
  margin-inline: auto;
  padding: clamp(1rem, 4vw, 2.15rem);
  border: 1px solid #8e89a560;
  border-radius: .75rem;
  background: #181725f5;
  box-shadow: 0 .75rem 2.25rem #09081574;
}
.wrap-summary h2 { text-align: center; }
.wrap-brand { display: flex; justify-content: center; gap: .55rem; margin-bottom: .75rem; font-size: .95rem; }
.poster-wall {
  --poster-width: clamp(4.5rem, 11vw, 8rem);
  --poster-gap: clamp(.35rem, 1vw, .65rem);
  position: absolute;
  inset: .65rem 0;
  z-index: -1;
  display: grid;
  align-content: space-between;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.poster-row { overflow: hidden; }
.poster-track { display: flex; width: max-content; gap: var(--poster-gap); }
.poster-tile {
  flex: 0 0 var(--poster-width);
  width: var(--poster-width);
  aspect-ratio: 2 / 3;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #c4b9e14d;
  border-radius: .4rem;
  background: linear-gradient(140deg, #423852, #242738);
}
.poster-tile span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  overflow-wrap: anywhere;
  margin-inline: .35rem;
  text-align: center;
  font-size: .75rem;
  line-height: 1.15;
}
.poster-tile img { position: absolute; inset: 0; }
.scene .poster-motion { position: absolute; right: .75rem; bottom: .75rem; margin: 0; background: #191925f2; }
.chapter-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .6rem;
  margin-top: .8rem;
}
.chapter-nav #back { justify-self: start; }
.chapter-nav #next { justify-self: end; }
.recap-actions { grid-column: 1 / -1; justify-self: center; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: 1.55rem; }
.scene:is([data-theme="time"], [data-theme="rhythm"]) .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.scene[data-theme="credits"] .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 42rem; }
.scene[data-theme="credits"] .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
.stat { display: grid; border-top: 1px solid #8e89a560; padding-top: .6rem; }
.stat strong { font-size: clamp(1.25rem, 2.8vw, 2.25rem); letter-spacing: -.05em; overflow-wrap: anywhere; }
.stat span { font-size: .9rem; color: #d1cede; }
.media-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: .75rem; margin-top: 1.2rem; }
.media-card { min-width: 0; max-width: 10rem; }
.media-card strong { display: block; margin-top: .35rem; line-height: 1.25; overflow-wrap: anywhere; }
.media-card > span { color: var(--muted); font-size: .86rem; }
.media-poster { aspect-ratio: 2 / 3; overflow: hidden; border-radius: .4rem; border: 1px solid #c4b9e162; background: #37334c; }
.media-image { width: 100%; height: 100%; object-fit: cover; }
.genres { margin-top: 1.1rem; }
.genre-panel { border-top: 1px solid #b1a7d140; }
.genre-panel:last-child { border-bottom: 1px solid #b1a7d140; }
.genre-summary {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  width: 100%;
  min-height: 44px;
  padding: .6rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.genre-summary::before { content: ''; width: .45rem; height: .45rem; margin-left: .2rem; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(-45deg); }
.genre-summary[aria-expanded="true"]::before { transform: rotate(45deg); }
.genre-content { display: grid; grid-template-rows: 0fr; opacity: 0; }
.genre-summary[aria-expanded="true"] + .genre-content { grid-template-rows: 1fr; opacity: 1; }
.genre-content > div { min-height: 0; overflow: hidden; }
.genre-title { display: grid; overflow-wrap: anywhere; }
.genre-title small { color: var(--muted); font-size: .88rem; }
.genre-runtime { color: var(--muted); font: .85rem var(--mono); }
.genres .media-cards { margin: .25rem 0 .85rem 1.6rem; }
.leaderboard { width: min(100%, 42rem); margin-top: 1.3rem; border-collapse: collapse; text-align: left; }
.leaderboard :is(th, td) { padding: .55rem .65rem; border-bottom: 1px solid #b1a7d140; overflow-wrap: anywhere; }
.leaderboard thead th { color: var(--muted); font-size: .85rem; }
.leaderboard tr > :first-child { width: 4rem; }
.leaderboard tr > :last-child { text-align: right; white-space: nowrap; }
.leaderboard .you { color: var(--accent); background: #cabbff16; }
.leaderboard .you span { color: var(--muted); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .25rem; padding: 0; margin: 1.2rem 0 0; list-style: none; }
.month {
  display: grid;
  grid-template-rows: 7rem auto;
  justify-items: center;
  align-items: end;
  gap: .3rem;
  width: 100%;
  padding: .2rem 0;
  border: 0;
  border-radius: .3rem;
  color: var(--ink);
  background: transparent;
  font: .75rem var(--mono);
}
.month .bar { width: 75%; max-width: 40px; border-radius: 3px 3px 0 0; background: #78a1cf; }
.month .peak { background: #c5e7ff; }
.month:focus-visible { outline-offset: -2px; }
.month[aria-pressed="true"] { background: #a4d5fa24; box-shadow: inset 0 0 0 1px #a4d5fa80; }
.scene p.month-total { margin-top: .55rem; font-size: .9rem; }

dialog { width: min(100% - 2rem, 30rem); max-height: calc(100dvh - 2rem); padding: 2rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; }
dialog::backdrop { background: #0c0b14d9; }
dialog h2 { font-size: 2.15rem; letter-spacing: -.06em; margin: .3rem 0; }
dialog p:not(.eyebrow) { color: var(--muted); }
.accent { color: var(--accent); }
.close { position: absolute; top: .65rem; right: .65rem; width: 42px; height: 42px; border: 0; border-radius: .3rem; background: transparent; color: var(--ink); font-size: 1.5rem; }
.close:hover { background: #343248; }
form { display: grid; gap: .9rem; margin-top: 1.3rem; }
form label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 700; }
input { width: 100%; min-height: 45px; border: 1px solid #55546a; background: #10101a; border-radius: .35rem; padding: .55rem .65rem; color: var(--ink); }
.message:not(:empty), #dialog-demo { margin-top: .9rem; }

@media (max-width: 920px) {
  .shell { width: calc(100% - 3rem); }
  .preview-card { align-items: start; flex-direction: column; }
  .preview-art { flex: none; width: 75px; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 1.5rem); }
  .mast-inner { min-height: 62px; }
  .hero { margin-top: .85rem; min-height: 510px; align-items: end; background-position: 64% center; }
  .hero::before { background: linear-gradient(0deg, #141420 3%, #141420e8 43%, #1414202b 85%), linear-gradient(90deg, #14142070, transparent); }
  .hero-content { padding: 1.35rem 1.15rem 2rem; }
  .hero h1 { font-size: clamp(3.15rem, 13vw, 5rem); }
  .hero-description { margin-top: 1rem; }
  .hero-edge { display: none; }
  .actions { margin-top: 1.25rem; gap: .5rem; }
  .actions .button { padding-inline: .7rem; font-size: .92rem; }
  .inside { margin-top: 1.45rem; }
  .preview-grid { grid-template-columns: 1fr; gap: .5rem; }
  .preview-card { flex-direction: row; align-items: center; padding: .65rem; }
  .preview-art { transform: scale(.86); }
  .journey { margin-top: .55rem; }
  .journey-tools .eyebrow { font-size: .7rem; letter-spacing: .035em; }
  .scene { --scene-height: min(480px, 68vh); }
  .scene-still { object-position: 76% center; }
  .chapter-nav .button { padding-inline: .6rem; font-size: .9rem; }
  .chapter-nav .eyebrow { font-size: .68rem; }
  .months { column-gap: .12rem; }
  .month { grid-template-rows: 5rem auto; font-size: .68rem; }
  .scene:is([data-theme="time"], [data-theme="rhythm"]) .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.6rem), 1fr)); gap: .6rem; }
  .genres .media-cards { margin-left: 0; }
  .leaderboard :is(th, td) { padding-inline: .4rem; }
}

@media (max-width: 385px) {
  .months { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem .25rem; }
  .month { grid-template-rows: 3.5rem auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .scene-frame { transition: opacity .55s ease; }
  .scene > .scene-body { animation: reveal .32s ease-out both; }
  .genre-content { transition: grid-template-rows .28s ease, opacity .22s ease; }
  .genre-summary::before { transition: transform .22s ease; }
  .poster-track { animation: scroll-posters 4.5s linear infinite; }
  .poster-track.is-reversed { animation-direction: reverse; }
  .poster-wall.is-paused .poster-track { animation-play-state: paused; }
  @keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes scroll-posters { to { transform: translateX(calc(-1 * (var(--poster-width) + var(--poster-gap)))); } }
}
@media (prefers-reduced-motion: reduce) {
  .poster-motion { display: none; }
}
