/* Sprout's listening page (2026-11-18): a music player for the songs of a Sprout book, made for a phone first.
   It stands alone (no site.css): the brand's fonts and Sprout's colors are set here. */
:root {
  --paper: #ebe5d6; --raised: #f6f1e6; --line: #d3cbb8; --ink: #1d2433; --muted: #5d6472;
  --leaf: #2e7424; --green: #7fae68; --pale: #dcebd0; --gold: #f2b530;
  --veil: rgba(235, 229, 214, .62); --veil-end: #ebe5d6; --shadow: 0 14px 34px rgba(40, 50, 30, .22);
  --display: "Young Serif", Georgia, serif; --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141a15; --raised: #1e2620; --line: #2f3a31; --ink: #f1eee4; --muted: #a9b0a6;
    --leaf: #8fc777; --green: #7fae68; --pale: #243322; --gold: #f2b530;
    --veil: rgba(16, 21, 17, .7); --veil-end: #141a15; --shadow: 0 14px 34px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.4 var(--body); overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; }
svg.fill { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }

/* the song's picture, soft and large, behind the player */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(34px) saturate(1.15); opacity: 0; transition: opacity .7s ease; transform: translateZ(0); }
.bg i.on { opacity: 1; }
.bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--veil) 0%, var(--veil) 55%, var(--veil-end) 100%); }

.app { position: relative; z-index: 1; }

/* ---------- now playing: one screen ---------- */
.now { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 18px) calc(env(safe-area-inset-bottom) + 6px) calc(env(safe-area-inset-left) + 18px); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.top .brand { color: var(--muted); text-decoration: none; }
.top .allbooks { margin-left: auto; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px 2px; white-space: nowrap; }
.top .book { padding: 4px 12px; border-radius: 999px; background: var(--leaf); color: var(--paper); white-space: nowrap; }

.art { flex: none; width: min(100%, calc(38vh * 4 / 3)); width: min(100%, calc(38svh * 4 / 3)); aspect-ratio: 4 / 3; margin: 0 auto; border-radius: 20px; overflow: hidden; background: var(--raised); box-shadow: var(--shadow); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .35s ease; }
.art img.in { opacity: 1; }

.meta { text-align: center; }
.meta .num { margin: 2px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--leaf); }
.meta h1 { margin: 0; font: 400 26px/1.15 var(--display); text-wrap: balance; }

/* the words: every line of the song; the line being sung is large, each word lights as it is sung */
.words { flex: 1 1 0; min-height: 92px; overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; display: flex; flex-direction: column; text-align: center; padding: 6px 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
.words::-webkit-scrollbar { display: none; }
.words p { margin: 0; padding: 3px 4px; font: 400 clamp(19px, 2.7svh, 23px)/1.3 var(--display); color: var(--muted); opacity: .75; text-wrap: balance; transition: opacity .25s ease, color .25s ease, transform .25s ease; transform: scale(.94); }
.words p:first-child { margin-top: auto; } .words p:last-child { margin-bottom: auto; }
.words p.on { color: var(--ink); opacity: 1; transform: scale(1.06); }
.words p.was { opacity: .55; }
.words span { transition: color .12s ease; }
.words p.on span.sung { color: var(--leaf); }
.words p.on span.cur { color: var(--leaf); text-shadow: 0 0 18px rgba(127, 174, 104, .55); }

/* the timeline */
.scrub { flex: none; }
.scrub input { --p: 0%; display: block; width: 100%; height: 30px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: none; }
.scrub input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--leaf) var(--p), var(--line) var(--p)); }
.scrub input::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--leaf) var(--p), var(--line) var(--p)); }
.scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--leaf); border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .12s ease; }
.scrub input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--leaf); border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.scrub input:active::-webkit-slider-thumb { transform: scale(1.35); }
.times { display: flex; justify-content: space-between; margin-top: -4px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* the buttons */
.ctl { flex: none; display: flex; align-items: center; justify-content: space-between; max-width: 400px; width: 100%; margin: 0 auto; }
.ctl button { display: grid; place-items: center; border-radius: 50%; position: relative; transition: transform .1s ease, background-color .15s ease, color .15s ease; }
.ctl button:active { transform: scale(.9); }
.ctl .opt { width: 46px; height: 46px; color: var(--muted); }
.ctl .opt svg { width: 22px; height: 22px; }
.ctl .opt.on { color: var(--leaf); background: var(--pale); }
.ctl .opt b { position: absolute; right: 4px; top: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--leaf); color: var(--paper); font-size: 11px; line-height: 16px; text-align: center; display: none; }
.ctl .opt.one b { display: block; }
.ctl .skip { width: 56px; height: 56px; }
.ctl .skip svg { width: 32px; height: 32px; }
.ctl .play { width: 72px; height: 72px; background: var(--leaf); color: var(--paper); box-shadow: 0 6px 16px rgba(46, 116, 36, .35); }
.ctl .play svg { width: 34px; height: 34px; }
.i-pause, .playing .i-play { display: none; }
.playing .i-pause { display: block; }
.play .spin { position: absolute; inset: -5px; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--gold); opacity: 0; }
.waiting .play .spin { opacity: 1; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tolist { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 700; color: var(--muted); }
.tolist svg { width: 18px; height: 18px; }

/* ---------- the songs ---------- */
.list { max-width: 560px; margin: 0 auto; padding: 18px calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 96px) calc(env(safe-area-inset-left) + 12px); }
.listhead { padding: 0 6px 4px; }
.listhead h2 { margin: 0; font: 400 30px/1.15 var(--display); }
.listhead p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.list h3 { margin: 22px 6px 6px; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--leaf); }
.track { width: 100%; display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 7px 8px 7px 6px; border-radius: 14px; text-align: left; transition: background-color .15s ease; }
.track:active { background: var(--raised); }
.track .pic { position: relative; width: 60px; height: 45px; border-radius: 9px; overflow: hidden; background: var(--raised); }
.track .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.track .t b { display: block; font-size: 16.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .t small { display: block; font-size: 13px; color: var(--muted); }
.track time { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; padding-right: 2px; }
.track.on { background: var(--pale); }
.track.on .t b { color: var(--leaf); }
.track .eq { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 11px; background: rgba(20, 30, 20, .5); }
.track.on .eq { display: flex; }
.eq i { width: 4px; height: 6px; border-radius: 2px; background: #fff; }
.playing .track.on .eq i { animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; } .eq i:nth-child(3) { animation-delay: -.6s !important; }
@keyframes eq { 0%, 100% { height: 6px; } 50% { height: 20px; } }
/* the free sample and the perks (2026-11-26): a locked song, the visitor's note, the downloads, the course for book owners */
.row { position: relative; }
.row.has-dl { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 2px; }
.row .dl { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.row .dl:hover, .row .dl:active { background: var(--raised); color: var(--leaf); }
.row .dl svg { width: 21px; height: 21px; }
.track.locked .pic img { filter: grayscale(.55); opacity: .72; }
.track.locked .t b { color: var(--muted); }
.track .lock { width: 34px; display: grid; place-items: center; color: var(--muted); }
.track .lock svg { width: 19px; height: 19px; }
.locknote { margin: 0 8px 6px 78px; padding: 10px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; }
.locknote b { display: block; color: var(--ink); }
.locknote a, .perk a:not(.btn) { color: var(--leaf); font-weight: 700; }
.perk { margin: 14px 6px 4px; padding: 14px 16px 15px; border-radius: 16px; background: var(--raised); border: 1px solid var(--line); }
.perk > b { display: block; font: 400 21px/1.2 var(--display); }
.perk p { margin: 6px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.perk p.fine { font-size: 13px; }
.perk .go { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
.perk .btn { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 999px; background: var(--leaf); color: var(--paper); font-weight: 700; text-decoration: none; }
.perk.invite { background: var(--pale); border-color: transparent; margin-top: 26px; }
.zips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.zips a { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--paper); text-decoration: none; }
.zips a svg { grid-row: span 2; width: 22px; height: 22px; }
.zips a span { font-size: 15px; } .zips a small { color: var(--muted); font-weight: 400; font-size: 13px; }
.moreitem { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--paper); text-decoration: none; }
.moreitem span { display: block; font-size: 15.5px; } .moreitem small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 13.5px; line-height: 1.4; }
.sample { flex: none; margin: 0; text-align: center; font-size: 13.5px; color: var(--muted); }
.sample a { color: var(--leaf); font-weight: 700; }
.foot { margin: 26px 8px 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.foot.small { margin-top: 10px; font-size: 12px; }

/* ---------- the small player that stays while the list is on the screen ---------- */
.mini { position: fixed; z-index: 5; left: calc(env(safe-area-inset-left) + 8px); right: calc(env(safe-area-inset-right) + 8px); bottom: calc(env(safe-area-inset-bottom) + 8px); max-width: 544px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 48px 48px; align-items: center; gap: 2px; padding: 7px 8px; border-radius: 18px; overflow: hidden;
  background: var(--raised); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0, 0, 0, .28); transform: translateY(140%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.mini.up { transform: none; }
.minimain { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 10px; text-align: left; }
.minimain img { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; display: block; background: var(--paper); }
.minimain b { display: block; font-size: 15.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minimain small { display: block; font-size: 12.5px; color: var(--muted); }
.mini > button:not(.minimain) { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; }
.mini > button:not(.minimain):active { background: var(--pale); }
.miniplay svg { width: 28px; height: 28px; } .mininext svg { width: 26px; height: 26px; }
.minibar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--leaf); }

.toast { position: fixed; z-index: 9; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 700; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }

/* a short screen (a small phone, or a phone on its side): the picture gives way first */
@media (max-height: 640px) { .art { width: min(100%, calc(30svh * 4 / 3)); } .meta h1 { font-size: 22px; } .ctl .play { width: 62px; height: 62px; } .tolist { min-height: 30px; } }
@media (max-height: 480px) and (orientation: landscape) {
  .now { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; column-gap: 20px; max-width: none; row-gap: 4px; }
  .top { grid-column: 1 / -1; } .art { grid-row: 2 / 6; align-self: center; width: 100%; } .meta, .words, .scrub, .ctl { grid-column: 2; } .tolist { display: none; }
  .words { min-height: 56px; }
}

/* a wide screen: the player on the left, the songs beside it */
@media (min-width: 940px) and (min-height: 481px) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1180px; margin: 0 auto; gap: 24px; padding: 0 24px; }
  .now { position: sticky; top: 0; height: 100vh; margin: 0; max-width: none; width: 100%; padding-bottom: 28px; }
  .art { width: min(100%, calc(44vh * 4 / 3)); }
  .meta h1 { font-size: 32px; } .words p { font-size: 22px; }
  .tolist { display: none; }
  .list { margin: 0; max-width: none; width: 100%; padding-top: 56px; padding-bottom: 40px; }
  .track:hover { background: var(--raised); } .track.on:hover { background: var(--pale); }
  .mini { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
