/* Home page only (loaded by site/pages/home.mjs). Reads the design tokens; no colour is hard-coded. */

/* Hero: the lilac brand field behind the promise and the demo */
.home-band { background: var(--hero); color: var(--hero-ink); padding-bottom: 36px; }
.home-band .home-hero__lead, .home-band .home-hero__fine, .home-band .kicker { color: var(--hero-ink); opacity: .85; }
.home-band .hd { box-shadow: var(--shadow-lg); }

/* Hero */
.home-hero { padding: 40px 0 8px; display: grid; gap: 28px; grid-template-columns: 1.05fr 1fr; align-items: center; }
.home-hero h1 { font-size: clamp(34px, 5vw, 52px); }
.home-hero__lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.home-hero__promise { font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--ink); border-left: 4px solid var(--accent); padding: 2px 0 2px 12px; margin: 18px 0; }
.home-hero__fine { font-size: 14px; color: var(--muted); margin-top: 14px; }
@media (max-width: 860px) {
  /* Phones: the demo comes right after the promise, before the long text, so the goal is seen first. */
  .home-hero { grid-template-columns: 1fr; padding-top: 20px; gap: 0; }
  .home-hero__text { display: contents; }
  .home-hero__text > .kicker { order: 1; } .home-hero h1 { order: 2; margin-bottom: 4px; } .home-hero__promise { order: 3; margin: 10px 0 14px; }
  .home-hero > .hd { order: 4; } .home-hero__lead { order: 5; margin-top: 18px; } .home-hero .hero__actions { order: 6; } .home-hero__fine { order: 7; }
}

/* Demo card */
.hd { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hd__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hd__tune { font-size: 13px; color: var(--muted); }
.hd__caption { margin: 0; min-height: 3.2em; font-family: var(--display); font-weight: 800; font-size: 17px; line-height: 1.35; }
.hd__status { margin: 0; min-height: 1.5em; }
.hd__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hd__icon { width: 16px; height: 16px; display: inline-grid; }
.hd__icon svg { fill: currentColor; width: 16px; height: 16px; }

[data-pc="0"] { --pc: var(--pc-0); } [data-pc="1"] { --pc: var(--pc-1); } [data-pc="2"] { --pc: var(--pc-2); }
[data-pc="3"] { --pc: var(--pc-3); } [data-pc="4"] { --pc: var(--pc-4); } [data-pc="5"] { --pc: var(--pc-5); }
[data-pc="6"] { --pc: var(--pc-6); } [data-pc="7"] { --pc: var(--pc-7); } [data-pc="8"] { --pc: var(--pc-8); }
[data-pc="9"] { --pc: var(--pc-9); } [data-pc="10"] { --pc: var(--pc-10); } [data-pc="11"] { --pc: var(--pc-11); }

/* Transcript: one slot per note of the tune ("?" until it is found) */
.hd-transcript { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; }
.hd-transcript li {
  position: relative; display: flex; flex-direction: column; align-items: center; padding: 5px 0 4px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-family: var(--display); line-height: 1.1;
  transition: background .15s, transform .12s;
}
.hd-transcript b { font-size: 12px; }
.hd-transcript span { font-size: 11px; opacity: .8; }
.hd-transcript li.is-found { background: var(--pc); border-color: var(--pc); color: var(--note-ink); }
.hd-transcript li.is-on { outline: 2px solid var(--accent); outline-offset: 1px; transform: translateY(-2px); }
.is-running .hd-transcript li:not(.is-found) > * { visibility: hidden; }
.is-running .hd-transcript li:not(.is-found)::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-weight: 800; }
@media (max-width: 520px) { .hd-transcript { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* One-octave keyboard (same conventions as the lesson keyboard: --surface white keys, --ink black keys) */
.hd-keys { position: relative; display: flex; gap: 2px; height: 136px; background: var(--key-black); border: 2px solid var(--key-black); border-radius: var(--radius-s); overflow: hidden; }
.hd-key { flex: 1; position: relative; padding: 0; border: 0; border-radius: 0 0 6px 6px; background: var(--key-white); transition: background .12s, transform .08s; }
.hd-key span { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--key-white-ink); }
.hd-key.is-found { box-shadow: inset 0 -8px 0 var(--pc); }
.hd-key.is-ref::before { content: "ref"; position: absolute; left: 0; right: 0; top: 64%; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--key-white-ink); }
.hd-key.is-on { background: var(--pc); transform: translateY(2px); }
.hd-key.is-on span, .hd-key.is-on::before { color: var(--note-ink); }
.hd-key--black { position: absolute; top: 0; left: var(--x); width: 8%; height: 58%; transform: translateX(-50%); z-index: 1; background: var(--key-black); border-radius: 0 0 5px 5px; box-shadow: inset 0 -5px 0 var(--key-white-ink); }
.hd-key--black.is-on { background: var(--pc); transform: translateX(-50%) translateY(2px); }
@media (prefers-reduced-motion: reduce) {
  .hd-transcript li.is-on, .hd-key.is-on { transform: none; }
  .hd-key--black.is-on { transform: translateX(-50%); }
}

/* Honesty: what you learn / what we don't promise */
.home-honest { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.home-honest .card h3 { margin-top: 0; }
.home-honest ul { margin: 0; padding-left: 1.1em; }
.home-honest li { margin: 6px 0; }
@media (max-width: 700px) { .home-honest { grid-template-columns: 1fr; } }

/* The path: five steps toward playing melodies by ear */
.home-path { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: step; }
.home-path li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.home-path li.is-goal { border: 2px solid var(--accent); }
.home-path .n { font-family: var(--mono); font-size: 13px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); }
.home-path li.is-goal .n { background: var(--accent); color: var(--surface); }
.home-path b { font-family: var(--display); font-size: 19px; }
.home-path small { color: var(--muted); font-size: 15px; line-height: 1.45; }
.home-path a { margin-top: auto; font-weight: 700; font-size: 15px; }
@media (max-width: 980px) { .home-path { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }

/* Daily game banner */
.home-daily { display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.home-daily h2 { margin: 0 0 6px; }
.home-daily p { margin: 0; color: var(--muted); max-width: 52ch; }
