/* ==========================================================================
   my lyrics annotations
   Everything is scoped to #annot (the overlay) and #annot-open (the entry
   button), so nothing here can change the rest of the site.
   ========================================================================== */

/* Theme colours are registered so a theme switch can fade every colour in the
   overlay at once (one transition on .annot-ui, everything else just reads
   var()). Browsers without @property simply switch instantly. */
@property --a-bg      { syntax: "<color>";  inherits: true; initial-value: #151517; }
@property --a-ink     { syntax: "<color>";  inherits: true; initial-value: #f3efe6; }
@property --a-ink2    { syntax: "<color>";  inherits: true; initial-value: #a29e95; }
@property --a-surface { syntax: "<color>";  inherits: true; initial-value: rgba(255, 255, 255, 0.06); }
@property --a-line    { syntax: "<color>";  inherits: true; initial-value: rgba(255, 255, 255, 0.14); }
@property --a-focus   { syntax: "<color>";  inherits: true; initial-value: #ffe94d; }
@property --a-prog    { syntax: "<color>";  inherits: true; initial-value: #ffe94d; }
@property --a-scrim   { syntax: "<number>"; inherits: true; initial-value: 0.68; }

/* ---------- entry button (replaces the About Me card) ---------------------- */

.about-card {
  /* the card is kept as a navigation section, but it is only a button now */
  background: none;
  border: 0;
  box-shadow: none;
  padding-block: 8px;
}

#annot-open {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px 10px 16px;
  border-radius: 9999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  cursor: pointer;
  opacity: 0.78;
  transition: opacity 0.4s ease, letter-spacing 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#annot-open::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--annot-yellow, #ffe94d);
  opacity: 0.75;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  animation: annot-open-dot 3.8s ease-in-out infinite;
}

#annot-open:hover,
#annot-open:focus-visible {
  opacity: 1;
  letter-spacing: 0.2em;
}

#annot-open:hover::before,
#annot-open:focus-visible::before {
  transform: scale(1.5);
  opacity: 1;
}

#annot-open:active {
  transform: scale(0.97);
}

@keyframes annot-open-dot {
  50% {
    opacity: 0.25;
  }
}

/* ---------- overlay shell -------------------------------------------------- */

#annot {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow: hidden;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#annot[hidden],
#annot [hidden] {
  display: none !important; /* author display rules below must never beat the hidden attribute */
}

#annot button,
#annot a {
  font-family: inherit;
}

#annot :focus-visible {
  outline: 2px solid var(--a-focus);
  outline-offset: 3px;
}

.annot-layer {
  position: absolute;
  inset: 0;
  clip-path: circle(0px at 50% 50%);
  pointer-events: none;
}
.annot-layer[data-l="1"] { background: var(--annot-yellow, #ffe94d); } /* warm genius yellow */
.annot-layer[data-l="2"] { background: #0a0a0b; } /* near-black */
.annot-layer[data-l="3"] { background: #151517; } /* charcoal, same as the dark interface */

.annot-ui {
  position: absolute;
  inset: 0;
  color: var(--a-ink);
  transition:
    --a-bg 420ms ease, --a-ink 420ms ease, --a-ink2 420ms ease, --a-surface 420ms ease,
    --a-line 420ms ease, --a-focus 420ms ease, --a-prog 420ms ease, --a-scrim 420ms ease,
    opacity 0.35s ease;
}

.annot-ui[data-theme="dark"] {
  --a-bg: #151517;
  --a-ink: #f3efe6;
  --a-ink2: #a29e95;
  --a-surface: rgba(255, 255, 255, 0.06);
  --a-line: rgba(255, 255, 255, 0.14);
  --a-focus: var(--annot-yellow, #ffe94d);
  --a-prog: var(--annot-yellow, #ffe94d);
  --a-scrim: 0.68;
}

.annot-ui[data-theme="light"] {
  --a-bg: #f6f1e4;
  --a-ink: #17160f;
  --a-ink2: #6a665c;
  --a-surface: rgba(255, 253, 247, 0.72);
  --a-line: rgba(23, 22, 15, 0.16);
  --a-focus: #17160f;
  --a-prog: #17160f;
  --a-scrim: 0.72;
}

.annot-ui.is-leaving {
  opacity: 0;
  pointer-events: none;
}

/* background: theme colour, blurred artwork wash, scrim for contrast */
.annot-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--a-bg);
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.annot-ui.is-bg-on .annot-bg {
  opacity: 1;
}

.annot-wash {
  position: absolute;
  inset: -14%;
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(1.15);
  opacity: 0;
  transition: opacity 1s ease;
}
.annot-wash.on {
  opacity: 1;
}

.annot-scrim {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--a-bg) calc(var(--a-scrim) * 100%), transparent);
}

/* ---------- top bar: persistent title + theme / exit ---------------------- */

.annot-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) clamp(20px, 5vw, 80px) 0;
  pointer-events: none;
}
.annot-top > * {
  pointer-events: auto;
}

.annot-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 44px;
  white-space: nowrap;
  color: var(--a-ink);
  opacity: 0;
  transform-origin: 0 0;
  transition: color 0.7s ease;
}
.annot-ui:not(.is-bg-on) .annot-title {
  color: #f3efe6; /* the covering layers are dark, whatever theme comes next */
}
.annot-ui[data-phase="intro"] .annot-title,
.annot-ui[data-phase="song"] .annot-title,
.annot-ui[data-phase="end"] .annot-title {
  opacity: 1;
}

.annot-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.annot-ui[data-phase="intro"] .annot-actions,
.annot-ui[data-phase="song"] .annot-actions,
.annot-ui[data-phase="end"] .annot-actions {
  opacity: 1;
}

.annot-ibtn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--a-ink2);
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.annot-ibtn:hover {
  color: var(--a-ink);
  background: var(--a-surface);
  border-color: var(--a-line);
}
.annot-ibtn:active {
  transform: scale(0.92);
}
.annot-ibtn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* sun/moon: show the icon of the current mode, crossfade on change */
#annot-theme svg {
  position: absolute;
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.annot-ui[data-theme="dark"] .i-sun,
.annot-ui[data-theme="light"] .i-moon {
  opacity: 0;
  transform: rotate(-40deg) scale(0.6);
}

/* ---------- introductory screen ------------------------------------------- */

.annot-intro {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s 0.45s;
}
.annot-ui[data-phase="intro"] .annot-intro,
.annot-ui.is-morphing .annot-intro {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.9s ease, visibility 0s;
}

.annot-intro-inner {
  position: relative;
  display: grid;
  justify-items: center;
}

.annot-hint {
  position: absolute;
  bottom: calc(100% + 26px);
  margin: 0;
  font-size: 0.85rem;
  font-style: italic;
  letter-spacing: 0.1em;
  white-space: nowrap;
  color: var(--a-ink2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.annot-hint.on {
  opacity: 1;
  transform: none;
}

.annot-start {
  position: relative;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1px solid var(--a-line);
  border-radius: 50%;
  background: var(--a-surface);
  color: var(--a-ink);
  cursor: pointer;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, background-color 0.3s ease;
}
.annot-start::after {
  content: "";
  position: absolute;
  inset: -11px;
  border: 1px solid var(--a-line);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.92);
  animation: annot-breathe 4.2s ease-in-out infinite;
  pointer-events: none;
}
.annot-start:hover {
  transform: scale(1.06);
  border-color: var(--a-ink2);
}
.annot-start:hover::after {
  animation: none;
  opacity: 0.9;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.annot-start:active {
  transform: scale(0.97);
}
.annot-start svg {
  grid-area: 1 / 1;
  width: 30px;
  height: 30px;
  fill: currentColor;
  transition: opacity 0.2s ease;
}
.annot-start .i-pause,
.annot-start.is-playing .i-play {
  opacity: 0;
}
.annot-start.is-playing .i-pause {
  opacity: 1;
}
.annot-start .i-play {
  transform: translateX(2px);
}

@keyframes annot-breathe {
  0%, 100% { opacity: 0; transform: scale(0.92); }
  50% { opacity: 0.7; transform: scale(1); }
}

/* ---------- stage: artwork left, lyric + annotation right ---------------- */

.annot-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: clamp(32px, 6vw, 104px);
  align-items: center;
  padding: 92px clamp(20px, 5vw, 80px) 116px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.annot-ui[data-phase="song"] .annot-stage {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease 0.1s, visibility 0s;
}

.annot-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

.annot-art {
  /* the box takes the cover's own aspect ratio (set from JS once the image is known), so the
     artwork is never cropped or letterboxed and the title sits right under it */
  --art-h: min(calc(100dvh - 340px), 520px);
  display: grid;
  width: min(100%, calc(var(--art-h) * var(--ratio, 1)));
  min-width: 140px;
  aspect-ratio: var(--ratio, 1);
}
.annot-art img,
.annot-art-fallback {
  grid-area: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 24px 48px -22px rgba(0, 0, 0, 0.6), 0 4px 14px -6px rgba(0, 0, 0, 0.4);
}
.annot-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.annot-art-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 22% 20%, hsl(var(--h) 62% 48%), transparent 62%),
    radial-gradient(circle at 80% 86%, hsl(calc(var(--h) + 42) 66% 42%), transparent 60%),
    hsl(var(--h) 45% 18%);
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 700;
  text-transform: lowercase;
}

.annot-meta {
  min-width: 0;
  max-width: 100%;
}
.annot-song {
  margin: 0;
  font-size: clamp(1.15rem, 1.7vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.annot-artist {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: var(--a-ink2);
  overflow-wrap: anywhere;
}

.annot-right {
  min-width: 0;
  height: 100%;
  min-height: 0;
}
.annot-scroll {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--a-line) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 28px), transparent 100%);
}
.annot-scroll:focus-visible {
  outline-offset: -2px;
}
.annot-copy {
  /* margin:auto centres short content and lets tall content scroll from the top */
  margin-block: auto;
  padding: 28px 8px 28px 0;
  max-width: 42rem;
}

.annot-lyrics {
  margin: 0 0 clamp(28px, 4.5vh, 48px);
}
.annot-ctx {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.6;
  color: var(--a-ink2);
  white-space: pre-line;
}
.annot-lyric {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.68;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}
.annot-hl {
  padding: 0.08em 0.28em;
  border-radius: 2px;
  background: var(--annot-yellow, #ffe94d);
  color: #141412;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.annot-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: var(--a-ink2);
}
.annot-label::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--annot-yellow, #ffe94d);
}
.annot-body p {
  margin: 0 0 1.1em;
  font-size: clamp(1rem, 1.12vw, 1.12rem);
  line-height: 1.78;
  white-space: pre-line;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}
.annot-body p:last-child {
  margin-bottom: 0;
}
.annot-genius {
  display: inline-block;
  margin-top: 22px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--a-ink2);
  text-decoration: underline;
  text-decoration-color: var(--a-line);
  text-underline-offset: 4px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.annot-genius:hover {
  color: var(--a-ink);
  text-decoration-color: var(--annot-yellow, #ffe94d);
}

/* staged reveal for artwork / meta / lyrics / annotation.
   Only the left column slides sideways; the scrollable right column moves vertically so its edge never clips. */
.annot-lyrics,
.annot-note {
  --rx: 0px;
}
[data-r] {
  transition: opacity 0.62s ease var(--d, 0s), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) var(--d, 0s);
}
[data-r].is-pre {
  opacity: 0;
  transform: translate3d(var(--rx, 0px), 16px, 0);
  transition: none;
}
[data-r].is-out {
  opacity: 0;
  transform: translate3d(calc(var(--rx, 0px) * -0.6), -8px, 0);
  transition: opacity 0.22s ease, transform 0.26s ease;
}

/* ---------- player dock + navigation -------------------------------------- */

.annot-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 5vw, 80px) max(24px, env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.annot-dock > * {
  pointer-events: auto;
}
.annot-ui[data-phase="song"] .annot-dock {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease 0.2s, visibility 0s;
}

.annot-player {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(340px, 100%);
  transition: opacity 0.35s ease;
}
.annot-ui[data-phase="end"] .annot-player {
  opacity: 0;
  pointer-events: none;
}

.annot-playbtn {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--a-line);
  border-radius: 50%;
  background: var(--a-surface);
  color: var(--a-ink);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.annot-playbtn:hover {
  border-color: var(--a-ink2);
}
.annot-playbtn:active {
  transform: scale(0.94);
}
.annot-playbtn:disabled {
  opacity: 0.4;
  cursor: default;
}
.annot-ui.is-morphing .annot-playbtn {
  opacity: 0;
}
.annot-playbtn svg {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: opacity 0.2s ease;
}
.annot-playbtn .i-replay {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.annot-playbtn .i-play { transform: translateX(1px); }
.annot-playbtn svg { opacity: 0; }
.annot-ui[data-seg="playing"] .annot-playbtn .i-pause,
.annot-ui[data-seg="ended"] .annot-playbtn .i-replay,
.annot-ui:is([data-seg="paused"], [data-seg="none"], [data-seg="error"], [data-seg="idle"]) .annot-playbtn .i-play {
  opacity: 1;
}

.annot-prog {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 9px;
}
.annot-track {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: var(--a-line);
  overflow: hidden;
}
.annot-fill {
  position: absolute;
  inset: 0;
  background: var(--a-prog);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.annot-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--a-ink2), transparent);
  transform: translateX(-100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.annot-ui.is-loading .annot-track::after {
  opacity: 0.8;
  animation: annot-load 1.3s linear infinite;
}
@keyframes annot-load {
  to { transform: translateX(100%); }
}
.annot-time {
  display: flex;
  justify-content: space-between;
  min-height: 1.1em;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--a-ink2);
}
.annot-status {
  color: var(--a-ink2);
}

.annot-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.annot-count {
  margin-right: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  color: var(--a-ink2);
}
.annot-nav .annot-ibtn {
  width: 48px;
  height: 48px;
  border-color: var(--a-line);
  color: var(--a-ink);
}
.annot-nav .annot-ibtn:hover {
  background: var(--a-surface);
  border-color: var(--a-ink2);
}
.annot-nav .annot-ibtn:disabled {
  opacity: 0.28;
  pointer-events: none;
}

/* ---------- end of the collection ----------------------------------------- */

.annot-end {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--a-line) transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.annot-ui[data-phase="end"] .annot-end {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease 0.2s, visibility 0s;
}
.annot-end-screen {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 28px;
  min-height: 100dvh;
  padding: 0 24px 72px;
  text-align: center;
}
.annot-end-line {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.annot-end-line::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin: 18px auto 0;
  background: var(--annot-yellow, #ffe94d);
}
.annot-end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.annot-textbtn {
  padding: 12px 22px;
  border: 1px solid var(--a-line);
  border-radius: 9999px;
  background: transparent;
  color: var(--a-ink);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.annot-textbtn:hover {
  background: var(--a-surface);
  border-color: var(--a-ink2);
}
.annot-textbtn:active {
  transform: scale(0.97);
}

.annot-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- small screens: one column, controls in a bottom bar ----------- */

@media (max-width: 820px) {
  .annot-stage {
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 84px 22px calc(128px + env(safe-area-inset-bottom));
  }
  .annot-left {
    gap: 18px;
    margin-bottom: 30px;
  }
  .annot-art {
    --art-h: 52dvh;
    width: min(100%, 340px, calc(var(--art-h) * var(--ratio, 1)));
    min-width: 0;
  }
  .annot-right {
    height: auto;
  }
  .annot-scroll {
    display: block;
    height: auto;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .annot-copy {
    margin: 0;
    padding: 0;
    max-width: none;
  }
  .annot-lyric {
    font-size: clamp(1.3rem, 5.4vw, 1.7rem);
  }
  .annot-dock {
    gap: 12px;
    padding-top: 40px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--a-bg) 58%, transparent);
  }
  .annot-player {
    flex: 1;
    width: auto;
    gap: 14px;
  }
  .annot-time,
  .annot-count {
    display: none;
  }
  .annot-nav {
    gap: 8px;
  }
  .annot-title {
    font-size: 0.92rem;
  }
  /* scrolled text slides under a soft bar instead of colliding with the title and buttons */
  .annot-top {
    padding-bottom: 22px;
    background: linear-gradient(to bottom, var(--a-bg) 76%, transparent);
  }
  .annot-ui:not([data-phase="song"]) .annot-top {
    background: none;
  }
}

/* short landscape screens (phones on their side) */
@media (min-width: 821px) and (max-height: 560px) {
  .annot-stage {
    padding-top: 72px;
    padding-bottom: 96px;
  }
  .annot-art {
    --art-h: min(calc(100dvh - 250px), 520px);
  }
  .annot-left {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #annot-open::before,
  .annot-start::after {
    animation: none;
  }
  .annot-ui {
    transition-duration: 150ms;
  }
  [data-r],
  [data-r].is-pre,
  [data-r].is-out {
    transform: none;
    transition: opacity 0.2s ease;
  }
  .annot-wash,
  .annot-bg {
    transition-duration: 0.25s;
  }
  .annot-hint {
    transform: none;
    transition: opacity 0.3s ease;
  }
}


/* ---------- autoplay switch (top right, next to theme + exit) ------------- */

.annot-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--a-ink2);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}
.annot-switch:hover {
  color: var(--a-ink);
  background: var(--a-surface);
}
.annot-switch-track {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border: 1px solid var(--a-line);
  border-radius: 9999px;
  background: var(--a-surface);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.annot-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--a-ink2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}
.annot-switch.is-on {
  color: var(--a-ink);
}
.annot-switch.is-on .annot-switch-track {
  background: var(--annot-yellow, #ffe94d);
  border-color: var(--annot-yellow, #ffe94d);
}
.annot-switch.is-on .annot-switch-knob {
  transform: translateX(14px);
  background: #141412;
}
.annot-ui[data-phase="end"] .annot-switch {
  opacity: 0;
  pointer-events: none;
}

/* ---------- end screen: arrow down to the full songs ---------------------- */

.annot-more {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--a-ink2);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  cursor: pointer;
  transform: translateX(-50%);
  transition: color 0.25s ease;
}
.annot-more:hover {
  color: var(--a-ink);
}
.annot-more svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: annot-nudge 2.6s ease-in-out infinite;
}
@keyframes annot-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
.annot-ui[data-phase="end"] .annot-top {
  padding-bottom: 20px;
  background: linear-gradient(to bottom, var(--a-bg) 70%, transparent);
}

/* ---------- full songs: player left, playlist right ----------------------- */

.annot-full {
  min-height: 100dvh;
  padding: 104px clamp(20px, 5vw, 80px) 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}
.annot-full-label {
  margin: 0;
}
.annot-full-label:focus-visible {
  outline-offset: 6px;
}
.annot-full-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: stretch;
  width: 100%;
  max-width: 1800px;
}
.annot-player-wrap {
  min-width: 0;
}
.annot-yt {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: calc((100dvh - 250px) * 16 / 9); /* as big as the column allows, but never taller than the screen */
  overflow: hidden;
  border: 1px solid var(--a-line);
  border-radius: 12px;
  background: #000; /* the embedded player brings its own look */
  box-shadow: 0 24px 48px -26px rgba(0, 0, 0, 0.6);
}
.annot-yt iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.annot-now {
  margin: 14px 2px 0;
  font-size: 0.9rem;
  color: var(--a-ink2);
}

/* contain: size keeps the playlist from stretching the row, so it is exactly as tall as the player and scrolls inside */
.annot-pl {
  contain: size;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.annot-pl-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--a-line) transparent;
}
.annot-pl-item {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--a-line);
  border-radius: 10px;
  background: transparent;
  color: var(--a-ink);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.annot-pl-item:hover {
  background: var(--a-surface);
  border-color: var(--a-ink2);
}
.annot-pl-item:active {
  transform: scale(0.99);
}
.annot-pl-item.is-current {
  background: var(--a-surface);
  border-color: var(--a-ink2);
}
.annot-pl-item.is-current::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: var(--annot-yellow, #ffe94d);
}
.annot-pl-thumb {
  display: block;
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--a-surface);
}
.annot-pl-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.annot-pl-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.annot-pl-artist {
  font-size: 0.8rem;
  color: var(--a-ink2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.annot-pl-idx {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--a-ink2);
}

@media (max-width: 820px) {
  .annot-switch-text {
    display: none;
  }
  .annot-switch {
    padding: 0 6px;
  }
  .annot-full {
    justify-content: flex-start;
    padding-top: 92px;
  }
  .annot-full-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .annot-yt {
    max-width: none; /* phones keep the player exactly as before */
  }
  .annot-pl {
    contain: none;
  }
  .annot-pl-list {
    max-height: 340px;
  }
  .annot-pl-item {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .annot-pl-thumb {
    width: 80px;
    height: 45px;
  }
  .annot-pl-idx {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .annot-more svg {
    animation: none;
  }
}
