/* ============================================================
   base.css — reset, tokens de diseño y temas (oscuro / claro)
   Paleta inspirada en el piano: ébano, marfil y latón.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }

:root {
  /* Escala tipográfica y radios */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-music: "Bravura", "Segoe UI Symbol", "Segoe UI Historic", "Noto Music", var(--font-serif);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --space: 16px;
  --maxw: 1180px;

  --ease: cubic-bezier(.22,.61,.36,1);

  /* Colores de marca constantes */
  --brass: #e6ad3c;
  --brass-strong: #f4c04e;
  --teal: #46c2a4;
  --rose: #e7607e;
  --indigo: #8b8bff;
}

/* -------- Tema oscuro (por defecto, ambiente de concierto) -------- */
:root, :root[data-theme="dark"] {
  --bg: #14110f;
  --bg-grad: radial-gradient(1200px 700px at 78% -8%, #241d18 0%, #14110f 58%, #100d0b 100%);
  --panel: #1d1916;
  --panel-2: #262019;
  --panel-3: #2f2820;
  --ink: #f4ede2;
  --ink-soft: #c3b6a5;
  --ink-mute: #8f8172;
  --line: rgba(244, 237, 226, .10);
  --line-strong: rgba(244, 237, 226, .18);
  --accent: var(--brass);
  --accent-ink: #201704;
  --key-white: #f3ecdf;
  --key-white-sh: #d9cfbd;
  --key-black: #201b18;
  --key-black-hi: #3a322b;
  --good: var(--teal);
  --bad: var(--rose);
  --info: var(--indigo);
  --shadow: 0 18px 40px -18px rgba(0,0,0,.7), 0 2px 8px -4px rgba(0,0,0,.6);
  --shadow-soft: 0 10px 30px -20px rgba(0,0,0,.8);
  --glow: 0 0 0 3px rgba(230,173,60,.25);
}

/* -------- Tema claro (marfil) -------- */
:root[data-theme="light"] {
  --bg: #efe7d8;
  --bg-grad: radial-gradient(1200px 700px at 80% -10%, #fffaf0 0%, #f3ecdd 55%, #e9e0cf 100%);
  --panel: #fffaf1;
  --panel-2: #f7efe1;
  --panel-3: #efe5d3;
  --ink: #241d16;
  --ink-soft: #5f5546;
  --ink-mute: #8a7d6b;
  --line: rgba(40, 30, 18, .12);
  --line-strong: rgba(40, 30, 18, .20);
  --accent: #b5801b;
  --accent-ink: #fff6e4;
  --key-white: #fffdf7;
  --key-white-sh: #e6dcc8;
  --key-black: #2a231d;
  --key-black-hi: #4a3f33;
  --good: #1f9e80;
  --bad: #cf3f60;
  --info: #5457d6;
  --shadow: 0 18px 40px -22px rgba(80,60,20,.45), 0 2px 8px -5px rgba(80,60,20,.35);
  --shadow-soft: 0 12px 30px -22px rgba(80,60,20,.5);
  --glow: 0 0 0 3px rgba(181,128,27,.22);
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; }
h1 { font-family: var(--font-serif); font-weight: 600; letter-spacing: .2px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }

::selection { background: rgba(230,173,60,.35); }

:focus-visible {
  outline: none;
  box-shadow: var(--glow);
  border-radius: 8px;
}

/* Utilidades */
.muted { color: var(--ink-mute); }
.soft { color: var(--ink-soft); }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
