/*
 * PianoSpot content pages (SEO articles).
 * Shared by every page cloned from /_templates/article.html.
 *
 * Reading surface is the app's cream; header, CTA card and footer reuse the
 * ink surfaces from the landing page (index.html) so the two feel like one site.
 * The landing page is dark-only and has no light/dark switch, so these pages
 * ship a single light scheme on purpose.
 *
 * Contrast (WCAG AA, checked with a script):
 *   ink #221D17 on cream #FBF5E7 ........ 15.4:1
 *   muted #5A5148 on cream ............... 7.1:1
 *   link #A84A1E on cream ................ 5.3:1
 *   link #A84A1E on cream-2 #F1E8D6 ...... 4.7:1
 *   muted #5A5148 on cream-2 ............. 6.4:1
 *   cream on ink ......................... 15.4:1
 *   cream-dim (72%) on ink ............... 8.5:1
 *   pale #FFE49A on ink .................. 13.4:1
 *   (breadcrumb "/" separator is decorative)
 */

@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka_bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka_semibold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dmsans_regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dmsans_medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dmsans_bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #221D17;
  --ink-deep: #17130F;
  --cream: #FBF5E7;
  --cream-2: #F1E8D6;
  --surface: #FFFDF8;
  --muted: #5A5148;
  --cream-dim: rgba(251, 245, 231, 0.72);
  --terra: #D2622F;
  --terra-deep: #A84A1E;
  --pale: #FFE49A;
  --moss: #3F8F5E;
  --line: rgba(34, 29, 23, 0.14);
  --line-dark: rgba(251, 245, 231, 0.22);
  --radius: 18px;
  --radius-lg: 28px;
  --measure: 62ch;
  --display: "Fredoka", "Avenir Next Rounded", "Nunito", system-ui, sans-serif;
  --body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
::selection { background: var(--pale); color: var(--ink); }
:focus-visible { outline: 3px solid var(--terra-deep); outline-offset: 3px; border-radius: 6px; }
.dark :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--pale); }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.wrap--text { width: min(760px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--pale); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 700; z-index: 20; text-decoration: none; }
.skip:focus { top: 16px; }
.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Header (same brand row as index.html) ---------- */
.site-header { background: var(--ink); color: var(--cream); padding: 14px 0; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--pale); color: var(--ink);
  text-decoration: none; font-weight: 700; font-size: 13px;
  padding: 10px 18px; border-radius: 999px;
  transition: transform 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.pill:hover { background: #FFEDB8; }
.pill:active { transform: translateY(1px) scale(0.98); }

/* ---------- Article head ---------- */
.article { padding: clamp(20px, 4vw, 40px) 0 clamp(48px, 7vw, 88px); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: "/"; color: rgba(34, 29, 23, 0.35); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; color: var(--ink); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 500; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(36px, 3.6vw, 48px); margin: 18px 0 12px; max-width: 20ch; }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.answer { font-size: 22px; line-height: 1.6; max-width: var(--measure); text-wrap: pretty; }
.answer + .answer { margin-top: 0.8em; }

/* ---------- CTA card (right after the answer) ---------- */
.cta {
  background: var(--ink); color: var(--cream);
  border-radius: var(--radius-lg);
  margin: clamp(28px, 4vw, 40px) 0;
  padding: clamp(22px, 4vw, 36px);
  display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: clamp(20px, 4vw, 36px); align-items: center;
  overflow: hidden;
}
.cta > * { min-width: 0; }
.cta .cta-title { color: var(--cream); font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.12; margin-bottom: 10px; }
.cta .cta-title .accent { color: var(--pale); }
.cta p { color: var(--cream-dim); margin-bottom: 20px; max-width: 38em; }
.cta .phone { max-width: 168px; margin-inline: auto; }

/* Store badges: copied from index.html so both pages look the same */
.stores { display: flex; gap: 12px; flex-wrap: wrap; }
.store-badge { display: inline-flex; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s; }
.store-badge img { display: block; height: 48px; width: auto; }
.store-badge:hover { transform: translateY(-2px); }
.store-badge:active { transform: translateY(0) scale(0.98); }

/* Phone frame around an app screenshot (same as index.html) */
.phone {
  background: #0E0C0A; border-radius: 30px; padding: 7px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(251, 245, 231, 0.1);
  width: 100%;
}
.phone .screen { position: relative; overflow: hidden; border-radius: 24px; aspect-ratio: 1284 / 2778; background: var(--cream); }
.phone .screen img { position: absolute; left: 0; top: 30px; width: 100%; height: calc(100% - 30px); object-fit: cover; object-position: top; }
.phone .screen::after { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 56px; height: 16px; background: #0E0C0A; border-radius: 999px; }

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 28px; margin-top: 1.9em; margin-bottom: -0.1em; }
.prose h3 { font-size: 22px; font-weight: 600; margin-top: 1.6em; margin-bottom: -0.3em; }
.prose p, .prose li { text-wrap: pretty; }
.prose a { color: var(--terra-deep); font-weight: 500; }
.prose a:hover { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--terra-deep); font-weight: 700; }
.prose strong { font-weight: 700; }
.prose figure { margin-top: 1.6em; }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Numbered how-to steps */
.prose ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.prose ol.steps li { counter-increment: step; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.prose ol.steps li::before { content: counter(step); font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--terra-deep); line-height: 1; }

/* Tables: scroll inside their own box, never the page */
.table-wrap { overflow-x: auto; padding: 6px; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prose .table-wrap { margin-top: 1.4em; }
table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.45; }
caption { text-align: left; padding: 14px 16px 0; font-size: 13px; color: var(--muted); }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; }
thead th { background: var(--cream-2); font-weight: 700; font-size: 13px; white-space: nowrap; }
tbody tr + tr td, tbody tr + tr th { border-top: 1px solid var(--line); }
tbody th { font-weight: 700; }
@media (max-width: 560px) { th, td { padding: 10px 12px; } table { min-width: 520px; } }

/* Callout */
.callout { background: var(--cream-2); border-radius: var(--radius); padding: 18px 20px; }
.prose .callout { margin-top: 1.4em; }
.callout > * + * { margin-top: 0.6em; }
.callout-title { font-family: var(--display); font-weight: 600; font-size: 22px; }
.callout p { color: var(--ink); }
.callout--source { background: transparent; border: 1px dashed rgba(34, 29, 23, 0.3); font-size: 13px; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { margin-top: clamp(48px, 7vw, 72px); max-width: var(--measure); }
.faq h2 { font-size: 28px; margin-bottom: 8px; }
.faq-item { padding: 20px 0; border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 22px; font-weight: 600; line-height: 1.25; margin-bottom: 6px; }
.faq-item p { color: var(--muted); }

/* ---------- Related pages ---------- */
.related { margin-top: clamp(48px, 7vw, 72px); }
.related h2 { font-size: 28px; margin-bottom: 16px; }
.related ul { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.related a {
  display: block; height: 100%; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color 0.18s var(--ease-out), transform 0.18s var(--ease-out);
}
.related a:hover { border-color: var(--terra-deep); transform: translateY(-2px); }
.related b { display: block; font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.2; margin-bottom: 4px; }
.related span { color: var(--muted); font-size: 17px; line-height: 1.5; display: block; }
@media (min-width: 640px) { .related ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Footer (same as index.html) ---------- */
.site-footer { background: var(--ink-deep); padding: 34px 0 44px; color: var(--cream-dim); font-size: 13px; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .answer { font-size: 17px; font-weight: 500; }
  /* CTA stacks: copy + store badges, then a cropped peek of the screenshot */
  .cta { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cta .phone { max-width: none; border-radius: 22px; padding: 6px; box-shadow: none; }
  .cta .phone .screen { aspect-ratio: auto; height: 220px; border-radius: 17px; }
  .cta .phone .screen img { top: 0; height: auto; }
  .cta .phone .screen::after { display: none; }
  .cta .phone .screen::before { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(to bottom, rgba(14, 12, 10, 0), rgba(14, 12, 10, 0.55)); z-index: 1; }
}
@media (max-width: 380px) {
  .pill { padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pill, .store-badge, .related a { transition: none; }
}

/* Site-wide footer navigation (generated markup: scripts/sync-footer.js) */
  .footer-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 24px; padding-bottom: 28px; margin-bottom: 24px; border-bottom: 1px solid rgba(251, 245, 231, 0.12); }
  .footer-nav h2 { font-family: Fredoka, "Avenir Next Rounded", Nunito, system-ui, sans-serif; font-size: 17px; font-weight: 600; color: #FBF5E7; margin: 0 0 10px; letter-spacing: 0.01em; }
  .footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
  .footer-nav a { color: inherit; text-decoration: none; font-size: 13px; line-height: 1.4; }
  .footer-nav a:hover { color: #FBF5E7; text-decoration: underline; }
  @media (max-width: 760px) { .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
