/* mesa.hipix.cl: misma línea gráfica que hipix.cl (Sora, navy, naranja, crema). */
:root {
  --navy: #152846;
  --navy-dark: #0f2342;
  --orange: #dc5b1d;
  --orange-text: #b74b1d;
  --bright: #f3a14a;
  --teal: #2f6f73;
  --slate: #556a82;
  --purple: #7a4fa3;
  --text: #152846;
  --text-soft: #2c4361;
  --muted: #556a82;
  --bg: #f8f2e9;
  --surface: #fffdf9;
  --soft: #fffaf4;
  --border: #ecd8c4;
  --line: #f1e3d4;
  --radius: 18px;
  --shadow: 0 14px 28px rgba(21, 40, 69, 0.08);
  --gradient: linear-gradient(135deg, #dc5b1d, #f3a14a);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: Sora, 'Segoe UI', Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--orange-text); }
a:hover { color: var(--orange); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button { font: inherit; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: 28px; }
.center { text-align: center; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { font-size: 13px; color: var(--muted); text-align: center; }
.state { text-align: center; color: var(--muted); padding: 32px 0; }
.loader { display: flex; justify-content: center; padding: 40px 0; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(220, 91, 29, 0.18); border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- botones y etiquetas ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 999px;
  font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 10px 22px rgba(220, 91, 29, 0.28); }
.btn-primary:hover { color: #fff; }
.btn-ghost { background: rgba(255, 250, 241, 0.86); border-color: rgba(21, 40, 69, 0.3); color: var(--navy); }
.btn-ghost:hover { color: var(--navy); }
.btn-outline-light { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn-outline-light:hover { color: #fff; }
.btn-sm { min-height: 44px; padding: 10px 20px; }
.label-short { display: none; }
.btn-center { display: flex; width: fit-content; margin: 0 auto; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.actions-center { justify-content: center; }

.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pills-left { justify-content: flex-start; }
.pill {
  min-height: 44px; padding: 10px 18px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600;
  border: 1px solid rgba(21, 40, 69, 0.24); background: rgba(255, 252, 247, 0.92); color: var(--navy);
}
.pill.is-active { background: var(--gradient); border-color: var(--orange); color: #fff; }
.pill-dark.is-active { background: var(--navy); border-color: var(--navy); }

.tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tag-agree { background: rgba(21, 40, 69, 0.08); color: var(--navy); }
.tag-divided { background: rgba(220, 91, 29, 0.12); color: var(--orange-text); }
.tag-top { margin-left: auto; letter-spacing: 0; text-transform: none; font-size: 12px; font-weight: 700; padding: 2px 10px; }
.tag-top-high { background: #1f7a4d; color: #fff; }
.tag-top-mid { background: #f5c542; color: #4a3a00; }
.tag-top-none { background: rgba(21, 40, 69, 0.07); color: var(--muted); font-weight: 600; }

.chip { flex-shrink: 0; font-size: 12px; font-weight: 700; color: #fff; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip-1 { background: var(--orange-text); }
.chip-2 { background: var(--navy); }
.chip-3 { background: var(--teal); }
.chip-4 { background: var(--slate); }
.chip-rest { background: rgba(21, 40, 69, 0.07); color: var(--muted); font-weight: 600; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.num {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background-color: var(--navy); color: #fff;
  /* Volumen suave, como el mandil de la app (SaddleBadge). */
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(0, 0, 0, 0.12) 100%);
  font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.rank { width: 22px; font-size: 12px; color: var(--muted); text-align: right; flex-shrink: 0; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--orange-text); }
.eyebrow { letter-spacing: 0.35em; text-transform: uppercase; font-size: 12px; color: rgba(21, 40, 69, 0.75); }
.eyebrow-light { color: var(--bright); letter-spacing: 0.18em; }
.muted-light { color: #c9d3e0; max-width: 56ch; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 249, 241, 0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 40, 69, 0.1); box-shadow: 0 8px 20px rgba(21, 40, 69, 0.08);
}
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { height: 38px; width: auto; }
.brand-tag { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--orange-text); border-left: 1px solid var(--border); padding-left: 12px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; font-size: 15px; flex-shrink: 0; }
.nav-links a:not(.btn) { color: var(--navy); text-decoration: none; }
.nav-links a:not(.btn):hover { color: var(--orange); }

/* ---------- hero (como hipix.cl: imagen de fondo, texto a la izquierda) ---------- */
.hero { position: relative; overflow: hidden; background: #f8ecdb; min-height: 620px; display: flex; align-items: center; }
.hero-media { position: absolute; top: 0; right: 0; width: 74%; height: 100%; object-fit: cover; object-position: 100% 45%; }
/* La ilustración ya trae el lado izquierdo despejado en crema: el degradé la funde con el fondo del texto. */
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(248, 236, 219, 1) 0%, rgba(248, 236, 219, 0.96) 34%, rgba(248, 236, 219, 0.7) 42%, rgba(248, 236, 219, 0) 52%);
}
.hero-content { position: relative; padding-top: 88px; padding-bottom: 96px; }
.hero-copy { max-width: 470px; display: flex; flex-direction: column; gap: 16px; }
.hero h1 { font-size: clamp(36px, 4.4vw, 56px); font-weight: 700; letter-spacing: -0.01em; }
.hero-subtitle { font-size: clamp(17px, 1.6vw, 21px); color: #445d78; }
.hero-note { color: #526a84; }
.hero-note strong { color: var(--orange-text); }

/* ---------- secciones ---------- */
.section { padding: 88px 0; }
.section-soft { background: var(--soft); }
.section-warm { background: linear-gradient(180deg, #fff7ec 0%, #f6ece2 100%); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h2 { color: #fff; }
.section-head { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.section-head p { max-width: 60ch; color: var(--muted); }
h2 { font-size: clamp(27px, 2.4vw, 38px); }

/* personajes */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; }
.persona {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center;
}
.persona h3 { font-size: 22px; }
.persona p { font-size: 15px; color: #445d78; }
.persona .persona-role { font-size: 14px; color: var(--muted); margin-top: -8px; }
.persona .quote { font-weight: 600; color: var(--orange-text); }
.badge { position: absolute; top: 16px; right: 16px; padding: 4px 10px; border-radius: 999px; background: rgba(220, 91, 29, 0.12); color: var(--orange-text); font-size: 11px; font-weight: 600; }

.avatar {
  width: 120px; height: 120px; flex-shrink: 0; border-radius: 50%; border: 4px solid #fff;
  box-shadow: 0 12px 24px rgba(21, 40, 69, 0.16); background-repeat: no-repeat;
}
.avatar-sm { width: 72px; height: 72px; border-width: 3px; }
.avatar-hipix { background-image: url(../assets/personajes/hipix_index.webp), linear-gradient(160deg, #fde3cc, #f6c39b); background-size: 112% auto, cover; background-position: 40% 2%, center; }
.avatar-tomas { background-image: url(../assets/personajes/tomas.webp), linear-gradient(160deg, #e3e8f0, #c3cee0); background-size: 112% auto, cover; background-position: 45% 6%, center; }
.avatar-laura { background-image: url(../assets/personajes/laura.webp), linear-gradient(160deg, #ece2f3, #d4c2e6); background-size: 118% auto, cover; background-position: 60% 8%, center; }

/* resultados */
.reunion-title { text-align: center; color: var(--muted); margin-bottom: 18px; }
.reunion-title strong { color: var(--navy); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 10px; }
.summary-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: #445d78; box-shadow: 0 10px 22px rgba(21, 40, 69, 0.06);
}
.summary-card strong { color: var(--navy); font-size: 18px; }
.stat-pct { display: inline-block; margin: 0 4px 0 6px; padding: 1px 7px; border-radius: 999px; background: rgba(21, 40, 69, 0.07); color: var(--navy); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.col-title { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.summary-card .col-title { font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--navy); font-weight: 700; }

.races { display: flex; flex-direction: column; gap: 16px; margin: 22px 0 18px; }
/* Una carrera a la vez. */
.slider { margin: 22px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.slide-nav { display: flex; align-items: center; gap: 8px; }
.slide-arrow {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(21, 40, 69, 0.24);
  background: var(--surface); color: var(--navy); font-size: 26px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding-bottom: 3px;
}
.slide-arrow:disabled { opacity: 0.35; cursor: default; }
.race-chips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; justify-content: safe center; }
.race-chips::-webkit-scrollbar { display: none; }
.race-chip {
  flex-shrink: 0; min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(21, 40, 69, 0.18);
  background: var(--surface); color: var(--navy); font-weight: 700; font-size: 14px; cursor: pointer;
}
.race-chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.slide-count { text-align: center; font-size: 13px; color: var(--muted); }
.race { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.race-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbf4ea;
}
.race-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.race-title h3 { font-size: 19px; }
.race-empty { padding: 16px 20px; }
.result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.col { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.col-mesa { background: rgba(220, 91, 29, 0.05); }
.pick { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* La 1ª opción, separada del resto con una línea. */
.col .pick:first-of-type { padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
/* Aciertos y no aciertos de un vistazo. */
.pick-won { background: rgba(220, 91, 29, 0.09); border-radius: 10px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.col .pick-won:first-of-type { padding-top: 4px; }
.pick-miss .num { opacity: 0.45; }
.pick-miss .pick-name { color: #8a99ab; font-weight: 500; }
.legend { margin-top: 14px; }
.legend strong { color: var(--navy); }
.pills-filter { margin-top: 18px; }
.filter-note { margin-top: 14px; }
.pills-filter .pill { min-height: 38px; padding: 7px 14px; font-size: 13px; }
.pick-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols-cards { gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.cols-cards .col { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.cols-cards .col-mesa { background: rgba(220, 91, 29, 0.06); border: 2px solid rgba(220, 91, 29, 0.55); }
/* La Mesa (el consenso) en un recuadro naranjo, para distinguirla de los tres integrantes. */
.cols .col-mesa { outline: 2px solid rgba(220, 91, 29, 0.55); outline-offset: -7px; border-radius: 16px; background: rgba(220, 91, 29, 0.06); background-clip: padding-box; }
.col-mesa .col-title { color: var(--orange-text); }

/* estudio liberado */
.study { background: #fffdf8; border: 1px solid var(--border); border-radius: 24px; box-shadow: 0 18px 34px rgba(21, 40, 69, 0.1); overflow: hidden; }
.study-head { padding: 24px 26px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; }
.study-head > div { display: flex; flex-direction: column; gap: 4px; }
.study-title { font-size: 24px; }
.study-block { padding: 24px 26px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); }
.study-block:last-child { border-bottom: 0; align-items: flex-start; }
.study-block h4 { font-size: 17px; }
.block-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.lead { font-size: 15px; color: var(--text-soft); max-width: 75ch; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.mini-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-soft); }
.mini-title { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); font-size: 15px; }
.signals { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.plus { color: var(--teal); }
.minus { color: var(--orange-text); }
.watch { background: rgba(220, 91, 29, 0.08); border: 1px solid rgba(220, 91, 29, 0.25); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-soft); }
.voice { display: flex; gap: 18px; align-items: flex-start; }
.voice > div:last-child { display: flex; flex-direction: column; gap: 6px; color: var(--text-soft); font-size: 15px; }
.voice-name { font-weight: 700; font-size: 17px; color: var(--navy); }
.empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* método */
.cards-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.step { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); padding: 24px; box-shadow: 0 10px 22px rgba(21, 40, 69, 0.06); display: flex; flex-direction: column; gap: 10px; }
.step h3 { font-size: 17px; }
.step p { font-size: 14px; color: var(--muted); }
.step-n { width: 44px; height: 44px; border-radius: 14px; background: rgba(220, 91, 29, 0.14); color: var(--orange-text); font-weight: 700; display: flex; align-items: center; justify-content: center; }

.site-footer { background: var(--navy-dark); color: #c9d3e0; font-size: 13px; }
.site-footer a { color: #c9d3e0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding-top: 28px; padding-bottom: 28px; }

/* ---------- celular ---------- */
@media (max-width: 767px) {
  .container { padding: 0 16px; }
  .site-header { background: #fff9f1; backdrop-filter: none; box-shadow: 0 4px 12px rgba(21, 40, 69, 0.08); }
  /* Como hipix.cl: más aire arriba y abajo del encabezado. */
  .nav { flex-wrap: nowrap; padding-top: 15px; padding-bottom: 15px; }
  .nav-links a:not(.btn) { display: none; }
  .brand { gap: 10px; }
  .brand img { height: 34px; }
  .brand-tag { font-size: 11px; letter-spacing: 0.14em; padding-left: 10px; white-space: nowrap; }
  .site-header .btn-sm { white-space: nowrap; padding: 10px 16px; font-size: 14px; min-height: 42px; }

  /* Como hipix.cl en el celular: la imagen arriba, con un desvanecido abajo, y el texto en una tarjeta que la monta. */
  .hero { display: block; min-height: 0; background: #fff8ef; }
  /* Más cerca de los personajes (como hipix.cl, que agranda la imagen y la corre a la derecha). */
  .hero-media { position: relative; inset: auto; width: 150%; max-width: none; margin-left: -46%; height: clamp(250px, 70vw, 340px); object-position: 70% 42%; }
  .hero-overlay { inset: auto 0 auto 0; top: calc(clamp(250px, 70vw, 340px) - 90px); height: 90px; background: linear-gradient(180deg, rgba(255, 248, 239, 0) 0%, #fff8ef 100%); }
    .hero-content { margin-top: -2.5rem; padding-top: 0; padding-bottom: 32px; }
  .hero-copy {
    max-width: none; gap: 12px; padding: 22px 20px 20px; border-radius: 20px;
    background: #fffaf3; border: 1px solid rgba(236, 216, 196, 0.82); box-shadow: 0 14px 34px rgba(19, 39, 70, 0.12);
  }
  .hero .eyebrow { letter-spacing: 0.24em; font-size: 11px; }
  .hero h1 { font-size: clamp(1.72rem, 8.2vw, 2.2rem); line-height: 1.06; color: #0f2544; }
  .hero-subtitle { font-size: clamp(0.96rem, 4.6vw, 1.1rem); line-height: 1.38; color: #294b6f; }
  .hero-note { font-size: clamp(0.86rem, 4.1vw, 1rem); color: #31506f; }
  .hero .actions { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
  .hero .actions .btn { width: 100%; min-height: 50px; padding: 12px 18px; font-size: 1rem; white-space: nowrap; }
  .section { padding: 56px 0; }
  .race-head, .col, .study-head, .study-block { padding-left: 16px; padding-right: 16px; }
  .voice { flex-direction: column; }
}

/* Celulares angostos (≤ 400 px): logo, "La mesa" y el botón más cortos para que no se monten. */
@media (max-width: 400px) {
  .nav { gap: 8px; }
  .brand { gap: 8px; }
  .brand img { height: 28px; }
  .brand-tag { font-size: 10px; letter-spacing: 0.1em; padding-left: 8px; }
  .site-header .btn-sm { padding: 9px 14px; }
  .label-long { display: none; }
  .label-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 2.4s; }
  .btn { transition: none; }
}
