:root {
  --night: #12161f;
  --night-deep: #0a0d13;
  --gold: #d4af6a;
  --gold-dim: #9a7d45;
  --limestone: #c9b89a;
  --paper: #f3ebd8;
  --paper-edge: #e2d4b8;
  --ink: #231c16;
  --ink-soft: #4a4036;
  --wound: #7a2430;
  --river: #1e3542;
  --mist: #8b939e;
  --flame: #f0d48a;
  --display: "Cormorant Garamond", "Palatino Linotype", Palatino, serif;
  --text: "Newsreader", "Iowan Old Style", "Palatino Linotype", serif;
  --rail: 5.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--night);
  color: var(--limestone);
  font-family: var(--text);
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.55;
  min-height: 100%;
  color-scheme: dark;
}

body { overflow-x: hidden; }

img { max-width: 100%; display: block; }

a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { color: var(--flame); }

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

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.8rem;
}

/* ---------- landing ---------- */

.landing {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: var(--paper);
}

.landing-pair {
  position: absolute;
  inset: 0;
}

.landing-pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-him { object-position: center 18%; }

.landing::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(10, 13, 19, 0.94) 0%, rgba(10, 13, 19, 0.45) 38%, rgba(10, 13, 19, 0.12) 62%, rgba(10, 13, 19, 0.18) 100%),
    linear-gradient(to right, rgba(10, 13, 19, 0.2), transparent 28%, transparent 72%, rgba(10, 13, 19, 0.25));
  z-index: 1;
}

.landing-inner {
  position: relative;
  z-index: 2;
  padding: 0 8vw 8vh;
  max-width: 42rem;
}

.landing-kicker {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--gold);
  margin: 0 0 1.1rem;
}

.landing h1 {
  font-family: var(--display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(3.2rem, 8vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  color: var(--paper);
}

.landing-lede {
  font-size: 1.12rem;
  line-height: 1.55;
  max-width: 36em;
  color: var(--limestone);
  margin: 0 0 2rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem 2.2rem;
  align-items: baseline;
  margin-bottom: 2.4rem;
}

.enter {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.45rem;
  color: var(--paper);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--gold);
  padding: 0 0 0.15rem;
  cursor: pointer;
}

.enter:hover { color: var(--gold); }

.quiet-link {
  font-size: 0.95rem;
  color: var(--mist);
}

.landing-meta {
  border-top: 1px solid rgba(212, 175, 106, 0.28);
  padding-top: 1.1rem;
  max-width: 28rem;
}

.landing-meta .quiet-link { white-space: nowrap; }

/* ---------- night essay ---------- */

.essay {
  max-width: 72rem;
  margin: 0 auto;
  padding: 4.5rem 8vw 6rem;
}

.essay-kicker {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
  margin: 0 0 0.6rem;
}

.essay h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  color: var(--paper);
  margin: 0 0 2rem;
  max-width: 18ch;
}

.essay-grid {
  display: grid;
  grid-template-columns: minmax(0, 38rem) minmax(14rem, 1fr);
  gap: 3rem 4rem;
  align-items: start;
}

.essay-body p {
  margin: 0 0 1.15rem;
  color: var(--limestone);
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 38em;
}

.essay-body p:first-of-type::first-letter {
  font-family: var(--display);
  font-size: 3.4rem;
  float: left;
  line-height: 0.75;
  padding: 0.18em 0.12em 0 0;
  color: var(--gold);
  font-style: italic;
}

.movements {
  position: sticky;
  top: 2rem;
}

.movements ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid rgba(212, 175, 106, 0.35);
}

.movements li { padding: 0 0 1.4rem 1.2rem; position: relative; }

.movements li::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0.45rem;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
}

.movements a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.movements a:hover .mv-title { color: var(--gold); }

.mv-range {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--gold-dim);
  margin-bottom: 0.15rem;
}

.mv-title {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--paper);
  display: block;
}

.mv-line {
  display: block;
  font-size: 0.92rem;
  color: var(--mist);
  margin-top: 0.25rem;
}

.set-index {
  list-style: none;
  margin: 3.5rem 0 0;
  padding: 1.6rem 0 0;
  border-top: 1px solid rgba(212, 175, 106, 0.28);
  max-width: 42rem;
}

.set-index li { margin: 0; }

.si-encore {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
  padding: 1.1rem 0 0.35rem;
  letter-spacing: 0.02em;
}

.set-index a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 16rem) minmax(0, 1fr);
  gap: 0.8rem 1.1rem;
  align-items: baseline;
  padding: 0.55rem 0;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(201, 184, 154, 0.08);
}

.set-index a:hover .si-title { color: var(--gold); }

.si-n {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold-dim);
}

.si-title {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--paper);
}

.si-beat {
  color: var(--mist);
  font-size: 0.92rem;
}

.essay-foot {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(212, 175, 106, 0.28);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
}

/* ---------- song reader ---------- */

.reader {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.spine {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: var(--night-deep);
  border-right: 1px solid rgba(212, 175, 106, 0.18);
  padding: 1rem 0.35rem 2rem;
  scrollbar-width: thin;
}

.spine-home {
  display: block;
  text-align: center;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  padding: 0.3rem 0;
}

.spine ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spine a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto;
  color: var(--mist);
  text-decoration: none;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  border-radius: 50%;
}

.spine a:hover { color: var(--paper); background: rgba(212, 175, 106, 0.08); }

.spine a[aria-current="page"] {
  color: var(--night);
  background: var(--gold);
}

.spine a.encore-mark { color: var(--gold-dim); }
.spine a.encore-mark[aria-current="page"] {
  color: var(--night);
  background: var(--gold);
}

.stage { min-width: 0; }

.song-hero {
  position: relative;
  height: min(46vh, 28rem);
  min-height: 14rem;
  overflow: hidden;
}

.song-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.song-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(to top, var(--night), transparent);
}

.song-head {
  padding: 0 6vw 0.5rem;
  margin-top: -3.2rem;
  position: relative;
  z-index: 1;
}

.song-kicker {
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.song-head h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.02;
  color: var(--paper);
  margin: 0 0 0.45rem;
}

.song-sub {
  color: var(--mist);
  font-size: 0.98rem;
  margin: 0 0 0.8rem;
}

.song-beat {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--limestone);
  max-width: 28em;
  margin: 0;
}

.song-listen {
  margin: 1.1rem 0 0;
}

.song-listen a {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.08rem;
}

.song-listen a:hover { color: var(--flame); border-color: var(--flame); }

.song-body {
  display: grid;
  grid-template-columns: minmax(0, 34rem) minmax(0, 28rem);
  gap: 2.5rem 4rem;
  padding: 2rem 6vw 4.5rem;
  align-items: start;
}

.missal {
  background: var(--paper);
  color: var(--ink);
  padding: 2.2rem 2rem 2.6rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.missal-label {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--paper-edge);
}

.lyrics {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-size: 1.05rem;
  line-height: 1.62;
  margin: 0;
  font-family: var(--text);
}

.meaning h2 {
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-size: 1.7rem;
  color: var(--paper);
  margin: 0 0 1rem;
}

.pull {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--gold);
  margin: 0 0 1.4rem;
  max-width: 18em;
}

.meaning p {
  margin: 0 0 1rem;
  color: var(--limestone);
  font-size: 1.02rem;
  line-height: 1.65;
}

.meaning-source {
  margin-top: 1.6rem;
  font-size: 0.88rem;
  color: var(--mist);
}

.nav-songs {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 6vw 3.5rem;
  border-top: 1px solid rgba(212, 175, 106, 0.18);
  padding-top: 1.4rem;
}

.nav-songs a {
  color: var(--limestone);
  text-decoration: none;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.2rem;
  max-width: 46%;
}

.nav-songs a:hover { color: var(--gold); }

.nav-songs .dir {
  display: block;
  font-size: 0.85rem;
  color: var(--mist);
  font-style: normal;
  margin-bottom: 0.15rem;
}

.nav-songs .next { text-align: right; margin-left: auto; }

.help {
  position: fixed;
  right: 1.1rem;
  bottom: 1rem;
  font-size: 0.78rem;
  color: var(--mist);
  opacity: 0.7;
  pointer-events: none;
}

/* ---------- colophon ---------- */

.colophon {
  padding: 2.5rem 0 0;
  margin-top: 1rem;
  color: var(--mist);
  font-size: 0.92rem;
  max-width: 38rem;
}

.colophon a { color: var(--limestone); }

/* ---------- mobile ---------- */

@media (max-width: 860px) {
  html { font-size: 17px; }
  .reader { grid-template-columns: 1fr; }
  .spine {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.35rem 0.5rem;
    border-right: 0;
    border-bottom: 1px solid rgba(212, 175, 106, 0.18);
  }
  .spine-home { display: none; }
  .spine ol {
    flex-direction: row;
    width: max-content;
    gap: 0;
  }
  .spine a { width: 2.2rem; height: 2.2rem; }
  .essay-grid { grid-template-columns: 1fr; }
  .movements { position: static; }
  .song-body { grid-template-columns: 1fr; padding: 1.4rem 5vw 3rem; }
  .missal { padding: 1.5rem 1.2rem 1.8rem; }
  .landing-him { object-position: center 20%; }
  .help { display: none; }
  .song-head { padding: 0 5vw 0.5rem; }
  .set-index a {
    grid-template-columns: 1.8rem 1fr;
    gap: 0.3rem 0.8rem;
  }
  .si-beat { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  .spine, .help, .landing-actions, .nav-songs { display: none !important; }
  .reader { display: block; }
  .missal { box-shadow: none; }
  body { background: white; color: black; }
}
