/* maestra.sh homepage — shared by / (site-study.html, English) and /es (site-study.es.html, Mexican Spanish).
   The app's visual language (docs/interface-study/ereader.html): soft purple on paper, Figtree for the interface,
   Literata for reading and headings, rules and whitespace rather than boxes. Dark follows the app's dark theme
   (packages/web/src/device.html → html.maestra-dark). iPhone first: 390 px is the design width. */
:root {
  --paper: #f7f3fa; --surface: #fdfbff; --ink: #3e304b; --plum: #4e315f; --dim: #6c5d77;
  --purple: #75528f; --purple-hover: #624279; --on-purple: #fff; --rule: #e0d5e8; --hover: #eee6f4;
  --blue: #4a6890; --gold: #86621f; --berry: #a42877; --green: #1f6645; --mint: #dcf1e3;
  --shadow: 0 1px 2px rgb(62 48 75 / 6%), 0 12px 40px -12px rgb(62 48 75 / 18%);
  --serif: Literata, Georgia, 'Times New Roman', serif;
  --sans: Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --measure: 1120px; --gutter: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000; --surface: #0e0d10; --ink: #e6e6e6; --plum: #f3f3f3; --dim: #a3a3a3;
    --purple: #d77ce0; --purple-hover: #e59bec; --on-purple: #000; --rule: #2b2a2e; --hover: #1a191c;
    --blue: #93b6de; --gold: #d8ad5c; --berry: #f494cf; --green: #93dcab; --mint: #0f271a;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--purple); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--purple-hover); }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { color: var(--plum); font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
[lang^="es"] em, em { font-style: italic; }
.wrap {
  width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right));
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--purple); color: var(--on-purple); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 10px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.bar { height: 60px; display: flex; align-items: center; gap: 4px; }
.brand { display: inline-flex; align-items: center; gap: 9px; margin-right: auto; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand span { font: 500 24px/1 var(--serif); letter-spacing: -1px; }
.brand:hover { color: var(--ink); }
.nav { display: none; gap: 4px; margin-right: 8px; }
.nav a, .signin { color: var(--dim); text-decoration: none; font-size: 15px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 10px; white-space: nowrap; }
.nav a:hover, .signin:hover { color: var(--ink); background: var(--hover); }
.lang { display: inline-flex; align-items: center; margin: 0 2px; }
.lang a {
  min-width: 34px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--dim); text-decoration: none; border-radius: 8px;
}
.lang a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--purple); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.lang a:not([aria-current]):hover { color: var(--ink); background: var(--hover); }
.lang .sep { width: 1px; height: 14px; background: var(--rule); }
@media (max-width: 373px) { .signin { display: none; } }
@media (min-width: 900px) { .nav { display: inline-flex; } .bar { height: 68px; gap: 10px; } }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; font: 600 15px/1 var(--sans); text-decoration: none; white-space: nowrap;
  background: var(--purple); color: var(--on-purple); border: 0; cursor: pointer;
  transition: background-color .12s ease, transform .12s ease;
}
.btn:hover { background: var(--purple-hover); color: var(--on-purple); }
.btn:active { transform: scale(.98); }
.btn.big { min-height: 54px; padding: 0 28px; font-size: 17px; border-radius: 14px; }
.btn svg { width: 18px; height: 18px; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { padding-top: 36px; padding-bottom: 56px; display: grid; gap: 40px; }
.kicker { font: 600 12px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--purple); margin-bottom: 14px; }
h1 { font-size: clamp(40px, 10.6vw, 70px); line-height: 1.04; letter-spacing: -.025em; }
h1 em { color: var(--purple); }
.lede { font-size: 19px; line-height: 1.55; margin-top: 20px; max-width: 34em; }
.lede strong { color: var(--plum); font-weight: 600; }
.cta { margin-top: 28px; display: grid; gap: 14px; justify-items: start; }
.cta .btn.big { width: 100%; }
.cta-note { font-size: 14px; color: var(--dim); }
.cta-alt { font-size: 15px; }
@media (min-width: 560px) { .cta .btn.big { width: auto; } }
@media (min-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); align-items: center; gap: 72px; padding-top: 88px; padding-bottom: 96px; }
  .lede { font-size: 20px; }
}

/* ── the drill, as the app draws it ─────────────────────────────────────── */
.drill { margin: 0; }
.screen { background: var(--surface); border: 1px solid var(--rule); border-radius: 22px; box-shadow: var(--shadow); padding: 6px 20px 8px; }
.screen-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 16px 0 14px; border-bottom: 1px solid var(--rule); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.screen-head b { display: block; margin-top: 3px; font: 500 16px/1.3 var(--serif); letter-spacing: 0; text-transform: none; color: var(--plum); }
.screen-head > span:last-child { white-space: nowrap; }
.beat { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 12px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.beat:last-child { border-bottom: 0; }
.n { font: 500 15px/26px var(--serif); color: var(--purple); text-align: center; border-radius: 50%; width: 26px; height: 26px; background: var(--hover); }
.step { font-size: 13px; font-weight: 600; color: var(--dim); line-height: 26px; }
.step i { font-style: italic; font-weight: 400; color: var(--blue); }
.beat-body { grid-column: 2; margin-top: 6px; }
.say { display: flex; align-items: center; gap: 12px; }
.say + .say { margin-top: 12px; }
.es { font: 500 23px/1.35 var(--serif); color: var(--plum); letter-spacing: -.01em; }
.gloss { font-size: 14px; color: var(--dim); margin-top: 2px; }
.heard { font: 400 21px/1.4 var(--serif); color: var(--ink); }
.heard .quote { color: var(--dim); }
.miss { background: none; color: inherit; text-decoration: underline wavy var(--berry); text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.fix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.score { display: inline-flex; align-items: baseline; gap: 6px; border-radius: 999px; background: var(--mint); color: var(--green); font-size: 13px; font-weight: 700; padding: 5px 11px; }
.score small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.why { font-size: 15px; color: var(--ink); }
.why code { font: 600 15px var(--sans); color: var(--berry); }
.why code.ok { color: var(--green); }
.right { font: 500 21px/1.4 var(--serif); color: var(--green); margin-top: 8px; }
.note { font-size: 14px; color: var(--gold); margin-top: 4px; }
.others { font-size: 14px; color: var(--dim); margin-top: 8px; }
.others span[lang] { font-family: var(--serif); color: var(--ink); }
.grade { font-size: 15px; }
.grade b { font-weight: 600; color: var(--plum); }
.grade .dim { color: var(--dim); display: block; margin-top: 2px; font-size: 14px; }
.play {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--purple); background: transparent;
  color: var(--purple); display: inline-grid; place-items: center; cursor: pointer; padding: 0;
  transition: background-color .12s ease, color .12s ease;
}
.play:hover { background: var(--hover); }
.play svg { width: 16px; height: 16px; }
.play .i-stop { display: none; }
.play[aria-pressed="true"] { background: var(--purple); color: var(--on-purple); }
.play[aria-pressed="true"] .i-play { display: none; }
.play[aria-pressed="true"] .i-stop { display: block; }
.play:disabled { opacity: .4; cursor: default; }
.drill figcaption { font-size: 14px; color: var(--dim); margin-top: 14px; padding: 0 4px; }
@media (min-width: 560px) { .screen { padding: 8px 28px 10px; } .es { font-size: 25px; } }

/* ── sections ───────────────────────────────────────────────────────────── */
section { padding: 64px 0; border-top: 1px solid var(--rule); }
@media (min-width: 900px) { section { padding: 104px 0; } }
.head { max-width: 40em; margin-bottom: 36px; }
h2 { font-size: clamp(30px, 7.4vw, 44px); line-height: 1.12; letter-spacing: -.02em; }
.head > p:not(.kicker) { margin-top: 16px; font-size: 18px; color: var(--ink); }
h3 { font: 500 21px/1.3 var(--serif); letter-spacing: -.01em; }
.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.list > li { padding: 20px 0; border-top: 1px solid var(--rule); }
.list > li p { margin-top: 6px; color: var(--ink); font-size: 16px; }
.list > li p.dim, .dim { color: var(--dim); }
@media (min-width: 760px) {
  .list.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
  .list.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
}

/* a lesson, part by part */
.parts { counter-reset: part; }
.parts > li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; }
.parts > li::before { counter-increment: part; content: counter(part); grid-row: 1 / span 2; font: 400 30px/1 var(--serif); color: var(--purple); }
.parts > li > * { grid-column: 2; }
.parts > li > h3 { grid-row: 1; }
.review { margin-top: 28px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 12px; padding: 20px 0 0; border-top: 1px solid var(--rule); }
.review svg { width: 30px; height: 30px; color: var(--purple); }
.review p { margin-top: 6px; font-size: 16px; max-width: 40em; }

/* the stance */
.stance { display: grid; gap: 32px; }
.stance .head { margin-bottom: 0; }
.stance blockquote { margin: 26px 0 0; font: 400 italic 22px/1.45 var(--serif); color: var(--purple); max-width: 26em; }
@media (min-width: 980px) { .stance { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 72px; align-items: start; } }

/* where to use it */
.where > li h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.where > li h3 svg { width: 22px; height: 22px; color: var(--purple); flex: none; }
.soon { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 9px; white-space: nowrap; }
.cmd { margin-top: 14px; display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); overflow: hidden; }
.cmd code { flex: 1; min-width: 0; padding: 12px 14px; font: 13px/20px var(--mono); color: var(--ink); }
.copy { flex: none; min-width: 72px; min-height: 44px; border: 0; border-top: 1px solid var(--rule); background: transparent; color: var(--purple); font: 600 14px var(--sans); cursor: pointer; padding: 0 12px; }
.copy:hover { background: var(--hover); }
.fine { font-size: 14px; color: var(--dim); margin-top: 10px; }
.go { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 16px; }

/* questions */
.faq { max-width: 46em; border-bottom: 1px solid var(--rule); }
.faq details { border-top: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; min-height: 60px; padding: 16px 40px 16px 0; position: relative;
  font: 500 19px/1.35 var(--serif); color: var(--plum);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--purple); border-bottom: 2px solid var(--purple); transform: rotate(45deg);
  transition: transform .15s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details > div { padding: 0 0 20px; font-size: 16px; }
.faq details > div p + p { margin-top: 10px; }
.contact { margin-top: 24px; font-size: 15px; color: var(--dim); }

/* the last word */
.end { text-align: center; padding-top: 88px; padding-bottom: 96px; border-top: 1px solid var(--rule); }
.end h2 { font-size: clamp(36px, 9vw, 60px); }
.end h2 em { color: var(--purple); }
.end p { margin: 16px auto 0; max-width: 30em; font-size: 18px; text-wrap: balance; }
.end .btn { margin-top: 28px; }
.end .cta-note { margin-top: 14px; font-size: 14px; }

footer { border-top: 1px solid var(--rule); padding: 28px 0 calc(36px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--dim); }
.foot { display: grid; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 4px; margin-left: -10px; }
.foot nav a { color: var(--dim); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; }
.foot nav a:hover { color: var(--ink); background: var(--hover); }
@media (min-width: 760px) { .foot { grid-template-columns: auto 1fr; align-items: center; } .foot nav { justify-content: flex-end; } }
