/* =========================================================
   Quetzal Integrador — hoja de estilos
   Colores tomados del logo
   ========================================================= */
:root {
  --green: #25a45f;
  --green-dark: #137a43;
  --green-deep: #0d4f2c;
  --green-light: #3ecb7a;
  --green-tint: #eaf6ef;
  --red: #e0313f;
  --yellow: #f7b92f;
  --ink: #141414;
  --text: #2b2f2c;
  --muted: #5e6660;
  --line: #dfe5e0;
  --bg: #ffffff;
  --bg-alt: #f6f8f6;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 6px 20px rgba(20, 20, 20, .06);
  --max: 1120px;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p  { margin: 0 0 1em; }
a  { color: var(--green-dark); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: .6em;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .8em 1.4em;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--green-dark); color: #fff; }
.btn-primary:hover { background: var(--green-deep); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--green-deep); }
.btn-light:hover { background: var(--green-tint); }
.btn:focus-visible, .nav a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }


/* ---------- Encabezado ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.brand img { width: 34px; height: auto; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: .45em .8em;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  font-size: .95rem;
}
.nav a:hover { background: var(--green-tint); color: var(--green-deep); }
.nav a.nav-cta { background: var(--green-dark); color: #fff; margin-left: 6px; border-radius: 999px; padding: .45em 1.1em; }
.nav a.nav-cta:hover { background: var(--green-deep); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }

/* ---------- Portada ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 10%, var(--green-tint), transparent 45%),
    var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 64px;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero-logo img { width: 100%; max-width: 540px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; }

.key-facts {
  list-style: none;
  padding: 0;
  margin: 1.6em 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.key-facts li { padding: 12px 16px; border-left: 1px solid var(--line); }
.key-facts li:first-child { border-left: 0; }
.key-facts span { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.key-facts strong { color: var(--ink); font-size: .98rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Secciones ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 32px; }
.section-head h2 { margin-bottom: .15em; }
.section-head p { color: var(--muted); margin: 0; }
.section-mark {
  font-family: "Noto Serif", Georgia, serif;
  font-style: italic;
  font-size: 3.2rem;
  line-height: .9;
  color: var(--green);
  flex-shrink: 0;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card ul { margin: 0; padding-left: 1.15em; }
.card li { margin-bottom: .45em; }
.card li::marker { color: var(--green); }

/* ---------- Bienvenida: video + premios ---------- */
.welcome-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }

/* El marco negro ocupa toda la altura de la fila; el video (1080×618, recortado
   sin las franjas negras del original) se muestra completo, sin cortes */
.video-frame { display: flex; align-items: center; min-width: 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.video { display: block; width: 100%; height: auto; aspect-ratio: 1080 / 618; object-fit: contain; background: #000; }

.prizes {
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--green-deep);
  color: #e4f3ea;
}
.prizes .eyebrow { color: var(--yellow); margin-bottom: .2em; }
.prizes h3 { color: #fff; font-size: 1.5rem; margin-bottom: .45em; }
.prize-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; align-content: center; }
.prize {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  transition: transform .2s ease, background-color .2s ease;
}
.prize:hover { transform: translateX(4px); background: rgba(255, 255, 255, .12); }
.medal {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.prize-1 .medal { background: var(--yellow); }
.prize-2 .medal { background: #c9d1d8; }
.prize-3 .medal { background: #d08a4e; }
.prize-place { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.prize-name { color: #fff; font-size: 1.35rem; line-height: 1.2; }
.prize-extra { display: block; font-size: .85rem; color: var(--yellow); }

/* Animación: los premios bajan uno tras otro al llegar a la sección (lo activa script.js) */
.prizes.reveal-ready .prize { opacity: 0; transform: translateY(-28px); }
.prizes.reveal-ready.is-visible .prize {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .3, 1);
}
.prizes.reveal-ready.is-visible .prize-2 { transition-delay: .18s; }
.prizes.reveal-ready.is-visible .prize-3 { transition-delay: .36s; }
.prizes.reveal-ready.is-visible .prize:hover { transform: translateX(4px); transition-delay: 0s; }

/* ---------- Sede ---------- */
.venue { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; }
.venue-details { margin: 0; padding: 8px 24px; }
.venue-details div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.venue-details div:last-child { border-bottom: 0; }
.venue-details dt { font-weight: 700; color: var(--muted); font-size: .92rem; }
.venue-details dd { margin: 0; color: var(--ink); }
.map { display: flex; padding: 10px; min-height: 320px; }
.map iframe { flex: 1; width: 100%; min-height: 300px; border: 0; border-radius: 10px; }
.map-link { font-size: .9rem; font-weight: 700; }
.muted { color: var(--muted); font-size: .9rem; }

/* ---------- Reglas: documentos ---------- */
.docs { display: grid; gap: 24px; }
.doc { background: #000; color: #fff; border-radius: var(--radius); overflow: hidden; scroll-margin-top: calc(var(--header-h) + 24px); }
/* Las integrales se muestran a la misma escala tipográfica */
.doc-eq { height: 200px; margin: 0 40px; background: no-repeat center; }
.doc-eq-gaussiana { background-image: url("assets/integral-gaussiana.png"); background-size: auto 122px; }
.doc-eq-partes    { background-image: url("assets/integral-por-partes.png"); background-size: auto 115px; }
.doc-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 40px 28px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.doc .eyebrow { color: var(--yellow); margin-bottom: .35em; }
.doc h3 { color: #fff; font-size: 1.3rem; margin: 0; }
.doc .btn { flex-shrink: 0; }

/* ---------- Inscripción ---------- */
.form-card {
  position: relative;
  overflow: hidden;
  padding: 48px 44px;
  border-radius: 20px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.form-card h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.form-card p { max-width: 36em; }
.form-card .btn { position: relative; z-index: 1; }
.deadline { font-size: .95rem; }

.form-card-primary { background: var(--green-dark); color: #e4f3ea; }
.form-card-primary h2 { color: #fff; }
.form-card-primary .eyebrow { color: var(--yellow); }
.form-card-primary .deadline strong { color: #fff; }
.form-card-art {
  position: absolute;
  right: 40px;
  bottom: -60px;
  width: 260px;
  opacity: .16;
  filter: grayscale(1) brightness(3);
  pointer-events: none;
}

/* ---------- Pie ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 40px 0 28px; }
.footer-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 32px; }
.footer-logo { width: 170px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 20px; }
.footer-links a { color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--green-dark); }
/* Botón "Síguenos" (Instagram), en la portada */
.follow {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: .6em 1.1em;
  border-radius: 999px;
  background: var(--green-deep);
  color: #fff;
  text-decoration: none;
  transition: background-color .2s ease;
}
.follow:hover { background: var(--green-dark); }
.follow strong { color: var(--yellow); font-weight: 700; }
.ig-icon { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.ig-icon .ig-dot { fill: currentColor; stroke: none; }
.footer-note { grid-column: 1 / -1; margin: 12px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .prize, .prize:hover { transition: none; transform: none; }
}

/* ---------- Responsivo ---------- */
/* Pantallas medianas: el video ocupa todo el ancho (el marco mide exactamente lo que el
   video, sin franjas negras) y los tres premios quedan en fila debajo */
@media (max-width: 1119px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .prize-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-logo img { max-width: 420px; margin: 0 auto; }
  .venue { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .7em .8em; }
  .nav a.nav-cta { margin: 6px 0 0; text-align: center; }

  .container { padding: 0 16px; }
  .hero { padding: 32px 0 44px; }
  .key-facts { grid-template-columns: 1fr; }
  .key-facts li { border-left: 0; border-top: 1px solid var(--line); }
  .key-facts li:first-child { border-top: 0; }
  .hero-actions .btn { flex: 1 1 100%; }

  .section { padding: 52px 0; }
  .section-mark { font-size: 2.5rem; }
  .prize-list { grid-template-columns: 1fr; }
  .doc-eq { height: 130px; margin: 0 18px; }
  .doc-eq-gaussiana { background-size: auto 91px; }
  .doc-eq-partes    { background-size: contain; background-size: min(100%, 341px) auto; }
  .doc-body { flex-direction: column; align-items: stretch; text-align: center; gap: 18px; padding: 20px 22px 24px; }
  .doc h3 { font-size: 1.15rem; }
  .venue-details { padding: 4px 18px; }
  .venue-details div { grid-template-columns: 1fr; gap: 2px; }
  .form-card { padding: 30px 22px; }
  .form-card-art { right: -30px; width: 170px; }
  .form-card .btn { width: 100%; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
