/* Esplanade landing page. Plain CSS, no build step. */

:root {
  /* Base */
  --paper: #f6f3ef;
  --paper-2: #efeae4;
  --card: #ffffff;
  --ink: #17151a;
  --muted: #5b5660;
  --line: rgba(23, 21, 26, 0.1);
  --shadow: 0 1px 2px rgba(23, 21, 26, 0.06), 0 12px 32px -12px rgba(23, 21, 26, 0.22);
  --scrim: rgba(246, 243, 239, 0.5);

  /* The playing item's palette; main.js changes these. */
  --c1: #ff4d5e;
  --c2: #c8102e;
  --c3: #ff9a8b;
  --accent-l: #c4102d;
  --accent-d: #ff7a86;
  --accent: var(--accent-l);

  --grille: #fb2d45;
  --serif: "New York", ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fade: 1.4s;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0d10;
    --paper-2: #141317;
    --card: #1a181d;
    --ink: #f3f0ec;
    --muted: #a8a2ac;
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -16px rgba(0, 0, 0, 0.7);
    --scrim: rgba(14, 13, 16, 0.5);
    --accent: var(--accent-d);
  }
}

@property --c1 { syntax: "<color>"; inherits: true; initial-value: #ff4d5e; }
@property --c2 { syntax: "<color>"; inherits: true; initial-value: #c8102e; }
@property --c3 { syntax: "<color>"; inherits: true; initial-value: #ff9a8b; }
@property --accent-l { syntax: "<color>"; inherits: true; initial-value: #c4102d; }
@property --accent-d { syntax: "<color>"; inherits: true; initial-value: #ff7a86; }

:root {
  transition: --c1 var(--fade) ease, --c2 var(--fade) ease, --c3 var(--fade) ease,
              --accent-l var(--fade) ease, --accent-d var(--fade) ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
}
.skip:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- The aura: the app's themed background, on the web ---------- */

.aura,
.mini-aura {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--c2) 70%, var(--paper));
}

.blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.95;
  will-change: transform;
}
.b1 { background: var(--c1); left: -20vmax; top: -25vmax; animation: drift1 26s var(--ease) infinite alternate; }
.b2 { background: var(--c2); right: -25vmax; top: 5vmax; animation: drift2 32s var(--ease) infinite alternate; }
.b3 { background: var(--c3); left: 10vmax; bottom: -40vmax; animation: drift3 29s var(--ease) infinite alternate; }

.scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

/* A soft grain of dots, borrowed from the icon's grille. */
.aura::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.22) 1.2px, transparent 1.6px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%);
}

@keyframes drift1 { to { transform: translate(18vmax, 12vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-16vmax, 14vmax) scale(0.9); } }
@keyframes drift3 { to { transform: translate(12vmax, -14vmax) scale(1.15); } }

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

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(100svh, 980px);
  display: flex;
  flex-direction: column;
  padding-bottom: clamp(48px, 8vw, 96px);
}
.hero > .aura { z-index: -1; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.brand img { border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line);
}
.nav ul a {
  display: block;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}
.nav ul a:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }

.hero-inner {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--gutter) 0;
}

.hero-icon {
  display: block;
  width: clamp(72px, 9vw, 112px);
  height: auto;
  border-radius: 22.5%;
  margin-bottom: 28px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 18px 40px -12px color-mix(in srgb, var(--grille) 70%, transparent);
}

.eyebrow,
.kicker {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow { color: color-mix(in srgb, var(--ink) 72%, transparent); }
.kicker { color: var(--accent); }

h1,
h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 7.2vw, 5.5rem); }
h1 em { font-style: italic; font-weight: 500; }
h2 { font-size: clamp(2rem, 4.6vw, 3.4rem); margin-bottom: 20px; }

.lede {
  max-width: 34ch;
  margin: 24px 0 0;
  font-size: clamp(1.125rem, 1.9vw, 1.375rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.note {
  display: inline-block;
  margin: 28px 0 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.hero-phone { margin: 0; display: flex; justify-content: center; }
.hero-phone .phone { width: min(100%, 340px); transform: rotate(2deg); }

/* ---------- Phone frame ---------- */

.phone {
  container-type: inline-size;
  position: relative;
  width: 100%;
  padding: 2.6%;
  /* Outer corners: the screen's corner radius plus the bezel, as % of width / % of height. */
  border-radius: 15.5% / 7.34%;
  background: linear-gradient(145deg, #2a292d, #0b0b0c 40%, #1d1c20);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.2),
    0 40px 80px -30px rgba(0, 0, 0, 0.55);
}
.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 40px;
  border-radius: 13.6cqw;
}

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 11vw, 148px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(36px, 7vw, 96px);
}
.split.reverse .copy { order: 2; }

.copy p { max-width: 54ch; margin: 0 0 16px; color: var(--muted); text-wrap: pretty; }
.copy p.kicker { color: var(--accent); margin-bottom: 14px; }
.copy.center { text-align: center; margin: 0 auto; max-width: 720px; }
.copy.center p { margin-left: auto; margin-right: auto; }

.ticks { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; }
.ticks li {
  position: relative;
  padding-left: 30px;
  color: var(--muted);
  max-width: 52ch;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px),
              color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Colour */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 12px;
}
.swatch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: 500 0.9375rem/1 var(--sans);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.swatch:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.swatch[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.swatch .cover {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.swatch[data-palette="grille"] .cover { background: radial-gradient(circle at 50% 50%, #fff 0 2px, transparent 2.5px) 0 0 / 8px 8px, linear-gradient(#ff5a6c, #f22a44); }
.swatch[data-palette="night"] .cover { background: radial-gradient(circle at 70% 30%, #9b7cff, transparent 55%), linear-gradient(160deg, #3a3fbf, #14164a); }
.swatch[data-palette="spectrum"] .cover { background: linear-gradient(135deg, #14c3b0 0 33%, #7a3cf0 33% 66%, #ea3b78 66%); }
.swatch[data-palette="dusk"] .cover { background: linear-gradient(180deg, #f6a552, #c63f6d 60%, #4a2c7a); }
.swatch[data-palette="moss"] .cover { background: radial-gradient(circle at 30% 70%, #d6c066, transparent 50%), linear-gradient(200deg, #5c8f4a, #22412b); }

.hint { font-size: 0.9375rem; }

.mini-demo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 4 / 3.4;
  border-radius: 32px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(18px, 4vw, 32px);
  gap: 16px;
}
.mini-aura { z-index: -1; }
.mini-aura .blob { width: 60%; height: 80%; filter: blur(48px); }
.mini-aura .b1 { left: -10%; top: -20%; }
.mini-aura .b2 { right: -15%; top: 10%; left: auto; }
.mini-aura .b3 { left: 20%; bottom: -40%; top: auto; }

.mini-player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
}
.mini-cover {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c1), var(--c2) 55%, var(--c3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.mini-text { flex: 1; display: grid; line-height: 1.3; }
.mini-text small { color: var(--muted); font-size: 0.875rem; }
.mini-play {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--paper);
}
.mini-progress {
  height: 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 15%, transparent);
  overflow: hidden;
}
.mini-progress span {
  display: block;
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: var(--accent);
  animation: progress 18s linear infinite;
}
@keyframes progress { from { width: 8%; } to { width: 92%; } }

/* Music flow */

.flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.flow li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.flow li + li::before {
  content: "";
  position: absolute;
  left: 46px;
  top: -19px;
  width: 2px;
  height: 18px;
  background: repeating-linear-gradient(var(--accent) 0 3px, transparent 3px 6px);
}
.flow li span:last-child { display: grid; line-height: 1.35; }
.flow small { color: var(--muted); font-size: 0.9rem; }
.flow-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.icon-app { background: url("img/icon-256.png") center / cover; border-radius: 12px; }

/* Podcasts gallery */

.gallery {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 5vw, 72px);
  margin-top: clamp(40px, 6vw, 72px);
}
.gallery figure { margin: 0; width: min(320px, 42vw); text-align: center; }
.gallery figure:nth-child(2) { margin-top: clamp(24px, 6vw, 80px); }
.gallery figcaption { margin-top: 20px; color: var(--muted); font-size: 0.9375rem; text-wrap: balance; }

/* One player */

.sources {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: clamp(20px, 4vw, 36px);
  border-radius: 32px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.source {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--paper-2);
  font-weight: 600;
  color: var(--ink);
}
.source svg { color: var(--accent); }
.source.on { box-shadow: 0 0 0 2px var(--accent); }
.wires {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: 56px;
  margin: -16px 0;
  overflow: visible;
}
.wires path {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  transition: stroke 0.6s;
}
.sources[data-on="music"] .w-music,
.sources[data-on="podcasts"] .w-podcasts { stroke: var(--accent); stroke-width: 2.5; }
.one-player {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 35%, var(--card)), color-mix(in srgb, var(--c2) 30%, var(--card)));
}
.one-player > span:last-child { display: grid; line-height: 1.35; }
.one-player small { color: var(--muted); }
.grille {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 22.5%;
  background: url("img/icon-256.png") center / cover;
  box-shadow: 0 8px 20px -8px rgba(242, 42, 68, 0.7);
}

/* Lyrics */

.lyric-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 32px;
  background: color-mix(in srgb, var(--c2) 55%, #000);
  color: #fff;
  box-shadow: var(--shadow);
}
.lyric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--c1) 80%, transparent), transparent 55%),
    radial-gradient(circle at 90% 90%, color-mix(in srgb, var(--c3) 70%, transparent), transparent 50%);
  opacity: 0.85;
}
.lyric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, 0.35);
}
.lyric-card p {
  margin: 0 0 0.45em;
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  opacity: 0.38;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transform-origin: left center;
}
.lyric-card p.now { opacity: 1; transform: scale(1.02); }
.lyric-card p:last-child { margin-bottom: 0; }
.caption { margin: 12px 4px 0; font-size: 0.8125rem; color: var(--muted); }

/* Sync */

.folder {
  padding: 8px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.9375rem;
}
.folder-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  font-weight: 600;
}
.folder-head svg { color: #3b8cf3; }
.sub {
  padding: 12px 16px 4px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
.file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
}
.file:nth-child(odd) { background: var(--paper-2); }
.file code { font-family: var(--mono); font-size: 0.875rem; }
.file small { margin-left: auto; color: var(--muted); }
.file .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.d-phone .dot { background: var(--accent); }
.d-mac .dot { background: color-mix(in srgb, var(--ink) 45%, transparent); }

/* Footer */

.footer {
  padding: clamp(64px, 9vw, 120px) 0 max(56px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  background: var(--paper-2);
}
.footer img { border-radius: 22.5%; box-shadow: var(--shadow); }
.footer .sign {
  margin: 16px 0 8px;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.footer p { max-width: 52ch; margin: 0 auto 10px; color: var(--muted); }
.footer .fine { font-size: 0.8125rem; }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .hero-inner,
  .split { grid-template-columns: 1fr; }
  .split.reverse .copy { order: 0; }
  .hero-inner { text-align: left; }
  .hero-phone .phone { width: min(78vw, 320px); }
  .copy.center { text-align: left; }
}

@media (max-width: 640px) {
  .nav ul { display: none; }
  .gallery { gap: 14px; }
  .gallery figure { width: 50%; }
  .gallery figcaption { font-size: 0.8125rem; }
  .file small { display: none; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  :root { --fade: 0s; }
  html { scroll-behavior: auto; }
  .blob,
  .mini-progress span { animation: none; }
  .hero-phone .phone { transform: none; }
  .lyric-card p,
  .swatch { transition: none; }
}

@media (forced-colors: active) {
  .swatch[aria-pressed="true"] { outline: 3px solid Highlight; }
}
