/* ==========================================================
   Easy Violin — páginas de contenido (guías, afinador, legales)
   Los tokens son los mismos que css/app.css (:root). Mantener sincronizados.
   ========================================================== */
:root {
  --bg: #0d0b12;
  --surface: #16131d;
  --surface-2: #1d1926;
  --surface-3: #262131;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f5f0e8;
  --text-2: #c9c1d3;
  --text-3: #968da2;
  --accent: #f4c15d;
  --accent-strong: #ffd27a;
  --accent-ink: #1c1405;
  --accent-soft: rgba(244, 193, 93, 0.12);
  --good: #3dd68c;
  --warn: #ff9f43;
  --str-1: #6d72ff;
  --str-2: #17b47e;
  --str-3: #e08a2e;
  --str-4: #ef4b5f;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: radial-gradient(1000px 500px at 50% -10%, rgba(244, 193, 93, 0.07), transparent 60%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px max(16px, calc((100vw - 1120px) / 2));
  background: rgba(13, 11, 18, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.site-brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg, #ffd98a, #d99a2b); color: #3a2308; }
.site-brand__mark svg { width: 21px; height: 21px; }
.site-brand__name { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.site-brand__name em { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  padding: 8px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 15px; font-weight: 600;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.site-header__lang { border: 1px solid var(--line-strong); }

/* ---------- Página ---------- */
.page { max-width: 780px; margin: 0 auto; padding: 20px 16px 64px; }
.breadcrumbs ol { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--text-3); }
.breadcrumbs li + li::before { content: '›'; margin-right: 6px; }
.breadcrumbs a { color: var(--text-2); }

.page-head { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.prose h1 { font-family: var(--font-display); font-size: clamp(34px, 6vw, 50px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 14px; }
.prose h1 em { color: var(--accent); }
.lead { font-size: 20px; line-height: 1.55; color: var(--text-2); margin: 0 0 10px; }
.page-meta { font-size: 14px; color: var(--text-3); margin: 0; }
.prose h2 { font-family: var(--font-display); font-size: 29px; line-height: 1.2; font-weight: 600; margin: 44px 0 12px; letter-spacing: -0.01em; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--text); }
.prose code { font-size: 0.9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

.answer {
  padding: 18px 20px; margin: 0 0 24px; border-radius: var(--r-lg);
  background: var(--accent-soft); border: 1px solid rgba(244, 193, 93, 0.3);
}
.answer p:last-child { margin-bottom: 0; }
.note {
  padding: 14px 18px; margin: 20px 0; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn); color: var(--text-2); font-size: 16px;
}
.note p:last-child { margin: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border-radius: var(--r-md); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.string-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--surface-3); color: var(--text); }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button--primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; }

.cta {
  margin: 40px 0 8px; padding: 24px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-strong);
}
.cta h2 { margin-top: 0; }

.related { margin-top: 36px; }
.related ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.related a { display: block; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 600; }
.related a:hover { border-color: var(--line-strong); background: var(--surface-2); }
.related small { display: block; color: var(--text-3); font-weight: 400; }

.figure { margin: 24px 0; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 10px; font-size: 14px; color: var(--text-3); }

/* ---------- Tonos de referencia ---------- */
.ref-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 20px; }
.ref {
  position: relative; min-height: 52px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text); font: inherit; font-weight: 800; cursor: pointer; overflow: hidden;
}
.ref small { display: block; font-weight: 500; font-size: 12px; color: var(--text-3); }
.ref::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); }
.ref:hover { border-color: var(--c); }
.ref.is-ringing { background: color-mix(in srgb, var(--c) 22%, var(--surface-2)); }

/* ---------- Afinador ---------- */
.tuner-widget {
  margin: 8px 0 28px; padding: 22px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-strong);
  display: grid; gap: 16px;
}
.tuner-widget__readout { text-align: center; }
.tuner-widget__note { font-family: var(--font-display); font-size: 72px; line-height: 1; font-weight: 600; min-height: 72px; }
.tuner-widget__cents { font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; min-height: 26px; }
.tuner-widget__meta { display: flex; justify-content: center; gap: 16px; font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tuner-widget[data-state="in"] .tuner-widget__note, .tuner-widget[data-state="in"] .tuner-widget__cents { color: var(--good); }
.tuner-widget[data-state="flat"] .tuner-widget__cents, .tuner-widget[data-state="sharp"] .tuner-widget__cents { color: var(--warn); }
.gauge { position: relative; height: 40px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.gauge__zone { position: absolute; top: 0; bottom: 0; left: 50%; width: 18%; transform: translateX(-50%); background: rgba(61, 214, 140, 0.16); border-left: 1px solid rgba(61, 214, 140, 0.4); border-right: 1px solid rgba(61, 214, 140, 0.4); }
.gauge__center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: rgba(255, 255, 255, 0.3); }
.gauge__needle { position: absolute; top: 6px; bottom: 6px; left: 50%; width: 6px; border-radius: 99px; transform: translateX(-50%); background: var(--text-3); opacity: 0.5; transition: left 110ms linear, background-color .16s; }
.tuner-widget[data-state="in"] .gauge__needle { background: var(--good); opacity: 1; }
.tuner-widget[data-state="flat"] .gauge__needle, .tuner-widget[data-state="sharp"] .gauge__needle { background: var(--warn); opacity: 1; }
.gauge-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-top: 8px; }
.tuner-widget__status { text-align: center; font-size: 15px; color: var(--text-2); min-height: 24px; margin: 0; }
.tuner-widget [aria-pressed="true"] { background: rgba(61, 214, 140, 0.14); border-color: rgba(61, 214, 140, 0.4); color: #bff5da; }

/* ---------- Diagrama del mástil ---------- */
.fingerboard text { font-family: var(--font-ui); }

/* ---------- Lista de piezas ---------- */
.song-table td:last-child { white-space: nowrap; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 16px 40px; text-align: center; color: var(--text-3); font-size: 15px; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 10px; }
.site-footer a { color: var(--text-2); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { position: static; padding-top: 10px; padding-bottom: 6px; gap: 6px; }
  .site-nav a { padding: 8px 10px; font-size: 14px; }
  .site-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .site-nav a { white-space: nowrap; }
  .lead { font-size: 18px; }
  .ref-row { grid-template-columns: repeat(2, 1fr); }
  .tuner-widget__note { font-size: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
