/* The music app splash screen with the icon that becomes the cover: Sona, an invented music app, launching on a phone
   on a near black page. Everything inside the screen is measured in cqw (the screen is a size container), so the phone
   can be as small as a phone's preview box and still be the same picture. The skeletons are a ::before on every
   bone (.b): its strength is --sk, inherited from its piece, and one shared light (--sp on the screen) runs through
   all of them at the same height, as if it crossed the whole screen. GSAP only writes custom properties on the
   pieces (--in, --ry, --sk), so the CSS keeps the transforms. */
:root {
  --page: #09080b;          /* the page */
  --app: #0f0d13;           /* the app's background */
  --ink: #f3f1f6;           /* the words */
  --muted: #8d8898;         /* the small words */
  --accent: #ff6b4a;        /* coral, the colour of the app */
  --accent-2: #7d5cff;      /* violet, the second light */
  --bone: #1d1a23;          /* a skeleton */
  --bone-hi: rgba(255, 255, 255, 0.075); /* the light that runs through the skeletons */
  --frame: #1b1a20;         /* the phone's frame */
}

* {
  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;
}

/* the page: two soft lights behind the phone and a little grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 14px 16px;
  overflow: hidden;
  background:
    radial-gradient(42% 38% at 30% 70%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(40% 40% at 72% 28%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%),
    var(--page);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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 phone */
.phone {
  position: relative;
  z-index: 1;
  width: min(calc((100vh - 28px) * 0.4737), 300px, calc(100vw - 32px));
  aspect-ratio: 9 / 19;
  border-radius: 16% / 7.6%;
  background: linear-gradient(150deg, #2c2a32, var(--frame) 40%, #121116);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 14px 30px -12px rgba(0, 0, 0, 0.8),
    0 40px 80px -30px rgba(0, 0, 0, 0.9);
  container-type: inline-size;
  opacity: 0;
}

.screen {
  position: absolute;
  inset: 2.6cqw;
  border-radius: 13.5cqw;
  overflow: hidden;
  background: var(--app);
  container-type: inline-size;
  font-size: 4cqw;
  --sp: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.island {
  position: absolute;
  top: 2.8cqw;
  left: 50%;
  width: 30cqw;
  height: 8.8cqw;
  margin-left: -15cqw;
  border-radius: 99px;
  background: #000;
  z-index: 8;
}

.homebar {
  position: absolute;
  left: 50%;
  bottom: 2.2cqw;
  width: 34cqw;
  height: 1.2cqw;
  margin-left: -17cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
  z-index: 7;
}

.status {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 14.4cqw;
  padding: 0 8.5cqw 0 10cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 7;
}

.status__time {
  font-size: 4.1cqw;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.status__icons {
  width: 14.5cqw;
  height: auto;
}

/* ---------------------------------------------------------------- the bones */
.pc {
  --in: 0;
  --ry: 1;
  --sk: 1;
  opacity: var(--in);
  transform: translateY(calc(var(--ry) * 3.2cqw)) scale(calc(1 - var(--ry) * 0.02));
}

.b {
  position: relative;
  display: block;
  --ox: 0px;
}

.b > * {
  opacity: calc(1 - var(--sk, 1));
}

.b::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: var(--br, 1.4cqw);
  pointer-events: none;
  background-color: var(--bone);
  background-image: linear-gradient(100deg, transparent 0%, var(--bone-hi) 50%, transparent 100%);
  background-size: 60cqw 100%;
  background-repeat: no-repeat;
  background-position: calc(var(--sp) * 200cqw - 60cqw - var(--ox)) 0;
  opacity: var(--sk, 1);
}

.b--line {
  width: fit-content;
}

.b--line::before {
  inset: 16% -0.4cqw;
}

.b--round {
  --br: 99px;
}

/* ---------------------------------------------------------------- the home screen */
.home {
  position: absolute;
  inset: 0;
  padding: 0 6cqw;
}

.head {
  margin-top: 16cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.head__words {
  display: grid;
  gap: 0.6cqw;
}

.head__kicker {
  display: block;
  font-size: 3.4cqw;
  color: var(--muted);
}

.head__name {
  display: block;
  font-size: 7.4cqw;
  line-height: 1.1;
  font-weight: 660;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.01em;
}

.avatar {
  width: 10.4cqw;
  height: 10.4cqw;
}

.avatar__face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  font-size: 4cqw;
  font-weight: 640;
  background: linear-gradient(140deg, #ffb08f, var(--accent) 55%, #c2416a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 0.5cqw var(--app), 0 0 0 0.75cqw rgba(255, 255, 255, 0.12);
  color: #2a0f0a;
}

.hero {
  position: relative;
  margin-top: 5cqw;
}

.hero__cover {
  --br: 6cqw;
  --sk: 1;
  height: 62cqw;
  border-radius: 6cqw;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 10cqw 18cqw -10cqw rgba(0, 0, 0, 0.8);
}

.hero__cover > .art {
  position: absolute;
  inset: 0;
}

.hero__glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.16) 50%, transparent 62%);
  background-size: 260% 100%;
  background-position: calc(var(--gl, 0) * 100%) 0;
  mix-blend-mode: screen;
  opacity: var(--glo, 0);
}

/* the words over the cover are skeletons of frosted glass */
.hero__over {
  --bone: rgba(255, 255, 255, 0.13);
  --bone-hi: rgba(255, 255, 255, 0.16);
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero__words {
  position: absolute;
  left: 5cqw;
  bottom: 5.4cqw;
  display: grid;
  gap: 0.4cqw;
  text-shadow: 0 1px 6px rgba(20, 8, 20, 0.35);
}

.hero__kicker {
  display: block;
  font-size: 2.9cqw;
  font-weight: 560;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.6cqw;
}

.hero__title {
  display: block;
  font-size: 5.8cqw;
  line-height: 1.12;
  font-weight: 660;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.01em;
}

.hero__artist {
  display: block;
  font-size: 3.3cqw;
  color: rgba(255, 255, 255, 0.78);
}

.hero__chip {
  position: absolute;
  top: 4.2cqw;
  right: 4.2cqw;
}

.hero__time {
  display: block;
  padding: 0.9cqw 2.2cqw;
  border-radius: 99px;
  font-size: 2.8cqw;
  font-weight: 580;
  font-variant-numeric: tabular-nums;
  background: rgba(20, 12, 24, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hero__play {
  position: absolute;
  right: 4.4cqw;
  bottom: 4.4cqw;
  width: 13cqw;
  height: 13cqw;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #18111a;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.hero__play:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.hero__play-face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #ece8ef);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08), 0 1.4cqw 3.4cqw -1cqw rgba(30, 10, 30, 0.55);
}

.hero__play svg {
  width: 52%;
  height: 52%;
  fill: currentColor;
  overflow: visible;
}

.ic-pause {
  opacity: 0;
}

.hero__track {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.8cqw;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0 0 6cqw 6cqw;
  overflow: hidden;
}

.hero__track,
.mini__track {
  opacity: calc(1 - var(--sk, 1));
}

.hero__fill,
.mini__fill {
  display: block;
  height: 100%;
  background: #ffffff;
  transform-origin: 0 50%;
  transform: scaleX(0.31);
}

.sec {
  margin-top: 6.4cqw;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.sec__title {
  display: block;
  font-size: 4.5cqw;
  font-weight: 640;
  font-variation-settings: 'wdth' 106;
}

.sec__more {
  display: block;
  font-size: 3.2cqw;
  color: var(--muted);
}

.tiles {
  margin-top: 3.2cqw;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.2cqw;
}

.tile__cover {
  --br: 3.6cqw;
  aspect-ratio: 1;
  border-radius: 3.6cqw;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 4cqw 8cqw -4cqw rgba(0, 0, 0, 0.8);
}

.tile__cover > .art {
  position: absolute;
  inset: 0;
}

.tile__name {
  display: block;
  margin-top: 1.8cqw;
  font-size: 3.1cqw;
  font-weight: 600;
  white-space: nowrap;
}

.tile__sub {
  display: block;
  margin-top: 0.3cqw;
  font-size: 2.7cqw;
  color: var(--muted);
}

/* the next song, one row in the list */
.next {
  margin-top: 5.4cqw;
  display: flex;
  align-items: center;
  gap: 3cqw;
}

.next__cover {
  --br: 2.6cqw;
  flex: none;
  width: 11cqw;
  height: 11cqw;
  border-radius: 2.6cqw;
  overflow: hidden;
}

.next__cover > .art {
  position: absolute;
  inset: 0;
}

.next__words {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.5cqw;
}

.next__kicker {
  display: block;
  font-size: 2.6cqw;
  color: var(--muted);
}

.next__title {
  display: block;
  font-size: 3.3cqw;
  font-weight: 600;
  white-space: nowrap;
}

.next__len {
  display: block;
  font-size: 2.9cqw;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.art--d {
  background:
    radial-gradient(70% 70% at 70% 30%, rgba(255, 196, 120, 0.95), rgba(255, 196, 120, 0) 70%),
    radial-gradient(70% 70% at 20% 90%, rgba(255, 107, 74, 0.85), rgba(255, 107, 74, 0) 70%),
    linear-gradient(200deg, #3a2010, #1a0e14);
}

/* the mini player floats over the tab bar and rises from further down */
.mini {
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  bottom: 24cqw;
  z-index: 3;
  transform: translateY(calc(var(--ry) * 12cqw)) scale(calc(1 - var(--ry) * 0.03));
}

.mini__glass {
  position: relative;
  height: 15cqw;
  padding: 0 3cqw 0 2.4cqw;
  display: flex;
  align-items: center;
  gap: 3cqw;
  border-radius: 4.6cqw;
  background: linear-gradient(180deg, rgba(44, 40, 52, 0.86), rgba(30, 27, 36, 0.86));
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 2cqw 5cqw -1cqw rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.mini__cover {
  --br: 2.4cqw;
  flex: none;
  width: 10.4cqw;
  height: 10.4cqw;
  border-radius: 2.4cqw;
  overflow: hidden;
}

.mini__cover > .art {
  position: absolute;
  inset: 0;
}

.mini__words {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.4cqw;
}

.mini__title {
  display: block;
  font-size: 3.3cqw;
  font-weight: 620;
}

.mini__artist {
  display: block;
  font-size: 2.8cqw;
  color: var(--muted);
}

.mini__eq {
  flex: none;
  width: 7cqw;
  height: 7cqw;
}

.mini__eq svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: var(--accent);
  overflow: visible;
}

.mini__track {
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  bottom: 0;
  height: 0.55cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mini__fill {
  background: linear-gradient(90deg, var(--accent), #ffb08f);
}

.tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6.6cqw;
  padding: 0 8cqw;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  z-index: 2;
  transform: translateY(calc(var(--ry) * 5cqw));
}

.tabs::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -5cqw;
  bottom: -6.6cqw;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 13, 19, 0), var(--app) 40%);
}

.tab {
  width: 10.6cqw;
  height: 10.6cqw;
  display: grid;
  place-items: center;
  color: #6f6a79;
}

.tab svg {
  width: 6.2cqw;
  height: 6.2cqw;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.is-on {
  color: var(--accent);
}

.tabs__pill {
  position: absolute;
  top: 0.3cqw;
  left: calc(8cqw + 10.5cqw - 8cqw);
  width: 16cqw;
  height: 10cqw;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: scale(var(--pl, 0));
  opacity: var(--pl, 0);
}

/* ---------------------------------------------------------------- the art (no pictures, only light) */
.art {
  display: block;
  overflow: hidden;
}

.art--hero {
  background:
    radial-gradient(48% 64% at 26% 30%, rgba(255, 150, 105, 0.95), rgba(255, 107, 74, 0) 70%),
    radial-gradient(58% 80% at 82% 78%, rgba(125, 92, 255, 0.95), rgba(125, 92, 255, 0) 72%),
    radial-gradient(30% 36% at 72% 18%, rgba(255, 214, 178, 0.7), rgba(255, 214, 178, 0) 70%),
    linear-gradient(160deg, #3a1630, #150d22 70%);
}

.art__ring {
  position: absolute;
  left: 63%;
  top: 46%;
  height: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32), 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.art__ring::after {
  content: '';
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

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

.art--a {
  background:
    radial-gradient(70% 60% at 30% 80%, rgba(255, 176, 92, 0.95), rgba(255, 176, 92, 0) 70%),
    radial-gradient(70% 70% at 80% 20%, rgba(38, 170, 170, 0.9), rgba(38, 170, 170, 0) 70%),
    linear-gradient(200deg, #0d2a33, #1d1220);
}

.art--b {
  background:
    radial-gradient(80% 70% at 50% 100%, rgba(255, 200, 170, 0.95), rgba(255, 200, 170, 0) 70%),
    radial-gradient(60% 60% at 20% 20%, rgba(232, 112, 160, 0.9), rgba(232, 112, 160, 0) 70%),
    linear-gradient(180deg, #4a2340, #2a1424);
}

.art--c {
  background:
    linear-gradient(180deg, transparent 61%, rgba(255, 255, 255, 0.35) 61.5%, transparent 63%),
    radial-gradient(60% 50% at 50% 62%, rgba(120, 200, 255, 0.85), rgba(120, 200, 255, 0) 70%),
    linear-gradient(180deg, #171b48, #0c0f26);
}

/* ---------------------------------------------------------------- the splash and the icon */
.splash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(46% 26% at 50% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 75%),
    var(--app);
}

.splash__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40cqw;
  height: 40cqw;
  margin: -20cqw 0 0 -20cqw;
  overflow: visible;
  transform: rotate(-90deg);
}

.splash__note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17cqw;
  text-align: center;
  font-size: 3cqw;
  letter-spacing: 0.01em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.splash__track,
.splash__arc {
  fill: none;
  stroke-width: 1.1;
}

.splash__track {
  stroke: rgba(255, 255, 255, 0.07);
}

.splash__arc {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.icon {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 2cqw 6cqw -1cqw rgba(0, 0, 0, 0.7), 0 0 10cqw -2cqw color-mix(in srgb, var(--accent) 45%, transparent);
}

.icon > .art {
  position: absolute;
  inset: 0;
}

.icon__mark {
  position: absolute;
  left: 22%;
  top: 22%;
  width: 56%;
  height: 56%;
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  overflow: visible;
}

.icon__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
