/* Public pages (melodygenerator.io /, /text-to-midi, /privacy, /terms, 404). Hand-written page layout on top of
   shared.css, which is GENERATED from the app's tokens/fonts/components (scripts/site_sync_styles.py). Use only
   the app's tokens here: no new colours. Peach only. */

/* body: the app's font/colour rule (app.css body) minus its overflow:hidden app-shell lock */
body {
  font: 400 14px/1.45 "Adwaita Sans", "Ubuntu Nerd Font Propo", "Noto Sans", sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.link { color: var(--accent-ink); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- header (the app's .top bar) ---------- */
.top { height: 64px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 500; white-space: nowrap; }
/* .nav a = app.css .nav button / .nav button.on (links here, buttons in the app) */
.nav a { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.signin-link { color: var(--muted); font-weight: 500; padding: 0 8px; white-space: nowrap; }
.signin-link:hover { color: var(--text); }
.top .btn.primary { width: auto; height: 40px; border-radius: 12px; padding: 0 18px; font-size: 14px; white-space: nowrap; flex: none; }

main { display: flex; flex-direction: column; gap: 56px; padding: 8px 0 64px; }
section > h2, .sh { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.sh { font-weight: 500; } /* h3 headings like the h2s: no extra Ubuntu Bold font download */
.lede { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 720px; }
.sec-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }

/* ---------- hero ---------- */
.hero { background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); padding: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; align-items: center; }
.hero h1 { font-size: 46px; line-height: 1.1; font-weight: 500; letter-spacing: -.01em; }
.hero .sub { font-size: 18px; color: var(--muted); margin: 12px 0 24px; line-height: 1.45; }
.hero .intro { font-size: 15px; color: var(--muted); margin: -12px 0 24px; line-height: 1.55; max-width: 560px; }
.hero form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.hero .prompt textarea { height: 96px; }
.hero .tries { justify-content: flex-start; margin-top: 4px; }
.hero .tries .try { display: inline-flex; align-items: center; }
.hero-roll { height: 280px; }
.hero-roll i { position: absolute; height: 12px; border-radius: 6px; background: var(--note-mel); }
.hero-roll i.c { background: var(--note-chd); opacity: .85; }
.hero-roll { background-image: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--roll-line) calc(25% - 1px) 25%); }
.page-hero { padding: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.page-hero h1 { font-size: 42px; line-height: 1.1; font-weight: 500; }
.page-hero .btn.primary { width: auto; align-self: flex-start; padding: 0 22px; }

/* ---------- demos (the app's take card) ---------- */
.demos { display: flex; flex-direction: column; gap: 12px; }
.demo { background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 16px; padding: 16px; min-height: 160px; outline: 2px solid transparent; transition: outline-color .2s; }
.demo.playing { outline-color: var(--accent); }
.demo .meta { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.demo .meta h3 { font-size: 16px; font-weight: 500; line-height: 1.3; }
.demo .roll { min-height: 128px; }
.demo .acts { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.demo .acts .btn { height: 40px; font-size: 13.5px; width: 100%; white-space: nowrap; }
.demo .badge.placeholder { background: var(--warn-bg); color: var(--warn); align-self: flex-start; }
.demo.ghost .roll, .demo.ghost .bar { background: var(--raised); }
.demo.ghost .bar { height: 14px; border-radius: 7px; width: 70%; }
.demos-err { color: var(--muted); }

/* ---------- steps / features / daws ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step, .feat { gap: 10px; }
.step .n { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; }
.feat .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.step h3, .feat h3 { font-size: 16px; font-weight: 500; }
.step p, .feat p { color: var(--muted); line-height: 1.5; }
.daws { display: flex; flex-wrap: wrap; gap: 8px; }
.daws .tag { height: 36px; padding: 0 16px 0 12px; gap: 8px; font-size: 14px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
/* DAW icons (scripts/site_icons.py): monochrome in the chip's text colour, fixed 16x16 (width/height attrs = no CLS) */
.daws .tag svg { fill: currentColor; flex: none; width: 16px; height: 16px; }
.prose { line-height: 1.6; font-size: 15px; display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.prose p { color: var(--text); }
.tips { display: flex; flex-direction: column; gap: 6px; padding-left: 20px; color: var(--text); line-height: 1.5; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.examples a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); font-weight: 500; }
.examples a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.examples a svg { color: var(--accent-ink); }

/* ---------- FAQ ---------- */
.faq { padding: 8px 24px; gap: 0; }
.faq .qa { padding: 18px 0; border-top: 1px solid var(--line); }
.faq .qa:first-child { border-top: 0; }
.faq h3 { font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.faq p { color: var(--muted); line-height: 1.55; font-size: 15px; }

/* ---------- CTA band ---------- */
.cta { background: var(--accent-soft); border-radius: 20px; padding: 32px; display: flex; align-items: center; gap: 24px; }
.cta h2 { font-size: 24px; }
.cta p { color: var(--muted); margin-top: 4px; }
.cta .btn.primary { width: auto; padding: 0 24px; margin-left: auto; flex: none; }

/* ---------- legal + 404 ---------- */
.legal { max-width: 820px; margin: 0 auto; gap: 14px; padding: 32px; }
.legal h1 { font-size: 34px; font-weight: 500; line-height: 1.15; }
.legal h2 { font-size: 19px; margin-top: 10px; }
.legal p, .legal li { line-height: 1.6; font-size: 15px; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal th, .legal td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.legal th { color: var(--muted); font-weight: 600; }
.draft { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-weight: 500; line-height: 1.5; }
.nf { align-items: center; text-align: center; max-width: 560px; margin: 32px auto 0; padding: 40px 32px; }
.nf h1 { font-size: 30px; font-weight: 500; }
.nf .btn.primary { width: auto; padding: 0 22px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; }
footer .fbrand { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
footer .fbrand .brand { color: var(--text); font-size: 16px; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
footer nav a, footer nav button { color: var(--muted); font-weight: 500; font-size: 14px; }
footer nav a:hover, footer nav button:hover { color: var(--text); }

/* ---------- consent banner (pre-rendered hidden in each page; consent.js) ---------- */
.consent[hidden] { display: none; }
.consent { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: 400px; max-width: calc(100vw - 32px); background: var(--panel); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 4px 10px #0000001A, 0 16px 40px #00000026; border: 1px solid var(--line); }
.consent p { line-height: 1.5; font-size: 14px; }
.consent .row2 { display: flex; gap: 8px; }
.consent .row2 .btn { flex: 1; height: 40px; }
.consent .row2 .btn.primary { width: auto; font-size: 14px; border-radius: 12px; }

/* ---------- sign-up prompt (Download MIDI on a demo; native <dialog>, signup.js) ---------- */
.signup { margin: auto; width: 420px; max-width: calc(100vw - 32px); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px 20px;
  background: var(--panel); color: var(--text); box-shadow: 0 4px 10px #0000001A, 0 16px 40px #00000026; text-align: center; }
.signup[open] { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.signup::backdrop { background: #2E262259; }
.signup .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.signup h2 { font-size: 21px; font-weight: 500; line-height: 1.25; }
.signup p { color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.signup .btn.google { width: 100%; height: 48px; border-radius: 14px; font-size: 15px; margin-top: 4px; background: var(--panel); color: var(--text); border: 2px solid var(--line); }
.signup .btn.google:hover { background: var(--raised); border-color: var(--hover); }
.signup .btn.google:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.signup .btn.google svg { flex: none; }
.signup .x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.signup .x:hover { background: var(--raised); color: var(--text); }
.signup .later { color: var(--muted); font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 10px; }
.signup .later:hover { color: var(--text); background: var(--raised); }

/* mobile nav: second row under the header (desktop uses the pill in the header) */
.mnav { display: none; margin: 0 0 8px; overflow-x: auto; }
.mnav.nav { width: max-content; max-width: 100%; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding: 28px; }
  .hero-roll { display: none; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo { grid-template-columns: 200px minmax(0, 1fr); }
  .demo .acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .demo .acts .btn { width: auto; flex: 1 1 auto; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .top { gap: 10px; height: 60px; }
  .top .brand { font-size: 16px; gap: 8px; }
  .top .btn.primary { padding: 0 14px; }
  .top .nav { display: none; }
  .signin-link { padding: 0 4px; }
  .mnav.nav { display: flex; }
  main { gap: 40px; }
  .hero { padding: 22px; gap: 20px; }
  .hero h1, .page-hero h1 { font-size: 34px; }
  .hero .sub { font-size: 16px; margin: 8px 0 18px; }
  .hero .intro { font-size: 14px; margin: -8px 0 18px; }
  section > h2, .sh { font-size: 22px; }
  .grid3, .grid4, .examples { grid-template-columns: 1fr; }
  .demo { grid-template-columns: 1fr; gap: 12px; }
  .demo .roll { min-height: 112px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 24px; }
  .cta .btn.primary { margin-left: 0; }
  .legal { padding: 22px; }
  .legal h1 { font-size: 28px; }
  footer nav { margin-left: 0; }
  .signup { padding: 24px 18px 16px; }
  .consent { right: 8px; bottom: 8px; max-width: calc(100vw - 16px); padding: 16px; }
}
