/* The tab pages in the welcome's look (15 Nov 2026, the owner's pick from the hello screen and "Your take"):
   a bright teal hero with Bud, dots and floating notes, a sun sticker eyebrow, then sticker cards with a
   colour per row. Pages opt in with <header class="page-head page-hero"> + heroDeco(pose) from js/ui.js.
   Home keeps its own Studio look (css/homestudio.css). Not in tools/build-dark-css.py: dark is set by hand at
   the bottom of this file. */

:root { --pg-ink: #111640; --pg-sun: #ffd65a; --pg-coral: #f4594b; --pg-lilac: #8f7bf0; --pg-deep: #0b7f8a; --pg-teal: #17b6c2; }

/* ---------- The hero ---------- */
.page-hero {
  position: relative; overflow: hidden; isolation: isolate; color: #fff;
  margin: calc(-14px - var(--safe-t, 0px)) calc(-1 * var(--gutter)) 20px;
  padding: calc(18px + var(--safe-t, 0px)) var(--gutter) 26px;
  background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.14) 0 18%, transparent 19%),
              radial-gradient(circle at 96% 92%, rgba(255, 214, 90, 0.26) 0 16%, transparent 17%),
              linear-gradient(160deg, var(--pg-deep) 0%, var(--pg-teal) 100%);
  border-radius: 0 0 32px 32px;
}
.page-hero > :not(.ph-deco):not(.ph-bud) { position: relative; z-index: 1; }
.page-hero .eyebrow {
  display: inline-block; margin: 0 0 10px; padding: 5px 11px 4px; border-radius: 999px;
  background: var(--pg-sun); color: var(--pg-ink); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em;
  box-shadow: 0 0 0 2px var(--pg-ink), 2px 2px 0 var(--pg-ink); transform: rotate(-2deg);
}
.page-hero .page-title { color: #fff; margin: 0; padding-right: 92px; font-size: clamp(1.75rem, 1.45rem + 1.6vw, 2.4rem); line-height: 1.08; }
.page-hero:not(:has(.ph-bud)) .page-title { padding-right: 0; }
.page-hero .page-lede { color: rgba(255, 255, 255, 0.95); margin: 10px 0 0; max-width: 46ch; padding-right: 30px; }
.page-hero .btn-link, .page-hero .pg-back, .page-hero a.others-back { color: #fff; }
.page-hero .btn-link .ic, .page-hero .pg-back .ic { stroke: #fff; color: #fff; }

/* Bud sits top right, bobbing; dots and notes drift behind the words. */
.ph-bud { position: absolute; z-index: 0; right: calc(var(--gutter) - 6px); top: calc(10px + var(--safe-t, 0px)); width: 92px; pointer-events: none;
  filter: drop-shadow(0 5px 0 rgba(17, 22, 64, 0.18)); animation: ph-bob 3.6s ease-in-out infinite; }
.ph-bud svg { display: block; width: 100%; height: auto; }
.ph-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ph-dot { position: absolute; border-radius: 50%; }
.ph-dot.d1 { width: 11px; height: 11px; background: var(--pg-sun); left: 58%; top: 18%; }
.ph-dot.d2 { width: 7px; height: 7px; background: #fff; opacity: 0.7; left: 46%; top: 8%; }
.ph-dot.d3 { width: 13px; height: 13px; background: var(--pg-coral); left: 30px; bottom: 9px; }
.ph-note { position: absolute; font-style: normal; color: rgba(255, 255, 255, 0.5); font-size: 1.35rem; animation: ph-float 4s ease-in-out infinite; }
/* Notes keep to a strip down the right edge, which the lede leaves free. */
.ph-note.n1 { right: 8px; top: 52%; }
.ph-note.n2 { right: 15%; bottom: 2px; animation-delay: -2s; }
@keyframes ph-float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
@keyframes ph-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(2deg); } }

/* The two-way switch (Progress / Profile, Library / Your path) becomes a white sticker on the teal. */
.page-hero .seg-switch { margin-top: 16px; background: #fff; border: 0; box-shadow: 0 0 0 2px var(--pg-ink), 3px 3px 0 var(--pg-ink); }
.page-hero .seg-switch a { color: var(--pg-ink); }
.page-hero .seg-switch a[aria-current="page"] { background: var(--pg-sun); color: var(--pg-ink); box-shadow: 0 0 0 2px var(--pg-ink); }

/* Phones: every hero the size of the Songs one (owner, 15 Nov 2026): Songs' title size, a smaller Bud so titles
   wrap less, and no intro paragraph (the title and the switch carry the page; wide screens keep it). */
@media (max-width: 759px) {
  .page-hero .page-title { font-size: 1.75rem; line-height: 1.12; padding-right: 78px; }
  .ph-bud { width: 74px; }
  .page-hero .page-lede { display: none; }
  .page-hero .seg-switch { margin-top: 14px; }
  .page-hero { padding-bottom: 24px; }
}
/* Phones: one header height on every tab, the Songs one. Short headers keep their words at the bottom with Bud
   up top; Home's header holds its title and button only (the line under it and the pitch picture go). */
@media (max-width: 759px) {
  :root { --hero-h: 176px; }
  .page-hero, .st-home > .st-hero.st-card:first-child, .sc-ask-top { box-sizing: border-box; min-height: calc(var(--hero-h) + var(--safe-t, 0px)); display: flex; flex-direction: column; }
  .page-hero { justify-content: flex-end; align-items: flex-start; }
  .page-hero > .seg-switch { align-self: stretch; }
  .page-hero > .page-title { align-self: stretch; }
  .st-home > .st-hero.st-card:first-child { justify-content: flex-end; }
  .st-home > .st-hero:first-child .st-heard, .st-home > .st-hero:first-child .st-pitch, .st-home > .st-hero:first-child .st-legend { display: none; }
  .st-home > .st-hero:first-child .st-bud { width: 84px; height: auto; }
  .sc-ask-top { justify-content: flex-end; }
  /* Others and the Song library have short titles and short intro lines: the line comes back and Bud is bigger,
     so the block isn't empty teal. (Games and Programs keep theirs hidden: too long for the height.) */
  .others > .page-hero .page-lede, .songs > .page-hero .page-lede { display: block; font-size: 0.98rem; line-height: 1.4; }
  .page-hero:not(:has(.seg-switch)) .ph-bud { width: 100px; }
}

/* Wide screens: the hero is a rounded sticker card inside the page instead of a full-bleed band. */
@media (min-width: 760px) {
  .page-hero { margin: 0 0 24px; padding: 26px 28px 28px; border-radius: 28px; box-shadow: 0 0 0 2.5px var(--pg-ink), 4px 4px 0 var(--pg-ink); }
  .ph-bud { right: 22px; top: 50%; width: 112px; margin-top: -60px; }
  .page-hero .page-title { padding-right: 130px; }
  .page-hero .page-lede { padding-right: 130px; }
}

/* ---------- Others: every row gets its own coloured tile ---------- */
.others-h { font-weight: 800; color: var(--pg-ink); }
.way-rows .way-row .way-ic { color: var(--pg-ink); box-shadow: 0 0 0 2px var(--pg-ink); }
.way-rows .way-row:nth-child(4n + 1) .way-ic { background: #fff4cf; }
.way-rows .way-row:nth-child(4n + 2) .way-ic { background: #ece7ff; }
.way-rows .way-row:nth-child(4n + 3) .way-ic { background: #ffe3df; }
.way-rows .way-row:nth-child(4n + 4) .way-ic { background: #e4f8fa; }

/* ---------- Practice path ---------- */
.lvl-card .level-badge { background: var(--pg-deep); color: #fff; font-weight: 800; box-shadow: 0 0 0 2px var(--pg-ink), 2px 2px 0 var(--pg-ink); }
.lvl-past .level-badge { background: var(--pg-teal); box-shadow: 0 0 0 2px var(--pg-ink), 2px 2px 0 var(--pg-ink); }
.lvl-later .level-badge { background: #eef0f6; color: #6b7190; box-shadow: 0 0 0 2px #c5cbe0; }
.lvl-after .level-badge { background: var(--pg-sun); color: var(--pg-ink); }
.lvl-now .lvl-status { background: var(--pg-sun); color: var(--pg-ink); font-weight: 800; box-shadow: 0 0 0 2px var(--pg-ink), 2px 2px 0 var(--pg-ink); transform: rotate(-3deg); }
.lesson.is-next { background: #e4f8fa; box-shadow: 0 0 0 2px var(--pg-ink), 3px 3px 0 var(--pg-ink); }
.lesson.is-next .lesson-node { background: var(--pg-coral); box-shadow: 0 0 0 2px var(--pg-ink); }
.lesson.is-next .lesson-node .ic { color: #fff; fill: #fff; }
.lesson.is-next .lesson-tag { padding: 4px 8px; border-radius: 999px; background: var(--pg-coral); color: #fff; font-weight: 800; }
.lesson.is-done .lesson-node { background: var(--pg-deep); box-shadow: 0 0 0 2px var(--pg-ink); }

/* ---------- Progress: chunky bars, one colour per skill ---------- */
.progress .skill-bar { height: 12px; background: #fff; box-shadow: 0 0 0 2px var(--pg-ink); }
.progress .skill:nth-child(5n + 1) .skill-fill { background: var(--pg-teal); }
.progress .skill:nth-child(5n + 2) .skill-fill { background: var(--pg-sun); }
.progress .skill:nth-child(5n + 3) .skill-fill { background: var(--pg-coral); }
.progress .skill:nth-child(5n + 4) .skill-fill { background: var(--pg-lilac); }
.progress .skill:nth-child(5n + 5) .skill-fill { background: var(--pg-deep); }
.progress .skill-ticks i { background: var(--pg-ink); opacity: 0.18; }

/* ---------- Profile ---------- */
.avatar-lg { box-shadow: 0 0 0 2.5px var(--pg-ink), 3px 3px 0 var(--pg-ink); }

/* ---------- Song library: play tiles in colour, the lock stays quiet ---------- */
.lib-list .lib-card:not(.is-locked) .lib-icon { background: var(--pg-sun); color: var(--pg-ink); box-shadow: 0 0 0 2px var(--pg-ink); }
.lib-list .lib-card.is-locked .lib-icon { background: #eef0f6; color: #6b7190; }

@media (prefers-reduced-motion: reduce) {
  .ph-bud, .ph-note { animation: none; }
}

/* ---------- Dark ---------- */
html[data-theme="dark"] .page-hero {
  background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.08) 0 18%, transparent 19%),
              radial-gradient(circle at 96% 92%, rgba(255, 214, 90, 0.18) 0 16%, transparent 17%),
              linear-gradient(160deg, #06535b 0%, #0d8f9a 100%);
}
html[data-theme="dark"] .others-h { color: inherit; }
html[data-theme="dark"] .way-rows .way-row:nth-child(4n + 1) .way-ic { background: #4a3f12; color: #ffd65a; }
html[data-theme="dark"] .way-rows .way-row:nth-child(4n + 2) .way-ic { background: #2f2a5a; color: #c9bdff; }
html[data-theme="dark"] .way-rows .way-row:nth-child(4n + 3) .way-ic { background: #4f2724; color: #ffb3a9; }
html[data-theme="dark"] .way-rows .way-row:nth-child(4n + 4) .way-ic { background: #10424a; color: #7fe6ee; }
html[data-theme="dark"] .way-rows .way-row .way-ic,
html[data-theme="dark"] .progress .skill-bar { box-shadow: 0 0 0 2px #39e6ee55; }
html[data-theme="dark"] .progress .skill-bar { background: #1a2248; }
html[data-theme="dark"] .lesson.is-next { background: #10424a; box-shadow: 0 0 0 2px #39e6ee, 3px 3px 0 #39e6ee55; }
html[data-theme="dark"] .lvl-later .level-badge, html[data-theme="dark"] .lib-list .lib-card.is-locked .lib-icon { background: #2a3460; color: #a9b0d6; box-shadow: none; }
/* The sun stickers keep ink text in the dark (the generated dark sheet turns eyebrows and statuses light). */
html[data-theme="dark"] .page-hero .eyebrow,
html[data-theme="dark"] .lvl-now .lvl-status { background: var(--pg-sun); color: var(--pg-ink); }
html[data-theme="dark"] .lvl-card .level-badge { color: #fff; }

/* ---------- Home: the top card becomes the teal hero (owner, 15 Nov 2026) ---------- */
.st-home .st-hero.st-card {
  position: relative; overflow: hidden; isolation: isolate; color: #fff; border: 0; border-radius: 28px;
  background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.14) 0 18%, transparent 19%),
              radial-gradient(circle at 96% 92%, rgba(255, 214, 90, 0.26) 0 16%, transparent 17%),
              linear-gradient(160deg, var(--pg-deep) 0%, var(--pg-teal) 100%);
  box-shadow: 0 0 0 2.5px var(--pg-ink), 4px 4px 0 var(--pg-ink);
  --st-title: #fff; --st-soft: rgba(255, 255, 255, 0.94); --st-mu: rgba(255, 255, 255, 0.88); --st-note: rgba(255, 255, 255, 0.92); --st-line: rgba(255, 255, 255, 0.22);
}
.st-home .st-hero > :not(.ph-deco) { position: relative; z-index: 1; }
.st-home .st-hero .eyebrow { color: var(--pg-sun); font-weight: 800; }
.st-home .st-hero .page-title { color: #fff; }
.st-home .st-hero .st-heard, .st-home .st-hero .st-heard b { color: rgba(255, 255, 255, 0.95); }
.st-home .st-hero .st-bud { filter: drop-shadow(0 5px 0 rgba(17, 22, 64, 0.2)); animation: ph-bob 3.6s ease-in-out infinite; }
.st-home .st-hero .btn-primary { background: var(--pg-sun); color: var(--pg-ink); box-shadow: 0 0 0 2.5px var(--pg-ink), 3px 3px 0 var(--pg-ink); }
.st-home .st-hero .btn-primary .ic { color: var(--pg-ink); stroke: var(--pg-ink); }
/* Icons with filled parts (the song note's heads, the play triangle) fill in ink on the yellow button, not white. */
.st-home .st-hero .btn-primary .ic .ic-fill { fill: var(--pg-ink); stroke: var(--pg-ink); }
.st-home .st-hero .btn-secondary { background: #fff; color: var(--pg-ink); }
.st-home .st-hero .btn-link, .st-home .st-hero .st-legend { color: #fff; }
.st-home .st-hero .ph-note.n1 { top: auto; bottom: 34%; }
.st-home .st-hero .ph-dot.d2 { top: 4px; }
.st-home .st-hero .ph-dot.d1 { left: 62%; right: auto; top: 10px; }
@media (max-width: 759px) {
  .st-home > .st-hero.st-card:first-child { margin: calc(-14px - var(--safe-t, 0px)) calc(-1 * var(--gutter)) 4px; padding: calc(20px + var(--safe-t, 0px)) var(--gutter) 28px; border-radius: 0 0 32px 32px; box-shadow: none; }
}
html[data-theme="dark"] .st-home .st-hero.st-card {
  background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.08) 0 18%, transparent 19%),
              radial-gradient(circle at 96% 92%, rgba(255, 214, 90, 0.18) 0 16%, transparent 17%),
              linear-gradient(160deg, #06535b 0%, #0d8f9a 100%);
  --st-title: #fff; --st-soft: rgba(255, 255, 255, 0.94); --st-mu: rgba(255, 255, 255, 0.88); --st-note: rgba(255, 255, 255, 0.92); --st-line: rgba(255, 255, 255, 0.22);
}
html[data-theme="dark"] .st-home .st-hero .btn-primary { background: var(--pg-sun); color: var(--pg-ink); box-shadow: 0 0 0 2.5px var(--pg-ink), 3px 3px 0 var(--pg-ink); }

/* ---------- Songs: Bud, the question and the hint sit in a teal hero on phones ---------- */
@media (max-width: 759px) {
  .sc-ask-top {
    position: relative; overflow: hidden; isolation: isolate; color: #fff; text-align: center;
    margin: calc(-14px - var(--safe-t, 0px)) calc(-1 * var(--gutter)) 18px; padding: calc(12px + var(--safe-t, 0px)) var(--gutter) 24px;
    background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.14) 0 18%, transparent 19%),
                radial-gradient(circle at 96% 92%, rgba(255, 214, 90, 0.26) 0 16%, transparent 17%),
                linear-gradient(160deg, var(--pg-deep) 0%, var(--pg-teal) 100%);
    border-radius: 0 0 32px 32px;
  }
  .sc-ask-top > :not(.ph-deco) { position: relative; z-index: 1; }
  .sc-ask-top .sc-hero-bud svg { filter: drop-shadow(0 5px 0 rgba(17, 22, 64, 0.2)); }
  .sc-ask-top .sc-hero-bud::before { background: rgba(255, 255, 255, 0.16); }
  .sc-ask-top .sc-notes i { color: rgba(255, 255, 255, 0.7); }
  .sc-ask-top .ph-note.n1 { top: 22px; right: 16%; }
  .sc-ask-top .ph-note.n2 { display: none; }
  html[data-theme="dark"] .sc-learn .sc-ask-top .sc-hero-bud::before { background: rgba(255, 255, 255, 0.12); }
  .sc-ask-top .ob-title { color: #fff; }
  .sc-ask-top .ob-title .squiggle-line path { stroke: var(--pg-sun); }
  .sc-ask-top .ob-hint { color: rgba(255, 255, 255, 0.95); }
  .sc-ask-top .sc-laststep { display: inline-block; padding: 5px 11px 4px; border-radius: 999px; background: var(--pg-sun); color: var(--pg-ink); box-shadow: 0 0 0 2px var(--pg-ink), 2px 2px 0 var(--pg-ink); transform: rotate(-2deg); }
  html[data-theme="dark"] .sc-ask-top {
    background: radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.08) 0 18%, transparent 19%),
                radial-gradient(circle at 96% 92%, rgba(255, 214, 90, 0.18) 0 16%, transparent 17%),
                linear-gradient(160deg, #06535b 0%, #0d8f9a 100%);
  }
  html[data-theme="dark"] .sc-ask-top .ob-title { color: #fff; }
  html[data-theme="dark"] .sc-ask-top .sc-laststep { background: var(--pg-sun); color: var(--pg-ink); }
}
@media (min-width: 760px) {
  .sc-ask-top { display: contents; }
  .sc-ask-top > .ph-deco { display: none; }
}

/* Phones, 15 Nov 2026 (owner, from outside feedback): headers ~14% shorter (176px), and Songs laid out like every
   other header: words left-aligned at the bottom, Bud top right. */
@media (max-width: 759px) {
  .page-hero, .st-home > .st-hero.st-card:first-child, .sc-ask-top { padding-top: calc(14px + var(--safe-t, 0px)); padding-bottom: 18px; }
  .page-hero .eyebrow { margin-bottom: 8px; font-size: 0.68rem; }
  .page-hero .page-title, .sc-ask-top .ob-title, .st-home > .st-hero:first-child .page-title { font-size: 1.6rem; line-height: 1.1; }
  .page-hero .seg-switch { margin-top: 12px; }
  .page-hero .seg-switch a { padding-top: 7px; padding-bottom: 7px; }
  .others > .page-hero .page-lede, .songs > .page-hero .page-lede { margin-top: 6px; font-size: 0.94rem; }
  .st-home > .st-hero:first-child .st-hero-foot { margin-top: 10px; }
  .st-home > .st-hero:first-child .btn-lg { min-height: 48px; padding-top: 10px; padding-bottom: 10px; }
  .st-home > .st-hero:first-child .st-bud { width: 74px; }

  .sc-ask-top { text-align: left; align-items: stretch; }
  .sc-learn .sc-ask-top > .sc-hero-bud { position: absolute; right: calc(var(--gutter) - 6px); top: calc(8px + var(--safe-t, 0px)); width: 74px; margin: 0; }
  .sc-learn .sc-ask-top > .ob-title { text-align: left; margin: 0; padding-right: 78px; }
  .sc-learn .sc-ask-top > .ob-hint { text-align: left; margin: 6px 0 0; font-size: 0.94rem; }
  .sc-learn .sc-ask-top > .sc-laststep { align-self: flex-start; margin: 0 0 8px; }
}

/* Progress: Bud says one thing from the real scores, under the header. */
.bud-says { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 16px; }
.bud-says-bud { flex: none; width: 52px; }
.bud-says-bud svg { display: block; width: 100%; height: auto; }
.bud-says-bubble { position: relative; margin: 0; padding: 12px 14px; border-radius: 18px 18px 18px 6px; background: #e4f8fa; color: var(--pg-ink);
  font-weight: 600; line-height: 1.4; box-shadow: 0 0 0 2px var(--pg-ink), 3px 3px 0 var(--pg-ink); }
html[data-theme="dark"] .bud-says-bubble { background: #10424a; color: #fff; box-shadow: 0 0 0 2px #39e6ee, 3px 3px 0 #39e6ee55; }

