/* largescore.kvds.media: one stylesheet for every page. Large type for people with
   low vision and their families; the look of a part on a music stand: warm paper,
   black ink, Newsreader for headings, and the music itself as the pictures (engraved
   by Verovio, tools/render_music.mjs). Every text pair measured (tools/contrast.py). */
@font-face { font-family: "Newsreader"; src: url(/fonts/Newsreader.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/fonts/Newsreader-Italic.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #f5efe3;        /* warm paper */
  --bg-deep: #ebe2d0;   /* the darker band */
  --sheet: #ffffff;     /* a printed page */
  --text: #1c1712;      /* 15.5:1 on --bg */
  --muted: #4a4137;     /* 8.7:1 on --bg */
  --line: #8a7d6b;      /* 3.5:1: rules, never text */
  --accent: #0b3f97;    /* the icon's blue; 8.4:1 on --bg */
  --on-accent: #ffffff;
  --band: #1c1712;      /* the Converter band */
  --on-band: #f5efe3;
  --band-muted: #d6ccbb;
  --band-accent: #a9c4ff;
  --focus: #0b3f97;
  --shadow: 0 1px 2px rgb(60 40 10 / 0.12), 0 12px 32px rgb(60 40 10 / 0.16);
  --serif: "Newsreader", ui-serif, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120e;
    --bg-deep: #1f1a14;
    --sheet: #fbf8f1;
    --text: #f3ecdf;
    --muted: #cfc4b2;
    --line: #6f6455;
    --accent: #a9c4ff;
    --on-accent: #0c1a33;
    --band: #f3ecdf;
    --on-band: #1c1712;
    --band-muted: #4a4137;
    --band-accent: #0b3f97;
    --focus: #a9c4ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 14px 36px rgb(0 0 0 / 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.25rem/1.6 var(--sans);
  overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0; font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 8vw, 4.75rem); }
/* Headings never break inside a word. A heading holding a word too long for its
   column (Dutch "Voortekenherinneringen") is marked .long by the build and shrinks to
   its column instead (cqi: the width of the box around it). */
h1, h2, h3, dt { overflow-wrap: normal; hyphens: manual; }
.feature > div:first-child { container-type: inline-size; }
.feature h2.long { font-size: min(clamp(1.9rem, 5vw, 2.75rem), 8.4cqi); }
h2 { font-size: clamp(1.9rem, 5vw, 2.75rem); margin-top: 2em; }
h3 { font-size: 1.6rem; margin-top: 1.5em; }
p, ul, ol, dl { margin: 0.9em 0 0; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.45em; }
strong { font-weight: 700; }

a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 4px; border-radius: 4px; }

kbd {
  font: inherit; font-size: 0.9em; font-weight: 600;
  border: 2px solid var(--line); border-radius: 6px; padding: 0 0.35em;
  white-space: nowrap;
}

.wrap { width: min(65ch, 100% - 32px); margin-inline: auto; }
.wide { width: min(1180px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -200px; z-index: 10;
  background: var(--accent); color: var(--on-accent);
  padding: 12px 18px; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 16px; }

/* Header: the icon and name, then the pages. Every link is at least 48 px tall. */
.site-header .bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 20px; padding-block: 14px;
}
.home {
  display: inline-flex; align-items: center; gap: 14px; min-height: 48px;
  color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.6rem;
}
.home img { width: 48px; height: 48px; border-radius: 22%; flex: none; }
.site-header nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 22px; }
.site-header nav li + li { margin-top: 0; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 600; }
.site-header nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

main { padding: clamp(24px, 5vw, 48px) 0 72px; }
main.home-page { padding: 0; }
.lede { font-size: clamp(1.35rem, 2.6vw, 1.6rem); color: var(--muted); margin-top: 0.6em; }

/* ---------------------------------------------------------------- Home */

/* The opening: the words, then the same part twice, as printed and as Large Score
   shows it, two sheets of paper on the stand. */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-block: clamp(24px, 5vw, 64px) clamp(48px, 7vw, 96px);
}
.hero h1 { max-width: 11ch; }
.hero .status { margin-top: 1.6em; font-weight: 600; }
.hero .status span { display: block; font-weight: 400; color: var(--muted); }

.stand { position: relative; margin: 44px 0 0; aspect-ratio: 1 / 1.02; }
.sheet {
  position: absolute; margin: 0; background: var(--sheet); box-shadow: var(--shadow); border-radius: 3px;
}
.sheet img { display: block; width: 100%; height: auto; }
.sheet figcaption {
  position: absolute; left: 0; top: 100%; margin-top: 10px;
  font-size: 1.05rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.sheet.printed { left: 0; top: 2%; width: 46%; transform: rotate(-3deg); }
.sheet.printed img { padding: 4%; }
.sheet.large { right: 0; top: 12%; width: 72%; padding: 3% 3% 1%; transform: rotate(1.5deg); }
.sheet.large figcaption { left: auto; right: 0; }
/* Above its page: below it, the large sheet would cover it on a phone. */
.sheet.printed figcaption { top: auto; bottom: 100%; margin: 0 0 10px; transform: rotate(3deg); transform-origin: left bottom; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .stand { max-width: 560px; width: 100%; margin-inline: auto; }
}

/* The story, in Kris's words. */
.story { background: var(--bg-deep); padding-block: clamp(48px, 7vw, 88px); }
.story h2 { margin-top: 0; }
.story p { font-family: var(--serif); font-size: clamp(1.45rem, 2.8vw, 1.85rem); line-height: 1.45; max-width: 34ch; }

/* Features shown with music: words beside the pictures. */
.showcase { padding-block: clamp(24px, 4vw, 48px); }
.feature {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
.feature:first-child { border-top: 0; }
.feature h2 { margin-top: 0; }
.feature p { max-width: 36ch; }
.feature.stacked { grid-template-columns: 1fr; }
.feature.stacked p { max-width: 52ch; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }

.pair { display: grid; gap: 22px; margin: 0; }
.card { margin: 0; }
/* The same bars at three sizes (classes, not inline styles: the site allows none). */
.card.w52 { width: 52%; } .card.w74 { width: 74%; } .card.w100 { width: 100%; }
.card .paper { background: var(--sheet); box-shadow: var(--shadow); border-radius: 3px; padding: 2% 3%; }
.card img { display: block; width: 100%; height: auto; }
.card figcaption { margin-top: 10px; font-size: 1.05rem; font-weight: 600; color: var(--muted); }

/* The colour modes: the same bars in each, drawn through a mask so any ink works. */
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.modes li { margin: 0; }
.mode { border-radius: 6px; padding: 9% 7%; box-shadow: var(--shadow); }
.mode .ink {
  display: block; aspect-ratio: 720 / 250; background: currentColor;
  -webkit-mask: url(/img/music/excerpt.svg) center / contain no-repeat;
  mask: url(/img/music/excerpt.svg) center / contain no-repeat;
}
.mode.paper { background: #ffffff; color: #000000; }
.mode.night { background: #000000; color: #ffffff; }
.mode.yellow { background: #000000; color: #ffd60a; }
.modes p { margin-top: 10px; font-size: 1.05rem; font-weight: 600; color: var(--muted); }
@media (max-width: 700px) { .modes { grid-template-columns: 1fr; } }

/* Everything else, in two columns of short entries. */
.more { padding-block: clamp(24px, 4vw, 48px) clamp(48px, 6vw, 80px); }
.more h2 { margin-top: 0; }
.more dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 48px; margin-top: 1.2em; }
.more dl div { border-top: 1px solid var(--line); padding-block: 18px 6px; }
.more dt { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; line-height: 1.2; }
.more dd { margin: 0.35em 0 0; color: var(--muted); }
@media (max-width: 760px) { .more dl { grid-template-columns: 1fr; } }

/* The Converter, on a dark band. */
.band { background: var(--band); color: var(--on-band); padding-block: clamp(48px, 7vw, 88px); }
.band h2 { margin-top: 0; }
.band p { max-width: 44ch; color: var(--band-muted); }
.band p strong { color: var(--on-band); }
.band a { color: var(--band-accent); }
.band .button { background: var(--on-band); color: var(--band); }
.band :focus-visible { outline-color: var(--band-accent); }

.facts { padding-block: clamp(48px, 6vw, 80px); }
.facts h2 { margin-top: 0; }
.facts .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
@media (max-width: 760px) { .facts .cols { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Other pages */

.notice {
  background: var(--bg-deep); border-left: 6px solid var(--accent);
  padding: 16px 20px; margin-top: 1.5em; font-weight: 600;
}

.features { list-style: none; padding: 0; }
.features li { padding: 0.85em 0; border-top: 1px solid var(--line); margin: 0; }
.features li:last-child { border-bottom: 1px solid var(--line); }

/* Table of contents on Help. */
.toc { background: var(--bg-deep); padding: 18px 22px 22px; margin-top: 1.5em; border-radius: 8px; }
.toc h2 { font-size: 1.5rem; margin: 0; }
.toc ol { margin-top: 0.4em; }
.toc li { margin: 0; padding-block: 0.35em; }
.toc li + li { margin-top: 0; }

.button {
  display: inline-flex; align-items: center; min-height: 56px; padding: 12px 32px; /* 26 px plus what the round ends take: 28 × (1 − π/4) */
  background: var(--accent); color: var(--on-accent); border-radius: 999px;
  font-weight: 700; text-decoration: none; margin-top: 1.2em;
}
.button:hover { text-decoration: underline; }

/* Places for framed screenshots: hidden until a picture is put in. */
.shot { margin: 2em 0 0; }
.shot:empty { display: none; }
.shot img { display: block; max-width: 100%; height: auto; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 24px; }
.site-footer li + li { margin-top: 0; }
.site-footer a { display: inline-flex; align-items: center; min-height: 48px; }
.site-footer p { margin-top: 0.5em; font-size: 1.05rem; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85em; }
/* A command to type: on its own line, broken only at its space, never inside a word. */
code.command span { white-space: nowrap; }
code.command {
  display: block; width: fit-content; max-width: 100%;
  margin-top: 0.4em; padding: 6px 10px; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 6px;
}
