/* The year in review of a music app, told as stories, on a black page. A sober phone (.phone) holds the screen
   (.screen), a size container: every word and drawing inside is measured in cqw, so the same stories fit the phone's
   box and grow on a computer. The five stories (.sl) lie one over the other; GSAP brings each one in its own way and
   hides the one before. The bars at the top are scaled by GSAP; the tap areas (.tap) cover the two halves. */
:root {
  --page: #000000;              /* the page */
  --frame: #0c0c0e;             /* the phone's body */
  --ink: #f6f4f1;               /* the words */
  --muted: rgba(246, 244, 241, 0.62); /* the small words */
  --intro: #8f74ff;             /* the intro's colour, violet */
  --intro-base: #0f0a24;        /* the intro's ground */
  --hours: #ffb54d;             /* the hours' colour, amber */
  --hours-base: #1a1106;        /* the hours' ground */
  --genre: #2fd8b8;             /* the genre's colour, sea green */
  --genre-hi: #9dfbe6;          /* the top of the liquid */
  --genre-base: #03171a;        /* the genre's ground */
  --artist: #ff5f7e;            /* the artist's colour, rose */
  --artist-2: #ff9a5a;          /* the second colour of the cover */
  --artist-base: #1c0710;       /* the artist's ground */
  --song: #c9f23f;              /* the song's colour, lime */
  --song-base: #0e1407;         /* the song's ground */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}

.wr {
  position: relative;
}

/* ---------------------------------------------------------------- the phone */
.phone {
  --w: min(calc(min(640px, 100vh - 24px) * 0.49), calc(100vw - 24px));
  position: relative;
  width: var(--w);
  aspect-ratio: 0.49;
  padding: calc(var(--w) * 0.028);
  border-radius: calc(var(--w) * 0.155);
  background: linear-gradient(160deg, #1d1d21 0%, var(--frame) 38%, #050506 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.5),
    0 24px 60px -18px rgba(143, 116, 255, 0.18),
    0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.phone__island {
  position: absolute;
  left: 50%;
  top: calc(var(--w) * 0.05);
  width: calc(var(--w) * 0.27);
  height: calc(var(--w) * 0.078);
  border-radius: 99px;
  background: #000;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateX(-50%);
  z-index: 9;
  pointer-events: none;
}

.phone__key {
  position: absolute;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2a2a30, #111114);
}

.phone__key--a {
  right: -2px;
  top: 24%;
  height: 11%;
}

.phone__key--b {
  left: -2px;
  top: 19%;
  height: 7%;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--w) * 0.13);
  background: #000;
  container-type: size;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

.slides {
  position: absolute;
  inset: 0;
  transform-origin: 50% 55%;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- the chrome: status, bars, head */
.chrome {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 6;
  padding: 3.4cqh 6cqw 0;
  pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, 0.32), transparent);
}

.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4cqh;
  padding: 0 3cqw;
  font-size: max(9px, 4.4cqw);
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.status__icons {
  display: flex;
  gap: 1.6cqw;
  align-items: center;
}

.status__icons svg {
  height: max(7px, 3.4cqw);
  width: auto;
  fill: currentColor;
}

.bars {
  display: flex;
  gap: 1.4cqw;
  margin-top: 2.8cqh;
}

.bar {
  position: relative;
  flex: 1;
  height: max(2px, 0.9cqw);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.24);
}

.bar i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

.head {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  margin-top: 2.6cqh;
}

.head__logo svg {
  display: block;
  width: max(16px, 8.4cqw);
  height: max(16px, 8.4cqw);
}

.head__logo circle {
  fill: #fff;
}

.head__logo path {
  fill: none;
  stroke: #000;
  stroke-width: 2;
  stroke-linecap: round;
}

.head__who {
  display: flex;
  flex-direction: column;
  line-height: 1.12;
  font-size: max(8px, 3.7cqw);
}

.head__who b {
  font-weight: 680;
  font-size: max(9px, 4.2cqw);
}

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

.head__paused {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 1.2cqw 2.8cqw;
  border-radius: 99px;
  font-size: max(8px, 3.5cqw);
  font-weight: 620;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
}

.head__paused svg {
  width: max(7px, 3cqw);
  height: max(7px, 3cqw);
  fill: currentColor;
}

/* ---------------------------------------------------------------- the taps */
.tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tap--prev {
  left: 0;
  width: 34%;
}

.tap--next {
  right: 0;
  width: 66%;
}

.tap:focus-visible {
  outline: none;
}

.tap:focus-visible .tap__hint {
  opacity: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.tap__hint {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: max(24px, 10cqw);
  height: max(24px, 10cqw);
  margin-top: max(-12px, -5cqw);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tap--prev .tap__hint {
  left: 3cqw;
}

.tap--next .tap__hint {
  right: 3cqw;
}

.tap__hint svg {
  width: 60%;
  height: 60%;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .tap:hover .tap__hint {
    opacity: 0.85;
  }
}

/* ---------------------------------------------------------------- the stories */
.sl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: var(--base);
}

.sl__bg {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(60% 40% at var(--gx, 70%) var(--gy, 26%), color-mix(in srgb, var(--acc) 46%, transparent), transparent 70%),
    radial-gradient(70% 50% at 10% 100%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 72%),
    var(--base);
}

.sl__body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 26cqh 8cqw 8cqh;
}

.sl__body--end {
  justify-content: flex-end;
  padding-bottom: 10cqh;
}

.kick {
  margin: 0 0 2.4cqh;
  padding: 1cqw 2.8cqw;
  border-radius: 99px;
  font-size: max(8px, 3.6cqw);
  font-weight: 640;
  letter-spacing: 0.02em;
  color: var(--acc);
  background: color-mix(in srgb, var(--acc) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--acc) 34%, transparent);
}

.note {
  margin: 0.6cqh 0 0;
  font-size: max(9px, 4.4cqw);
  color: var(--muted);
}

.note b {
  color: var(--ink);
  font-weight: 640;
}

.big {
  margin: 2cqh 0 0;
  font-size: 11cqw;
  line-height: 1;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variation-settings: 'wdth' 92;
}

.badge {
  margin: 2.6cqh 0 0;
  padding: 1.6cqw 3.4cqw;
  border-radius: 99px;
  font-size: max(8px, 3.8cqw);
  font-weight: 620;
  color: var(--base);
  background: var(--acc);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--acc) 70%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* intro */
.sl--intro {
  --acc: var(--intro);
  --base: var(--intro-base);
  --gx: 50%;
  --gy: 34%;
}

.rings {
  position: absolute;
  left: 50%;
  top: 37%;
  width: 96cqw;
  height: 96cqw;
  margin: -48cqw 0 0 -48cqw;
  overflow: visible;
}

.rings__c {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 0.6;
  transform-origin: 110px 110px;
}

.rings__arc {
  fill: none;
  stroke: var(--intro);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 22 78;
  filter: drop-shadow(0 0 3px var(--intro));
}

[data-orbit] {
  transform-origin: 110px 110px;
}

.rings__core {
  fill: var(--intro);
  transform-origin: 110px 110px;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--intro) 80%, transparent));
}

.intro__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  line-height: 0.92;
  font-weight: 760;
  letter-spacing: -0.03em;
}

.mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

.intro__l {
  display: block;
  font-size: 12cqw;
}

.intro__year {
  --wd: 125;
  font-size: 29cqw;
  font-variation-settings: 'wdth' var(--wd);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, color-mix(in srgb, var(--intro) 60%, #fff));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro__go {
  display: inline-flex;
  align-items: center;
  gap: 1cqw;
  margin: 3.4cqh 0 0;
  font-size: max(8px, 3.8cqw);
  font-weight: 620;
}

.intro__go svg {
  width: max(8px, 3.6cqw);
  height: max(8px, 3.6cqw);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* hours */
.sl--hours {
  --acc: var(--hours);
  --base: var(--hours-base);
  --gx: 80%;
  --gy: 30%;
}

.lead {
  margin: 0;
  font-size: 5.6cqw;
  font-weight: 560;
}

.odo {
  display: flex;
  margin: 1cqh 0 0;
  font-size: 26cqw;
  font-weight: 780;
  letter-spacing: -0.03em;
  font-variation-settings: 'wdth' 88;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--hours);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--hours) 38%, transparent));
}

.odo__col {
  display: block;
  height: 1.02em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}

.odo__strip {
  display: flex;
  flex-direction: column;
}

.odo__strip b {
  display: block;
  height: 1.02em;
  font-weight: inherit;
}

.odo__sep {
  display: block;
  margin: 0 -0.02em;
}

.unit {
  margin: 0;
  font-size: 9cqw;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.months {
  width: 100%;
  margin-top: 4cqh;
}

.months__bars {
  display: flex;
  align-items: flex-end;
  gap: 1.6cqw;
  height: 16cqh;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.months__bars i {
  flex: 1;
  height: calc(var(--h) * 100%);
  border-radius: 2px 2px 1px 1px;
  background: rgba(255, 255, 255, 0.2);
  transform-origin: 50% 100%;
}

.months__bars i.is-peak {
  background: linear-gradient(var(--hours), color-mix(in srgb, var(--hours) 60%, #000));
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--hours) 70%, transparent);
}

.months__cap {
  display: flex;
  justify-content: space-between;
  margin: 1.4cqh 0 0;
  font-size: max(8px, 3.7cqw);
  color: var(--muted);
}

.months__cap b {
  color: var(--ink);
  font-weight: 640;
}

/* genre */
.sl--genre {
  --acc: var(--genre);
  --base: var(--genre-base);
  --gx: 30%;
  --gy: 40%;
}

.blob {
  position: relative;
  align-self: center;
  width: min(66cqw, 36cqh);
  aspect-ratio: 1;
  margin: 1cqh 0 1cqh;
}

.blob svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.blob__glass {
  fill: rgba(255, 255, 255, 0.05);
}

.blob__back {
  fill: color-mix(in srgb, var(--genre) 45%, transparent);
}

.blob__shine {
  fill: rgba(255, 255, 255, 0.16);
}

.blob__rim {
  fill: none;
  stroke: color-mix(in srgb, var(--genre-hi) 60%, transparent);
  stroke-width: 1;
}

.blob__pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17cqw;
  font-weight: 760;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 40, 36, 0.5);
}

.blob__pct b {
  font-weight: inherit;
}

.blob__pct small {
  margin-left: 0.04em;
  font-size: 0.48em;
  vertical-align: 0.72em;
}

.stack {
  width: 100%;
  margin-top: 3cqh;
}

.stack__bar {
  display: flex;
  gap: 1cqw;
  height: max(4px, 1.8cqw);
  border-radius: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.stack__s {
  width: var(--w);
  border-radius: 9px;
  transform-origin: 0 50%;
}

.stack__s--a {
  background: var(--genre);
}

.stack__s--b {
  background: color-mix(in srgb, var(--genre) 55%, #fff);
}

.stack__s--c {
  background: rgba(255, 255, 255, 0.45);
}

.stack__cap {
  margin: 1.4cqh 0 0;
  font-size: max(8px, 3.7cqw);
  color: var(--muted);
}

/* artist */
.sl--artist {
  --acc: var(--artist);
  --base: var(--artist-base);
  --gx: 64%;
  --gy: 36%;
}

.art {
  position: relative;
  width: min(54cqw, 30cqh);
  aspect-ratio: 1;
  margin: 1cqh 0 1cqh;
}

.vinyl {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 15%, rgba(255, 255, 255, 0.05) 15.5% 16%, transparent 16.5%),
    repeating-radial-gradient(circle, #121214 0 1.2%, #1b1b1f 1.4% 2.2%),
    #111;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.vinyl::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 10%, rgba(255, 255, 255, 0.14) 14%, transparent 20% 58%, rgba(255, 255, 255, 0.1) 62%, transparent 68%);
}

.vinyl__label {
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #000 0 8%, transparent 9%), linear-gradient(135deg, var(--artist), var(--artist-2));
}

.cover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(150deg, #2a0b18, #120309);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 22px 40px -14px rgba(0, 0, 0, 0.9),
    0 16px 50px -20px color-mix(in srgb, var(--artist) 80%, transparent);
}

.cover svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cover__sun {
  fill: var(--artist-2);
}

.cover__moon {
  fill: var(--artist);
  mix-blend-mode: screen;
  opacity: 0.92;
}

.cover__lines {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 0.5;
}

.cover__word {
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.08em;
  fill: rgba(255, 255, 255, 0.86);
}

.cover__sheen {
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-60%);
}

/* song */
.sl--song {
  --acc: var(--song);
  --base: var(--song-base);
  --gx: 50%;
  --gy: 42%;
  background: transparent;
}

.blinds {
  position: absolute;
  inset: 0;
  display: flex;
}

.blinds i {
  flex: 1;
  margin-right: -1px;
  background: var(--song-base);
  transform-origin: 50% 0;
}

.eq {
  position: relative;
  align-self: stretch;
  height: 26cqh;
  margin: 1cqh 0 1cqh;
}

.eq__glow {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 20%;
  bottom: 20%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--song) 40%, transparent);
  filter: blur(22px);
  opacity: 0.4;
}

.eq__bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eq__bars i {
  width: 2.2cqw;
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(#fff, var(--song) 30%, var(--song) 70%, #fff);
  transform: scaleY(0.2);
}

.scrub {
  width: 100%;
  margin-top: 2.4cqh;
}

.scrub__line {
  display: block;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}

.scrub__line i {
  display: block;
  height: 100%;
  background: #fff;
  transform-origin: 0 50%;
  transform: scaleX(0.32);
}

.scrub__t {
  display: flex;
  justify-content: space-between;
  margin-top: 0.8cqh;
  font-size: max(8px, 3.4cqw);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.scrub__t b {
  font-weight: 560;
}

@media (prefers-reduced-motion: reduce) {
  .tap__hint {
    transition: none;
  }
}
