/* ---------- fonts (self-hosted, SIL OFL — see assets/fonts/OFL.txt) ---------- */
@font-face {
  font-family: "Cascadia Mono";
  src: url("../assets/fonts/CascadiaMono-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Cascadia Mono";
  src: url("../assets/fonts/CascadiaMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- theme tokens ---------- */
:root {
  --bg: #f2f6f9;
  --surface: #ffffff;
  --ink: #34333e; /* main purple */
  --purple-light: #68667b;
  --gray-light: #c3cdca;
  --on-ink: #ffffff;
  --accent-pink: #b3217e; /* popup ornaments only */
  --accent-violet: #5b3fd0;
  --fill: var(--ink); /* solid bands: footer, card titles, buttons */
  --edge: var(--ink); /* navbar outline, divider line */
  --rule: var(--ink); /* heading rules */
  --rule-soft: var(--gray-light);
  --frame: var(--ink); /* video frames */
  --card: var(--purple-light); /* card stats band */
  --hover: var(--purple-light);
  --plate-face: var(--surface);
  --backdrop: rgba(20, 20, 28, .55);

  --font: "Cascadia Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --gutter: clamp(1rem, 3.5vw, 4rem);
  --content-max: 96rem;
  --notch: 1.6rem;
  --outline: .65rem; /* purple edge on the lower slant of the point */
  --outline-bottom: .3rem; /* purple edge along the straight bottom */
}

/* dark theme: set on <html data-theme="dark"> by shell.js */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e2122;
  --surface: #17191a;
  --ink: #cfc6ba;
  --purple-light: #9d9588;
  --gray-light: #3a3f42;
  --on-ink: #e6dfd4;
  --accent-pink: #cfc6ba;
  --accent-violet: #a89d8c;
  --fill: #373c3f;
  --edge: #3a3f42;
  --rule: #8a7f6e;
  --rule-soft: #3a3f42;
  --frame: #756b5e;
  --card: #50565a;
  --hover: #e6dfd4;
  --backdrop: rgba(0, 0, 0, .65);
}

/* added by shell.js for the moment after a theme toggle, so colors fade
   instead of snapping (not on page load) */
html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, fill .4s ease, stroke .4s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-fade, html.theme-fade *, html.theme-fade *::before, html.theme-fade *::after { transition: none !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.5rem);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--on-ink); padding: .5rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* shared focus ring for anything without its own hover treatment */
:focus-visible { outline: 3px solid var(--purple-light); outline-offset: 3px; }

/* ---------- navbar plates ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.plate {
  display: flow-root; /* keeps the face's bottom margin inside the plate */
  background: var(--edge);
  clip-path: polygon(var(--notch) 0, 0 50%, var(--notch) 100%, 100% 100%, 100% 0);
}
.plate--left {
  clip-path: polygon(0 0, 0 100%, calc(100% - var(--notch)) 100%, 100% 50%, calc(100% - var(--notch)) 0);
}
.plate__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  background: var(--surface);
  color: var(--ink);
  margin: 0 0 var(--outline-bottom);
  min-height: 5rem;
  padding: 0 2rem 0 calc(var(--notch) + 1rem);
  /* plate shape shifted up, so purple shows along the bottom and the lower
     slant only; the slant band tapers from --outline to --outline-bottom */
  clip-path: polygon(var(--notch) calc(var(--outline) * -1), 0 calc(50% + (var(--outline-bottom) / 2) - var(--outline)), var(--notch) 100%, 100% 100%, 100% calc(var(--outline) * -1));
  transition: background-color .3s, color .3s;
}
.plate--left .plate__face {
  clip-path: polygon(0 calc(var(--outline) * -1), 0 100%, calc(100% - var(--notch)) 100%, 100% calc(50% + (var(--outline-bottom) / 2) - var(--outline)), calc(100% - var(--notch)) calc(var(--outline) * -1));
  padding: 0 calc(var(--notch) + 1rem) 0 2rem;
}

.nav-desktop .plate__face { padding-left: calc(var(--notch) + 2.5rem); padding-right: 3.5rem; }
.nav-list { display: flex; align-items: center; }
.nav-list li { display: flex; align-items: center; }
.nav-list li + li::before { content: ""; width: 1px; height: 1.1rem; background: var(--edge); margin: 0 3rem; }

.nav-link {
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: .25rem .1rem;
  font-weight: 300;
  font-size: 1.1em;
  transition: color .15s;
}
.nav-link:is(:hover, :focus-visible) { color: var(--hover); }
.nav-link:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 4px; }
.nav-link[aria-current="page"] { text-decoration: underline; text-underline-offset: .35em; }
.nav-link svg { display: block; width: 1.5rem; height: 1.5rem; }

.nav-mobile { display: none; position: relative; width: min(17rem, 60vw); }
.menu-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; position: relative; z-index: 2; }
.menu-btn .plate__face { font-size: 1.1em; padding: 0 1.25rem 0 calc(var(--notch) + .5rem); }
.menu-btn svg { width: 1.65rem; height: 1.65rem; }
.menu-btn[aria-expanded="true"] .plate__face { background: var(--fill); color: var(--on-ink); }
.menu-btn:focus-visible { outline: none; }
.menu-btn:focus-visible .plate__face { color: var(--hover); }
.menu-btn[aria-expanded="true"]:focus-visible .plate__face { color: var(--on-ink); box-shadow: inset 0 0 0 3px var(--purple-light); }

.menu-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 1; visibility: hidden; transition: visibility 0s .35s; }
.menu-list[data-open="true"] { visibility: visible; transition-delay: 0s; }
.menu-list li { transform: translateY(-110%); opacity: 0; transition: transform .35s ease, opacity .25s; }
.menu-list[data-open="true"] li { transform: none; opacity: 1; }
.menu-list li:nth-child(2) { transition-delay: .04s; }
.menu-list li:nth-child(3) { transition-delay: .08s; }
.menu-list .plate { width: 100%; padding: 0; border: 0; cursor: pointer; text-decoration: none; }
.menu-list .plate__face { font-size: 1.1em; min-height: 4.6rem; }
.menu-list .plate:is(:hover, :focus-visible) .plate__face { color: var(--hover); }
.menu-list .plate:focus-visible { outline: none; }

@media (max-width: 48rem) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .plate { --notch: 1.3rem; }
  .plate__face { min-height: 4.4rem; }
  .plate--left .plate__face { padding-left: 1.25rem; padding-right: calc(var(--notch) + .75rem); }
}
@media (prefers-reduced-motion: reduce) {
  .menu-list li, .menu-list, .plate__face, .nav-link { transition: none; }
}

/* ---------- page frame ---------- */
main { flex: 1; width: 100%; }
.page {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(7rem, 12vw, 11rem) var(--gutter) 4rem;
}
.page-title, .section-title {
  margin: 0 0 2.5rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--rule);
  font-weight: 300;
  font-size: clamp(1.5rem, 1rem + 1.3vw, 2.5rem);
  line-height: 1.3;
}
.section-title { margin-top: 5rem; font-size: clamp(1.2rem, .85rem + 1.1vw, 2rem); }

.status { margin: 3rem 0; font-weight: 400; }

/* ---------- landing ---------- */
.hero {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(16rem, 40vh, 32rem) var(--gutter) clamp(14rem, 35vh, 28rem);
}
.hero__inner { width: min(54rem, 100%); display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.hero h1 {
  margin: 0;
  font-weight: 300;
  text-align: center;
  font-size: clamp(1.2rem, 0.45rem + 2.25vw, 2.7rem);
  line-height: 1.25;
}
.divider { display: flex; align-items: center; width: 100%; color: var(--ink); }
.divider__line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--edge), color-mix(in srgb, var(--purple-light) 45%, var(--bg)) 50%, var(--edge)); }
.divider svg { width: 1.8rem; height: 1.3rem; flex: none; }

.btn-more { --btn: var(--fill); display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); margin-top: -1rem; }
.btn-more__chev { display: block; width: 2rem; height: 2.6rem; flex: none; background: var(--btn); transition: background-color .15s; }
.btn-more__chev--left { clip-path: polygon(65% 0, 100% 0, 35% 50%, 100% 100%, 65% 100%, 0 50%); }
.btn-more__chev--right { clip-path: polygon(35% 0, 0 0, 65% 50%, 0 100%, 35% 100%, 100% 50%); }
.btn-more__plate {
  background: var(--btn);
  color: var(--on-ink);
  font-weight: 300;
  font-size: clamp(1rem, .8rem + .7vw, 1.6rem);
  display: flex;
  align-items: center;
  height: 2.6rem; /* same as the arrows */
  padding: 0 2.6rem;
  /* 1.3rem = half the height, so the ends have the same 45° point as the arrows */
  clip-path: polygon(1.3rem 0, calc(100% - 1.3rem) 0, 100% 50%, calc(100% - 1.3rem) 100%, 1.3rem 100%, 0 50%);
  transition: background-color .15s;
}
.btn-more:is(:hover, :focus-visible) { --btn: var(--card); }
.btn-more:focus-visible { outline: 3px solid var(--purple-light); outline-offset: 4px; }

/* ---------- footer ---------- */
.streaming {
  background-color: var(--fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='180' fill='none' stroke='%23fff' stroke-opacity='.06' stroke-width='4'%3E%3Cpath d='M0 0L380 180M120 0V180M440 0V180M520 0L640 60'/%3E%3C/svg%3E");
  background-size: 640px 180px;
  padding: 3.25rem var(--gutter);
}
.streaming__list { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; }
.badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 11.5rem;
  height: 3.3rem;
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.15;
  font-weight: 400;
  transition: filter .15s, transform .15s;
}
.badge__pre { font-size: .7rem; font-weight: 300; }
.badge__name { font-size: 1rem; font-weight: 400; }
.badge:is(:hover, :focus-visible) { filter: brightness(1.12); transform: translateY(-2px); }
.badge:focus-visible { outline: 3px solid var(--on-ink); outline-offset: 3px; }
.badge--apple { background: linear-gradient(90deg, #d12a55, #7b3fd8); color: #fff; } /* darker pink end keeps white text at 4.5:1+ */
.badge--ytm { background: #c4161c; color: #fff; }
.badge--spotify { background: #1ed760; color: #0b0b0b; }

.legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  font-size: .8rem;
  font-weight: 400;
}
.legal p { margin: 0; }
.legal__links { display: flex; gap: .6rem; align-items: center; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.legal a, .linklike { transition: color .15s; }
.legal :is(a, .linklike):is(:hover, :focus-visible) { color: var(--hover); }

@media (max-width: 48rem) {
  .streaming__list { flex-direction: column; align-items: center; gap: 1.25rem; }
  .legal { flex-direction: column-reverse; text-align: center; gap: .9rem; }
}

/* ---------- popups (native <dialog>) ---------- */
.popup {
  padding: 0;
  border: 0;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--accent-pink), var(--accent-violet)) 1;
  background: var(--surface);
  color: var(--ink);
  width: min(34rem, calc(100vw - 2rem));
  font-family: var(--font);
  font-weight: 400;
  text-align: center;
}
.popup::backdrop { background: var(--backdrop); }
.popup__inner { padding: 2.25rem 2rem 1.75rem; }
.popup h2 { margin: 0 0 .75rem; font-size: 1.05rem; font-weight: 400; }
.popup p { margin: 0 0 .75rem; font-size: .95rem; }
.popup a { color: var(--accent-violet); text-underline-offset: .2em; font-size: 1.05rem; }
.popup a:is(:hover, :focus-visible) { color: var(--hover); }
.popup__close {
  position: absolute; top: .6rem; right: .6rem;
  width: 2.25rem; height: 2.25rem; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--ink);
}
.popup__close:is(:hover, :focus-visible) { color: var(--hover); }
.popup__close svg { width: 1rem; height: 1rem; }
.ornament { display: flex; justify-content: center; gap: .6rem; margin-top: 1.25rem; }
.ornament svg { width: .9rem; height: .9rem; }

/* ---------- about ---------- */
.prose p { margin: 0 0 1.6em; }
.prose .genres { margin: -0.9em 0 1.6em; }
.prose .genres li::before { content: "- "; }

/* ---------- song cards ---------- */
.songcard {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--on-ink);
  background: var(--card);
  text-align: center;
}
.songcard__art { position: relative; background: var(--surface); overflow: hidden; }
.songcard__art img, .songcard__placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.songcard__thumb { transform: scale(1.334); } /* hqdefault: 270 of 360 rows are picture, the rest is letterbox */
.songcard__placeholder {
  display: grid; place-items: center; padding: 1rem;
  background: linear-gradient(135deg, var(--card), var(--fill));
  color: var(--on-ink); font-size: .9rem; font-weight: 300;
}
.songcard__title {
  margin: 0;
  background: var(--fill);
  padding: .85rem .75rem;
  font-size: 1.15rem;
  font-weight: 300;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.songcard__label { display: block; font-size: .75rem; font-weight: 300; line-height: 1.2; }
.songcard__value { display: block; font-weight: 400; font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }
.songcard__meta { padding: .6rem .75rem .9rem; }

/* ---------- carousel ---------- */
.carousel { --card-w: clamp(11rem, 15vw, 17rem); --gap: clamp(1rem, 2.4vw, 2.9rem); margin-inline: calc(var(--gutter) * -1); }
.carousel__viewport { overflow: hidden; touch-action: pan-y; cursor: grab; padding: .5rem 0; user-select: none; -webkit-user-select: none; }
.carousel__viewport.is-dragging { cursor: grabbing; }
.carousel__track { display: flex; width: max-content; will-change: transform; }
.carousel__set { display: flex; gap: var(--gap); padding-right: var(--gap); flex: none; }
.carousel__set li { flex: none; width: var(--card-w); }
.songcard--fav { height: 100%; }
/* fixed two-line title band so the Artist band lines up on every card */
.songcard--fav .songcard__title {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; height: calc(2 * 1.4em + 1.5rem); padding: .75rem; line-height: 1.4;
  text-transform: none;
}
.songcard--fav .songcard__title > span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.carousel__toggle {
  display: block; margin: 1rem var(--gutter) 0 auto; padding: .2rem .6rem;
  background: none; border: 1px solid var(--ink); cursor: pointer; font-size: .8rem; font-weight: 400;
}
.carousel__toggle:is(:hover, :focus-visible) { background: var(--fill); color: var(--on-ink); }
.songcard--fav .songcard__art { aspect-ratio: 1; }
a.songcard--fav { transition: filter .15s; }
a.songcard--fav:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.songcard--fav img { -webkit-user-drag: none; }

/* ---------- originals ---------- */
/* "complete" / "abandoned": smaller than the page title, no rule, indented */
.group-title {
  margin: 4rem 0 0;
  padding-left: clamp(1rem, 2.5vw, 2.5rem);
  font-weight: 300;
  font-size: clamp(1.05rem, .85rem + .6vw, 1.5rem);
  line-height: 1.3;
}
.originals-group:first-child .group-title { margin-top: 0; }
.originals { display: grid; gap: clamp(3rem, 6vw, 5.5rem); padding-block: clamp(2rem, 5vw, 5rem); }
.original {
  /* card = 12rem square art + two-line title band + stats band; the video is
     sized to that height at 16:9 */
  --card-w: 12rem;
  --orig-h: 21.5rem;
  display: grid;
  grid-template-columns: var(--card-w) calc(var(--orig-h) * 16 / 9);
  justify-content: center;
  gap: 1.1rem;
  align-items: stretch;
}
.songcard--original { height: var(--orig-h); }
/* the art is always a full square; the title band takes whatever is left, so a
   long title can't squeeze the art. Titles past two lines end in "…" */
.songcard--original .songcard__art { flex: none; aspect-ratio: 1; }
.songcard--original .songcard__title {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0;
  padding: .4rem .6rem; font-size: 1.1rem; line-height: 1.3; text-transform: none;
}
.songcard--original .songcard__title > span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.original .embed { aspect-ratio: auto; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem .5rem; padding: .5rem .6rem .7rem; margin: 0; }
.stats div { text-align: center; }
.stats div:last-child { grid-column: 1 / -1; }
.stats dt { font-size: .65rem; font-weight: 300; line-height: 1.2; }
.stats dd { margin: 0; font-weight: 400; font-size: 1.1rem; line-height: 1.3; }

.embed {
  aspect-ratio: 16 / 9;
  background: var(--frame);
  border: .5rem solid var(--frame);
  position: relative;
}
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* thumbnail + play button until clicked (see youtubeEmbed) */
.embed__facade {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: grid; place-items: center; padding: 0; border: 0; cursor: pointer;
  background: var(--frame); overflow: hidden;
}
/* hqdefault is 4:3 with letterbox bars; covering a 16:9 box crops exactly to the picture */
.embed__facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.embed__facade svg { position: relative; width: 4.25rem; height: 3rem; color: rgba(33, 33, 33, .85); transition: color .15s; }
.embed__facade:is(:hover, :focus-visible) svg { color: #c4161c; }
.embed__facade:focus-visible { outline: 3px solid var(--purple-light); outline-offset: 3px; }
.embed__blocked {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem;
  padding: 1rem; text-align: center; color: var(--on-ink); font-weight: 400;
}
.embed__blocked p { margin: 0; }
.embed__blocked a { text-underline-offset: .2em; }
.embed__blocked a:is(:hover, :focus-visible) { color: var(--gray-light); }
.embed--empty { display: grid; place-items: center; color: var(--on-ink); font-weight: 400; text-align: center; padding: 1rem; }

@media (max-width: 56rem) {
  .original { grid-template-columns: minmax(0, 40rem); }
  .songcard--original { height: auto; width: min(100%, 24rem); justify-self: center; }
  .songcard--original .songcard__art { flex: none; aspect-ratio: 1; }
  .original .embed { aspect-ratio: 16 / 9; }
}

/* ---------- remakes ---------- */
.remakes { display: grid; gap: 0; max-width: 49.9rem; margin-inline: auto; padding-block: clamp(2rem, 5vw, 5rem); } /* same width as an originals row */
.remake {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.25rem, 3vw, 3rem);
  row-gap: 0;
  padding: clamp(2.5rem, 5.5vw, 5rem) 0; /* two of these = the originals row gap */
  border-top: 2px solid var(--rule-soft);
}
.remake:first-child { border-top: 0; padding-top: 0; }
.remake:last-child { padding-bottom: 0; }
/* each column spans the row's two grid rows (label, media) via subgrid, so a
   long label grows both label rows and the videos stay level */
.remake__col { display: grid; grid-row: span 3; grid-template-rows: subgrid; } /* label, media, date */
.remake__date { margin: .6rem 0 0; font-size: .85rem; font-weight: 300; color: var(--purple-light); }
.remake__label { margin: 0 0 .75rem; align-self: end; font-size: 1.1rem; font-weight: 300; overflow-wrap: anywhere; }
.remake__audio { aspect-ratio: 16 / 9; display: grid; place-items: center; }
.remake__audio audio { width: min(100%, 26rem); }

@media (max-width: 60rem) {
  .remake { grid-template-columns: minmax(0, 1fr); }
  .remake__col + .remake__col { margin-top: 2rem; }
}
