/* ============================================================================
   SB-414 — apple-polish.css · capa de refinamiento visual estilo Apple.

   Vive como stylesheet separado (igual que design-system.css) para sobrevivir
   al truncador de build_cycle_compass.py. Se carga DESPUÉS de styles.css y
   design-system.css: solo refina — tipografía, aire, radios, glass del topbar,
   jerarquía — sin tocar hooks de JS ni estructura del DOM.

   Principios (pedido directo de Alex, 2026-06-10):
   - Tipografía Apple (SF Pro vía -apple-system; Inter de gemelo métrico).
   - Dark = azul marino profundo; naranjo Bitcoin como color protagonista.
   - Aire generoso, jerarquía clara, nada de decoración sin datos.
   ========================================================================== */

/* ---------- Base tipográfica ---------- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  line-height: 1.6;
  background:
    radial-gradient(1200px 520px at 80% -10%, var(--halo-accent), transparent 60%),
    radial-gradient(900px 420px at 0% 0%, rgba(69, 122, 245, 0.05), transparent 55%),
    var(--bg);
}
::selection { background: rgba(247, 147, 26, 0.30); }

h1, h2, h3 { font-weight: 700; }
h1 { letter-spacing: -0.028em; }
h2 { letter-spacing: -0.024em; }
h3 { letter-spacing: -0.015em; }

.mono, .kpi-value, .tile-value, .metric-card-value, .s21c-btc, .hero-chart-price {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- Topbar: vidrio Apple ---------- */
.topbar {
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--border-soft);
}
.topbar-inner { padding: 0.8rem 0; }
.brand { letter-spacing: -0.02em; }
.brand-mark {
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(247, 147, 26, 0.35);
}
.toplinks a, .tabbar a {
  border-color: transparent;
  background: transparent;
  font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease;
}
.toplinks a:hover, .tabbar a:hover {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--text);
}
.tabbar a.is-active { background: var(--accent-soft); color: var(--text); border-color: transparent; }

/* ---------- Masthead (titular de la home, estático y honesto) ---------- */
.home-masthead {
  padding: 3.4rem 0 0.6rem;
  max-width: 880px;
}
.home-masthead .kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.home-masthead h1 {
  margin: 0.3rem 0 0.8rem;
  font-size: clamp(2.5rem, 5.4vw, 4.2rem);
  line-height: 1.04;
  background: linear-gradient(92deg, var(--text) 55%, var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-masthead .masthead-sub {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
  line-height: 1.55;
  max-width: 62ch;
}
@media (max-width: 720px) {
  .home-masthead { padding-top: 2.2rem; }
}

/* ---------- Cards y paneles: radios suaves, hover sereno ---------- */
.panel, .card, .kpi-tile, .metric-card, .hero-v3-chart, .s21c-item, .topic, .hero-mini {
  border-radius: var(--radius-tile);
}
.kpi-tile, .metric-card {
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
a.metric-card:hover, .kpi-tile:hover {
  border-color: rgba(247, 147, 26, 0.45);
  box-shadow: 0 10px 34px rgba(2, 6, 18, 0.35), 0 0 0 1px rgba(247, 147, 26, 0.12);
}
[data-theme="light"] a.metric-card:hover,
[data-theme="light"] .kpi-tile:hover {
  box-shadow: 0 10px 30px rgba(29, 29, 31, 0.10), 0 0 0 1px rgba(156, 82, 0, 0.14);
}

/* KPI: número primero, aire después */
.kpi-value { font-size: 1.7rem; font-weight: 650; letter-spacing: -0.03em; }
.kpi-label { letter-spacing: 0.09em; font-size: 0.7rem; }
.kpi-tile { padding: 1rem 1.05rem; gap: 0.5rem; }

/* ---------- Secciones: respiración y jerarquía ---------- */
.section { padding: 2.6rem 0 0; }
.section-head { margin-bottom: 1.4rem; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
.section-head p { font-size: 0.98rem; line-height: 1.6; }
.kicker { font-weight: 600; letter-spacing: 0.12em; }
.section-cta {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 140ms ease;
}
.section-cta:hover { opacity: 0.75; color: var(--accent); }

/* ---------- Botones y pills ---------- */
.tf-btn { border-radius: 999px; padding: 6px 13px; }
.theme-toggle { transition: background-color 160ms ease; }
.df-pill, .tile-pill, .s21c-pill, .badge { font-weight: 600; }

/* ---------- Hero chart: lienzo limpio ---------- */
.hero-v3-chart { padding: 20px 20px 16px; }
.hero-chart-price { font-size: 24px; letter-spacing: -0.02em; }

/* ---------- Footer ---------- */
.footer {
  margin-top: 3rem;
  padding: 2rem 0 2.6rem;
  border-top: 1px solid var(--border-soft);
}

/* ---------- Scrollbar discreto (WebKit) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Focus visible coherente ---------- */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
