:root {
  --rojo: #DA291C;
  --amarillo: #FFC72C;
  --texto: #27251F;
  --fondo: #FFF8EC;
  --superficie: #FFFFFF;
  --suave: rgba(39, 37, 31, .64);
  --linea: rgba(39, 37, 31, .08);
  --radio: 28px;
  --radio-s: 16px;
  --sombra: 0 1px 2px rgba(39, 37, 31, .04), 0 12px 32px rgba(39, 37, 31, .07);
  --ancho: 1120px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--texto);
  background: var(--fondo);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.025em; line-height: 1.04; margin: 0; }
h1 { font-size: clamp(44px, 7.4vw, 92px); }
h2 { font-size: clamp(34px, 5vw, 60px); }
h3 { font-size: 24px; letter-spacing: -0.015em; line-height: 1.15; }
p { margin: 0; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--texto); color: #fff; padding: 10px 16px; border-radius: 12px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--ancho), 100% - 32px); margin-inline: auto; }

/* Encabezado */
.top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--fondo) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--linea);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 999px; color: var(--suave);
  transition: background .2s, color .2s;
}
.nav a:hover { color: var(--texto); background: var(--linea); }
.nav a[aria-current="page"] { color: var(--texto); font-weight: 700; }
.menu-btn { display: none; background: none; border: 0; padding: 10px; border-radius: 12px; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--texto); margin: 4px 0; border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; gap: 0;
    background: var(--fondo); border-bottom: 1px solid var(--linea); padding: 8px 16px 16px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 19px; padding: 12px 4px; border-radius: 0; border-bottom: 1px solid var(--linea); }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* Secciones */
main { display: block; }
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section + .section { padding-top: 0; }
.center { text-align: center; }
.lead { font-size: clamp(19px, 2.2vw, 24px); color: var(--suave); line-height: 1.45; max-width: 640px; }
.center .lead { margin-inline: auto; }
.section-head { margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .lead { margin-top: 16px; }

/* Héroe */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 96px); text-align: center; }
.hero h1 { max-width: 12ch; margin-inline: auto; }
.hero .lead { margin: 22px auto 0; }
.hero .sub { font-size: clamp(22px, 3vw, 32px); font-weight: 700; color: var(--rojo); margin-top: 14px; letter-spacing: -0.015em; }
.hero-media { margin: clamp(40px, 6vw, 64px) auto 0; max-width: 980px; }
.hero-media img, .media img { width: 100%; border-radius: var(--radio); box-shadow: var(--sombra); }
.hero-logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 28px; box-shadow: var(--sombra); }

.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 26px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--rojo); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--rojo) 88%, #000); }
.btn-dark { background: var(--texto); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-light { background: var(--superficie); color: var(--texto); box-shadow: var(--sombra); }
.btn-yellow { background: var(--amarillo); color: var(--texto); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 15px; }

/* Tarjetas */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--superficie); border-radius: var(--radio); padding: 32px;
  box-shadow: var(--sombra);
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--suave); }
.card .num { font-size: 15px; font-weight: 800; color: var(--rojo); margin-bottom: 18px; display: block; }

.link-card {
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden; padding: 0;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  cursor: pointer; text-align: left; border: 0; width: 100%;
}
.link-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(39,37,31,.05), 0 24px 48px rgba(39,37,31,.12); }
.link-card .cover { aspect-ratio: 16 / 10; background: var(--rojo); overflow: hidden; display: grid; place-items: center; }
.link-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.link-card:hover .cover img { transform: scale(1.04); }
.link-card .cover.icon img { width: 72px; height: 72px; object-fit: contain; border-radius: 18px; background: #fff; padding: 8px; }
.link-card .body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.link-card .body p { color: var(--suave); font-size: 16px; }
.link-card .domain { margin-top: auto; padding-top: 10px; font-size: 14px; color: var(--suave); display: flex; align-items: center; gap: 6px; }
.link-card .domain::after { content: "→"; margin-left: auto; font-size: 18px; color: var(--texto); transition: transform .3s var(--ease); }
.link-card:hover .domain::after { transform: translateX(4px); }
.group + .group { margin-top: clamp(48px, 7vw, 80px); }
.group-title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 24px; }

/* Bloques */
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split h1, .split h2 { margin-bottom: 18px; }
.split .sub { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; color: var(--rojo); margin-bottom: 16px; letter-spacing: -0.015em; line-height: 1.2; }
.split .lead + .actions, .split .lead + .credit { margin-top: 28px; }
.split .actions { justify-content: flex-start; }
.credit { font-size: 15px; color: var(--suave); }

.banner {
  background: var(--rojo); color: #fff; border-radius: calc(var(--radio) + 8px);
  padding: clamp(48px, 8vw, 96px) clamp(24px, 6vw, 80px); text-align: center;
}
.banner h2 { color: #fff; max-width: 16ch; margin-inline: auto; }
.banner p { color: rgba(255, 255, 255, .86); font-size: clamp(18px, 2vw, 22px); margin: 18px auto 0; max-width: 560px; }
.banner .accent { color: var(--amarillo); }

/* Redes y QR */
.social { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 32px 24px; }
.social .qr { width: 100%; max-width: 220px; aspect-ratio: 1; background: #fff; border-radius: var(--radio-s); padding: 10px; }
.social .qr svg { width: 100%; height: 100%; display: block; }
.social .handle { color: var(--suave); font-size: 15px; word-break: break-all; }
.social .dl { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.note { margin-top: 32px; color: var(--suave); font-size: 16px; text-align: center; }
.qr-site { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center; }
.qr-site .qr { width: 200px; height: 200px; background: #fff; border-radius: var(--radio-s); padding: 10px; }
.qr-site .qr svg { width: 100%; height: 100%; }
@media (max-width: 620px) { .qr-site { grid-template-columns: 1fr; justify-items: center; text-align: center; } .qr-site .actions { justify-content: center; } }

/* Piezas gráficas */
.piezas { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .piezas { grid-template-columns: repeat(2, 1fr); } }
.pieza { padding: 0; overflow: hidden; aspect-ratio: 4 / 5; transition: transform .35s var(--ease); }
.pieza:hover { transform: translateY(-4px); }
.pieza img { width: 100%; height: 100%; object-fit: cover; }

/* Video */
.video-wrap { max-width: 380px; margin-inline: auto; }
.videos { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.videos .video-wrap { flex: 1 1 300px; margin: 0; display: grid; gap: 14px; justify-items: center; }
.video-wrap iframe { width: 100%; aspect-ratio: 9 / 16; border: 0; border-radius: var(--radio); box-shadow: var(--sombra); background: #000; }
.video-wrap video { width: 100%; border-radius: var(--radio); box-shadow: var(--sombra); background: #000; aspect-ratio: 9 / 16; object-fit: cover; }

/* Pie */
.foot { padding: 48px 0 56px; color: var(--suave); font-size: 14px; border-top: 1px solid var(--linea); margin-top: 40px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.foot strong { color: var(--texto); }

/* Animación de entrada */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .link-card, .link-card .cover img { transition: none; }
}

/* Navegador interno */
.visor { position: fixed; inset: 0; z-index: 90; background: #111; display: flex; flex-direction: column; }
.visor[hidden] { display: none; }
.visor-bar {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #1c1b18; color: #fff;
  padding-top: max(8px, env(safe-area-inset-top));
}
.visor-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.visor-bar button, .visor-bar a {
  background: rgba(255, 255, 255, .1); border: 0; color: #fff; border-radius: 10px; min-height: 38px; padding: 0 12px;
  font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.visor-bar button:hover, .visor-bar a:hover { background: rgba(255, 255, 255, .2); }
.visor-body { flex: 1; position: relative; background: #fff; }
.visor-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.visor-fallback {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--texto); color: #fff; border-radius: 18px; padding: 14px 16px 14px 20px;
  display: flex; gap: 14px; align-items: center; box-shadow: 0 12px 40px rgba(0,0,0,.3); width: max-content; max-width: calc(100% - 32px);
}
.visor-fallback[hidden] { display: none; }
.visor-fallback p { font-size: 15px; }
@media (max-width: 620px) { .visor-bar .lbl { display: none; } .visor-fallback { flex-direction: column; text-align: center; } }

/* Ficha modal */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(20, 18, 14, .5); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--superficie); border-radius: var(--radio); padding: 32px; width: min(560px, 100%); max-height: 90vh; overflow: auto; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; border: 0; background: var(--linea); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.ficha dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; margin: 20px 0 0; font-size: 16px; }
.ficha dt { color: var(--suave); }
.ficha dd { margin: 0; white-space: pre-wrap; }

/* Calendario */
.cal-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav strong { font-size: 24px; min-width: 200px; text-align: center; }
.icon-btn { border: 0; background: var(--superficie); box-shadow: var(--sombra); width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters select, .field select, .field input, .field textarea {
  font: inherit; font-size: 15px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--linea); background: var(--superficie); color: var(--texto);
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 13px; color: var(--suave); text-align: center; padding: 6px 0; font-weight: 700; }
.cal-day { background: var(--superficie); border-radius: 14px; min-height: 112px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.out { background: transparent; }
.cal-day.today .n { background: var(--rojo); color: #fff; }
.cal-day .n { font-size: 13px; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.chip {
  border: 0; text-align: left; font-size: 12px; line-height: 1.25; padding: 5px 8px; border-radius: 8px; color: #fff; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
@media (max-width: 700px) {
  .cal-day { min-height: 64px; padding: 4px; }
  .chip { font-size: 0; padding: 0; height: 8px; border-radius: 4px; }
  .cal-nav strong { min-width: 0; font-size: 20px; }
}
.summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }
.summary .card { padding: 18px 22px; display: flex; align-items: center; gap: 12px; }
.summary b { font-size: 28px; }
.table-wrap { overflow-x: auto; background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-size: 13px; color: var(--suave); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--fondo); }
.empty { text-align: center; color: var(--suave); padding: 40px 16px; }

/* Hoja de QR para imprimir */
.hoja { display: none; }
@media print {
  .top, .foot, .no-print, .visor, .modal { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .reveal { opacity: 1; transform: none; }
  .card, .table-wrap { box-shadow: none; border: 1px solid #ddd; }
  body.printing-hoja main > :not(.hoja) { display: none !important; }
  body.printing-hoja .hoja { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .hoja .item { text-align: center; break-inside: avoid; border: 1px solid #ddd; border-radius: 12px; padding: 12px; }
  .hoja svg { width: 100%; height: auto; }
  .hoja h3 { font-size: 13pt; margin-top: 6px; }
  .hoja p { font-size: 9pt; color: #555; word-break: break-all; }
  .cal-day { min-height: 90px; border: 1px solid #eee; }
  .chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
