/* ==========================================================================
   El Mejor del Instituto — landing page
   Design language: the game's own hand-drawn comic badges set the palette.
   Chalkboard green for the "class in session" sections, ruled notebook
   paper for the study sections, sticker-style mode cards with a slight tilt.
   ========================================================================== */

:root {
  --ink: #1F2A22;
  --ink-soft: #4A5A4E;
  --paper: #F7F2DE;
  --paper-alt: #EFE7C8;
  --board: #1E4638;
  --board-2: #274F40;
  --chalk: #F2EFE1;
  --red: #E0473A;
  --red-dark: #B93327;
  --blue: #2E6FBD;
  --yellow: #F2B705;
  --orange: #E8752D;
  --line-on-dark: rgba(242, 239, 225, 0.18);
  --line-on-dark-soft: rgba(242, 239, 225, 0.09);
  --line-on-light: rgba(31, 42, 34, 0.16);
  --rule-line: rgba(31, 42, 34, 0.09);

  --font-display: "Luckiest Guy", "Bungee", cursive;
  --font-body: "Poppins", "Helvetica Neue", Arial, sans-serif;

  --max-w: 1120px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.01em;
}

h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.25rem; }

p { margin: 0; font-family: var(--font-body); }

.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 46ch; }

.eyebrow { font-family: var(--font-body); font-size: 0.85rem; color: var(--red); font-weight: 700; text-transform: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--board); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* -------------------------------------------------------------------- */
/* Nav                                                                   */
/* -------------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247, 242, 222, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line-on-light);
}

.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 20px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand span { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); line-height: 1; }

.nav-links { display: flex; align-items: center; gap: 26px; font-size: 0.95rem; font-weight: 600; }
.nav-links a { text-decoration: none; color: var(--ink-soft); border-bottom: 2px solid transparent; padding-bottom: 2px; }
.nav-links a:hover { color: var(--ink); border-color: var(--red); }

.lang-switch {
  display: flex; border: 2px solid var(--ink); border-radius: var(--radius-sm);
  overflow: hidden; font-size: 0.8rem; font-weight: 800;
}
.lang-switch a { padding: 6px 10px; text-decoration: none; color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }

.nav-cta {
  background: var(--red); color: #fff; padding: 10px 18px;
  border-radius: var(--radius-sm); text-decoration: none; font-weight: 700; font-size: 0.9rem;
  white-space: nowrap; border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.nav-cta:hover { background: var(--red-dark); }

/* -------------------------------------------------------------------- */
/* Hero                                                                  */
/* -------------------------------------------------------------------- */

.hero { position: relative; background: var(--board); color: var(--chalk); overflow: hidden; }

.hero-doodles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-doodles .chalk-line { stroke: var(--line-on-dark-soft); stroke-width: 1.4; fill: none; }
.hero-doodles .chalk-line-accent { stroke: rgba(242, 183, 5, 0.35); stroke-width: 1.8; fill: none; }

.hero-inner {
  position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: 36px; align-items: center; padding: 76px 0 68px;
}

.hero-copy .eyebrow { color: #F0C069; }

.hero h1 { font-size: clamp(2.4rem, 5.4vw, 3.8rem); margin: 12px 0 20px; color: var(--chalk); }
.hero h1 .accent { color: var(--yellow); }

.hero .lede { color: rgba(242, 239, 225, 0.85); font-size: 1.12rem; max-width: 44ch; }

.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.store-badge img { height: 54px; width: auto; }

.secondary-link {
  text-decoration: none; color: var(--chalk); font-weight: 700; font-size: 0.95rem;
  border-bottom: 2px solid rgba(242,239,225,0.4); padding-bottom: 3px;
}
.secondary-link:hover { border-color: var(--yellow); color: var(--yellow); }

.hero-meta { display: flex; gap: 24px; margin-top: 34px; padding-top: 20px; border-top: 1px dashed var(--line-on-dark); flex-wrap: wrap; }
.hero-meta-item { font-size: 0.85rem; color: rgba(242,239,225,0.78); }
.hero-meta-item strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--chalk); font-weight: 400; }

.hero-visual { position: relative; display: flex; justify-content: center; align-items: flex-end; }
.moni-hero { width: 220px; filter: drop-shadow(0 12px 22px rgba(0,0,0,0.35)); }

.speech-bubble {
  position: absolute; top: 4%; right: 4%;
  background: var(--chalk); color: var(--ink);
  font-family: var(--font-display); font-weight: 400; font-size: 0.95rem;
  padding: 12px 16px; border-radius: 18px; border: 3px solid var(--ink);
  max-width: 170px; text-align: center; line-height: 1.2;
}
.speech-bubble::after {
  content: ""; position: absolute; bottom: -14px; left: 30px;
  border-width: 14px 10px 0 0; border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}
.speech-bubble::before {
  content: ""; position: absolute; bottom: -9px; left: 33px;
  border-width: 11px 8px 0 0; border-style: solid;
  border-color: var(--chalk) transparent transparent transparent;
  z-index: 1;
}

/* -------------------------------------------------------------------- */
/* Sections generic                                                     */
/* -------------------------------------------------------------------- */

section { padding: 80px 0; }
.section-head { max-width: 62ch; margin-bottom: 44px; }
.section-head h2 { margin-top: 8px; }

.ruled {
  background-image: repeating-linear-gradient(
    to bottom, transparent, transparent 34px, var(--rule-line) 34px, var(--rule-line) 35px
  );
}
.bg-alt { background: var(--paper-alt); }
.bg-board { background: var(--board); color: var(--chalk); }
.bg-board .eyebrow { color: #F0C069; }
.bg-board h2 { color: var(--chalk); }

/* Stats strip */

.stats-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-on-light); border: 1px solid var(--line-on-light);
  margin-top: 8px;
}
.stat-box { background: var(--paper); padding: 26px; text-align: center; }
.stat-box strong { display: block; font-family: var(--font-display); font-size: 2.2rem; color: var(--red); font-weight: 400; }
.stat-box span { font-size: 0.9rem; color: var(--ink-soft); }

/* Game mode cards */

.modes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.mode-card {
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px;
  padding: 20px 18px 22px; text-align: center;
  box-shadow: 5px 5px 0 var(--line-on-light);
}
.mode-card:nth-child(1) { transform: rotate(-1.4deg); }
.mode-card:nth-child(2) { transform: rotate(1.1deg); }
.mode-card:nth-child(3) { transform: rotate(-0.8deg); }
.mode-card:nth-child(4) { transform: rotate(1.4deg); }
.mode-card img { height: 62px; width: auto; margin: 0 auto 14px; }
.mode-card p { color: var(--ink-soft); font-size: 0.92rem; }

/* Categories */

.category-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.category-pill {
  background: var(--board-2); border: 1px solid var(--line-on-dark);
  color: var(--chalk); padding: 8px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
}

/* Versus section */

.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.versus-side { text-align: center; }
.versus-side img { max-height: 220px; margin: 0 auto 14px; }
.versus-side h3 { margin-bottom: 6px; }
.versus-side p { color: var(--ink-soft); font-size: 0.92rem; max-width: 26ch; margin: 0 auto; }
.versus-vs {
  font-family: var(--font-display); font-size: 2.6rem; color: var(--red);
  border: 4px solid var(--ink); border-radius: 50%; width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center; background: var(--yellow);
  transform: rotate(-6deg);
}

/* Screenshots */

.screens { display: flex; gap: 20px; overflow-x: auto; padding: 6px 6px 20px; scroll-snap-type: x mandatory; margin: 0 -6px; }
.screens img { scroll-snap-align: start; flex: none; width: 200px; border-radius: 16px; border: 3px solid var(--ink); }

/* Audience row */

.audience { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.audience-item { text-align: left; padding: 22px 0; border-top: 1px solid var(--line-on-light); }
.audience-item svg { margin-bottom: 14px; }
.audience-item h3 { font-size: 1.02rem; margin-bottom: 6px; font-family: var(--font-body); font-weight: 700; }
.audience-item p { color: var(--ink-soft); font-size: 0.92rem; }

/* FAQ */

.faq { max-width: 760px; }
.faq-item { border-top: 1px solid var(--line-on-light); padding: 22px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--line-on-light); }
.faq-item summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 400; font-size: 1.15rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { flex: none; width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 50%; position: relative; }
.faq-item summary .plus::before, .faq-item summary .plus::after {
  content: ""; position: absolute; background: var(--ink); top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.faq-item summary .plus::before { width: 11px; height: 2px; }
.faq-item summary .plus::after { width: 2px; height: 11px; }
.faq-item[open] summary .plus::after { display: none; }
.faq-item p { margin-top: 14px; color: var(--ink-soft); max-width: 65ch; font-family: var(--font-body); }

/* Final CTA */

.cta-band { background: var(--board); color: var(--chalk); position: relative; overflow: hidden; }
.cta-inner { position: relative; padding: 66px 0; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-inner h2 { color: var(--chalk); max-width: 20ch; }
.cta-inner .lede { color: rgba(242,239,225,0.82); margin-top: 12px; }
.cta-moni { width: 90px; }
.cta-left { display: flex; align-items: center; gap: 18px; }

/* Footer */

footer { background: var(--paper); border-top: 1px solid var(--line-on-light); padding: 48px 0 32px; font-size: 0.9rem; color: var(--ink-soft); }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 32px; }
.footer-col h3 { font-size: 0.82rem; color: var(--ink); margin-bottom: 12px; font-family: var(--font-body); font-weight: 800; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { color: var(--red); }
.footer-bottom { border-top: 1px solid var(--line-on-light); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.82rem; }

/* -------------------------------------------------------------------- */
/* One orchestrated entrance moment (hero only)                         */
/* -------------------------------------------------------------------- */

.hero-copy > * { opacity: 0; transform: translateY(10px); animation: rise 0.7s ease forwards; }
.hero-copy .eyebrow { animation-delay: 0.05s; }
.hero-copy h1 { animation-delay: 0.15s; }
.hero-copy .lede { animation-delay: 0.28s; }
.hero-copy .hero-actions { animation-delay: 0.4s; }
.hero-copy .hero-meta { animation-delay: 0.52s; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .hero-copy > * { opacity: 1; transform: none; animation: none; }
}

/* -------------------------------------------------------------------- */
/* Responsive                                                            */
/* -------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 52px 0 44px; }
  .hero-visual { order: -1; margin-bottom: 8px; }
  .speech-bubble { position: static; margin-bottom: 12px; }
  .modes-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: 1fr; }
  .versus { grid-template-columns: 1fr; }
  .versus-vs { margin: 0 auto; }
  .audience { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .cta-inner { text-align: left; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 20px; }
  section { padding: 56px 0; }
  .modes-grid { grid-template-columns: 1fr; }
  .audience { grid-template-columns: 1fr 1fr; }
  .hero-meta { gap: 18px; }
}
