/* PianoBuddy - shared styles. Mobile first, no frameworks. */

:root {
  --navy: #2E3A59;
  --navy-hover: #3B4A70;
  --sky: #CFE6F7;
  --blue: #8EBFE3;
  --tuft: #6E9BDB;
  --yellow: #F5D978;
  --beak: #EFA95A;
  --maker: #2F6DB8;
  --cream: #FBF7EF;
  --white: #FFFFFF;

  --ink: var(--navy);
  --muted: #56617B;
  --line: #E6DFD0;
  --key-line: #C9D3E2;

  --gutter: 1rem;
  --wrap: 70rem;
  --measure: 42rem;
  --radius: 1.25rem;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.6rem + 3.2vw, 3.75rem); font-weight: 900; line-height: 1.05; }
h2 { font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25rem; }
li { margin-bottom: 0.35em; }
strong { font-weight: 800; }

a {
  color: inherit;
  text-decoration-color: var(--tuft);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 3px solid var(--tuft);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Header ---------- */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand { display: inline-flex; flex-shrink: 0; }
.brand img { width: 8.75rem; height: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 800;
  font-size: 1rem;
}
.nav li { margin: 0; }
.nav a { text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--tuft); }
.nav .lang {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border: 2px solid var(--blue);
  border-radius: 999px;
}
.nav .lang:hover { border-color: var(--navy); text-decoration: none; }

/* ---------- Buttons ---------- */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0.75rem;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  min-width: 16.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 0.9rem;
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: 0 3px 0 #1E2740;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.store-btn:hover { background: var(--navy-hover); }
.store-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #1E2740; }
.store-btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.store-btn.ghost:hover { background: var(--sky); }
.store-btn.ghost:active { transform: none; }

.fine { font-size: 0.9375rem; color: var(--muted); margin: 0; }

/* ---------- Landing: hero ---------- */

.hero { padding: 1.5rem 0 2.5rem; }
.hero .wrap { display: grid; gap: 1.5rem; align-items: center; }

.hero-icon {
  width: 6rem;
  border-radius: 22.5%;
  box-shadow: 0 14px 30px -16px rgba(46, 58, 89, 0.55);
  transform: rotate(-4deg);
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 34rem;
  margin-bottom: 0;
}

/* ---------- Landing: the playable keyboard ---------- */

.piano {
  --wk: calc(100% / 15);           /* 15 white keys, C4 to C6 */
  background: var(--navy);
  color: var(--cream);
  padding-bottom: 0.9rem;
  border-bottom: 2px solid rgba(142, 191, 227, 0.3);
}
.piano-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
.piano-hint {
  margin: 0;
  font-weight: 800;
  color: var(--white);
}
.piano-hint::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.55em;
  border-radius: 50%;
  background: var(--yellow);
  vertical-align: 0.1em;
}
.piano-play {
  appearance: none;
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1.2;
  padding: 0.4rem 1rem 0.4rem 0.85rem;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.piano-play::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 0.55em;
  border-style: solid;
  border-width: 0.38em 0 0.38em 0.6em;
  border-color: transparent transparent transparent var(--yellow);
  vertical-align: -0.05em;
}
.piano-play.is-playing::before {
  width: 0.65em;
  height: 0.65em;
  border: 0;
  border-radius: 2px;
  background: var(--yellow);
}
.piano-play:hover { background: var(--navy-hover); border-color: var(--white); }
.piano-play:focus-visible { outline-color: var(--yellow); }

.piano-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--blue) transparent;
  -webkit-overflow-scrolling: touch;
}
.piano-keys {
  position: relative;
  display: flex;
  height: 8.5rem;
  min-width: 42rem;                /* about 45px per white key: one octave fits a phone, scroll for the rest */
  max-width: calc(var(--wrap) - 2 * var(--gutter));
  margin-inline: auto;
  background: var(--navy);
  touch-action: pan-y;             /* vertical swipes still scroll the page; sideways is a glissando */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.key {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  -webkit-touch-callout: none;
}
.key.white {
  flex: 1 1 0;
  height: 100%;
  background: var(--white);
  border-right: 1px solid var(--key-line);
  border-radius: 0 0 5px 5px;
  box-shadow: inset 0 -5px 0 rgba(46, 58, 89, 0.08);
}
.key.white:last-child { border-right: 0; }
.key.black {
  position: absolute;
  top: 0;
  z-index: 2;
  width: calc(var(--wk) * 0.62);
  height: 60%;
  transform: translateX(-50%);
  background: var(--navy);
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 -5px 0 #1E2740, 0 3px 4px rgba(0, 0, 0, 0.25);
}
.key:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; border-radius: 0 0 5px 5px; }

/* lit keys: yellow for the white keys, the warmer orange for the black ones */
.key.white.is-pressed {
  background: var(--yellow);
  box-shadow: inset 0 -2px 0 rgba(46, 58, 89, 0.15);
}
.key.black.is-pressed {
  background: var(--beak);
  box-shadow: inset 0 -2px 0 #C47B32, 0 1px 2px rgba(0, 0, 0, 0.25);
}
@media (hover: hover) {
  .key.white:hover:not(.is-pressed) { background: #FFFDF7; }
  .key.black:hover:not(.is-pressed) { background: var(--navy-hover); }
}

.piano-keys-hint {
  display: none;
  margin: 0.7rem auto 0;
  max-width: var(--wrap);
  padding-inline: var(--gutter);
  font-size: 0.875rem;
  color: var(--blue);
}

/* ---------- Landing: navy band ---------- */

.band {
  background: var(--navy);
  color: var(--cream);
  padding: 3rem 0 3.5rem;
}
.band h2 { color: var(--white); }
.band a { text-decoration-color: var(--blue); }
.band .wrap { display: grid; gap: 2.25rem; }
.band-intro { font-size: 1.125rem; max-width: 36rem; }

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1.5rem 0 1.5rem;
  display: grid;
  gap: 0.9rem;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.85rem;
  align-items: start;
  margin: 0;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--blue);
  color: var(--navy);
  font-weight: 900;
}
.steps strong { color: var(--white); }

.private {
  align-self: start;
  border: 2px solid rgba(142, 191, 227, 0.45);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 0.4rem;
}
.private h3 { color: var(--white); }
.private ul { padding-left: 1.1rem; }
.private li::marker { color: var(--yellow); }

/* ---------- Landing: modes ---------- */

.section { padding: 3.5rem 0; }
.section.section-flush { padding-top: 0; }
.section-intro { max-width: 36rem; color: var(--muted); font-size: 1.125rem; }

.modes {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 2rem;
}
.modes li { margin: 0; }
.modes h3 { margin: 0.9rem 0 0.35rem; }
.modes p { margin: 0; color: var(--muted); }

.mode-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
}
.mode-icon svg { width: 1.75rem; height: 1.75rem; }
.mode-icon.learn { background: var(--sky); }
.mode-icon.together { background: var(--yellow); }
.mode-icon.perform { background: #F8D7AE; }

/* ---------- Landing: journey ---------- */

.journey {
  background: var(--sky);
  border-radius: 1.75rem;
  padding: 2rem 1.4rem;
  display: grid;
  gap: 1.75rem;
}
.journey p { max-width: 36rem; }
.journey p:last-child { margin-bottom: 0; }

.perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.perks li {
  margin: 0;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
}
.perks svg { width: 2.5rem; height: 2.5rem; }
.perks strong { display: block; }

/* ---------- Landing: closing call ---------- */

.closing { padding: 1rem 0 4rem; }
.closing .wrap { display: grid; justify-items: start; }
.closing img { width: 4.5rem; border-radius: 22.5%; margin-bottom: 1.25rem; }
.closing h2 { margin-bottom: 0.35em; }
.closing p { max-width: 40rem; }
.closing .store-buttons { margin: 0.5rem 0 1rem; }

/* ---------- Documents (privacy, terms, support) ---------- */

.doc { padding: 1.5rem 0 4rem; }
.doc .wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.doc h1 { font-size: clamp(2rem, 1.6rem + 2vw, 2.875rem); }
.doc h2 {
  font-size: 1.375rem;
  margin-top: 2.25em;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
  scroll-margin-top: 1rem;
}
.doc h3 { font-size: 1.0625rem; margin: 1.5em 0 0.35em; }
.doc li { margin-bottom: 0.5em; }

.meta { color: var(--muted); font-size: 0.9375rem; }

.summary {
  background: var(--sky);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 1.5rem 0;
}
.summary h2 {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
  font-size: 1.1875rem;
}
.summary ul { padding-left: 1.1rem; }

.toc {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.25rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
.toc p { font-weight: 800; margin-bottom: 0.4rem; }
.toc ol { margin: 0; padding-left: 1.4rem; columns: 1; }
.toc li { margin-bottom: 0.25em; }

.facts {
  margin: 1rem 0 1.25rem;
  display: grid;
  gap: 0.15rem 1rem;
}
.facts dt { font-weight: 800; }
.facts dd { margin: 0 0 0.7rem; }
.facts dd:last-of-type { margin-bottom: 0; }

.legal-basis {
  font-size: 0.9375rem;
  color: var(--muted);
  border-left: 4px solid var(--blue);
  padding-left: 0.85rem;
}

.contact-card {
  margin-top: 2.5rem;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem 0.4rem;
}
.contact-card h2 { margin-top: 0; padding-top: 0; border: 0; }
.mail { font-weight: 800; font-size: 1.125rem; overflow-wrap: anywhere; }

/* FAQ */
.faq { margin-top: 1.5rem; border-top: 2px solid var(--line); }
.faq details { border-bottom: 2px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 0;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.3rem;
  border-right: 3px solid var(--tuft);
  border-bottom: 3px solid var(--tuft);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(15%) rotate(-135deg); }
.faq .answer { padding: 0 0 1rem; }
.faq .answer > :last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */

.lost { padding: 3rem 0 5rem; }
.lost .wrap { display: grid; justify-items: start; max-width: calc(var(--measure) + 2 * var(--gutter)); }
.lost img { width: 7rem; border-radius: 22.5%; transform: rotate(6deg); margin-bottom: 1.5rem; }
.lost p { margin-bottom: 0.6rem; }
.lost .links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 2px solid var(--line);
  padding: 2rem 0 2.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}
.site-footer .wrap { display: grid; gap: 1rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); }
.site-footer .maker { color: var(--maker); font-weight: 800; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 700;
}
.footer-links li { margin: 0; }

/* ---------- Larger screens ---------- */

@media (min-width: 40rem) {
  :root { --gutter: 1.5rem; }
  .facts { grid-template-columns: 11rem 1fr; }
  .facts dd { margin-bottom: 0.5rem; }
  .toc ol { columns: 2; column-gap: 2rem; }
  .journey { padding: 2.5rem; }
}

@media (min-width: 48rem) {
  .hero { padding: 2.5rem 0 4rem; }
  .hero .wrap { grid-template-columns: 1.35fr 0.65fr; gap: 3rem; }
  .hero-text { order: 1; }
  .hero-art { order: 2; justify-self: center; }
  .hero-icon { width: 15rem; border-radius: 22.5%; box-shadow: 0 30px 50px -28px rgba(46, 58, 89, 0.6); }
  .piano-keys { height: 10.5rem; }
  .piano-keys-hint { display: block; }
  .band { padding: 4rem 0 4.5rem; }
  .band .wrap { grid-template-columns: 1.3fr 0.7fr; gap: 3.5rem; }
  .private { margin-top: 3.4rem; }
  .section { padding: 5rem 0; }
  .modes { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
  .journey { grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 3rem; padding: 3.25rem; }
  .closing { padding-bottom: 5.5rem; }
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .store-btn, .faq summary::after, .piano-play { transition: none; }
}
