/* ============================================================
   Robert Lamour™ · base: tipografías, tokens, reset, texturas
   ============================================================ */

/* Tipografías libres (SIL OFL 1.1), autoalojadas. Ver assets/fonts/LICENSE.txt */
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-full-normal.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-full-italic.woff2') format('woff2');
  font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Monoton'; src: url('../assets/fonts/monoton-400.woff2') format('woff2');
  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('../assets/fonts/courier-prime-400.woff2') format('woff2');
  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Courier Prime'; src: url('../assets/fonts/courier-prime-700.woff2') format('woff2');
  font-weight: 700; font-display: swap; }
@font-face { font-family: 'Pinyon Script'; src: url('../assets/fonts/pinyon-script-400.woff2') format('woff2');
  font-weight: 400; font-display: swap; }

:root {
  /* Paleta canónica (Character Bible §5) + marfiles */
  --bordo: #63162B;
  --bordo-hondo: #3a0b17;
  --bordo-noche: #240710;
  --negro: #191919;
  --tinta: #120d0e;
  --oro: #C5A15E;
  --oro-claro: #e6cc93;
  --oro-viejo: #8a6a32;
  --rojo: #A91D32;
  --marfil: #F3E9D2;
  --crema: #e7d7b4;
  --papel: #efe3c6;

  --txt: #f3e9d2;
  --txt-suave: rgba(243, 233, 210, .74);

  --f-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --f-disco: 'Monoton', 'Fraunces', serif;
  --f-tipo: 'Courier Prime', 'Courier New', monospace;
  --f-firma: 'Pinyon Script', 'Fraunces', cursive;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
  --topbar-h: 60px;
  --player-h: 68px;
  --radius: 4px;

  --beat: 0;           /* 0–1: energía de graves, la escribe audio.js */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-groove: cubic-bezier(.68, -0.4, .32, 1.4);

  /* Corderoy de canaleta ancha: canaletas verticales con luz y sombra */
  --corderoy: repeating-linear-gradient(90deg,
      rgba(0,0,0,.30) 0 1.5px,
      rgba(255,255,255,.045) 1.5px 4px,
      rgba(255,255,255,.075) 4px 6px,
      rgba(0,0,0,.16) 6px 9px);
  --grano: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 8px); }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bordo-hondo);
  background-image: var(--corderoy), radial-gradient(120% 80% at 50% 0%, var(--bordo) 0%, var(--bordo-hondo) 55%, var(--bordo-noche) 100%);
  background-attachment: fixed;
  color: var(--txt);
  font-family: var(--f-display);
  font-size: clamp(16px, 1.05vw + 11px, 19px);
  line-height: 1.55;
  font-variation-settings: 'opsz' 14, 'SOFT' 40, 'WONK' 0;
  font-weight: 380;
  overflow-x: clip;
  cursor: url('../assets/icons/cursor.svg') 20 18, auto;
  text-rendering: optimizeLegibility;
}
/* grano mate encima de todo, sin capturar eventos */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 90; pointer-events: none;
  background-image: var(--grano); opacity: .18; mix-blend-mode: overlay;
}
a, button, summary, label, select, input[type=range], input[type=checkbox], [role=button] {
  cursor: url('../assets/icons/cursor-rosa.svg') 16 16, pointer;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; }
a { color: var(--oro-claro); text-decoration-thickness: 1px; text-underline-offset: .18em; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.05; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--oro); color: var(--bordo-hondo); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--oro-claro);
  outline-offset: 3px;
  border-radius: 2px;
  box-shadow: 0 0 0 5px rgba(36, 7, 16, .85);
}

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 300; padding: 10px 16px;
  background: var(--oro); color: var(--bordo-hondo); font-weight: 700; text-decoration: none; border-radius: var(--radius);
  transition: top .2s;
}
.skip:focus { top: 12px; }
.noscript { padding: 24px var(--gutter); background: var(--oro); color: var(--negro); margin: 0; }

/* ------- Tipografía de sistema ------- */
.kicker {
  font-family: var(--f-tipo); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--oro); margin: 0 0 1rem; display: flex; align-items: center; gap: .8em;
}
.kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; flex: none; }
.subhead {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  font-variation-settings: 'opsz' 72, 'SOFT' 100, 'WONK' 1; font-weight: 750;
  color: var(--oro-claro); margin-bottom: .7em;
}
.subnote { font-family: var(--f-tipo); font-size: .82rem; color: var(--txt-suave); letter-spacing: .02em; }
.signature { font-family: var(--f-firma); font-weight: 400; color: var(--oro); line-height: 1; }

/* ------- Botones ------- */
.btn {
  --b-bg: transparent; --b-fg: var(--oro-claro); --b-bd: var(--oro);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 46px; padding: .7em 1.4em; border-radius: 999px;
  background: var(--b-bg); color: var(--b-fg); border: 1.5px solid var(--b-bd);
  font-family: var(--f-display); font-weight: 650; font-size: .98rem; letter-spacing: .01em;
  font-variation-settings: 'opsz' 24, 'SOFT' 100, 'WONK' 0;
  text-decoration: none; white-space: nowrap;
  transition: transform .35s var(--ease-groove), background-color .25s, color .25s, box-shadow .25s;
}
.btn svg { width: 1.05em; height: 1.05em; flex: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn--gold {
  --b-bg: linear-gradient(180deg, #e3c88c, var(--oro) 55%, #a9843f); --b-fg: var(--bordo-noche); --b-bd: #f1dcaa;
  background: var(--b-bg);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 -2px 0 rgba(0,0,0,.18) inset, 0 8px 22px -10px rgba(0,0,0,.8);
}
.btn--gold:hover { box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 0 0 4px rgba(197,161,94,.18), 0 12px 26px -10px rgba(0,0,0,.8); }
.btn--ghost:hover, .btn--ghost[aria-pressed=true] { background: rgba(197,161,94,.14); }
.btn--link { border: 0; min-height: 40px; padding: .4em 0; color: var(--oro); text-decoration: underline; text-underline-offset: .25em; border-radius: 0; }
.btn--sm { min-height: 38px; padding: .45em 1em; font-size: .88rem; }
.btn--big { min-height: 56px; font-size: 1.08rem; padding: .8em 1.8em; }
.btn[aria-disabled=true] { opacity: .78; }

/* ------- Selector de idioma ------- */
.lang { display: inline-flex; border: 1px solid rgba(197,161,94,.55); border-radius: 999px; padding: 2px; }
.lang button {
  font-family: var(--f-tipo); font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  min-width: 40px; min-height: 34px; border-radius: 999px; color: var(--oro);
  transition: background-color .2s, color .2s;
}
.lang button[aria-pressed=true] { background: var(--oro); color: var(--bordo-noche); }

/* ------- Revelado al hacer scroll ------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
