/* shared/tokens.css */
/* The app's colours (src/shared/theme/palette.ts), teal accent; dark when page.html sets the dark theme, from the
   visitor's choice here or their device's setting. Then the website's own few. */
:root {
  color-scheme: light;
  --background: #F6F5F2;
  --surface: #FFFDFA;
  --surface-alt: #EFECE5;
  --border: #E3DFD6;
  --border-strong: #CDC8BB;
  --text: #191815;
  --text-secondary: #5D5850;
  --text-muted: #6C6759;
  --primary: #00655B;
  --primary-hover: #004B43;
  --primary-fill: #00655B;
  --on-primary: #FFFFFF;
  --primary-tint: #E5EFED;
  --primary-tint-strong: #CFE3DF;
  --on-primary-tint: #004B43;
  --danger-text: #C5161B;
  --logo: #00655B;
  --grid-line: #ECEAE2;
  --chart-1: #00655B;
  --chart-2: #3F6F94;
  --chart-3: #6F8F5E;
  --chart-4: #B5822F;
  --chart-5: #8A8072;
  --chart-6: #2F8F8A;
  --chart-7: #4A5A7A;
  --chart-8: #A06B4A;

  --phone-body: #191815;
  --phone-notch: #5D5850;
  --card-shadow: 8px 8px 0 rgb(25 24 21 / 0.12);
  /* The edge of a sheet sliding up over the one before it. */
  --sheet-edge: 0 -12px 0 rgb(25 24 21 / 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #1B1A18;
  --surface: #232220;
  --surface-alt: #2B2A27;
  --border: #35332E;
  --border-strong: #4A473F;
  --text: #F1EFE9;
  --text-secondary: #A9A39A;
  --text-muted: #989289;
  --primary: #4FB3A4;
  --primary-hover: #6EC6B8;
  --primary-fill: #0B7D70;
  --on-primary: #FFFFFF;
  --primary-tint: #15302C;
  --primary-tint-strong: #1D443D;
  --on-primary-tint: #8FD6C9;
  --danger-text: #EF8A83;
  --logo: #4FB3A4;
  --grid-line: #2E2C28;
  --chart-1: #4FB3A4;
  --chart-2: #7AA6CC;
  --chart-3: #9DBD8B;
  --chart-4: #D8A95C;
  --chart-5: #B3AA9B;
  --chart-6: #5FC4B8;
  --chart-7: #8B9EC4;
  --chart-8: #CF9673;

  --phone-body: #0E0E0D;
  --phone-notch: #35332E;
  --card-shadow: 8px 8px 0 rgb(0 0 0 / 0.45);
  --sheet-edge: 0 -12px 0 rgb(0 0 0 / 0.3);
}

/* shared/base.css */
/* Barlow and Barlow Condensed, cut down by scripts/site-fonts.py, under the SIL Open Font License (fonts/OFL.txt). */
@font-face { font-family: "Barlow"; src: url("fonts/Barlow-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/BarlowCondensed-600.woff") format("woff"); font-weight: 600; font-display: swap; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: "Barlow", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

/* Blueprint paper: the app's grid colour every 32 px, on the page and on each sheet that slides up over it. */
body, .sheet-paper {
  background-color: var(--background);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
}
.sheet-paper { position: relative; border-top: 1px solid var(--border-strong); box-shadow: var(--sheet-edge); }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Every band of the page keeps its content within 1200 px, while its paper runs the full width. */
.top-bar, .scene, .legal, .page-footer { padding-inline: max(16px, calc((100% - 1200px) / 2)); }

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--text);
  text-decoration: none;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.4px;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 22px; height: 22px; fill: var(--logo); }
.top-actions { display: flex; align-items: center; gap: 12px; }
.theme-switch {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-switch svg { width: 20px; height: 20px; }
.top-bar .play-badge { padding-block: 4px; }
.top-bar .play-badge img { height: 40px; }
/* On the smallest phones the start's own badge is enough. */
@media (max-width: 479px) { .top-bar .play-badge { display: none; } }

.scene { position: relative; padding-block: 64px; }

/* Each beat's own line, and the plain sentence under it where it has one. */
.beat-head { display: grid; gap: 20px; margin-bottom: 48px; }
.beat-title {
  max-width: 12em;
  margin: 0;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(44px, 5vw + 16px, 88px);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.beat-lead { max-width: 36em; margin: 0; color: var(--text-secondary); font-size: 18px; }

/* Google Play's badge as Google provides it (docs/website.md): never recoloured, redrawn or under 28 px high, with
   a quarter of its height kept clear around it by whatever holds it. */
.play-badge { display: inline-block; width: max-content; }
.play-badge img { display: block; width: auto; height: 56px; }

.page-footer {
  position: relative;
  padding-block: 32px 48px;
  border-top: 1px solid var(--border-strong);
  background: var(--background);
}
.footer-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0 32px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--text);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.4px;
  text-decoration: none;
}
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
/* On phones each link takes a line of its own, rather than wrapping where it happens to. */
@media (max-width: 559px) { .footer-links { flex-direction: column; } }
.footer-legal { display: grid; gap: 6px; padding-top: 20px; color: var(--text-muted); font-size: 14px; }
.footer-legal p { max-width: 72em; margin: 0; }

/* shared/frame.css */
/* The blueprint frame, as in the app: square corners, a 1 px line, and a "+" just outside each corner. */
.frame {
  position: relative;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.frame::before {
  --mark: linear-gradient(var(--border-strong), var(--border-strong));
  content: "";
  position: absolute;
  inset: -7px;
  pointer-events: none;
  background:
    var(--mark) left 0 top 6px / 13px 1px,
    var(--mark) left 6px top 0 / 1px 13px,
    var(--mark) right 0 top 6px / 13px 1px,
    var(--mark) right 6px top 0 / 1px 13px,
    var(--mark) left 0 bottom 6px / 13px 1px,
    var(--mark) left 6px bottom 0 / 1px 13px,
    var(--mark) right 0 bottom 6px / 13px 1px,
    var(--mark) right 6px bottom 0 / 1px 13px;
  background-repeat: no-repeat;
}

/* legal/legal.css */
/* Every page beside the landing, laid out as the terms page (owner, 2026-11-24): its title, the line under it, then
   its sections in one blueprint frame. */
.legal { padding-block: 48px 80px; }
.legal h1 {
  max-width: 12em;
  margin: 0 0 14px;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(44px, 4vw + 24px, 72px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.legal-updated { max-width: 44em; margin: 0 0 36px; color: var(--text-muted); font-size: 15px; }
.legal-sections { display: grid; gap: 26px; max-width: 800px; padding: 28px 20px; }
.legal-sections h2 {
  margin: 0 0 6px;
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.15;
}
.legal-sections p { max-width: 64ch; margin: 0; }

@media (min-width: 600px) {
  .legal { padding-block: 72px 104px; }
  .legal-sections { padding: 36px 40px; }
}
