:root {
  --blue: #2e6b9f;
  --blue-deep: #1f4d76;
  --blue-logo: #046ca2;
  --gray: #505051;
  --gray-dark: #333334;
  --cream: #f7f5f0;
  --white: #ffffff;
  --gold: #e0a83a;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--gray-dark);
  font-family: 'Instrument Sans', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Scroll progress bar ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gold);
  z-index: 60;
  transition: width 0.1s linear;
}

/* ---------- Sticky mini nav ---------- */

.mini-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(31, 77, 118, 0.94);
  backdrop-filter: blur(6px);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.mini-nav.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.mini-nav img {
  height: 26px;
  filter: brightness(0) invert(1);
}

.mini-nav .btn {
  margin: 0;
  padding: 8px 18px;
  font-size: 13.5px;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.is-visible .item {
  animation: reveal-item 0.6s ease forwards;
}

.reveal-stagger .item {
  opacity: 0;
}

.reveal-stagger.is-visible .item:nth-child(1) { animation-delay: 0s; }
.reveal-stagger.is-visible .item:nth-child(2) { animation-delay: 0.08s; }
.reveal-stagger.is-visible .item:nth-child(3) { animation-delay: 0.16s; }
.reveal-stagger.is-visible .item:nth-child(4) { animation-delay: 0.24s; }

@keyframes reveal-item {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-stagger .item, .mini-nav, .blob {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

h1, h2, h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--blue-deep);
}

h1 em, h2 em {
  font-style: italic;
  color: var(--gold);
}

a {
  color: inherit;
}

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

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

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

.hero {
  background: linear-gradient(160deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--white);
  padding: 22px 0 46px;
  position: relative;
  overflow: hidden;
}

.hero .wrap.hero-inner {
  max-width: 1000px;
}

.hero-wave {
  display: block;
  width: 100%;
  height: 24px;
  color: var(--cream);
  position: relative;
  z-index: 1;
}

.hero-wave path {
  fill: currentColor;
}

.hero-copy {
  padding-bottom: 44px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-meta svg {
  color: var(--gold);
  flex-shrink: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

.blob-1 {
  right: -120px;
  top: -120px;
  width: 360px;
  height: 360px;
  background: rgba(255, 255, 255, 0.06);
}

.blob-2 {
  left: -100px;
  bottom: -140px;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
}

.brandbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 46px;
  position: relative;
  z-index: 1;
}

.brandbar img {
  height: 42px;
  width: auto;
  filter: brightness(0) invert(1);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

h1 {
  font-size: 46px;
  color: var(--white);
  line-height: 1.12;
  position: relative;
  z-index: 1;
}

.hero p.lead {
  color: rgba(255, 255, 255, 0.86);
  font-size: 16.5px;
  margin-top: 14px;
  margin-bottom: 56px;
  max-width: 42ch;
  position: relative;
  z-index: 1;
}

/* ============================================================
   INTRO ANIMADA A PANTALLA COMPLETA
   Se reproduce una vez al abrir la página y luego se desvanece,
   dejando ver el sitio real debajo. Ver initIntroSplash en script.js.
   ============================================================ */

body.intro-lock {
  overflow: hidden;
  height: 100%;
}

#introOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  background: linear-gradient(135deg, var(--blue) 0%, #255d8c 48%, var(--blue-deep) 100%);
  transition: opacity .6s ease;
}

#introOverlay.intro-hide {
  opacity: 0;
  pointer-events: none;
}

#introOverlay .af-hero__topglow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 120% at 18% 12%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 46%);
}

#introOverlay .af-hero__wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(26px, 5vw, 84px);
  padding: 0 clamp(24px, 6vw, 90px);
  width: 100%;
}

/* --- Logo --- */
#introOverlay .af-logo-box {
  position: relative;
  flex: 0 0 auto;
  width: clamp(160px, 24vw, 300px);
  aspect-ratio: 1064 / 772;
}

#introOverlay .af-glow {
  position: absolute;
  inset: -26% -16% -20% -16%;
  background: radial-gradient(56% 60% at 50% 52%,
  rgba(255, 255, 255, .97) 0%, rgba(255, 255, 255, .92) 40%,
  rgba(255, 255, 255, .55) 62%, rgba(255, 255, 255, 0) 78%);
  opacity: 0;
}

#introOverlay .af-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
}

#introOverlay .af-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#introOverlay .af-ink {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  opacity: 0;
}

#introOverlay .af-pen {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(20px, 3.2vw, 40px);
  height: clamp(20px, 3.2vw, 40px);
  margin: calc(clamp(20px, 3.2vw, 40px) / -2) 0 0 calc(clamp(20px, 3.2vw, 40px) / -2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .98) 0%, rgba(255, 237, 203, .92) 36%, rgba(224, 168, 58, .32) 68%, rgba(224, 168, 58, 0) 100%);
  offset-path: path('M45,105 C78,105 114,100 141,96 C181,89 217,79 247,73 C271,69 287,69 303,89');
  offset-rotate: 0deg;
  opacity: 0;
}

/* --- Titular --- */
#introOverlay .af-copy {
  flex: 0 1 auto;
  max-width: min(46vw, 540px);
}

#introOverlay .af-l1 {
  display: block;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: .005em;
  font-size: clamp(28px, 5.2vw, 66px);
  opacity: 0;
  transform: translateY(20px);
}

#introOverlay .af-l2 {
  display: block;
  font-style: italic;
  font-weight: 400;
  line-height: 1.04;
  margin-top: .04em;
  color: var(--gold);
  font-size: clamp(32px, 5.9vw, 74px);
  opacity: 0;
  transform: translateY(20px);
}

#introOverlay .af-rule {
  height: 2px;
  width: clamp(64px, 10vw, 132px);
  margin-top: clamp(12px, 1.8vw, 24px);
  background: var(--gold);
  border-radius: 2px;
  opacity: .9;
  transform-origin: left center;
  transform: scaleX(0);
}

/* ---------- ANIMACIÓN (al añadir .af-play, ver script.js) ---------- */
#introOverlay.af-play .af-glow     { animation: af-glow-in .8s cubic-bezier(.22,1,.36,1) .2s both; }
#introOverlay.af-play .af-logo-img { animation: af-reveal 1.7s cubic-bezier(.62,.02,.34,1) .45s both; }
#introOverlay.af-play .af-pen      { animation: af-pen 1.7s cubic-bezier(.62,.02,.34,1) .45s both; }
#introOverlay.af-play .af-ink      { animation: af-ink 2.2s cubic-bezier(.62,.02,.34,1) .45s both; }
#introOverlay.af-play .af-l1       { animation: af-line .8s cubic-bezier(.22,1,.36,1) 2.3s both; }
#introOverlay.af-play .af-l2       { animation: af-line .8s cubic-bezier(.22,1,.36,1) 2.62s both; }
#introOverlay.af-play .af-rule     { animation: af-rule .9s cubic-bezier(.62,.02,.34,1) 2.7s both; }

@keyframes af-glow-in {
  0%   { opacity: 0; transform: scale(.94); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes af-reveal {
  0%   { opacity: 1; clip-path: inset(0 100% 0 0); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes af-pen {
  0%   { offset-distance: 0%;   opacity: 0; }
  8%   { opacity: 1; }
  86%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@keyframes af-ink {
  0%   { stroke-dashoffset: 1000; opacity: .85; }
  68%  { stroke-dashoffset: 0;    opacity: .85; }
  100% { stroke-dashoffset: 0;    opacity: 0; }
}
@keyframes af-line {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes af-rule {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

/* pantallas pequeñas: apila logo y titular */
@media (max-width: 620px) {
  #introOverlay .af-hero__wrap { flex-direction: column; gap: 18px; padding: 34px 22px; }
  #introOverlay .af-copy { max-width: 88vw; text-align: center; }
  #introOverlay .af-rule { margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  #introOverlay { display: none !important; }
  body.intro-lock { overflow: visible !important; height: auto !important; }
}

/* ---------- Scratch card ---------- */

.card-scratch {
  background: var(--white);
  border-radius: 22px;
  margin-top: -38px;
  padding: 34px 20px 30px;
  text-align: center;
  box-shadow: 0 18px 38px rgba(31, 77, 118, 0.22);
  position: relative;
  z-index: 1;
}

.card-scratch .kicker {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 4px;
  font-weight: 500;
}

.card-scratch h2 {
  font-size: 23px;
  margin-bottom: 4px;
}

.card-scratch .sub {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 24px;
}

.scratch-holder {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
}

#prizeLayer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #eef4fa;
  border-radius: 20px;
  border: 1.5px solid #dbe8f3;
}

#prizeLayer .who {
  font-size: 12.5px;
  color: var(--gray);
}

#prizeLayer .amt {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 40px;
  color: var(--blue-logo);
  margin: 4px 0;
}

#prizeLayer .fine {
  font-size: 11px;
  color: var(--gray);
  margin-top: 8px;
  max-width: 170px;
}

#scratchCanvas {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  touch-action: none;
  cursor: pointer;
}

.scratch-hint {
  font-size: 12px;
  color: var(--gray);
  margin-top: 14px;
}

.btn {
  display: inline-block;
  margin-top: 22px;
  background: var(--blue-logo);
  color: #fff;
  font-weight: 500;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  color: var(--blue-deep);
  border: 1.5px solid var(--blue-deep);
}

/* ---------- Stats ---------- */

.stats {
  padding: 50px 0 4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-grid .item {
  text-align: left;
  border-top: 2px solid var(--blue-logo);
  padding-top: 10px;
}

.stat-grid .num {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 30px;
  color: var(--blue-deep);
}

.stat-grid .lbl {
  font-size: 12.5px;
  color: var(--gray);
  margin-top: 2px;
}

/* ---------- About ---------- */

.about {
  padding: 44px 0 8px;
}

.about .eyebrow {
  color: var(--blue-logo);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}

.about h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.about p {
  font-size: 15.5px;
  color: var(--gray);
  max-width: 56ch;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.why-grid .item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 18px;
  border: 1px solid #eae6da;
}

.why-grid .item h3 {
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--blue-deep);
}

.why-grid .item p {
  font-size: 13.5px;
  color: var(--gray);
  margin: 0;
}

/* ---------- Categories ---------- */

.cats {
  padding: 44px 0 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.chip {
  background: var(--white);
  border: 1px solid #dfe6ee;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--blue-deep);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s ease;
}

.chip:hover {
  background: #eaf1f8;
}

/* ---------- Footer ---------- */

footer {
  margin-top: 56px;
  background: var(--gray-dark);
  color: #d8d8d8;
  padding: 38px 0 28px;
}

footer h3 {
  color: var(--white);
  font-size: 20px;
  margin-bottom: 10px;
}

footer p {
  font-size: 14px;
  margin: 4px 0;
  color: #c9c9c9;
}

footer .contact-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

footer .foot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 26px;
  font-size: 13.5px;
}

footer .foot-grid .label {
  color: #9a9a9a;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.social-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.social-row a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e6e6e6;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.social-row a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

footer small {
  display: block;
  margin-top: 26px;
  color: #8a8a8a;
  font-size: 12px;
}

.legal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}

.legal-row a {
  font-size: 12px;
  color: #9a9a9a;
  text-decoration: underline;
}

.legal-row a:hover {
  color: #d8d8d8;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  background: var(--gray-dark);
  color: #e6e6e6;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  display: none;
  max-width: 520px;
  margin: 0 auto;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner p {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 14px;
  color: #d8d8d8;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-actions .btn {
  margin: 0;
  padding: 9px 18px;
  font-size: 13.5px;
}

.cookie-actions .btn.ghost {
  color: #e6e6e6;
  border-color: rgba(255, 255, 255, 0.35);
}

/* ---------- How it works ---------- */

.steps {
  padding: 46px 0 8px;
}

.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.step {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #e4dfd0;
}

.step-num {
  display: block;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 28px;
  color: var(--gold);
  margin-bottom: 6px;
}

.step h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.step p {
  font-size: 13.5px;
  color: var(--gray);
  margin: 0;
}

/* ---------- Testimonial ---------- */

.testimonial {
  padding: 46px 0 10px;
}

.testimonial .wrap {
  max-width: 620px;
  text-align: center;
}

.quote-mark {
  color: var(--gold);
  margin: 0 auto 8px;
  display: block;
}

.quote-text {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--blue-deep);
  margin: 0;
}

.quote-author {
  font-size: 13.5px;
  color: var(--gray);
  margin: 14px 0 0;
}

/* ---------- Featured courses ---------- */

.courses {
  padding: 44px 0 8px;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.course-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--white);
  border: 1px solid #eae6da;
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.course-card:hover {
  border-color: var(--blue-logo);
  transform: translateY(-2px);
}

.course-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-logo);
  background: #eaf1f8;
  padding: 4px 10px;
  border-radius: 999px;
}

.course-card h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 4px 0 0;
}

.course-price {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--blue-deep);
  margin: 0;
}

.course-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  margin-top: auto;
}

/* ---------- Trust badges ---------- */

.trust {
  padding: 34px 0 8px;
}

.trust-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: var(--white);
  border: 1px solid #eae6da;
  border-radius: var(--radius);
  padding: 18px;
}

.trust-badge img {
  max-width: 100%;
  height: 34px;
  width: auto;
  object-fit: contain;
}

.trust-code {
  font-size: 12.5px;
  color: var(--gray);
  margin: 0;
  line-height: 1.5;
}

/* ---------- WhatsApp float ---------- */

.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  z-index: 55;
  transition: transform 0.15s ease;
}

.whatsapp-float:hover {
  transform: scale(1.06);
}

/* ---------- Confetti ---------- */

.confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 11px;
  pointer-events: none;
  opacity: 1;
  animation: confetti-burst 0.9s ease-out forwards;
}

@keyframes confetti-burst {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .confetti-piece {
    display: none;
  }
}

@media (min-width: 860px) {
  .hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 48px;
  }
  .hero .wrap:not(.hero-inner) {
    max-width: 1000px;
  }
  .card-scratch {
    margin-top: 0;
  }
  .hero p.lead {
    margin-bottom: 0;
  }
  .hero-copy {
    padding-bottom: 24px;
  }
}

@media (max-width: 700px) {
  .wrap {
    padding: 0 18px;
  }
  h1 {
    font-size: 34px;
  }
  .card-scratch {
    padding: 28px 16px 24px;
  }
  .why-grid {
    grid-template-columns: 1fr 1fr;
  }
  .course-grid {
    grid-template-columns: 1fr 1fr;
  }
  .steps-row {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 28px;
  }
  .scratch-holder {
    width: 210px;
    height: 210px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .course-grid {
    grid-template-columns: 1fr;
  }
  .trust-row {
    grid-template-columns: 1fr;
  }
  footer .foot-grid {
    grid-template-columns: 1fr;
  }
  .whatsapp-float {
    right: 14px;
    bottom: 14px;
  }
}