/* The level test pages, in the Moymer house style. Loaded after moymer.css (tokens and component recipes: buttons,
   option tiles, bubbles, progress, nodes, stat cards). This file only lays things out and sets tokens.
   Concept: Lou runs a short game. He asks, you answer on chunky tiles, cards are dealt and fly off, and the result
   climbs a level ladder. One accent per screen: Falou blue for words, lavender for grammar. */

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; border-radius: 10px; }
.mm-wrap.lv-col { max-width: calc(640px + 2 * var(--mm-gutter)); }
h2 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem); margin-bottom: 14px; }

/* ---------- the "this site is also in …" bar and the draft banner: flat ice, never dark */
.lang-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; background: var(--mm-ice); font-size: .875rem; font-weight: 700; line-height: 1.4; padding: 10px 48px; text-align: center; }
.lang-bar a { color: var(--brand); font-weight: 900; text-decoration: none; white-space: nowrap; }
.lang-bar button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--mm-slate); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.draft-banner { background: color-mix(in srgb, var(--mm-gold) 22%, white); font-weight: 800; font-size: .875rem; padding: 8px 20px; text-align: center; }

/* ---------- bare header: logo, one link, language chip */
.lv-top__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px 10px; }
.logo { display: block; flex: none; }
.logo img { width: 132px; height: auto; }
.lv-top__nav { display: flex; align-items: center; gap: 18px; font-weight: 900; }
.lv-top__link { color: var(--mm-slate); text-decoration: none; font-size: .9375rem; }
.lv-top__link:hover { color: var(--mm-ink); }
.lv-lang { position: relative; }
.lv-lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; padding: 8px 14px; margin-bottom: var(--mm-depth-sm); background: var(--mm-bg); border: 2px solid var(--mm-line); border-radius: var(--mm-r); box-shadow: 0 var(--mm-depth-sm) 0 var(--mm-line); font-size: .9375rem; transition: transform var(--mm-t-press) ease-out, box-shadow var(--mm-t-press) ease-out; }
.lv-lang summary::-webkit-details-marker { display: none; }
/* The selector is spelled out where there is room ("Site language: English"), and a two-letter code on phones. */
.lv-lang__short { display: none; }
.lv-lang__full::after { content: ""; display: inline-block; width: .42em; height: .42em; margin: 0 0 .18em .55em; border: solid var(--mm-slate); border-width: 0 2.5px 2.5px 0; rotate: 45deg; }
@media (max-width: 700px) { .lv-lang__full { display: none; } .lv-lang__short { display: inline; } }
.lv-lang[open] summary, .lv-lang summary:active { transform: translateY(var(--mm-depth-sm)); box-shadow: 0 0 0 var(--mm-line); }
.lv-lang > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; display: grid; min-width: 170px; padding: 8px; background: var(--mm-bg); border: 2px solid var(--mm-line); border-radius: var(--mm-r); }
.lv-lang > div > * { padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 800; }
.lv-lang > div a:hover { background: var(--mm-ice); }
.lv-lang > div span { color: var(--brand); }

/* ---------- hero: the test itself */
.lv-hero { padding-block: clamp(8px, 2vw, 20px) clamp(56px, 9vw, 104px); overflow-x: clip; }
.lv-head { text-align: center; margin-bottom: clamp(18px, 3vw, 26px); }
.lv-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 2.875rem); margin-bottom: 8px; }
.lv-head .mm-lead { font-size: 1.0625rem; max-width: 46ch; margin-inline: auto; }
.lv-crumbs { font-size: .8125rem; font-weight: 800; color: var(--mm-slate); margin-bottom: 10px; }
.lv-crumbs a { text-decoration: none; }
.lv-crumbs a:hover { color: var(--mm-ink); }
.lv-hero.is-playing .lv-head { display: none; }
/* While the test runs it owns the screen: the rest of the page stays below the fold. */
.lv-hero.is-playing { padding-top: 8px; min-height: calc(100svh - 64px); }

.lv { --accent: var(--brand); position: relative; }
.lv[data-part="2"] { --accent: var(--mm-candy-lavender); }

/* Lou and his bubble */
.lv-lou { display: flex; align-items: flex-end; gap: 18px; }
.lv-lou__art { flex: none; width: 76px; }
.lv-lou .mm-bubble { flex: 0 1 auto; max-width: none; margin-bottom: 12px; }
.lv-lou--hero { margin-bottom: 4px; }
.lv-lou--hero .lv-lou__art { width: clamp(96px, 26vw, 132px); margin-bottom: -6px; }
.lv-lou--hero .mm-bubble { font-size: clamp(1.1875rem, 1rem + .9vw, 1.5rem); padding: 16px 20px; margin-bottom: 26px; }
.lv-lou__art.mm-hop { transform-origin: 50% 100%; }

/* option tiles (the recipe is .mm-option) */
.lv-options { display: grid; gap: 8px; }
[data-controls] .lv-options { margin-top: 16px; }
.lv-options .mm-option { --accent: inherit; padding-block: 14px; }
.lv-options .mm-option:hover { border-color: color-mix(in srgb, var(--accent) 45%, white); }
.lv-options .mm-option.is-quiet { color: var(--mm-slate); }
.lv-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; flex: none; }
.lv-bars i { width: 5px; border-radius: 2px; background: var(--mm-soft); }
.lv-bars i:nth-child(1) { height: 6px; } .lv-bars i:nth-child(2) { height: 10px; } .lv-bars i:nth-child(3) { height: 14px; }
.lv-bars i:nth-child(4) { height: 18px; } .lv-bars i:nth-child(5) { height: 22px; }
.lv-bars i.on { background: var(--brand); }
.lv-facts { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; color: var(--mm-slate); font-size: .875rem; font-weight: 700; text-align: center; }
.lv-last { margin-top: 14px; text-align: center; color: var(--mm-slate); font-size: .9375rem; font-weight: 800; }
.lv-noscript { margin-top: 16px; text-align: center; font-weight: 800; }

/* ---------- playing */
.lv-bar { display: flex; align-items: center; gap: 12px; }
.lv-bar .mm-progress { --c: var(--accent); flex: 1; height: 22px; transition: background-color var(--mm-t-ui) ease; }
.lv-bar .mm-progress > span { min-width: 16px; transition: width var(--mm-t-ui) var(--mm-ease-pop), background-color var(--mm-t-ui) ease; }
.lv-quit { width: 44px; height: 44px; font-size: 1.375rem; color: var(--mm-slate); flex: none; }
.lv-meta { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 20px; }
.lv-meta .mm-eyebrow { --eyebrow: var(--accent); }
.lv-meta .mm-eyebrow + .mm-eyebrow { color: var(--mm-slate); }

.lv-deck { display: grid; min-height: 196px; margin: 18px 0 6px; }
.lv-card { grid-area: 1 / 1; display: grid; place-items: center; align-content: center; gap: 6px; padding: 28px 20px; border-radius: var(--mm-r-card); background: color-mix(in srgb, var(--accent) 12%, var(--mm-bg)); text-align: center; transition: background-color var(--mm-t-ui) ease; }
.lv-card.is-in { animation: lv-deal 380ms var(--mm-ease-pop) both; }
.lv-card.is-out { animation: lv-fly 210ms ease-in forwards; }
@keyframes lv-deal { from { opacity: 0; transform: translateY(30px) rotate(7deg) scale(.9); } }
@keyframes lv-fly { to { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 0)) rotate(var(--fr, 0deg)); } }
.lv-word { font-weight: 900; font-size: clamp(2.375rem, 9.5vw, 3.75rem); line-height: 1.1; overflow-wrap: anywhere; }
.lv-word.long { font-size: clamp(1.75rem, 7.4vw, 3.25rem); }
.lv-word[lang="ko"], .lv-reading[lang="ko"] { font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', var(--mm-font); }
.lv-word[lang="ja"] { font-family: 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', var(--mm-font); }
.lv-word[lang^="zh"] { font-family: 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', var(--mm-font); }
.lv-reading { font-size: 1.25rem; font-weight: 700; color: var(--mm-ink-soft); }
.lv-sentence { font-weight: 900; font-size: clamp(1.375rem, 1.1rem + 1.6vw, 1.875rem); line-height: 1.4; text-wrap: balance; }
.lv-sentence + .lv-reading { font-size: 1rem; }
/* The gap is as wide as its longest option from the start (the options sit in it, invisible, one on top of the other),
   so the sentence does not move when the chosen one is filled in. */
.lv-gap { display: inline-grid; justify-items: center; min-width: 2.4em; padding: 0 .25em; border-bottom: 4px solid var(--accent); line-height: 1.15; color: color-mix(in srgb, var(--accent) 70%, black); vertical-align: baseline; }
.lv-gap > * { grid-area: 1 / 1; }
.lv-gap__size { visibility: hidden; }
.lv-gap.is-filled .lv-gap__fill { animation: mm-pop 300ms var(--mm-ease-pop) both; }
.lv-yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.lv-yn .mm-btn { --face: var(--accent); white-space: normal; padding-inline: 12px; }
.lv-yn .mm-btn--white { --face: var(--mm-bg); }
.lv-hint { margin-top: 12px; text-align: center; color: var(--mm-slate); font-size: .9375rem; font-weight: 700; }
.lv-break { display: grid; gap: 28px; padding-block: 28px 8px; }
/* Lavender is too light for white text: ink on the face, a darker lip (the recipe for light faces). */
.lv-break .mm-btn { --face: var(--accent); --on-face: var(--mm-ink); --lip: color-mix(in srgb, var(--face) 80%, black); }
.lv.is-locked .mm-option, .lv.is-locked .lv-yn .mm-btn { pointer-events: none; }

/* ---------- the result: a moment. Lou swings in, the ladder climbs, the level pops, the stats land, the app comes last */
.lv-result { display: grid; justify-items: center; text-align: center; }
.lv-wait { visibility: hidden; }
.lv-celebrate { display: flex; align-items: flex-start; justify-content: center; gap: 6px; width: 100%; margin-bottom: 4px; }
/* The app's celebration file (500 x 417) has Lou small, hanging on a vine from the top. The slot is a window onto the
   part of the artboard where he lands, at one pixel per unit, so he is about 100px tall and the vine runs off the top. */
.lv-vine { flex: none; width: 210px; aspect-ratio: 210 / 310; overflow: hidden; margin-top: -92px; }
.lv-vine > img { inset: auto 0 0 0; width: 100%; height: 44%; }
.lv-vine > canvas { inset: auto; left: -73.8%; top: -32.3%; width: 238.1%; height: auto; aspect-ratio: 500 / 417; max-width: none; }
.lv-vine--still { display: grid; align-items: end; }
.lv-vine--still img { width: 100%; height: 44%; object-fit: contain; object-position: center bottom; }
.lv-celebrate { padding-right: 24px; }
.lv-celebrate .mm-bubble { flex: 0 1 auto; min-width: 0; margin-top: 96px; margin-left: -22px; text-align: left; }
.lv-ladder { display: flex; justify-content: center; gap: clamp(4px, 1.7vw, 12px); margin: 14px 0 20px; }
.lv-ladder .mm-node { width: clamp(42px, 12.6vw, 62px); height: clamp(40px, 12vw, 58px); font-size: clamp(.75rem, 2.9vw, 1.0625rem); box-shadow: 0 5px 0 var(--c); }
.lv-ladder .mm-node.is-range { background: color-mix(in srgb, var(--brand) 16%, var(--mm-bg)); color: color-mix(in srgb, var(--brand) 72%, black); --c: color-mix(in srgb, var(--brand) 34%, var(--mm-bg)); }
.lv-ladder .mm-node.is-current { box-shadow: 0 9px 0 var(--c); }
.lv-level { font-size: clamp(4.5rem, 21vw, 7.5rem); font-weight: 900; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.lv-level i { font-style: normal; font-size: .45em; color: var(--mm-slate); }
.lv-level-name { margin-top: 6px; font-weight: 900; font-size: 1.375rem; }
.lv-range { margin-top: 4px; color: var(--mm-slate); font-weight: 700; }
.lv-warn { margin-top: 18px; padding: 14px 18px; border-radius: var(--mm-r-bubble); background: color-mix(in srgb, var(--mm-candy-tangerine) 20%, var(--mm-bg)); font-weight: 700; text-align: left; }
.lv-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: clamp(8px, 2.4vw, 12px); width: 100%; margin: 30px 0 26px; }
.lv-stats .mm-stat { padding: 16px 10px 12px; align-content: space-between; }
.lv-stats .mm-stat__label { font-size: clamp(.8125rem, 3.4vw, .9375rem); line-height: 1.25; text-wrap: balance; }
.lv-stats .mm-stat__value { padding-inline: 6px; font-size: clamp(1.5rem, 6.4vw, 1.875rem); }
.lv-stats .mm-stat__value i { font-style: normal; font-size: .6em; color: var(--mm-slate); }
.lv-desc { max-width: 48ch; font-size: 1.125rem; }
.lv-next { width: 100%; margin-top: 20px; padding: 18px 20px; text-align: left; display: grid; gap: 6px; }
.lv-app { width: 100%; margin-top: 36px; display: grid; justify-items: center; gap: 14px; }
.lv-app p { font-weight: 900; font-size: 1.25rem; text-wrap: balance; }
.stores { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.store-label { text-align: left; line-height: 1.1; }
.lv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.lv-detail { width: 100%; margin-top: 28px; text-align: left; color: var(--mm-slate); font-size: .9375rem; }
.lv-detail summary { cursor: pointer; font-weight: 900; }
.lv-detail table { width: 100%; margin-top: 10px; border-collapse: collapse; font-weight: 700; }
.lv-detail td, .lv-detail th { text-align: left; padding: 7px 4px; border-bottom: 2px solid var(--mm-line); }
.lv-detail th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.lv-meter { display: inline-block; vertical-align: middle; width: 90px; height: 10px; padding: 2px; margin-right: 10px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 12%, var(--mm-bg)); }
.lv-meter i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.lv-fine { margin-top: 20px; color: var(--mm-slate); font-size: .875rem; max-width: 56ch; }
.lv-linkbtn { margin-top: 14px; background: none; border: 0; padding: 4px; font: 800 .9375rem var(--mm-font); color: var(--mm-slate); text-decoration: underline; cursor: pointer; }

/* ---------- level path: what each level means */
.lv-note { color: var(--mm-ink-soft); margin-bottom: 36px; }
.lv-path { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; position: relative; }
.lv-path::before { content: ""; position: absolute; left: 30px; top: 30px; bottom: 60px; width: 4px; border-radius: 2px; background: var(--mm-soft); }
.lv-path li { display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start; }
.lv-path .mm-node { position: relative; width: 64px; height: 60px; font-size: 1.0625rem; }
.lv-path h3 { font-size: 1.25rem; margin: 6px 0 4px; }
.lv-path p { color: var(--mm-ink-soft); }

/* ---------- plain text */
.lv-prose { display: grid; gap: 16px; }
.lv-prose h2 { margin: 0; }
.lv-prose h2:not(:first-child) { margin-top: 40px; }
.lv-prose p, .lv-prose li { color: var(--mm-ink-soft); }
.lv-prose strong { color: var(--mm-ink); }
.lv-prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }

/* ---------- questions as a chat: yours on the right, Lou's answer on the left */
.lv-faq { display: grid; gap: 14px; margin-top: 24px; }
.lv-faq summary { list-style: none; display: flex; justify-content: flex-end; cursor: pointer; }
.lv-faq summary::-webkit-details-marker { display: none; }
.lv-faq .mm-msg { max-width: 88%; font-weight: 800; }
.lv-faq summary:hover .mm-msg { background: color-mix(in srgb, var(--brand) 92%, white); }
.lv-faq__a { display: flex; align-items: flex-end; gap: 16px; margin: 12px 0 10px; }
.lv-faq__a img { width: 44px; height: 44px; flex: none; }
.lv-faq__a .mm-bubble { max-width: 46ch; font-size: 1rem; font-weight: 600; }
.lv-faq details[open] .lv-faq__a { animation: mm-enter var(--mm-t-enter) var(--mm-ease-settle) both; }

.lv-sources-band { padding-block: 56px; }
.lv-sources-band h2 { font-size: 1.25rem; color: var(--mm-slate); }
.lv-sources { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--mm-slate); font-size: .875rem; }

/* ---------- closing band: the family sits on the footer */
.lv-cta { padding-top: clamp(56px, 8vw, 96px); overflow: hidden; }
.lv-cta__grid { display: grid; gap: 32px; align-items: end; }
.lv-cta__grid > div { display: grid; gap: 14px; justify-items: start; padding-bottom: 8px; }
.lv-cta h2 { margin: 0; }
.lv-cta p { font-size: 1.125rem; font-weight: 700; max-width: 40ch; }
.lv-cta .stores { justify-content: flex-start; margin-top: 8px; }
.lv-cta .mm-store { --face: #fff; --on-face: #000; --lip: color-mix(in srgb, #fff 55%, var(--brand)); }
.lv-cta .mm-store:hover { background: var(--mm-ice); }
.lv-cta__grid > img { width: min(100%, 420px); height: auto; justify-self: center; }
@media (min-width: 860px) {
  .lv-cta__grid { grid-template-columns: 1.1fr .9fr; gap: 48px; }
  .lv-cta__grid > div { padding-bottom: 72px; }
}

/* ---------- footer */
.mm-footer { padding-block: 72px 40px; }
.lv-foot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
.lv-foot__brand { grid-column: 1 / -1; display: grid; gap: 12px; }
.lv-foot__brand p { color: var(--mm-foot-link); max-width: 32ch; }
.lv-foot nav { display: grid; gap: 10px; align-content: start; }
.lv-foot h2 { font-size: 1rem; color: var(--mm-foot-title); margin: 0 0 2px; }
.lv-foot__fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 40px; color: var(--mm-foot-link); font-size: .875rem; }
.foot-langs { display: flex; gap: 16px; }
.foot-langs span { color: var(--mm-foot-title); }
@media (min-width: 860px) {
  .lv-foot { grid-template-columns: 1.6fr repeat(4, 1fr); }
  .lv-foot__brand { grid-column: auto; }
}

/* ---------- the hub: Lou asks which language */
.lv-tiles { display: grid; gap: 8px; }
.lv-tiles .mm-option { text-decoration: none; }
.lv-tiles .mm-option:hover { border-color: color-mix(in srgb, var(--brand) 45%, white); }
.lv-tiles img { width: 36px; height: 24px; border-radius: 5px; flex: none; }
@media (min-width: 600px) { .lv-tiles { grid-template-columns: 1fr 1fr; gap: 8px 12px; } }
.lv-hubnote { margin-top: 36px; color: var(--mm-slate); font-size: .9375rem; }

@media (max-width: 420px) {
  .lv-deck { min-height: 150px; margin-top: 14px; }
  .lv-card { padding: 22px 16px; }
  .lv-meta { margin: 12px 0 14px; }
  .lv-meta .mm-eyebrow + .mm-eyebrow { white-space: nowrap; }
  .lv-options .mm-option { padding-block: 13px; }
  /* A narrower window at 0.8px per unit, so all five poses still fit. */
  .lv-vine { width: 165px; aspect-ratio: 165 / 250; margin-top: -76px; }
  .lv-vine > canvas { left: -77.6%; top: -32%; width: 242.4%; }
  .lv-celebrate .mm-bubble { margin-top: 84px; }
  .lv-celebrate { padding-right: 0; }
  .lv-celebrate .mm-bubble { margin-left: -12px; }
  .lv-lou { gap: 14px; }
  .lv-lou__art { width: 64px; }
  .lv-celebrate .mm-bubble { font-size: 1rem; }
}
