/* ============================================================
   Hanblecheya — Sistema visual (Material Design 3 · café cálido)
   Tokens del UI Kit oficial. Light + Dark.
   ============================================================ */

:root {
  /* Paleta base (UI Kit) */
  --primary: #3E2723;          /* Café tostado profundo */
  --primary-hover: #2C1A16;
  --secondary: #D7CCC8;        /* Arena cálida */
  --surface: #FAF9F6;          /* Crema (fondo general) */
  --surface-variant: #F5F2EB;  /* Humo de café (cards/paneles) */
  --on-primary: #FFFFFF;
  --on-surface: #212121;       /* Carbón atenuado */
  --on-surface-muted: rgba(33, 33, 33, 0.66);
  --outline: rgba(141, 153, 174, 0.30);  /* Salvia 30% */
  --outline-strong: rgba(141, 153, 174, 0.55);
  --sage: #8D99AE;

  /* Acentos funcionales (derivados, coherentes con la calidez) */
  --accent: #C08A4B;           /* Dorado tostado (highlights, progreso) */
  --accent-soft: #EFE2CE;
  --success: #5B7C5A;          /* Verde salvia seca */
  --success-soft: #E4ECE2;
  --live: #C0563B;             /* Terracota (estado en vivo) */

  /* Tipografía */
  --font-display: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --font-body: "Inter", "Roboto", system-ui, sans-serif;

  /* Formas */
  --r-pill: 100px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;

  /* Elevación mínima (M3: color sobre sombra) */
  --shadow-hover: 0 6px 20px rgba(62, 39, 35, 0.08);
  --shadow-card: 0 2px 10px rgba(62, 39, 35, 0.04);
}

[data-theme="dark"] {
  --primary: #E9DFD7;          /* En dark, el café se invierte a crema */
  --primary-hover: #FFFFFF;
  --secondary: #3A302B;
  --surface: #17120F;          /* Espresso muy oscuro */
  --surface-variant: #211A16;
  --on-primary: #2C1A16;       /* Texto oscuro sobre botón crema */
  --on-surface: #EDE6E0;
  --on-surface-muted: rgba(237, 230, 224, 0.62);
  --outline: rgba(141, 153, 174, 0.22);
  --outline-strong: rgba(141, 153, 174, 0.40);
  --accent: #D9A864;
  --accent-soft: #2E2419;
  --success: #8DB08B;
  --success-soft: #20281F;
  --live: #E07C5E;
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.40);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Botones ---------- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: none;
  border-radius: var(--r-pill);
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--on-surface); border: 1px solid var(--outline-strong); }
.btn-ghost:hover { background: var(--secondary); }
.btn-soft { background: var(--secondary); color: var(--primary); }
.btn-soft:hover { filter: brightness(0.96); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--secondary); color: var(--primary);
  border-radius: var(--r-pill); padding: 5px 13px;
  font-size: 12px; font-weight: 500;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-live { background: transparent; color: var(--live); padding-left: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot-pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(.85);} }

/* ---------- Cards (anatomía UI Kit) ---------- */
.card {
  background: var(--surface-variant);
  border-radius: var(--r-md);
  padding: 20px;
  border: 1px solid transparent;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.card-outline { background: var(--surface); border: 1px solid var(--outline); }
.card:hover { box-shadow: var(--shadow-hover); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--outline);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 14px; color: var(--on-surface-muted); font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--on-surface); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--outline);
  background: transparent; color: var(--on-surface); cursor: pointer;
  display: grid; place-items: center; font-size: 17px; transition: background .15s;
}
.icon-btn:hover { background: var(--secondary); }

/* ---------- Utilidades ---------- */
.muted { color: var(--on-surface-muted); }
.grid { display: grid; gap: 16px; }
.section { padding: 72px 0; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .section { padding: 48px 0; }
}
