:root {
  --pine-deep: #0d2419;
  --pine: #143226;
  --pine-lift: #1c4333;
  --leaf: #5c9a76;
  --leaf-dim: #24503d;
  --ube: #c8b1ea;
  --ube-pale: #e6daf6;
  --ink: #eee8f5;
  --ink-soft: #a9bdb0;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Be Vietnam Pro", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --vine-w: 64px;
}

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

html { scroll-behavior: smooth; background: var(--pine-deep); }

body {
  margin: 0;
  background: var(--pine-deep);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

p, h1, h2, ol { margin: 0; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ube); outline-offset: 3px; }

.petals { fill: var(--petal, var(--ube)); }
.heart { fill: var(--core, var(--pine-deep)); }

/* Hero */

.hero {
  position: relative;
  min-height: 86vh;
  min-height: 86svh;
  display: flex;
  align-items: flex-end;
  padding: var(--gutter);
  padding-bottom: clamp(48px, 9vh, 96px);
  overflow: hidden;
}

.hero-bloom {
  position: absolute;
  width: min(92vh, 120vw);
  aspect-ratio: 1;
  top: -14%;
  right: -16%;
  transform: rotate(14deg);
  overflow: visible;
}
.hero-bloom { --petal: var(--pine); }

.hero-inner {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

h1 {
  font-family: var(--display);
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(3rem, 10.5vw, 8.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--ube-pale);
  max-width: 11em;
}
h1 em { display: block; font-style: italic; color: var(--ube); }

.hero-sub {
  margin-top: 1.5rem;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  color: var(--ube-pale);
}

/* Player and song list */

.story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px);
  max-width: calc(1120px + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(32px, 6vh, 64px) var(--gutter) 0;
  scroll-margin-top: 16px;
}

.stage {
  position: sticky;
  top: 32px;
  align-self: start;
}

.frame {
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: var(--pine);
  box-shadow: 0 0 0 1px var(--leaf-dim), 0 24px 60px -24px #000;
}
.frame iframe, .frame #player { display: block; width: 100%; height: 100%; border: 0; }

.now {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 18px;
}
.now-text { min-width: 0; }
.now-count { font-size: .8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.now-title {
  margin-top: 4px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--ube-pale);
}
.now-artist { margin-top: 4px; color: var(--ink-soft); }

.now-controls { display: flex; gap: 6px; flex: none; }
.now-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--leaf-dim);
  border-radius: 50%;
  background: transparent;
  color: var(--ube);
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.now-controls button:hover:not(:disabled) { background: var(--pine-lift); }
.now-controls button:disabled { opacity: .35; cursor: default; }
.now-controls svg { width: 20px; height: 20px; fill: currentColor; }

.now-error { margin-top: 12px; font-size: .875rem; color: var(--ube); }

.path { position: relative; }
.vine {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--vine-w);
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.vine-base { fill: none; stroke: var(--leaf-dim); stroke-width: 2; stroke-linecap: round; }
.vine-grown path.stem { fill: none; stroke: var(--leaf); stroke-width: 2.5; stroke-linecap: round; }
.vine-grown path.leaf { fill: var(--leaf); }

.bud { fill: var(--leaf-dim); transition: opacity .3s ease; }
.vine-node.open .bud { opacity: 0; }

.blossom {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0) rotate(-50deg);
  transition: transform .6s cubic-bezier(.3, 1.5, .5, 1);
}
.vine-node.open .blossom { transform: scale(1) rotate(0); }

.vine-node.playing .spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: turn 9s linear infinite;
}
@keyframes turn { to { transform: rotate(360deg); } }

.tracks { position: relative; list-style: none; padding-left: var(--vine-w); }

.track {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color .2s ease;
}
.tracks li { scroll-margin: 32px 0; }
.track:hover { background: var(--pine); }
.track[aria-current="true"] { background: var(--pine-lift); }

.thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(130deg, #8b6dbd, #2c6a50);
  isolation: isolate;
}
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: luminosity;
}
.track:hover .thumb img,
.track[aria-current="true"] .thumb img { mix-blend-mode: normal; }

.track-title {
  display: block;
  font-family: var(--display);
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.25;
  transition: color .2s ease;
}
.track[aria-current="true"] .track-title { color: var(--ube); }

.track-meta {
  display: block;
  margin-top: 3px;
  font-size: .875rem;
  color: var(--ink-soft);
}
.track-meta b { font-weight: 400; color: var(--ube); font-variant-numeric: tabular-nums; margin-right: .5em; }

.song-note {
  margin: 8px 14px 36px;
  font-family: var(--display);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ube-pale);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.song-note.is-empty {
  padding: 14px 16px;
  border: 1px dashed var(--leaf);
  border-radius: 8px;
  font-family: var(--body);
  font-size: .875rem;
  color: var(--ink-soft);
}

.foot { padding: clamp(48px, 8vh, 80px) var(--gutter) 48px; text-align: center; font-size: .875rem; color: var(--ink-soft); }

/* Phones and narrow windows: the player sticks to the top while the songs scroll under it. */

@media (max-width: 860px) {
  :root { --vine-w: 44px; }

  .story { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 0; }

  .stage {
    top: 0;
    z-index: 5;
    margin-inline: calc(-1 * var(--gutter));
    padding: 12px var(--gutter) 12px;
    background: var(--pine-deep);
    box-shadow: 0 12px 20px -12px var(--pine-deep);
  }
  .now { margin-top: 10px; align-items: center; }
  .now-count { display: none; }
  .now-title { margin-top: 0; font-size: 1.0625rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .now-artist { margin-top: 0; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .track { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 12px 8px; }
  .tracks li { scroll-margin: 320px 0 24px; }
  .song-note { margin: 6px 8px 28px; }
  .track-title { font-size: 1.0625rem; }
}

/* Landscape phones have no room for a sticky video. */
@media (max-height: 520px) {
  .stage { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blossom, .bud { transition: none; }
  .vine-node.playing .spin { animation: none; }
}
