/* =====================================================================
   Diseccionando Bitcoin — sistema de diseño 2026
   Se carga DESPUÉS del <style> de cada página: redefine tokens y
   unifica tipografía, navegación, cabeceras y bloques de contenido.
   ===================================================================== */

:root {
  --black: #000000;
  --surface: #0d0d0e;
  --surface-2: #161618;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --bone: #f5f5f7;
  --ash: #8e8e93;
  --ash-dim: #5c5c61;
  --orange: #f7931a;
  --ember: #e8590c;

  /* tokens heredados de las páginas */
  --bg-primary: var(--black);
  --bg-secondary: var(--surface);
  --bg-card: var(--surface);
  --border: var(--line);
  --text-primary: var(--bone);
  --text-secondary: var(--ash);
  --text-dim: var(--ash-dim);
  --btc-orange: var(--orange);

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --mono-ui: var(--font); /* las etiquetas antiguas en monoespaciada pasan a Archivo */
  --ease: cubic-bezier(.2, .7, .1, 1);
  --wrap: 1120px;
}

html { scroll-behavior: smooth; }
html body {
  background: var(--black);
  color: var(--bone);
  font-family: var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--orange); color: #000; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

/* Decoración antigua fuera: el negro es el lienzo */
.glow-orb, .glow-orb-2, #btcBg { display: none !important; }

/* Titulares: Archivo expandida, compacta y con aire */
html body h1, html body h2, html body h3,
.section-title, .page-hero h1, .content-section h2 {
  font-family: var(--font);
  font-stretch: 112%;
  letter-spacing: -0.03em;
  font-weight: 750;
}
html body h3 { font-stretch: 112%; letter-spacing: -0.02em; font-weight: 700; }
html body p { font-weight: 400; }

/* Etiquetas de sección: texto normal en naranja, sin mayúsculas ni monoespaciada */
html body .section-label, html body .page-label {
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--orange);
  background: none;
  border: 0;
  padding: 0;
}
.section-label .dot { display: none; }

/* Las animaciones de entrada genéricas desaparecen: el contenido siempre visible */
html body .fade-in { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ---------- Navegación: barra de vidrio fina ---------- */
html body nav:not(.lesson-nav) {
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px; padding: 0 max(20px, calc((100vw - 1240px) / 2));
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease);
}
html body nav .logo { font-family: var(--font); font-stretch: 112%; font-weight: 800; letter-spacing: -0.02em; font-size: 1.02rem; }
html body nav .logo-symbol, html body nav .logo-btc { color: var(--orange); }
html body .nav-links a, html body .nav-drop-btn {
  font-family: var(--font); font-size: 0.86rem; font-weight: 500; color: rgba(245,245,247,.8);
  letter-spacing: 0;
}
html body .nav-links a:hover, html body .nav-drop-btn:hover { color: #fff; }
html body .nav-drop-menu {
  background: rgba(22, 22, 24, 0.92);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
html body .lang-btn { font-family: var(--font); border-radius: 999px; }
html body .lang-btn.active { background: var(--orange); color: #000; border-color: var(--orange); }
#scrollProgress { height: 2px !important; background: linear-gradient(90deg, var(--ember), var(--orange)) !important; }
html body .mobile-menu { background: rgba(0,0,0,.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
html body .mobile-menu a { font-family: var(--font); font-stretch: 112%; font-weight: 700; font-size: 1.5rem; color: var(--bone); }
html body .mob-section-label { font-family: var(--font); text-transform: none; letter-spacing: 0; color: var(--orange); font-size: .9rem; }

/* ---------- Cabecera de página: escena que se aleja al hacer scroll ---------- */
html body .page-hero, html body .page-header {
  min-height: 74vh;
  max-width: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  margin: 0;
  position: relative;
}
html body .page-hero > *, html body .page-header > * {
  transform: translate3d(0, calc(var(--p, 0) * -60px), 0) scale(calc(1 - var(--p, 0) * .08));
  opacity: calc(1 - var(--p, 0) * 1.4);
  will-change: transform, opacity;
}
html body .page-hero h1, html body .page-header h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  max-width: 16ch;
  font-stretch: 110%;
  margin: 18px auto 28px;
}
html body .page-hero p, html body .page-header p {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.55; color: var(--ash); max-width: 38em; margin: 0 auto;
}
html body .page-hero::after, html body .page-header::after {
  content: ''; position: absolute; left: 50%; bottom: 28px; width: 1px; height: 56px;
  background: linear-gradient(var(--orange), transparent);
  opacity: calc(1 - var(--p, 0) * 3);
}

/* ---------- Secciones de contenido ---------- */
html body .content-section, html body .section {
  max-width: var(--wrap);
  padding-left: 24px; padding-right: 24px;
}
html body .content-section { padding-bottom: 140px; }
html body .content-section h2, html body .section h2, html body .section-title {
  font-size: clamp(2rem, 4.2vw, 3.3rem);
  line-height: 1.08;
  max-width: 18ch;
  font-stretch: 108%;
  margin-bottom: 40px;
}
/* Titulares que se "encienden" al cruzar la pantalla (lo controla db.js) */
html body [data-lit] {
  color: color-mix(in srgb, var(--bone) calc(25% + var(--lit, 1) * 75%), var(--ash-dim));
}

html body .content-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(28px, 4vw, 56px);
}
html body .content-block p, html body .content-section p { font-size: 1.08rem; line-height: 1.75; color: var(--ash); }
html body .content-block strong, html body .content-section strong { color: var(--bone); }

/* Tarjetas de todas las páginas: superficie plana, radio grande, sin sombra */
html body .book-card, html body .ref-card, html body .myth-item, html body .tool-card, html body .level-card,
html body .country-card, html body .stat-box, html body .metric-card, html body .pillar-card, html body .qn-card,
html body .term-card, html body .glos-card, html body .news-card, html body .price-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: none;
}

/* Botones */
html body .btn-primary, html body .btn-pay, html body .nav-cta {
  background: var(--orange); color: #000; border-radius: 999px; font-family: var(--font); font-weight: 700;
}
html body .btn-secondary, html body .btn-ghost {
  border-radius: 999px; font-family: var(--font);
}

/* CTA final y correo */
html body .cta-section { padding: 160px 24px; text-align: center; }
html body .cta-section h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.06; margin: 16px auto 24px; max-width: 14ch; }
html body .email-pill { border-radius: 999px; }

/* Pie */
html body footer {
  border-top: 1px solid var(--line);
  font-family: var(--font);
  color: var(--ash-dim);
  padding: 32px max(24px, calc((100vw - 1240px) / 2));
}
html body .footer-left { font-family: var(--font); }

/* Datos de máquina en monoespaciada (precios, bloques, hashes) */
.mono, code, kbd, #btc-price, .mhi-value, #block-height, #btc-mined, .ln-address, .slab-hex, .code-box { font-family: var(--mono) !important; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html body .page-hero > *, html body .page-header > * { transform: none !important; opacity: 1 !important; }
  html body [data-lit] { color: var(--bone); }
}
@media (max-width: 768px) {
  html body .page-hero, html body .page-header { min-height: 78vh; padding-top: 110px; }
  html body .content-section { padding-bottom: 90px; }
  html body .cta-section { padding: 110px 20px; }
}
