/* Copyright © 2026 Wayne Davies. Free software under the GNU General Public License, version 3 or later. */
/* SPDX-License-Identifier: GPL-3.0-or-later. See LICENSE in the project root. */

/* Songloft's product page · Midnight Line, as the app: Graphite (dark) and Porcelain (light).
   Tokens are the app's (src/styles.css); keep them in step. */

@font-face {
  font-family: "Overpass Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/overpass-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Overpass Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(fonts/overpass-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Overpass draws the middle dot with no width; the dot alone comes from the system's sans. */
@font-face {
  font-family: "Songloft Dot";
  src: local("Helvetica Neue"), local("HelveticaNeue"), local("Roboto"), local("Segoe UI"), local("Arial");
  unicode-range: U+00B7;
}

:root,
[data-theme="dark"] {
  --ground: #121417;
  --rail: #1a1d21;
  --raised: #24282d;
  --hair: #30353c;
  --text: #f2f2ef;
  --mute: #a2a8b0;
  --ghost: #4d545c;
  --verse: #1aa3e8;
  --verse-ink: #7fd0ff;
  --chorus: #e8412c;
  --chorus-ink: #ff8a78;
  --bridge: #2ea866;
  --bridge-ink: #79dba3;
  --other: #e8892c;
  --other-ink: #ffb15c;
  --now: #ffd23f;
  --now-text: #121417;
  --press: #1d6ad0;
  --press-hover: #2a7be6;
  --press-ink: #ffffff;
  --frame: #0b0c0e;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}
[data-theme="light"] {
  --ground: #f4f1ea;
  --rail: #ebe6db;
  --raised: #ddd6c6;
  --hair: #cfc6b2;
  --text: #0f1d3d;
  --mute: #4a5470;
  --ghost: #8c96ad;
  --verse: #2257c4;
  --verse-ink: #1f4fb3;
  --chorus: #c41e35;
  --chorus-ink: #b31b30;
  --bridge: #1d7f48;
  --bridge-ink: #176a3b;
  --other: #d0700f;
  --other-ink: #b35a00;
  --now: #d98a00;
  --now-text: #0f1d3d;
  --press: #0f1d3d;
  --press-hover: #1b2d57;
  --press-ink: #f4f1ea;
  --frame: #0f1d3d;
  --shadow: 0 30px 60px -34px rgba(15, 29, 61, 0.45);
  color-scheme: light;
}

:root {
  --page: 40px;
  --gutter: 56px; /* where the page's own line runs, left of the sections */
  --max: 1240px;
  --ease: cubic-bezier(0.2, 0.8, 0.3, 1);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: "Songloft Dot", "Overpass Variable", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--press);
  caret-color: var(--now);
}
::selection {
  background: var(--now);
  color: var(--now-text);
}
html {
  scrollbar-color: var(--ghost) var(--ground);
}
a {
  color: inherit;
  text-decoration-color: var(--ghost);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1.5px;
}
a:hover {
  text-decoration-color: var(--text);
}
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}
h1,
h2 {
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 var(--page);
  background: var(--ground);
  border-bottom: 1px solid var(--hair);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
}
.brand svg {
  width: 28px;
  height: 28px;
}
.top nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.top nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: var(--mute);
  text-decoration: none;
  transition:
    color 120ms var(--ease),
    background-color 120ms var(--ease);
}
.top nav a:hover {
  color: var(--text);
  background: var(--rail);
}
.top nav a.here {
  color: var(--text);
  background: var(--raised);
}
.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--mute);
  cursor: pointer;
}
.icon:hover {
  color: var(--text);
  background: var(--rail);
}
.icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 2px solid var(--ghost);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 120ms var(--ease),
    border-color 120ms var(--ease),
    transform 80ms var(--ease);
}
.btn:hover {
  border-color: var(--text);
}
.btn:active {
  transform: scale(0.98);
}
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn.primary {
  border-color: var(--press);
  background: var(--press);
  color: var(--press-ink);
}
.btn.primary:hover {
  border-color: var(--press-hover);
  background: var(--press-hover);
}
.btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}
.btn.big {
  min-height: 56px;
  padding: 0 28px;
  font-size: 18px;
}
.btn[aria-pressed="true"] {
  background: var(--raised);
  border-color: var(--text);
}

/* ---------- the hero: the song screen, playing ---------- */

.hero {
  max-width: calc(var(--max) + 2 * var(--page));
  margin: 0 auto;
  padding: 36px var(--page) 0;
}
.song-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.title-block {
  max-width: 720px;
}
h1 {
  font-size: clamp(34px, 4.4vw, 58px);
}
.by {
  margin-top: 14px;
  max-width: 52ch;
  font-size: 19px;
  color: var(--mute);
}
.controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}
.fact {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 56px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--rail);
}
.fact-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--mute);
  line-height: 1;
}
.fact-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fact output {
  min-width: 2.1ch;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
#bpm {
  min-width: 3.2ch;
}
.step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.step:hover {
  background: var(--ghost);
}
.controls .btn.primary {
  min-height: 56px;
  padding: 0 24px;
  font-size: 17px;
}

.route {
  margin-top: 28px;
  padding: 14px 20px 12px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--rail);
}
.route-map {
  position: relative;
  height: 136px;
}
.route-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.route-map path {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.st {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  cursor: pointer;
}
.st i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--rail);
  color: var(--ground);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms var(--ease);
}
.st:hover i {
  transform: scale(1.12);
}
.st.now i {
  width: 34px;
  height: 34px;
  font-size: 12px;
  box-shadow:
    0 0 0 3px var(--rail),
    0 0 0 6px var(--now);
}
.st b {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
}
.st.hi b {
  bottom: 44px;
}
.st.lo b {
  top: 44px;
}
.st.first b {
  left: 8px;
  transform: none;
}
.st.last b {
  left: auto;
  right: 8px;
  transform: none;
}
.route-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  font-size: 15px;
  font-weight: 700;
  color: var(--mute);
}
.route-now b {
  font-weight: 800;
  color: var(--text);
}
.route-now .ink-verse {
  color: var(--verse-ink);
}
.route-now .ink-chorus {
  color: var(--chorus-ink);
}
.route-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.beats {
  display: flex;
  gap: 8px;
  margin-right: 8px;
}
.beats i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid var(--ghost);
  background: var(--raised);
}
.beats i.on {
  background: var(--now);
  border-color: var(--now);
}

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
  min-height: 300px;
  padding: 26px 20px 0;
}
.col.next .line {
  color: var(--mute);
}
.col.next .ch {
  opacity: 0.8;
}
.sec {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--mute);
}
.col.cur .sec {
  color: var(--text);
}
.col.cur .sec::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-radius: 999px;
  background: var(--now);
  vertical-align: middle;
}
.line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  width: fit-content;
  max-width: 100%;
  margin: 0 -10px;
  padding: 4px 10px 5px;
  border-radius: 10px;
  font-size: clamp(19px, 1.75vw, 24px);
  line-height: 1.3;
  white-space: pre-wrap;
}
.line.static {
  display: block;
}
.line.on {
  background: var(--rail);
}
.word {
  display: inline-flex;
  align-items: flex-end;
}
.seg {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}
.ch {
  min-height: 1.35em;
  margin-right: 8px;
  padding: 0 5px;
  margin-left: -5px;
  border-radius: 5px;
  font-size: 0.86em;
  font-weight: 800;
  color: var(--ink);
}
.verse-ink {
  --ink: var(--verse-ink);
}
.chorus-ink {
  --ink: var(--chorus-ink);
}
.ch.lit {
  background: var(--now);
  color: var(--now-text);
}
.hint {
  margin: 18px 20px 0;
  font-size: 14px;
  color: var(--mute);
}
html:not(.js) .route,
html:not(.js) .controls .fact {
  display: none;
}

/* ---------- the page's own line: each section a stop on it ---------- */

main {
  position: relative;
}
.stop {
  position: relative;
  max-width: calc(var(--max) + 2 * var(--page));
  margin: 0 auto;
  padding: 104px var(--page) 0 calc(var(--page) + var(--gutter));
}
.stop::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--page) + 13px);
  width: 8px;
  background: var(--line);
}
.stop.verse {
  --line: var(--verse);
  --line-ink: var(--verse-ink);
}
.stop.chorus {
  --line: var(--chorus);
  --line-ink: var(--chorus-ink);
}
.stop.bridge {
  --line: var(--bridge);
  --line-ink: var(--bridge-ink);
}
.stop.other {
  --line: var(--other);
  --line-ink: var(--other-ink);
}
#arrange {
  margin-top: 40px;
}
#arrange::before {
  top: 104px;
  border-radius: 4px 4px 0 0;
}
.stn {
  position: absolute;
  top: 100px;
  left: calc(var(--page));
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--ground);
  color: var(--ground);
  font-size: 12px;
  font-weight: 800;
  z-index: 1;
  transition: box-shadow 200ms var(--ease);
}
.stop.here .stn {
  box-shadow:
    0 0 0 3px var(--ground),
    0 0 0 6px var(--now);
}
h2 {
  font-size: clamp(28px, 3.2vw, 44px);
  max-width: 20ch;
}
.lede p {
  margin-top: 16px;
  max-width: 62ch;
  color: var(--mute);
  font-size: 18px;
}
.lede p b,
.points b,
.facts dt {
  color: var(--text);
}

.shot {
  margin: 0;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--frame);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.shot.wide {
  margin-top: 40px;
}
.points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  color: var(--mute);
}
.points li {
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}
.points b {
  display: block;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px;
  align-items: center;
}
.plain {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--mute);
}
.plain li {
  position: relative;
  padding: 9px 0 9px 26px;
  border-top: 1px solid var(--hair);
}
.plain li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 3px solid var(--line);
}

#add {
  padding-bottom: 104px;
}
/* The refrain: a band of its own, the stage. */
.band {
  max-width: none;
  margin-top: 0;
  padding: 96px 0 96px;
  background: var(--rail);
  border-block: 1px solid var(--hair);
}
.band > * {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: 0;
}
.band::before {
  left: max(calc(var(--page) + 13px), calc(50% - var(--max) / 2 - var(--page) + var(--page) + 13px - 0px));
}
.band .stn {
  top: 92px;
  left: max(var(--page), calc(50% - var(--max) / 2 - var(--page) + var(--page)));
  box-shadow: 0 0 0 3px var(--rail);
}
.band.here .stn {
  box-shadow:
    0 0 0 3px var(--rail),
    0 0 0 6px var(--now);
}
.band > .lede,
.band > .shot,
.band > .facts {
  width: min(calc(100% - 2 * var(--page) - var(--gutter)), calc(var(--max) - var(--gutter)));
  margin-left: max(calc(var(--page) + var(--gutter)), calc(50% - var(--max) / 2 + var(--gutter)));
  margin-right: 0;
}
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
  margin-top: 32px;
  margin-bottom: 0;
}
.facts div {
  padding-top: 14px;
  border-top: 1px solid var(--hair);
}
.facts dt {
  font-weight: 800;
}
.facts dd {
  margin: 2px 0 0;
  color: var(--mute);
  font-size: 16px;
}

.devices {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 56px;
  align-items: center;
}
.stand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 24px;
}
.device {
  margin: 0;
  padding: 10px;
  border-radius: 26px;
  background: var(--frame);
  border: 1px solid var(--hair);
  box-shadow: var(--shadow);
}
.device img {
  border-radius: 16px;
}
.device.tablet {
  width: 62%;
}
.device.phone {
  width: 30%;
  padding: 7px;
  border-radius: 28px;
}
.device.phone img {
  border-radius: 21px;
}
.fine {
  margin-top: 14px;
  font-size: 15px;
  color: var(--mute);
}
.lede .fine {
  font-size: 15px;
  margin-top: 22px;
}

/* ---------- the close ---------- */

.close {
  padding-bottom: 120px;
}
.close::before {
  bottom: auto;
  height: 121px;
  border-radius: 0 0 4px 4px;
}
.close h2 {
  font-size: clamp(36px, 5vw, 68px);
  max-width: none;
}
.close-by {
  margin-top: 14px;
  font-size: 20px;
  color: var(--mute);
}
.gets {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin-top: 36px;
}
.get {
  width: min(100%, 340px);
}
.get .btn {
  width: 100%;
}
details {
  margin-top: 10px;
  font-size: 15px;
  color: var(--mute);
}
summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  border-radius: 6px;
}
summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border: solid var(--mute);
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  transition: transform 120ms var(--ease);
}
details[open] summary::before {
  transform: rotate(45deg);
}
details p {
  margin-top: 8px;
}
details b {
  color: var(--text);
}
.more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 44px;
  font-weight: 700;
}

.foot {
  padding: 28px var(--page) 40px;
  border-top: 1px solid var(--hair);
  background: var(--rail);
  color: var(--mute);
  font-size: 14px;
}
.foot p {
  max-width: var(--max);
  margin: 0 auto;
}
.foot p + p {
  margin-top: 4px;
}

/* ---------- narrower ---------- */

@media (max-width: 1100px) {
  .song-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
  .split,
  .devices {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 32px;
  }
  .stand {
    max-width: 520px;
  }
}
@media (max-width: 760px) {
  :root {
    --page: 20px;
    --gutter: 40px;
  }
  body {
    font-size: 16px;
  }
  .top {
    gap: 8px;
  }
  .top nav a:not([href="#download"]) {
    display: none;
  }
  .hero {
    padding-top: 24px;
  }
  .by {
    font-size: 17px;
  }
  .controls {
    flex-wrap: wrap;
    width: 100%;
  }
  .controls .btn.primary {
    flex: 1 1 auto;
  }
  .route {
    margin-top: 20px;
    padding: 10px 10px 8px;
  }
  .route-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -10px;
    padding: 0 10px;
  }
  .route-scroll::-webkit-scrollbar {
    display: none;
  }
  .route-map {
    width: 660px;
    height: 142px;
  }
  .shot.crop img {
    width: var(--w);
    max-width: none;
    margin-left: calc(var(--x) * -1);
  }
  .route-now {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    font-size: 14px;
  }
  .route-tools {
    justify-content: space-between;
  }
  .sheet {
    grid-template-columns: minmax(0, 1fr);
    min-height: 300px;
    padding: 18px 10px 0;
  }
  .col.next {
    display: none;
  }
  .hint {
    margin-inline: 10px;
  }
  .stop {
    padding-top: 72px;
  }
  .stop::before {
    left: calc(var(--page) + 9px);
    width: 6px;
  }
  .stn {
    top: 68px;
    width: 28px;
    height: 28px;
    font-size: 10px;
    left: calc(var(--page) - 2px);
  }
  #arrange {
    margin-top: 48px;
  }
  #arrange::before {
    top: 72px;
  }
  .lede p {
    font-size: 17px;
  }
  .points {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .band {
    padding: 64px 0;
  }
  #add {
    padding-bottom: 72px;
  }
  .band .stn {
    top: 60px;
  }
  .close {
    padding-bottom: 80px;
  }
  .close::before {
    height: 86px;
  }
  .btn.big {
    padding: 0 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}
