/* Cozy Lyre — one stylesheet for the whole site.
   Tokens mirror docs/04_UI_UX_DESIGN_SYSTEM.md ("Golden Hour Atelier"). */

:root {
  --bg: #fbf6ee;
  --surface: #ffffff;
  --surface-2: #f3eadb;
  --wood: #8a5a3b;
  --wood-light: #c89b6d;
  --string: #c9a056;
  --string-c: #c8463d;
  --string-f: #2f5d8c;
  --glow: #ffd48a;
  --primary: #b5562f;
  --primary-hover: #9c4726;
  --on-primary: #ffffff;
  --accent: #3e7c6b;
  --text: #2a1e16;
  --text-muted: #6e5e51;
  --border: rgba(90, 60, 35, 0.14);
  --shadow: 0 8px 24px rgba(60, 35, 15, 0.12);
  --hero-grad: radial-gradient(120% 90% at 80% 0%, #ffe2b8 0%, #fbf6ee 55%);
  --radius: 20px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110f;
    --surface: #1e1a17;
    --surface-2: #2a241f;
    --wood: #a97c55;
    --wood-light: #c89b6d;
    --string: #c9ced6;
    --string-c: #e0675d;
    --string-f: #6e9bd1;
    --glow: #ffe7b0;
    --primary: #e08a5e;
    --primary-hover: #eaa07a;
    --on-primary: #1a0f0a;
    --accent: #7fc1ae;
    --text: #f4ece1;
    --text-muted: #b5a898;
    --border: rgba(255, 240, 220, 0.1);
    --shadow: 0 0 0 1px rgba(255, 240, 220, 0.06);
    --hero-grad: radial-gradient(120% 90% at 80% 0%, #3a2618 0%, #14110f 60%);
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); padding: 8px 14px; border-radius: 10px; z-index: 10;
}
.skip-link:focus { left: 16px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 780px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; white-space: nowrap; }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text-muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 10px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* ---------- buttons & badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px; border: 0;
  font: 600 16px/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .09s ease-out, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { color: var(--text); background: color-mix(in srgb, var(--surface-2) 70%, var(--wood-light)); }

.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px;
  border-radius: 14px; background: var(--text); color: var(--bg); text-decoration: none;
}
.store-badge:hover { color: var(--bg); opacity: .9; }
.store-badge svg { width: 24px; height: 24px; }
.store-badge small { display: block; font-size: 11px; opacity: .75; line-height: 1.1; }
.store-badge strong { display: block; font-size: 17px; line-height: 1.2; }
.store-badge[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- hero ---------- */
.hero { background: var(--hero-grad); padding: 56px 0 40px; }
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--wood); background: var(--surface-2); padding: 6px 12px; border-radius: 999px;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(36px, 6vw, 60px); letter-spacing: -0.01em; margin-top: 16px; }
h2 { font-size: clamp(28px, 4vw, 40px); }
h3 { font-size: 21px; }
.lead { font-size: 19px; color: var(--text-muted); max-width: 34em; margin: 0 0 28px; }

/* playable mini lyre */
.lyre-card {
  background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  border: 1px solid var(--border); padding: 20px 18px 16px;
}
.lyre-frame {
  position: relative; border-radius: 22px; padding: 22px 14px 14px;
  background: linear-gradient(160deg, var(--wood-light), var(--wood));
}
.lyre-strings {
  position: relative; display: flex; justify-content: space-between; align-items: stretch;
  height: 260px; padding: 0 6px; border-radius: 14px;
  background: radial-gradient(90% 70% at 50% 60%, rgba(255, 235, 200, .25), rgba(0, 0, 0, .22));
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer;
}
.lyre-string {
  flex: 1; position: relative; display: flex; justify-content: center; border: 0; background: none;
  padding: 0; margin: 0; cursor: pointer; color: inherit;
}
.lyre-string::before {
  content: ""; width: var(--w, 2px); height: 100%; border-radius: 2px;
  background: var(--string); box-shadow: 0 0 0 rgba(255, 212, 138, 0);
  transition: box-shadow .5s ease-out, background .5s;
}
.lyre-string[data-color="c"]::before { background: var(--string-c); }
.lyre-string[data-color="f"]::before { background: var(--string-f); }
.lyre-string.ringing::before { animation: vibrate .9s ease-out; box-shadow: 0 0 14px 2px var(--glow); }
.lyre-string:focus-visible { outline: 2px solid var(--glow); outline-offset: -2px; border-radius: 6px; }
.lyre-string span {
  position: absolute; bottom: 6px; font: 600 12px/1 var(--font-body); color: #fff8ec;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none;
}
@keyframes vibrate {
  0% { transform: translateX(0); }
  10% { transform: translateX(2.4px); }
  20% { transform: translateX(-2.2px); }
  30% { transform: translateX(1.8px); }
  45% { transform: translateX(-1.2px); }
  60% { transform: translateX(.8px); }
  80% { transform: translateX(-.3px); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) { .lyre-string.ringing::before { animation: none; } }
.lyre-hint { margin: 12px 4px 0; font-size: 14px; color: var(--text-muted); text-align: center; }
.lyre-hint kbd {
  font: 600 12px/1 var(--font-body); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 6px;
}

/* ---------- sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--text-muted); margin: 0; }
.alt { background: var(--surface-2); }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 26px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.card p { margin: 0; color: var(--text-muted); font-size: 16px; }
.icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.icon svg { width: 24px; height: 24px; }

.models { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 15px;
}
.chip small { color: var(--text-muted); font-weight: 500; }

.notation {
  font: 600 22px/1.8 "Be Vietnam Pro", system-ui, sans-serif; letter-spacing: .12em;
  background: var(--surface); border-radius: 16px; padding: 18px 22px; border: 1px solid var(--border);
  overflow-x: auto; white-space: nowrap;
}
.notation .bar { color: var(--text-muted); padding: 0 .3em; }

.cta-band {
  text-align: center; background: linear-gradient(135deg, var(--wood), var(--primary)); color: #fff8ec;
  border-radius: 28px; padding: 48px 24px;
}
.cta-band h2 { color: #fff8ec; }
.cta-band p { opacity: .9; margin: 0 auto 24px; max-width: 32em; }
.cta-band .store-row { justify-content: center; }
.cta-band .store-badge { background: #fff8ec; color: #2a1e16; }

/* ---------- legal & support pages ---------- */
.page { padding: 48px 0 80px; }
.page h1 { font-size: clamp(32px, 5vw, 46px); }
.page h2 { font-size: 26px; margin-top: 2em; padding-top: .4em; }
.page h3 { font-size: 19px; margin-top: 1.6em; font-family: var(--font-body); font-weight: 700; }
.page p, .page li { color: var(--text); }
.page li { margin: .35em 0; }
.meta { color: var(--text-muted); font-size: 15px; }
.summary {
  background: var(--surface-2); border-left: 4px solid var(--primary); border-radius: 12px;
  padding: 18px 22px; margin: 24px 0;
}
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 22px; }
.toc ol { margin: 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }

details.faq {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px 20px; margin: 12px 0;
}
details.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; float: right; color: var(--text-muted); font-weight: 400; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin-top: 0; color: var(--text-muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0 40px; color: var(--text-muted); font-size: 15px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer .copy { margin-left: auto; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 36px 0 28px; }
  section { padding: 52px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .site-header .container { gap: 8px; }
  .site-nav { flex-wrap: nowrap; gap: 0; }
  .site-nav a { padding: 8px 7px; font-size: 14px; }
  .site-nav a[href="/#features"] { display: none; }
  .brand-name { font-size: 18px; }
  .lyre-strings { height: 220px; }
  .site-footer .copy { margin-left: 0; }
}
