@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500..700&family=Inter:wght@400..700&display=swap");

:root {
  --paper: #fdf9f3;
  --ink: #241a14;
  --muted: #62574f;
  --line: #eadcd0;
  --peach: #fff0e3;
  --accent: #a44320;
  --serif: Fraunces, Georgia, serif;
  --sans: Inter, "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.6 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
figure, fieldset, h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2 { font-family: var(--serif); font-weight: 590; line-height: 1.03; text-wrap: balance; }
p { color: var(--muted); }
section[id], #value, #practice, #dictionary { scroll-margin-top: 22px; }

.page { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.skip-link {
  position: absolute; z-index: 11; top: 10px; left: 12px; transform: translateY(-180%);
  background: var(--paper); padding: 8px 12px;
}
.skip-link:focus { transform: none; }
.topbar, .topbar-actions, .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.topbar { justify-content: space-between; padding-block: 14px 10px; }
.brand { display: grid; justify-items: center; width: 190px; text-decoration: none; }
.brand-logo { width: 170px; }
.brand-tagline { max-width: 155px; color: var(--muted); font-size: 12px; line-height: 1.35; text-align: center; text-wrap: balance; }
.nav { color: var(--muted); font-size: 13px; font-weight: 600; }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav .download-link { border: 1px solid var(--line); border-radius: 24px; padding: 6px 15px; color: var(--ink); }
.language-menu { position: relative; }
.language-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 24px;
  color: var(--ink); background: transparent; font-size: 13px; font-weight: 600; cursor: pointer;
}
.language-button svg { width: 16px; height: 16px; }
.language-options {
  position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; display: none;
  min-width: 155px; padding: 5px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); box-shadow: 0 14px 32px #55301b1a;
}
.language-menu.is-open .language-options { display: grid; }
.language-option {
  min-height: 36px; padding: 0 9px; border: 0; border-radius: 5px;
  color: var(--ink); background: transparent; font-size: 13px; text-align: start; cursor: pointer;
}
.language-option:hover, .language-option[aria-selected="true"] { background: var(--peach); }

.product-lockup { display: flex; align-items: center; width: fit-content; }
.product-lockup img { box-shadow: 0 12px 30px #8f481e26; }
.product-lockup strong { display: block; font: 640 26px/1.13 var(--serif); }
.product-lockup span, .section-label {
  display: block; color: var(--accent); font: 700 11px/1.4 var(--sans);
  text-transform: uppercase; letter-spacing: .12em;
}
.product-lockup span { margin-top: 5px; color: var(--muted); }
.store-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.store-links img { height: 39px; width: auto; }
.store-links a { border-radius: 6px; transition: transform .15s ease; }
.store-links a:hover { transform: translateY(-2px); }

.button, .text-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; line-height: 1.2; }
.button {
  min-height: 42px; padding: 9px 15px; border-radius: 24px;
  border: 1px solid #e5d7cb; background: var(--paper); color: var(--ink);
  cursor: pointer; text-decoration: none; font-size: 13px;
}
.button:hover { background: var(--peach); }
.text-link { width: fit-content; text-decoration-color: #d0694e; text-underline-offset: 4px; text-align: start; }
.text-link:hover { color: var(--accent); }
.play-mark { width: 0; height: 0; border-block: 5px solid transparent; border-inline-start: 7px solid currentColor; }

.feature, .lookup, .score-photos, .screen-pair, .media-card, .single-screen { display: grid; }
.feature.reverse .feature-body { order: 2; }
.feature.reverse > :last-child { order: 1; }
.feature-points { list-style: none; padding: 0; }
.feature-points li {
  display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: baseline; gap: 8px;
  color: var(--muted); font-size: 14px; line-height: 1.55;
}
.feature-points li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #c66638; }
.feature-points strong { color: var(--ink); font-weight: 650; }
.score-photos figure { display: flex; flex-direction: column; align-items: center; justify-content: end; min-width: 0; }
.score-photos img { object-fit: contain; }
.score-photos figcaption, .media-card figcaption, .single-screen figcaption {
  color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center;
}
.screen-pair { align-items: start; }
.media-card, .single-screen { justify-items: center; }

.ear-example { min-width: 0; border: 1px solid var(--line); border-radius: 18px; }
.ear-example h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin-block: 5px 14px; }
.ear-example fieldset { padding: 0; border: 0; min-width: 0; }
.ear-example legend { padding: 0; margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
  display: grid; grid-template-columns: minmax(0, 1fr) 39px; min-height: 39px;
  border: 1px solid #e7e1d6; border-radius: 8px; overflow: hidden;
}
.choice label { display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: pointer; font-size: 14px; font-weight: 620; }
.choice input { margin: 0; }
.choice button {
  display: grid; place-items: center; width: 39px; border: 0; border-inline-start: 1px solid #e7e1d6;
  background: transparent; cursor: pointer;
}
.choice button:focus-visible { outline-offset: -4px; }
.ear-feedback { margin-top: 8px; font-size: 13px; font-weight: 580; }

.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.cta h2 { font-size: clamp(27px, 3.5vw, 44px); }
.cta p { margin-top: 8px; font-size: 15px; }
footer { display: flex; flex-wrap: wrap; gap: 10px 23px; justify-content: space-between; padding-block: 16px 25px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
footer div { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.feature-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding-block: 18px 26px;
}
.feature-hero .hero-copy {
  justify-self: center;
  width: min(100%, 44rem);
  text-align: center;
}
.feature-hero .product-lockup {
  gap: 12px;
  margin: 0 auto 10px;
  text-align: start;
}
.feature-hero .product-lockup img { width: 64px; height: 64px; border-radius: 16px; }
.feature-hero .product-lockup strong { font-size: clamp(23px, 2.05vw, 28px); white-space: nowrap; }
.feature-hero .product-lockup span { font-size: 10px; }
.feature-hero h1 {
  margin-bottom: 8px;
  font-size: clamp(38px, 3.65vw, 50px);
}
.feature-hero .lede {
  max-width: none;
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.5;
  text-wrap: balance;
}
.feature-hero .hero-copy > .store-links { justify-content: center; margin-top: 10px; }
.feature-hero .store-links img { height: 36px; }

.hero-gallery {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr);
  align-items: center;
  gap: clamp(12px, 1.65vw, 22px);
  width: min(100%, 1016px);
  margin-inline: auto;
}
.gallery-instruction {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.gallery-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
}
.gallery-picker button {
  position: relative;
  display: grid;
  grid-template-columns: clamp(68px, 7.35vw, 94px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 66px;
  padding: 2px 10px 2px 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid #d9c6b5;
  border-radius: 8px;
  font: 670 17px/1.2 var(--sans);
  text-align: start;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.gallery-picker button:hover {
  border-color: #a96945;
  background: #fcf0e5;
}
.gallery-picker button[aria-pressed="true"] {
  border-color: #a45a32;
  background: #faeadd;
  box-shadow: inset 0 0 0 1px #a45a32;
}
.gallery-picker button:focus-visible { z-index: 1; outline-offset: 2px; }
.gallery-drawing {
  display: block;
  width: 100%;
  height: 60px;
  object-fit: contain;
}
.picker-caption { display: block; overflow-wrap: anywhere; }
.picker-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.25;
}
.picker-mark {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #864928;
  background: #f5e7d9;
  border-radius: 50%;
}
.picker-mark::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: -2px;
  border-inline-end: 1.5px solid;
  border-block-end: 1.5px solid;
  transform: rotate(-45deg);
}
[aria-pressed="true"] .picker-mark { color: #fff; background: #994727; }
[aria-pressed="true"] .picker-mark::before {
  width: 9px;
  height: 5px;
  margin: -2px 0 0;
  border-inline: 1.5px solid transparent;
  border-inline-start-color: currentColor;
}

.gallery-stage {
  --screen-height: clamp(320px, 28.75vw, 390px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.5vw, 20px);
  min-height: var(--screen-height);
  padding-inline-start: clamp(12px, 1.65vw, 22px);
  border-inline-start: 1px solid var(--line);
}
.gallery-stage[hidden] { display: none; }
.gallery-stage figcaption {
  flex: 0 1 280px;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 8px;
  overflow-wrap: anywhere;
}
.gallery-stage h2 {
  font-size: clamp(25px, 2.55vw, 34px);
  font-weight: 620;
  line-height: 1.1;
  text-wrap: initial;
}
.gallery-stage figcaption p { font-size: 15px; line-height: 1.45; }
.gallery-stage .text-link { max-width: 100%; font-size: 14px; }
.gallery-stage .hero-photo {
  flex: none;
  width: auto;
  height: auto;
  max-width: 56%;
  max-height: var(--screen-height);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.feature,
.lookup,
.cta {
  padding-block: clamp(21px, 2.15vw, 29px);
  border-top: 1px solid var(--line);
}
.feature,
.lookup {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(20px, 3.4vw, 44px);
}
.feature.reverse { grid-template-columns: minmax(0, .66fr) minmax(0, 1.34fr); }
.feature-body { max-width: 580px; }
.feature h2,
.lookup h2 {
  margin-block: 6px 11px;
  font-size: clamp(30px, 3.45vw, 48px);
}
.feature-points { margin: 12px 0 0; }
.feature-points li { margin-top: 6px; }
.score-photos {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr);
  align-items: end;
  gap: clamp(12px, 1.9vw, 24px);
  width: min(100%, 560px);
  justify-self: center;
}
.score-photos figure,
.single-screen,
.media-card {
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.score-photos img {
  width: auto;
  height: auto;
  max-height: clamp(142px, 16.5vw, 210px);
}
.single-screen { min-height: 0; justify-self: end; margin-inline-end: 14px; }
.feature-proof {
  grid-template-columns: repeat(2, minmax(0, 218px));
  justify-content: center;
  gap: clamp(12px, 1.8vw, 24px);
}
.feature-proof img,
.single-screen img,
.ear-training-detail .media-card img {
  width: auto;
  max-width: 100%;
  max-height: 355px;
  aspect-ratio: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.illustrated-screen {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-block-start: 47px;
}
.illustrated-screen > .section-drawing {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 4%;
  z-index: 1;
  display: block;
  width: clamp(62px, 65%, 106px);
  max-width: 100%;
  height: auto;
  transform: translateY(-88%);
  pointer-events: none;
}

.ear-training-detail {
  display: grid;
  grid-template-columns: minmax(225px, 1.2fr) minmax(0, .8fr);
  align-items: center;
  gap: 13px;
}
.ear-example {
  padding: 14px;
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
}
.ear-example h3 { font-size: clamp(24px, 2.35vw, 32px); }
.ear-example .section-label, .ear-feedback, .choice button { color: var(--accent); }
.ear-example .prompt { border-color: #e3bd9e; background: var(--peach); }
.ear-example .prompt:hover, .choice button:hover { background: #fbe4d2; }
.ear-example fieldset { margin-block: 12px; }
.choices { gap: 6px; }
.choice { background: transparent; }
.choice:has(input:checked) { background: var(--peach); border-color: #ba7f58; }
.choice input { accent-color: var(--accent); }

.cta {
  padding-inline: 0;
  margin-bottom: 0;
  background: transparent;
  border-inline: 0;
  border-bottom: 0;
  border-radius: 0;
}

@media (max-width: 940px) {
  #ear-training { grid-template-columns: minmax(0, 1fr); }
  .ear-training-detail { grid-template-columns: minmax(225px, 330px) minmax(0, 245px); }
  .ear-training-detail .media-card img { max-height: 285px; }
}
@media (max-width: 700px) {
  .page { width: calc(100% - 32px); }
  .topbar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding-block: 11px 7px; }
  .topbar .brand { width: fit-content; }
  .brand-logo { width: 122px; }
  .brand-tagline { display: none; }
  .nav { gap: 5px 11px; font-size: 12px; line-height: 1.4; }
  .nav .download-link { position: absolute; inset-block-start: 14px; inset-inline-end: 43px; padding: 4px 10px; }
  .language-menu { position: absolute; inset-block-start: 11px; inset-inline-end: 0; }
  .language-button { width: 34px; min-height: 34px; padding: 0; }
  .language-button span { display: none; }
  .feature-hero { gap: 16px; padding-block: 14px 23px; }
  .feature-hero .product-lockup img { width: 53px; height: 53px; border-radius: 13px; }
  .feature-hero h1 { font-size: clamp(30px, 8vw, 42px); margin-bottom: 7px; }
  .feature-hero .store-links img { height: 32px; }
  .hero-gallery { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .gallery-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-picker button {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 62px;
    padding: 6px 8px;
    font-size: 15px;
  }
  .gallery-picker [data-screen="search"] { grid-column: 1 / -1; grid-template-columns: 72px minmax(0, 1fr) auto; }
  .gallery-drawing { height: 43px; }
  .picker-note { font-size: 13px; }
  .picker-mark { width: 16px; height: 16px; }
  .gallery-stage {
    --screen-height: clamp(244px, 68vw, 315px);
    min-height: calc(var(--screen-height) + 12px);
    justify-content: center;
    padding: 11px 0 0;
    border-inline-start: 0;
    border-top: 1px solid var(--line);
  }
  .gallery-stage figcaption { flex-basis: 228px; gap: 6px; }
  .gallery-stage figcaption p { font-size: 14px; }
  .gallery-stage .text-link { font-size: 13px; }
  .feature, .feature.reverse, .lookup { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .feature.reverse .feature-body, .feature.reverse > :last-child { order: 0; }
  .single-screen { justify-self: center; margin-inline-end: 0; }
  .illustrated-screen { margin-block-start: 44px; }
  .illustrated-screen > .section-drawing { width: clamp(58px, 65%, 93px); }
  .feature-proof img, .single-screen img { max-height: 328px; }
}
@media (max-width: 560px) {
  .ear-training-detail { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .ear-training-detail .media-card img { max-height: 260px; }
}
@media (max-width: 480px) {
  .gallery-picker button:not([data-screen="search"]) {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "title title mark" "art note note";
    align-content: start;
    gap: 3px 5px;
  }
  .gallery-picker button:not([data-screen="search"]) .gallery-drawing { grid-area: art; height: 36px; }
  .gallery-picker button:not([data-screen="search"]) .picker-caption { display: contents; }
  .gallery-picker button:not([data-screen="search"]) .picker-caption > :first-child { grid-area: title; }
  .gallery-picker button:not([data-screen="search"]) .picker-note { grid-area: note; margin-top: 0; }
  .gallery-picker button:not([data-screen="search"]) .picker-mark { grid-area: mark; }
}
@media (max-width: 355px) {
  .gallery-picker button { font-size: 14px; }
  .picker-note { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
