:root {
  /* Onboarding's light colors: window, panel, card border, text. */
  --window: #efeff0;
  --panel: #f7f7f7;
  --bg: var(--window);
  --fg: #1d1d1f;
  --muted: #6e6e73;
  --rule: #d1d1d6;
  --accent: #0053e2;
  /* The charged colors of "Supercharge" and the download button's ring. */
  --charge-blue: #33a8ff;
  --charge-violet: #9b6bff;
  --charge-pink: #ff5fa2;
  --display: "Lato", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --page-width: 1040px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

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

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: inherit; }

/* Header ------------------------------------------------------------------ */

.site-header {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
}

.brand img { width: 32px; height: 32px; }

/* Hero -------------------------------------------------------------------- */

/* Its own layer, so the download button's glow can sit behind the button */
/* and still in front of the page's background.                          */
.hero,
.closing-download {
  isolation: isolate;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 6vw, 56px);
  padding: clamp(24px, 6vw, 64px) var(--gutter) clamp(72px, 10vw, 72px);
  text-align: center;
}

.tagline {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 6.5vw, 56px);
  line-height: 0.8;
  letter-spacing: -0.04em;
}

.sub-tagline {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 0.2;
  letter-spacing: -0.02em;
}

/* "Supercharged", which a band of charged color sweeps through now and   */
/* then. The text paints only inside the box, which the tight line height */
/* and tracking make smaller than the letters: pad it out without moving  */
/* it.                                                                    */
.supercharge {
  display: inline-block;
  font-weight: 700;
  padding: 0.1em 0.1em 0.25em;
  margin: -0.1em -0.1em -0.25em;
  background: linear-gradient(
    100deg,
    var(--fg) 0 34%,
    var(--accent) 41%,
    var(--charge-blue) 46%,
    var(--charge-violet) 51%,
    var(--charge-pink) 56%,
    var(--fg) 64% 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: charge-sweep 9s cubic-bezier(0.45, 0, 0.25, 1) 1s infinite;
}

@keyframes charge-sweep {
  0% { background-position: 100% 0; }
  /* A 1.6s sweep, then a rest for the rest of the 9s loop. */
  18%, 100% { background-position: 0 0; }
}

/* Under the pointer, the sweeps come one after the other, with no rest. */
.supercharge:hover {
  animation: charge-sweep-nonstop 1.6s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}

@keyframes charge-sweep-nonstop {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .supercharge,
  .supercharge:hover { animation: none; }
}

.download {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 26px 0 22px;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
}

.download:hover { background: #000; }

/* Under the pointer, the button glows from behind in the charged colors, */
/* which turn around it: a soft glow close in, and around it one cloud of */
/* light whose reach swells and shrinks around the button. Its outline is */
/* two smooth patterns of broad lobes laid over each other and turning    */
/* against each other, so the shape keeps slowly changing.                */
/* Both sit behind the button, so the button never scales or takes on     */
/* anything that would lift them in front of it.                          */
@property --glow-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --reach-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.download::before,
.download::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(
    from var(--glow-angle),
    var(--accent),
    var(--charge-blue),
    var(--charge-violet),
    var(--charge-pink),
    var(--accent)
  );
  opacity: 0;
  transform: scale(0.75);
  /* Leaving: the light gathers back in behind the button, and only fades  */
  /* once it has mostly drawn in.                                           */
  transition:
    opacity 0.45s cubic-bezier(0.7, 0, 0.9, 0.4),
    transform 0.45s cubic-bezier(0.4, 0, 0.6, 1);
  pointer-events: none;
}

/* The colors turn all the time, hidden or not, so that nothing jumps as the */
/* glow comes and goes.                                                       */
.download::before { animation: glow-turn 2s linear infinite; }
.download::after { animation: glow-turn 2s linear infinite, reach-turn 20s linear infinite; }

.download::before {
  inset: -3px;
  filter: blur(12px);
}

/* The cloud: a capsule a little larger than the button, blurred out so   */
/* that it reaches evenly all around, then dimmed in some directions and  */
/* not others. The transparent border gives the blur room inside the box. */
.download::after {
  inset: -52px;
  border: 44px solid transparent;
  background-clip: padding-box;
  filter: blur(16px);
  mask:
    conic-gradient(
      from var(--reach-angle),
      #000d, #0003 60deg, #000e 120deg, #0002 185deg,
      #000c 230deg, #0003 290deg, #000d
    ),
    conic-gradient(
      from calc(var(--reach-angle) * -1.6),
      #0009, #0001 90deg, #000a 170deg, #0001 260deg, #0009
    );
  mask-composite: add;
}

/* Hovering: the light builds out from behind the button and settles. */
.download:hover::before,
.download:hover::after {
  transform: scale(1);
  transition:
    opacity 0.3s ease-out,
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.download:hover::before { opacity: 0.6; }

.download:hover::after { opacity: 0.55; }

@keyframes glow-turn {
  to { --glow-angle: 360deg; }
}

@keyframes reach-turn {
  to { --reach-angle: -360deg; }
}

.download:active { background: #2c2c2e; }

@media (prefers-reduced-motion: reduce) {
  .download::before,
  .download::after {
    animation: none;
    transform: none;
  }
}
.download:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.download svg { width: 20px; height: 20px; margin-top: -3px; }

/* Features ---------------------------------------------------------------- */

/* Each band of color runs the full width, its content lined up with the  */
/* header's. Every other band is the other gray and puts its image first, */
/* on the wider side.                                                     */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(40px, 6vw, 64px);
  padding-inline: max(var(--gutter), calc((100% - var(--page-width)) / 2 + var(--gutter)));
  background: var(--panel);
}

.feature:nth-child(even) {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  background: var(--window);
}

.feature:nth-child(even) .feature-text { order: 2; }

.feature-text h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.feature-text p {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
}

/* Screenshots with their own soft shadows, drawn on transparency. */
.feature-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Turned a little in depth, around the vertical axis. Under the pointer, */
/* it turns most of the way back toward flat.                             */
.feature-image-tilted {
  --tilt: -14deg;
  transform: perspective(1400px) rotateY(var(--tilt));
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-image-tilted:hover { --tilt: -4deg; }

@media (max-width: 720px) {
  .feature,
  .feature:nth-child(even) { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-text { order: 0; }

  /* In one column: text centered above a flat image. */
  .feature-text { text-align: center; }
  .feature-text p { margin-inline: auto; }
  .feature-image-tilted { transform: none; }
}

/* The download button again, once the features have made the case. */
.closing-download {
  display: flex;
  justify-content: center;
  padding: clamp(64px, 10vw, 112px) var(--gutter);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--rule);
}

.site-footer-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
  font-size: 14px;
  color: var(--muted);
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--accent); }

/* The welcome demo -------------------------------------------------------- */
/* Drawn at the app's sizes on a 640 by 354 stage, scaled down to fit the   */
/* demo's width: tan(atan2(a, b)) is a / b as a plain number, here the      */
/* demo's width over the stage's. A browser without it shows the stage at   */
/* full size.                                                               */

.demo {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 640 / 354;
  container-type: inline-size;
}

.demo-stage {
  position: absolute;
  top: 0;
  left: 50%;
  width: 640px;
  height: 354px;
  translate: -50% 0;
  scale: min(1, tan(atan2(100cqw, 640px)));
  transform-origin: top center;
  text-align: left;
  line-height: normal;
  user-select: none;
  -webkit-user-select: none;
}

.demo-palette {
  position: absolute;
  top: 130px;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.pc-card {
  --h: var(--palette-height, 1);
  width: 600px;
  padding: 8px;
  border-radius: 12px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), transparent 5px),
    linear-gradient(to top, rgba(255, 255, 255, 0.6), transparent 5px),
    #f9faf7;
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -1px 0 #fff,
    inset 1px 0 0 rgba(255, 255, 255, 0.38),
    inset -1px 0 0 rgba(255, 255, 255, 0.38),
    0 calc(14px * var(--h)) calc(24px * var(--h)) rgba(0, 0, 0, calc(0.2 * var(--h)));
  transform: scale(var(--palette-scale, 1));
  opacity: var(--palette-opacity, 1);
  font-family: var(--text);
}

.pc-command-line {
  height: 41px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Only a line with text clips, to keep its end in sight. The empty line's */
/* caret straddles the card's padding, as in the app.                     */
.pc-command-line-empty { overflow: visible; }

.pc-line {
  flex: none;
  display: flex;
  align-items: center;
  white-space: pre;
  font-size: 26px;
  letter-spacing: 0.22px;
  color: rgba(0, 0, 0, 0.85);
}

.pc-ghost, .pc-placeholder { color: rgba(0, 0, 0, 0.26); }

.pc-text-before-pill { margin-right: 3px; }

.pc-text-with-caret { display: inline-block; }

.pc-caret-anchor {
  position: relative;
  display: inline-block;
  width: 0;
  height: 0;
  vertical-align: top;
}

.pc-caret {
  position: absolute;
  top: 0;
  left: -1px;
  width: 2px;
  height: 29px;
  background: #007aff;
}

.pc-caret-dark .pc-caret { opacity: 0; }

.pc-pill {
  position: relative;
  display: flex;
  height: 35px;
  margin-right: 4px;
  border-radius: 6px;
  overflow: hidden;
}

.pc-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #30b050;
  border-radius: 6px;
}

.pc-pill-label {
  display: flex;
  align-items: center;
  padding: 0 3px;
  background: #30b050;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: normal;
}

.pc-pill-value {
  display: flex;
  align-items: center;
  padding: 2px 7px;
}

.pc-pill-value > span { min-width: 17px; padding-right: 3px; }

.pc-url-section {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.1s ease-out, opacity 0.1s ease-in-out;
}

.pc-url-section.pc-url-shown { grid-template-rows: 1fr; opacity: 1; }

.pc-url-clip { min-height: 0; overflow: hidden; }

.pc-divider { height: 1px; margin: 8px 0; background: rgba(0, 0, 0, 0.08); }

.pc-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 19px;
}

.pc-mark { display: flex; justify-content: center; width: 18px; flex: none; }

.pc-favicon {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: contain;
}

.pc-favicon-tinted {
  background: rgba(0, 0, 0, 0.85);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.pc-glyph { display: block; width: 16px; height: 16px; color: rgba(0, 0, 0, 0.7); }
.pc-glyph svg { display: block; width: 100%; height: 100%; }

.pc-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 15px;
  color: rgba(0, 0, 0, 0.6);
}

.pc-return-key {
  display: flex;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(142, 142, 147, 0.25);
  color: rgba(0, 0, 0, 0.8);
}

.pc-return-key svg { width: 17px; height: 14px; }

.demo-windows {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.demo-windows.demo-windows-behind { z-index: 0; }

.demo-window {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 322px;
  height: 248px;
  margin: -124px 0 0 -161px;
  will-change: transform, opacity;
}

.w-window {
  display: flex;
  flex-direction: column;
  width: 322px;
  height: 248px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 29px rgba(0, 0, 0, 0.45);
}

.w-toolbar { position: relative; flex: none; height: 43px; background: #e3e3e3; }

.w-lights { position: absolute; left: 14px; top: 14px; display: flex; gap: 9px; }
.w-lights i { width: 14px; height: 14px; border-radius: 50%; }

.w-address {
  position: absolute;
  left: 92px;
  top: 8px;
  width: 219px;
  height: 26px;
  border-radius: 13px;
  background: #f5f5f5;
}

.w-address-globe { position: absolute; left: 7px; top: 3px; width: 20px; height: 20px; color: #26bf4d; }
.w-address-globe svg, .gh-open svg, .sp-home svg, .sp-play svg, .sp-play-green svg { display: block; width: 100%; height: 100%; }
.w-address .w-bar { position: absolute; top: 8px; height: 11px; }

.w-bar { display: block; flex: none; border-radius: 999px; background: #c4c4c4; }

.w-page { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

.gh-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  background: #24292f;
}

.gh-issues {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 0;
  background: #d9d9d9;
}

.gh-issue {
  flex: none;
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  background: #ececec;
}

.gh-open { width: 16px; height: 16px; margin-right: 10px; color: #1f883d; }
.gh-issue .w-bar + .w-bar { margin-left: 8px; }

.w-exported { flex: 1; }
.w-exported img { display: block; width: 100%; }

.g-page { flex: 1; background: #fff; }
.g-header { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; }

.g-search {
  flex: 1;
  display: flex;
  align-items: center;
  height: 26px;
  padding-left: 12px;
  border: 1px solid #c9c9c9;
  border-radius: 13px;
  background: #ececec;
}

.g-row { display: flex; gap: 10px; padding: 0 14px; }
.g-row + .g-row { margin-top: 10px; }
.g-picture { display: block; flex: none; border-radius: 10px; overflow: hidden; }

.sp-window { background: #000; }
.sp-top { position: relative; flex: none; height: 43px; }
.sp-nav { position: absolute; left: 92px; top: 8px; display: flex; gap: 8px; }

.sp-home {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #242424;
  color: #fff;
}

.sp-home svg { width: 13px; height: 13px; }

.sp-body { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 0 8px; }

.sp-library {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 56px;
  padding: 10px;
  border-radius: 10px;
  background: #121212;
}

.sp-cover { display: block; flex: none; border-radius: 6px; }

.sp-genre {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(#1f5f8b, #121212 75%);
}

.sp-genre-name {
  margin-bottom: 12px;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.sp-playlists { display: flex; gap: 10px; }
.sp-first { position: relative; }

.sp-play-green {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1ed760;
  color: #000;
}

.sp-play-green svg { width: 9px; height: 9px; }

.sp-player { position: relative; flex: none; display: grid; place-items: center; height: 40px; }
.sp-player .sp-cover { position: absolute; left: 14px; top: 7px; }

.sp-play {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: #000;
}

.sp-play svg { width: 12px; height: 12px; }
