/* Melupia landing page. The colours are the app's own (app/lib/ui/palette.dart): «استودیو» paper and
   ink, the light oak, honey for the song path, green and red for right and wrong, ivory and ebony keys.
   The oak and the keys stay the same in the dark theme, like in the app. */

@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url("fonts/Vazirmatn-Regular.woff2") format("woff2"), url("fonts/Vazirmatn-Regular.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-display: swap; src: url("fonts/Vazirmatn-Bold.woff2") format("woff2"), url("fonts/Vazirmatn-Bold.ttf") format("truetype"); }
@font-face { font-family: "Vazirmatn"; font-weight: 800; font-display: swap; src: url("fonts/Vazirmatn-ExtraBold.woff2") format("woff2"), url("fonts/Vazirmatn-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Noto Music"; font-weight: 400; font-display: block; src: url("fonts/NotoMusic-Regular.woff2") format("woff2"), url("fonts/NotoMusic-Regular.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --paper: #F6F4EF;
  --surface: #FFFFFF;
  --tray: #ECE8E0;
  --line: #E2DDD3;
  --ink: #1C1B19;
  --body: #3A3833;
  --muted: #66625A;
  --tile: #F1E8DA;
  --tile-ink: #6E4E2C;
  --honey: #C98A4B;
  --honey-soft: #F7E6CF;
  --honey-ink: #8A5A2B;
  --good: #1F9D6B;
  --good-soft: #D6F2E5;
  --good-ink: #136B47;
  --bad: #E2484D;
  --bad-soft: #FBDADB;
  --bad-ink: #A3262B;
  --accent: #2C6BD8;
  --accent-soft: #DCE7FB;
  --primary: #1C1B19;
  --on-primary: #FFFFFF;
  --plate: rgba(255, 251, 243, 0.96);
  --meadow: #E7EDDB;
  --meadow-ink: #3F5F2E;
  --frame: #1C1B19;
  /* The same in both themes. */
  --wood: #C1955F;
  --wood-ink: #2B1D10;
  --ledge: #8E663E;
  --felt: #8C2A2A;
  --ivory: #FFFDF8;
  --key-ink: #1C1B19;
  --key-active: #D3E1FA;
  --key-active-ink: #16408C;
  --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141311;
    --surface: #1F1D1A;
    --tray: #2B2925;
    --line: #38352F;
    --ink: #EFEBE3;
    --body: #D3CDC2;
    --muted: #B0AA9F;
    --tile: #33291E;
    --tile-ink: #E6C9A0;
    --honey: #D69C5F;
    --honey-soft: #3D2E1D;
    --honey-ink: #EBBE88;
    --good: #35B583;
    --good-soft: #173A2B;
    --good-ink: #86DDB4;
    --bad: #EC5F64;
    --bad-soft: #47201F;
    --bad-ink: #FFA4A6;
    --accent: #5E92EE;
    --accent-soft: #1D2C47;
    --primary: #EFEBE3;
    --on-primary: #141311;
    --plate: rgba(37, 35, 32, 0.96);
    --meadow: #1A2016;
    --meadow-ink: #B5CFA0;
    --frame: #2E2B27;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141311; --surface: #1F1D1A; --tray: #2B2925; --line: #38352F; --ink: #EFEBE3; --body: #D3CDC2;
  --muted: #B0AA9F; --tile: #33291E; --tile-ink: #E6C9A0; --honey: #D69C5F; --honey-soft: #3D2E1D; --honey-ink: #EBBE88;
  --good: #35B583; --good-soft: #173A2B; --good-ink: #86DDB4; --bad: #EC5F64; --bad-soft: #47201F; --bad-ink: #FFA4A6;
  --accent: #5E92EE; --accent-soft: #1D2C47; --primary: #EFEBE3; --on-primary: #141311; --plate: rgba(37, 35, 32, 0.96);
  --meadow: #1A2016; --meadow-ink: #B5CFA0; --frame: #2E2B27;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.9;
  overflow-x: hidden;
}
html[lang="en"] body { line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 800; }
p { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 10; background: var(--primary); color: var(--on-primary);
  padding: 8px 16px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 28px; } }

/* ---- Header ------------------------------------------------------------------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; }
.brand b { font-size: 21px; font-weight: 800; line-height: 1.2; display: block; }
.brand small { display: none; font-size: 13px; color: var(--muted); line-height: 1.3; }
@media (min-width: 560px) { .brand small { display: block; } }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: 12px; color: var(--body); }
.nav a:hover { background: var(--tray); }
.nav .nav-page { display: none; }
@media (min-width: 900px) { .nav .nav-page { display: inline-block; } }
.nav .lang { border: 1.5px solid var(--line); }

/* ---- Buttons and store badges ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 10px 22px; border-radius: 16px; border: 0;
  background: var(--primary); color: var(--on-primary);
  font: 800 17px/1.3 var(--font); text-decoration: none; cursor: pointer;
  position: relative; overflow: hidden; isolation: isolate;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.16);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
/* The faint notes on the app's black buttons. */
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.09;
  background: url("img/notes.svg") 0 0 / 92px 52px repeat;
}
:root[data-theme="dark"] .btn::before { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn::before { filter: invert(1); } }
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16); }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn--line { background: transparent; color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
.btn--line::before { display: none; }
.btn--small { min-height: 42px; padding: 6px 16px; font-size: 15px; border-radius: 13px; }

.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store { min-width: 168px; justify-content: flex-start; padding-inline: 18px 22px; }
.store span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.store small { font-size: 12px; font-weight: 400; opacity: 0.8; }
.store b { font-size: 18px; font-weight: 800; }
.store svg { width: 26px; height: 26px; }
.store--soon { opacity: 0.55; cursor: default; }
.store--soon:hover, .store--soon:active { transform: none; box-shadow: none; }

/* ---- The oak desk, the paper sheet and the keys -------------------------------------------------- */
.desk {
  position: relative;
  background: var(--wood) url("img/oak.webp") center / cover;
  border-radius: 28px;
  padding: 18px 14px 0;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 10px 0 -2px var(--ledge), 0 26px 44px -26px rgba(43, 29, 16, 0.75);
  margin-bottom: 10px;
}
@media (min-width: 768px) { .desk { padding: 26px 24px 0; } }
.sheet {
  background: var(--plate);
  color: var(--ink);
  border-radius: 20px;
  box-shadow: 0 2px 0 rgba(43, 29, 16, 0.22), 0 14px 26px -16px rgba(43, 29, 16, 0.6);
  margin: 0;
}

.keys {
  --n: 8;
  position: relative;
  display: flex;
  border-top: 4px solid var(--felt);
  margin-inline: -14px;
  background: #3A2614;
}
@media (min-width: 768px) { .keys { margin-inline: -24px; } }
.key { font: inherit; margin: 0; padding: 0; border: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.key.white {
  flex: 1 1 0; min-width: 0;
  background: linear-gradient(#ECE6DA 0, var(--ivory) 9%, #FAF6EE 92%, #E3DCCD 100%);
  border-inline-end: 1px solid rgba(43, 29, 16, 0.18);
  border-radius: 0 0 9px 9px;
  color: var(--key-ink);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-bottom: 10px; line-height: 1.2;
  position: relative;
  transition: background-color 0.15s ease;
}
.key.white:last-child { border-inline-end: 0; }
.key.black {
  position: absolute; top: 0; z-index: 2;
  width: calc(100% / var(--n) * 0.58); height: 60%;
  background: linear-gradient(#2C2B2F, #151417 70%, #0B0B0D);
  border-radius: 0 0 6px 6px;
  box-shadow: inset 0 -5px 0 #2B2A2E, 0 3px 4px rgba(0, 0, 0, 0.35);
}
.key .sol { font-weight: 800; font-size: clamp(13px, 2.6vw, 18px); }
.key .sci { font-size: clamp(10px, 1.9vw, 13px); color: #66625A; font-weight: 400; }
.key kbd {
  font: 700 11px/1 var(--font); color: #8A5A2B; background: #F7E6CF; border-radius: 6px;
  padding: 4px 6px; margin-bottom: 8px;
}
@media (hover: none) { .key kbd { display: none; } }
button.key { cursor: pointer; }
button.key.white:active, .key.white.is-down { background: linear-gradient(#DCE5F5, var(--key-active)); }
button.key.black:active, .key.black.is-down { background: linear-gradient(#1A2B4D, #23395F); }
.key.white.is-listen { background: linear-gradient(#B9CEF6, var(--key-active)); color: var(--key-active-ink); }
.key.white.is-good { background: linear-gradient(#BFE8D5, #D6F2E5); box-shadow: inset 0 -6px 0 #1F9D6B; }
.key.white.is-bad { background: linear-gradient(#F6C2C4, #FBDADB); box-shadow: inset 0 -6px 0 #E2484D; }
.key.black.is-bad { background: linear-gradient(#7A2226, #A3262B); }
.key.white.is-hint { background: linear-gradient(#BFE8D5, #D6F2E5); box-shadow: inset 0 -6px 0 #1F9D6B, inset 0 0 0 3px #1F9D6B; }
.key.white.is-hint .sol { color: #136B47; }
@media (prefers-reduced-motion: no-preference) {
  .key.white.is-hint { animation: hint 1.1s ease-in-out infinite; }
}
@keyframes hint { 50% { box-shadow: inset 0 -6px 0 #1F9D6B, inset 0 0 0 5px rgba(31, 157, 107, 0.55); } }

/* Hero keys: a strip along the desk's front edge, no labels. */
.keys--strip { height: 64px; margin-top: 22px; }
.keys--strip .key.white { padding: 0; border-radius: 0 0 6px 6px; }
@media (min-width: 768px) { .keys--strip { height: 78px; } }

/* ---- Staff (SVG drawn by site.js) ---------------------------------------------------------------- */
.staff { display: block; overflow: visible; }
.staff .line { stroke: currentColor; stroke-width: 1.3; opacity: 0.85; }
.staff .bar { stroke: currentColor; stroke-width: 1.6; }
.staff .bar.end { stroke-width: 4; }
.staff .clef { font-family: "Noto Music", serif; fill: currentColor; }
.staff .head { fill: currentColor; }
.staff .stem, .staff .ledger { stroke: currentColor; stroke-width: 1.6; }
.staff .name { font: 700 14px var(--font); fill: var(--muted); text-anchor: middle; }
.staff .note.is-done { color: var(--good); }
.staff .note.is-miss { color: var(--bad); }
.staff .note.is-listen { color: var(--accent); }
.staff .note.is-listen .name { fill: var(--accent); }
.staff .note.is-later { color: var(--muted); }
.staff .band { fill: var(--honey-soft); }
.staff .arrow { fill: var(--honey); }
@media (prefers-reduced-motion: no-preference) {
  .staff.enter .note { animation: noteIn 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
  .staff.enter .name { animation: nameIn 0.4s ease both; animation-delay: inherit; }
  .staff.turn { animation: turn 0.28s ease both; }
  .staff .arrow { transition: transform 0.2s ease; }
}
@keyframes noteIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes nameIn { 0%, 55% { opacity: 0; } }
@keyframes turn { from { opacity: 0; transform: translateX(-12px); } }

/* ---- Sections ----------------------------------------------------------------------------------- */
.section { padding-block: clamp(56px, 9vw, 112px) 0; }
.section-head { max-width: 40rem; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head h2 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); line-height: 1.35; margin-bottom: 12px; }
html[lang="en"] .section-head h2 { line-height: 1.15; letter-spacing: -0.01em; }
.section-head kbd { font: 700 0.85em/1 var(--font); background: var(--tray); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.lead { font-size: clamp(1.05rem, 1rem + 0.35vw, 1.2rem); color: var(--body); }
.small { font-size: 14px; color: var(--muted); }

/* Hero */
.hero { padding-block: clamp(16px, 4vw, 48px) 0; }
.hero-grid { display: grid; gap: 32px; align-items: center; grid-template-columns: minmax(0, 1fr); }
.split, .smart, .who, .mine, .foot-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 48px; } }
.hero h1 {
  font-size: clamp(2.35rem, 1.3rem + 4.6vw, 4.3rem);
  line-height: 1.28; margin-bottom: 18px; max-width: 11em;
}
html[lang="en"] .hero h1 { line-height: 1.06; letter-spacing: -0.02em; margin-bottom: 22px; }
.hero .lead { max-width: 33rem; margin-bottom: 26px; }
.hero-cta { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.try-link { font-weight: 700; color: var(--ink); text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--honey); }
.hero-sheet { padding: 14px 12px 12px; }
@media (min-width: 768px) { .hero-sheet { padding: 20px 22px 16px; } }
.hero-staff { color: var(--ink); min-height: 150px; }
.hero-sheet figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Steps: a real sequence, so the numbers are earned. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: step; position: relative; }
@media (min-width: 820px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
  .steps::before { content: ""; position: absolute; top: 27px; inset-inline: 40px; border-top: 2px dashed var(--line); }
}
.steps li { position: relative; }
.steps .num {
  width: 56px; height: 56px; border-radius: 17px; background: var(--tile); color: var(--tile-ink);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; margin-bottom: 14px;
  box-shadow: 0 0 0 8px var(--paper); position: relative;
}
.steps h3 { font-size: 1.3rem; margin-bottom: 6px; }

/* Try it */
.try-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .try-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; gap: 48px; } }
.try-grid .section-head { margin-bottom: 0; }
.try-notes { display: grid; gap: 12px; margin-top: 18px; }
.desk--trainer { max-width: 760px; width: 100%; }
.trainer-sheet { padding: 12px 12px 6px; }
@media (min-width: 768px) { .trainer-sheet { padding: 16px 20px 8px; } }
.t-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.t-stats { display: flex; gap: 4px; margin: 0; flex-wrap: wrap; }
.t-stats div { background: var(--tray); border-radius: 10px; padding: 2px 7px; display: flex; gap: 4px; align-items: baseline; line-height: 1.6; }
.t-stats dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.t-stats dd { margin: 0; font-weight: 800; font-size: 14px; color: var(--ink); white-space: nowrap; }
@media (min-width: 420px) {
  .t-stats { gap: 6px; }
  .t-stats div { padding: 4px 10px; border-radius: 12px; gap: 6px; }
  .t-stats dt { font-size: 12px; }
  .t-stats dd { font-size: 15px; }
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn[aria-pressed="false"] .on, .icon-btn[aria-pressed="true"] .off { display: none; }
.t-staff { color: var(--ink); min-height: 112px; margin-top: 2px; }
@media (min-width: 420px) { .t-staff { min-height: 140px; } }
.t-say { min-height: 3.4em; font-size: 15px; line-height: 1.7; color: var(--body); text-align: center; padding: 2px 4px 6px; }
.t-say.is-good { color: var(--good-ink); }
.t-say.is-bad { color: var(--bad-ink); }
.t-say .ltr { font-weight: 800; }
.keys--big { height: clamp(150px, 40vw, 210px); margin-top: 14px; }
.t-tip { margin-top: 18px; min-height: 1.8em; text-align: center; }
.t-tip .ltr { font-weight: 800; color: var(--ink); }
.t-midi { display: grid; gap: 8px; justify-items: start; margin-top: 18px; }
.t-midi[hidden] { display: none; }
.t-midi .btn svg { width: 22px; height: 22px; }

/* Feature rows with phones */
.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.points h3 { font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.points .glyph {
  width: 38px; height: 38px; border-radius: 12px; background: var(--tile); color: var(--tile-ink); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font: 22px/1 "Noto Music", serif;
}
.points .glyph svg { width: 20px; height: 20px; }
@media (min-width: 640px) { .points--two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 32px; } }

.phone {
  width: min(250px, 66vw); aspect-ratio: 540 / 1169; padding: 8px; border-radius: 38px; background: var(--frame);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 24px 40px -22px rgba(28, 27, 25, 0.55); flex-shrink: 0; margin: 0;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; background: var(--paper); }
.phone--land { width: min(520px, 100%); aspect-ratio: 1100 / 508; border-radius: 32px; }
.phone--land img { border-radius: 25px; }
.phones { display: flex; gap: 18px; justify-content: center; align-items: flex-end; }
.phones .phone:nth-child(2) { transform: translateY(-28px); }
.stack { display: grid; justify-items: center; }
.stack .phone:first-child { justify-self: end; margin-inline-end: 8%; }
.stack .phone--land { justify-self: start; margin-top: -32%; position: relative; z-index: 1; width: min(500px, 92%); }

.smart { display: grid; gap: 44px; }
.smart .points--two { max-width: 920px; }

/* A row of phones that scrolls sideways on small screens (inside its box, never the page). */
.shelf { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 16px 28px; margin-inline: -16px;
  scrollbar-width: thin; }
.shelf .phone { scroll-snap-align: center; width: min(230px, 62vw); }
.shelf figure { margin: 0; display: grid; gap: 10px; justify-items: center; flex-shrink: 0; }
.shelf figcaption { font-size: 14px; color: var(--muted); font-weight: 700; }
@media (min-width: 640px) { .shelf { justify-content: center; } .shelf .phone { width: min(230px, 28vw); } }
@media (min-width: 900px) { .shelf { overflow: visible; justify-content: center; margin-inline: 0; padding-inline: 0; gap: 28px; }
  .shelf figure:nth-child(2) { transform: translateY(-30px); } }

/* Songs: the meadow of the song path. */
.meadow { background: var(--meadow); margin-top: clamp(56px, 9vw, 112px); padding-block: clamp(48px, 8vw, 96px); }
.meadow .section-head h2 { color: var(--ink); }
.songs { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.songs li { background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 15px;
  font-weight: 700; color: var(--ink); line-height: 1.8; }
.songs li.done { background: var(--good-soft); border-color: transparent; color: var(--good-ink); }
.songs li.next { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.mine { margin-top: clamp(40px, 6vw, 64px); display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .mine { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; } }
.mine .phone--land { width: min(560px, 100%); justify-self: center; }
.mine h3 { font-size: 1.35rem; margin-bottom: 6px; }

/* Who it is for */
.who { display: grid; gap: 14px; }
@media (min-width: 820px) { .who { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.who article { background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 20px 20px 22px; }
.who .glyph { font: 34px/1 "Noto Music", serif; color: var(--honey); height: 44px; display: block; margin-bottom: 6px; }
.who h3 { font-size: 1.15rem; margin-bottom: 6px; line-height: 1.5; }
.soon { margin-top: 18px; display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 18px; background: var(--tray); }
.pill { display: inline-block; background: var(--honey-soft); color: var(--honey-ink); font-weight: 800; font-size: 13px;
  border-radius: 999px; padding: 2px 12px; white-space: nowrap; line-height: 1.9; }

/* FAQ */
.faq { background: var(--surface); border: 1.5px solid var(--line); border-radius: 24px; padding: 4px 18px; max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 800; color: var(--ink); font-size: 1.06rem;
  display: flex; justify-content: space-between; gap: 16px; align-items: center; line-height: 1.6;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 12px; height: 12px; flex-shrink: 0; border: solid var(--muted); border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translate(-3px, -3px); transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); }
.faq details p { padding: 0 0 18px; max-width: 42rem; }

/* Closing call */
.closing { padding-block: clamp(56px, 9vw, 112px) clamp(40px, 6vw, 72px); }
.desk--closing { padding: clamp(22px, 5vw, 48px) clamp(14px, 4vw, 48px); }
.closing-sheet { padding: clamp(22px, 4vw, 40px); display: grid; gap: 18px; justify-items: start; max-width: 720px; }
.closing-sheet h2 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); line-height: 1.3; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding-block: 28px 40px; font-size: 14px; color: var(--muted); }
.foot-grid { display: grid; gap: 14px; }
@media (min-width: 820px) { .foot-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--body); font-weight: 700; text-underline-offset: 4px; }
.foot p { line-height: 1.8; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .phones .phone:nth-child(2), .shelf figure:nth-child(2) { transform: none; }
}

/* ---- The phone on the piano: a scroll scene ------------------------------------------------------
   Without JavaScript, or with reduced motion, it is a still picture: the phone already on the music
   desk and the three steps as a list. site.js adds .is-scroll for the scroll version, and .is-sda
   where the browser runs scroll-driven animations itself; elsewhere it sets --ty, --tilt, --shade
   and --c1..--c3 from the scroll position. Only transform and opacity move. */
.scene-top { display: grid; gap: 14px; justify-items: start; }
.scene-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.scene-steps li { display: flex; align-items: baseline; gap: 12px; color: var(--ink); font-weight: 700; font-size: 1.08rem; line-height: 1.7; }
.scene-n {
  width: 32px; height: 32px; border-radius: 11px; background: var(--tile); color: var(--tile-ink); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; line-height: 1;
  transform: translateY(-2px);
}
.scene-count {
  display: inline-block; background: var(--good-soft); color: var(--good-ink); border-radius: 999px;
  padding: 0 12px; font-size: 0.85em; font-weight: 800; white-space: nowrap; margin-inline-start: 4px;
}
.scene-sound[hidden] { display: none; }
.scene-sound[aria-pressed="false"] .on, .scene-sound[aria-pressed="true"] .off { display: none; }
.scene-sound[aria-pressed="true"] { background: var(--honey-soft); border-color: var(--honey-ink); color: var(--honey-ink); }

.scene-stage { padding-top: 26px; }
.scene-piano {
  position: relative; width: min(calc(100% - 32px), 980px); margin: 26px auto 10px;
  border-radius: 22px 22px 10px 10px; padding: clamp(10px, 2vw, 20px) 0 clamp(10px, 1.6vw, 16px);
  background: var(--wood) url("img/oak.webp") center / cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 0 -2px var(--ledge), 0 28px 44px -24px rgba(43, 29, 16, 0.75);
}
/* The music desk: a darker board with a lip the phone stands on. */
.scene-rest {
  position: relative; z-index: 1; margin-inline: clamp(8px, 7% - 12px, 80px);
  padding: clamp(10px, 2.4vw, 24px) clamp(6px, 5% - 8px, 48px) 0;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(rgba(43, 29, 16, 0.24), rgba(43, 29, 16, 0.07));
  box-shadow: inset 0 3px 8px rgba(43, 29, 16, 0.35), inset 0 -1px 0 rgba(255, 255, 255, 0.25);
}
.scene-slot { position: relative; z-index: 2; display: flex; justify-content: center; }
.scene-ledge {
  position: relative; z-index: 1; height: clamp(8px, 1.3vw, 13px); margin-inline: calc(-1 * clamp(6px, 5% - 8px, 48px));
  background: linear-gradient(#B58858, var(--ledge)); border-radius: 3px;
  box-shadow: 0 3px 0 rgba(43, 29, 16, 0.35), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.scene-shade {
  position: absolute; inset-inline: 12%; bottom: -4px; height: 18px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(43, 29, 16, 0.5), rgba(43, 29, 16, 0));
}
.scene-phone {
  position: relative; margin: 0; width: min(100%, 580px, calc((100vh - 360px) * 2.1)); min-width: min(100%, 260px);
  padding: clamp(5px, 0.8vw, 8px); border-radius: clamp(16px, 2.6vw, 28px); background: var(--frame);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 18px 30px -18px rgba(28, 27, 25, 0.7);
  transform-origin: 50% 100%; transform: perspective(1000px) rotateX(6deg);
}
.scene-screen { position: relative; overflow: hidden; border-radius: clamp(11px, 1.9vw, 21px); background: #FFFFFF; }
.scene-screen img { width: 100%; height: auto; aspect-ratio: 1100 / 508; }
/* Overlays in the screenshot's own coordinates (1702 x 786): the listening band over the notes, and
   the key it lights on the phone's keyboard (B3 to B5). */
.scene-band, .scene-pkey { position: absolute; opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.12s ease; }
.scene-band {
  left: 35.194%; top: 11.832%; width: 4.054%; height: 29.77%; border-radius: 3px;
  background: rgb(220, 231, 251); mix-blend-mode: multiply;
  transform: translateX(calc(var(--i, 0) * 173.913%));
}
.scene-screen--en .scene-band { left: 19.683%; }
.scene-pkey {
  left: 1.293%; top: 57.76%; width: 6.228%; height: 39.95%; border-radius: 0 0 4px 4px;
  background: rgb(190, 210, 248); mix-blend-mode: multiply;
  transform: translateX(calc(var(--k, 0) * 104.27%)); transition: opacity 0.1s ease;
}
.scene-pkey--black { left: 75.79%; width: 3.76%; height: 25.19%; background: #2C4F90; mix-blend-mode: normal; transform: none; }
.scene-band.is-on, .scene-pkey.is-on { opacity: 1; }

.scene-fall {
  margin-top: clamp(10px, 2vw, 18px); height: clamp(18px, 2.8vw, 28px);
  background: linear-gradient(#4A311B, #2E1E10); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
.scene-fall span { font-size: clamp(9px, 1.3vw, 13px); font-weight: 800; line-height: 1; color: #D9B27E; opacity: 0.85; }
html[lang="en"] .scene-fall span { letter-spacing: 0.08em; }
.keys--scene { margin-inline: 0; height: clamp(92px, 13vw, 132px); border-top-width: 3px; z-index: 0; }
.keys--scene .key.white { padding: 0; border-radius: 0 0 5px 5px; transform-origin: 50% 0; transition: transform 0.08s ease; }
.keys--scene .key.black { transform-origin: 50% 0; transition: transform 0.08s ease; }
.keys--scene .key.white.is-play {
  background: linear-gradient(#B4CBF5, var(--key-active)); transform: scaleY(0.982);
  box-shadow: inset 0 4px 5px -2px rgba(22, 64, 140, 0.35);
}
.keys--scene .key.black.is-play { background: linear-gradient(#1A2B4D, #2C4F90); transform: scaleY(0.96); }

/* The scroll version: a tall track with a stage that stays in view while the phone comes up. */
.scene.is-scroll .scene-track { height: 270vh; }
.scene.is-scroll .scene-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; padding: 0;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 3.5vh, 36px);
}
.scene.is-scroll .scene-top { justify-items: center; text-align: center; gap: 12px; }
.scene.is-scroll .scene-steps { display: grid; width: 100%; max-width: 40rem; }
.scene.is-scroll .scene-steps li {
  grid-area: 1 / 1; justify-content: center; align-items: center; flex-direction: column; gap: 6px;
  font-size: clamp(1.15rem, 0.95rem + 1.1vw, 1.65rem); font-weight: 800; line-height: 1.55;
}
html[lang="en"] .scene.is-scroll .scene-steps li { line-height: 1.3; letter-spacing: -0.01em; }
.scene.is-scroll .scene-n { transform: none; }
.scene.is-scroll .scene-piano { margin-block: 0; }
.scene.is-scroll .scene-phone { will-change: transform; }

/* Driven from site.js where the browser can't do it alone. */
.scene.is-scroll:not(.is-sda) .scene-phone {
  transform: translate3d(0, calc(var(--ty, 0) * 72vh), 0) perspective(1000px) rotateX(calc(6deg + var(--tilt, 0) * 66deg)) scale(calc(1 - var(--ty, 0) * 0.14));
}
.scene.is-scroll:not(.is-sda) .scene-shade { opacity: var(--shade, 1); }
.scene.is-scroll:not(.is-sda) .scene-steps li:nth-child(1) { opacity: var(--c1, 1); }
.scene.is-scroll:not(.is-sda) .scene-steps li:nth-child(2) { opacity: var(--c2, 0); }
.scene.is-scroll:not(.is-sda) .scene-steps li:nth-child(3) { opacity: var(--c3, 0); }

@supports (animation-timeline: view()) {
  .scene.is-sda .scene-track { view-timeline: --scene block; }
  .scene.is-sda .scene-phone { animation: scene-phone linear both; animation-timeline: --scene; animation-range: contain 0% contain 50%; }
  .scene.is-sda .scene-shade { animation: scene-shade linear both; animation-timeline: --scene; animation-range: contain 36% contain 50%; }
  .scene.is-sda .scene-steps li:nth-child(1) { animation: scene-out linear both; animation-timeline: --scene; animation-range: contain 0% contain 32%; }
  .scene.is-sda .scene-steps li:nth-child(2) { animation: scene-mid linear both; animation-timeline: --scene; animation-range: contain 32% contain 70%; }
  .scene.is-sda .scene-steps li:nth-child(3) { animation: scene-in linear both; animation-timeline: --scene; animation-range: contain 70% contain 77%; }
}
@keyframes scene-phone {
  0% { transform: translate3d(0, 72vh, 0) perspective(1000px) rotateX(72deg) scale(0.86); animation-timing-function: cubic-bezier(0.25, 0.6, 0.4, 1); }
  62% { transform: translate3d(0, 9vh, 0) perspective(1000px) rotateX(54deg) scale(0.97); animation-timing-function: cubic-bezier(0.3, 0, 0.3, 1); }
  100% { transform: translate3d(0, 0, 0) perspective(1000px) rotateX(6deg) scale(1); }
}
@keyframes scene-shade { from { opacity: 0; } }
@keyframes scene-out { 0%, 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes scene-mid {
  0% { opacity: 0; transform: translateY(12px); }
  14%, 86% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}
@keyframes scene-in { 0% { opacity: 0; transform: translateY(12px); } 100% { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .keys--scene .key.is-play { transform: none; }
}

/* Gallery page (site/gallery.html, gallery-en.html; server/make_gallery.py). */
.nav .gallery-link { display: inline-block; }
.gallery-head { padding-block: 28px 8px; }
.gallery-head h1 { margin: 0 0 8px; }
.gallery-group { padding-block: 18px; }
.gallery-group h2 { margin: 0 0 14px; font-size: 1.35rem; }
.gallery-group h2 small { color: var(--muted); font-size: 0.85rem; font-weight: 400; margin-inline-start: 6px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 14px; align-items: start; }
.g-wide { grid-column: span 2; }
.g-item { display: flex; flex-direction: column; gap: 6px; color: var(--body); text-decoration: none; }
.g-item img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.g-item span { font-size: 13px; line-height: 1.55; }
.g-item:hover img, .g-item:focus-visible img { border-color: var(--honey); }
.g-view { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 19, 17, 0.94); color: #fff; }
.g-view::backdrop { background: rgba(20, 19, 17, 0.94); }
.g-view figure { height: 100%; margin: 0; padding: 56px 64px 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.g-view img { max-width: 100%; max-height: calc(100vh - 130px); width: auto; height: auto; object-fit: contain; border-radius: 12px; }
.g-view figcaption { margin-top: 12px; text-align: center; font-size: 15px; max-width: 40rem; }
.g-count { color: #bbb; font-size: 13px; margin-inline-start: 8px; white-space: nowrap; }
.g-btn { position: fixed; border: 0; border-radius: 999px; width: 48px; height: 48px; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); color: #fff; font: 700 28px/1 var(--font); }
.g-btn:hover, .g-btn:focus-visible { background: rgba(255, 255, 255, 0.28); }
.g-close { top: 12px; inset-inline-end: 12px; }
.g-prev, .g-next { top: 50%; transform: translateY(-50%); }
.g-prev { inset-inline-start: 10px; }
.g-next { inset-inline-end: 10px; }
[dir="rtl"] .g-prev, [dir="rtl"] .g-next { transform: translateY(-50%) scaleX(-1); }
@media (max-width: 600px) { .g-view figure { padding: 56px 8px 12px; } .g-prev, .g-next { top: auto; bottom: 14px; transform: none; } [dir="rtl"] .g-prev, [dir="rtl"] .g-next { transform: scaleX(-1); } }
