/* Learn's start, "Start your journey" (js/learnstart.js), and its card at the top of the Learn page (js/learnpage.js).
   One question at a time, on glass, the way Find your level is (learn.css .lv): the same stage, keys and chips, so the
   two read as one family. Plan: docs/jam/learn-plan.md §3 and §4. */

.ls {
  container-type: inline-size;
  padding-bottom: 4px;
  color: var(--starlight);
}

.ls :focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 3px;
}

.ls-stage {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  text-align: center;
}

.ls-stage p,
.ls-stage dl,
.ls-stage dd {
  margin: 0;
}

.ls-eyebrow {
  min-height: 18px;
  color: var(--dust);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
}

.ls-eyebrow:empty {
  display: none;
}

/* The question, and Riff's lines, in his serif. */
.ls-ask,
.ls-riff {
  max-width: 44ch;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.35;
}

.ls-ask:focus,
.ls-riff:focus {
  outline: none;
}

.ls-ask:focus-visible,
.ls-riff:focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 4px;
}

/* Riff picking a song: his line is a reason, so it reads smaller than a question. */
.ls-pickline {
  font-size: 17px;
}

.ls-lede,
.ls-lead {
  max-width: 52ch;
  color: color-mix(in srgb, var(--starlight) 78%, transparent);
  font-size: 14px;
  line-height: 1.5;
}

.ls-lead {
  color: var(--starlight);
  font-size: 15px;
}

.ls-hint {
  max-width: 52ch;
  color: var(--dust);
  font-size: 13px;
  line-height: 1.45;
}

.ls-or {
  color: var(--dust);
  font-size: 12.5px;
}

/* A box to type in: in your words, a song, who it's by. 16px, so a phone doesn't zoom into it. */
.ls-say {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
  text-align: left;
}

.ls-in {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--space) 40%, transparent);
  color: var(--starlight);
  font-size: 16px;
  transition: border-color var(--t) ease;
}

.ls-in::placeholder {
  color: var(--dust);
}

.ls-in:hover {
  border-color: var(--hair-hi);
}

.ls-in:focus-visible {
  border-color: color-mix(in srgb, var(--starlight) 40%, transparent);
  outline: 2px solid var(--starlight);
  outline-offset: 3px;
}

.ls-l {
  padding-left: 16px;
  color: var(--dust);
  font-size: 12.5px;
  font-weight: 500;
}

.ls-song {
  display: grid;
  gap: 6px;
  width: min(100%, 420px);
  text-align: left;
}

.ls-song .ls-row {
  justify-content: flex-start;
}

.ls-opts,
.ls-row,
.ls-ways {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.ls-col {
  flex-direction: column;
  align-items: stretch;
  width: min(100%, 340px);
}

.ls .chip {
  min-height: 40px;
  color: var(--starlight);
}

.ls .chip[aria-pressed="true"],
.ls-way.is-open {
  border-color: var(--starlight);
  background-color: color-mix(in srgb, var(--starlight) 12%, transparent);
}

/* A moment, a feeling, a destination: long words wrap rather than run off a phone. */
.ls .ls-chip {
  max-width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
}

.ls-opt {
  display: grid;
  gap: 2px;
  min-width: 96px;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--starlight);
  font-size: 16px;
  font-weight: 500;
}

.ls-opt.is-mine {
  border-color: color-mix(in srgb, var(--starlight) 55%, transparent);
}

/* The one filled key: what moves you on. */
.ls-go {
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  background-color: var(--starlight);
  color: var(--space);
  font-size: 15px;
  font-weight: 600;
}

.ls .ls-go:disabled {
  opacity: .4;
}

.ls-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 4px;
}

.ls-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 2px;
}

.ls-text {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  color: var(--dust);
  font-size: 14px;
  font-weight: 500;
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--t) ease, text-decoration-color var(--t) ease;
}

.ls-known {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 4px;
}

.ls-known .ls-text {
  padding: 0 6px;
}

/* Hear a few: each sound, with its key to hear it and its key to keep it. */
.ls-sounds {
  display: grid;
  gap: 8px;
  width: min(100%, 460px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ls-sound {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 4px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.ls-sound.is-playing {
  border-color: color-mix(in srgb, var(--starlight) 55%, transparent);
}

.ls-hear {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--starlight);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
}

.ls-hear .ic {
  width: 20px;
  height: 20px;
}

.ls-sound-n {
  min-width: 0;
}

.ls .ls-mine {
  flex: none;
}

/* Let's play first: the loop's chords, each lit as it reaches your ears. */
.ls-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ls-slot {
  display: grid;
  place-items: center;
  min-width: 52px;
  height: 48px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--dust);
  font-size: 16px;
  font-weight: 500;
}

.ls-slot.is-now {
  border-color: var(--starlight);
  background-color: var(--starlight);
  color: var(--space);
}

/* Riff thinking: three quiet dots. */
.ls-wait {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--dust);
}

.ls-dots {
  display: inline-flex;
  gap: 3px;
}

.ls-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: currentColor;
  animation: ls-dot 1.2s ease-in-out infinite;
}

.ls-dots span:nth-child(2) {
  animation-delay: .15s;
}

.ls-dots span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes ls-dot {
  0%,
  80%,
  100% {
    opacity: .25;
  }

  40% {
    opacity: 1;
  }
}

/* The song box (js/listensong.js), inside the sheet: on the sheet's glass, the width of the step. */
.ls .ls-box {
  width: min(100%, 460px);
  max-height: none;
  overflow: visible;
  background-color: color-mix(in srgb, var(--space) 30%, transparent);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-align: left;
}

/* A typed or picked song has no cover: a small note in its place leaves its name room to read. */
.ls .ls-box .lsb-head {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.ls .ls-box .lsb-noart {
  border-radius: 12px;
}

.ls .ls-box .lsb-title {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* Its "i", big enough to tap on a phone, as the rest of the start's keys are. */
.ls .ls-box .lsb-i {
  width: 36px;
  height: 36px;
}

.ls-note {
  color: color-mix(in srgb, var(--starlight) 78%, transparent);
}

/* Here's your start: what it found, as a short list. */
.ls-sum {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px 14px;
  width: min(100%, 460px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
}

.ls-sum dt {
  color: var(--dust);
  font-size: 12.5px;
  font-weight: 500;
}

.ls-sum dd {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.4;
}

.ls-sum dd:last-child {
  margin-bottom: 0;
}

@media (hover: hover) {
  .ls-go:not(:disabled):hover {
    background-color: color-mix(in srgb, var(--starlight) 88%, var(--space));
  }

  .ls-text:hover {
    color: var(--starlight);
    text-decoration-color: currentColor;
  }

  .ls-hear:hover {
    background-color: var(--lift);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ls-dots span {
    animation: none;
    opacity: .6;
  }

  .ls-in,
  .ls-text {
    transition: none;
  }
}

/* ---------- Your journey, at the top of the Learn page ---------- */

.lp-journey {
  border-color: color-mix(in srgb, var(--starlight) 40%, transparent);
}

.lp-said {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 2px 0 0;
}

.lp-said dt {
  color: var(--dust);
  font-size: 12.5px;
  font-weight: 500;
}

.lp-said dd {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
}

@media (min-width: 720px) {
  .lp-journey {
    grid-column: 1 / -1;
  }

  .lp-said {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 16px;
  }

  .lp-said dd {
    margin: 0;
  }

  .ls-sum {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 16px;
  }

  .ls-sum dd {
    margin: 0;
  }
}

/* ---------- The home ---------- */

/* The starters' row is hidden on the home at rest (v2.css), but its box still runs along the bottom of a phone's
   screen: taps go through it while there's nothing in it to tap. */
body[data-state="home"]:not(.is-composing) .bottom {
  pointer-events: none;
}
