/* Fraunces SemiBold, SOFT 50, WONK 1. License: /licenses/fraunces/OFL.txt */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-semibold-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #28282b;
  --deep-brown: #3d2c26;
  --paper: #e8e0d7;
  --ink: #3b1714;
  --cream: #fff4e6;
  --soft-cream: #cfc1b2;
  --accent: #eda55b;
  --line: rgb(255 244 230 / 0.22);
  --leaf: #3c9c3f;
  --flower: #ad2f7d;
  --maple: #a7672c;
  --snow: #328aa0;
  --crown: #a09533;
  --font: Consolas, Inconsolata, "Cascadia Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  background: var(--background);
}

body {
  min-width: 280px;
  margin: 0;
  background: var(--background);
  color: var(--soft-cream);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  text-align: center;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--cream);
  color: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  max-width: 1080px;
  min-height: 64px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-optical-sizing: auto;
  text-decoration: none;
}

.site-brand img {
  width: 32px;
  height: 32px;
  border-radius: 16px;
}

.site-nav {
  display: flex;
  gap: clamp(14px, 4vw, 32px);
}

.site-nav a {
  font-size: 14px;
}

.site-nav a[aria-current="page"] {
  color: var(--cream);
  font-weight: 700;
}

main,
.site-footer {
  width: calc(100% - 32px);
  max-width: 1080px;
  margin-inline: auto;
}

.songs-page main {
  width: calc(100% - 24px);
  max-width: 1440px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 72px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

/* The home page intentionally stays close to the original Qono site. */
.home-page {
  min-height: 100svh;
  background:
    linear-gradient(rgb(45 28 28 / 0.18), rgb(45 28 28 / 0.18)),
    url("/qono-bg.jpg") center / cover fixed no-repeat;
}

.home-page .site-header,
.home-page .site-footer {
  display: none;
}

.home-page main {
  width: 100%;
  max-width: none;
}

.minimal-home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100svh;
  padding: max(48px, 8svh) 20px 40px;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.9);
}

.home-icon {
  width: 100px;
  height: 100px;
  border-radius: 16px;
}

.minimal-home h1 {
  margin: 18px 0 0;
  color: var(--cream);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 600;
  font-optical-sizing: auto;
  line-height: 1.2;
}

.home-intro {
  margin: 12px 0 18px;
}

.home-status {
  margin: 0 0 42px;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  background: rgb(0 0 0 / 0.34);
  color: var(--cream);
  font-size: 13px;
}

.home-links {
  display: grid;
  gap: 22px;
}

.home-links a {
  font-size: 17px;
}

.catalog-hero,
.policy-hero {
  padding: 52px 0 28px;
}

.catalog-hero h1,
.policy-hero h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(30px, 6vw, 42px);
}

.catalog-hero p,
.policy-hero p {
  margin: 10px 0 0;
}

.chapter-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  margin: 8px 0 54px;
  font-size: 14px;
}

.chapter-section {
  margin-bottom: 64px;
  scroll-margin-top: 24px;
}

.chapter-heading {
  margin-bottom: 20px;
}

.chapter-heading h2 {
  margin: 0;
  color: var(--cream);
  font-size: 23px;
}

.chapter-heading span {
  font-size: 13px;
}

.catalog-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
}

.song-card {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  max-width: 256px;
  padding: 10px;
  background: var(--deep-brown);
}

.cover-gallery {
  position: relative;
}

.cover-images {
  aspect-ratio: 1;
  overflow: hidden;
}

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

.cover-images img[hidden] {
  display: none;
}

.cover-switch {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 48px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgb(255 255 255 / 0.65);
  border-radius: 0;
  background: rgb(0 0 0 / 0.68);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.song-info {
  flex: 1;
  padding: 14px 12px;
  background: var(--paper);
  color: var(--ink);
}

.song-info h3 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.music-author {
  min-height: 2.8em;
  margin: 5px 0 14px;
  font-size: 14px;
}

.music-author::before {
  content: "by ";
}

.song-facts,
.chart-credits dl {
  margin: 0;
}

.song-facts > div {
  text-align: center;
}

.song-facts dt,
.song-facts dd {
  display: inline;
  overflow-wrap: anywhere;
}

.chart-credits dl > div {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.song-facts dt::after,
.chart-credits dt::after {
  content: ":";
}

.song-facts dd,
.chart-credits dd {
  margin: 0;
}

.difficulty-list {
  display: grid;
  gap: 2px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.difficulty-list li {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.difficulty-list strong {
  font-weight: 400;
}

.difficulty-leaf { color: var(--leaf); }
.difficulty-flower { color: var(--flower); }
.difficulty-maple { color: var(--maple); }
.difficulty-snow { color: var(--snow); }
.difficulty-crown { color: var(--crown); }

.chart-credits {
  margin-top: 12px;
  font-size: 12px;
}

.chart-credits summary {
  cursor: pointer;
}

.chart-credits dl {
  margin-top: 8px;
}

.policy-document {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.simple-hero {
  padding: 52px 0 18px;
}

.simple-hero h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(30px, 6vw, 42px);
}

.simple-hero p {
  margin: 10px 0 0;
}

.prose-page {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
}

.prose-page h2 {
  margin: 40px 0 8px;
  color: var(--cream);
  font-size: 20px;
}

.prose-page h3 {
  margin: 32px 0 6px;
  color: var(--cream);
  font-size: 17px;
}

.prose-page p {
  max-width: 75ch;
}

.signature {
  margin-top: 40px;
  text-align: right;
}

.policy-document h2 {
  margin: 40px 0 8px;
  color: var(--cream);
  font-size: 20px;
}

.policy-document p,
.policy-document li {
  max-width: 75ch;
}

.policy-document li + li {
  margin-top: 10px;
}

.license-document {
  max-width: 820px;
  margin-inline: auto;
  text-align: left;
}

.license-intro h2,
.license-group h2 {
  color: var(--cream);
  font-size: 20px;
}

.license-intro p {
  max-width: 75ch;
}

.license-index {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 32px;
  padding-block: 20px;
  border-block: 1px solid var(--line);
  font-size: 14px;
}

.license-help,
.license-group-description,
.license-contact {
  font-size: 14px;
}

.license-group {
  margin-top: 40px;
}

.license-group h2 {
  margin-bottom: 8px;
}

.license-group-description {
  margin: 0 0 20px;
}

.license-project {
  border-bottom: 1px solid var(--line);
}

.license-project summary {
  position: relative;
  padding: 20px 32px 20px 0;
  cursor: pointer;
  list-style: none;
}

.license-project summary::-webkit-details-marker {
  display: none;
}

.license-project summary::after {
  position: absolute;
  top: 25px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  content: "";
  transform: rotate(45deg);
}

.license-project[open] summary::after {
  top: 29px;
  transform: rotate(225deg);
}

.license-project summary:hover .license-project-name {
  color: var(--accent);
}

.license-project-name {
  display: block;
  color: var(--cream);
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.license-project-kind {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.license-project-body {
  padding-bottom: 20px;
  overflow-wrap: anywhere;
}

.license-project-body > p:first-child {
  margin-top: 0;
}

.license-source h3 {
  margin: 24px 0 6px;
  color: var(--cream);
  font-size: 15px;
}

.license-download {
  display: inline-block;
  padding-block: 8px;
  font-size: 14px;
}

.license-text {
  margin: 8px 0 0;
  padding: clamp(12px, 3vw, 24px);
  border-left: 2px solid var(--accent);
  background: var(--deep-brown);
  color: var(--cream);
  font: 13px/1.7 var(--font);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
}

.license-contact {
  margin-top: 40px;
  overflow-wrap: anywhere;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    padding: 14px 0;
  }

  .site-brand span {
    display: none;
  }

  .site-nav {
    padding-top: 5px;
  }

  .minimal-home {
    padding-top: max(44px, 7svh);
  }

  .song-card {
    flex-basis: 100%;
    max-width: 320px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
