/* ============================================================
   Conquista — Rede POC / Olimpíada Internacional Matemática Sem Fronteiras
   ============================================================ */

:root {
  --navy: #1B1464;
  --orange: #F5A623;
  --sky: #4A90D9;
  --green: #8CC152;
  --yellow: #F7D354;
  --ink: #1B1464;
  --body: #3a3560;
  --paper: #ffffff;
  --paper-soft: #f7f7fb;
  --dark: #0d0a2e;
  --font-head: 'Sora', 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', 'Work Sans', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--font-body);
  color: var(--body);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); }
img { max-width: 100%; display: block; }

/* ---------- brand mark: overlay within the hero only ---------- */
.brand {
  position: absolute;
  top: 20px; left: 24px;
  z-index: 40;
  pointer-events: none;
}
.brand__logo {
  width: 128px; height: auto;
  /* opaque card + shadow so it stays legible over video, photos, or body
     copy scrolling underneath it — it's a deliberate watermark badge, not
     meant to blend in */
  background: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.16);
}

/* ---------- accent chips ---------- */
.chip {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy);
  padding: .35em .9em;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.chip--orange { background: var(--orange); }
.chip--green  { background: var(--green); }
.chip--blue   { background: var(--sky); color: #fff; }
.chip--yellow { background: var(--yellow); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn--primary {
  font-size: 1.05rem;
  color: #fff;
  background: var(--navy);
  padding: 1em 2.4em;
  box-shadow: 0 14px 40px rgba(27,20,100,.35);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 20px 50px rgba(27,20,100,.45); }
/* secondary CTAs: intentionally lighter weight so they never compete
   with the single primary CTA in the final section */
.btn--secondary {
  font-size: .92rem;
  color: var(--navy);
  background: transparent;
  border: 1.5px solid rgba(27,20,100,.28);
  padding: .7em 1.6em;
}
.btn--secondary:hover { background: rgba(27,20,100,.06); border-color: rgba(27,20,100,.45); }
/* sits over a video with unpredictable brightness/contrast underneath it —
   needs its own opaque backing so it never washes out (this was the
   invisible hero button bug) */
.btn--onvideo {
  background: rgba(255,255,255,.92);
  border-color: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.btn--onvideo:hover { background: #fff; }

/* ---------- generic scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   Math symbol decorative background
   Pure CSS drift — no JS per-frame cost, safe for low-end mobile.
   ============================================================ */
.mathbg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.mathbg__sym {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4rem);
  color: var(--sky);
  opacity: .1;
  transform: rotate(var(--r));
  animation: mathDrift var(--d) ease-in-out infinite alternate;
}
.mathbg__sym:nth-child(2n) { color: var(--orange); }
.mathbg__sym:nth-child(3n) { color: var(--green); }
.mathbg__sym:nth-child(4n) { color: var(--navy); }
.mathbg--light .mathbg__sym { opacity: .07; }
.mathbg--dark .mathbg__sym { opacity: .14; color: #fff; }
.mathbg--dark .mathbg__sym:nth-child(2n) { color: var(--sky); }
.mathbg--dark .mathbg__sym:nth-child(3n) { color: var(--yellow); }

@keyframes mathDrift {
  from { transform: translate(0, 0) rotate(var(--r)); }
  to   { transform: translate(14px, -18px) rotate(calc(var(--r) * -1)); }
}


/* ============================================================
   1. HERO — video background, pinned while headline lines reveal
   ============================================================ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper);
}
.hero__media { position: absolute; inset: 0; }
.hero__video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__media::after {
  /* slight dark veil: keeps white headline text readable over any frame —
     this video isn't a uniform bright gold shot, it swings through dark
     black-backdrop frames too, and navy-on-dark was reading as barely
     legible there */
  content: '';
  position: absolute; inset: 0;
  background: rgba(13,10,46,.22);
}
.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  max-width: 800px;
  padding: 0 6vw;
}
.hero__line {
  /* lines share one grid cell: one visible at a time, no stacking */
  grid-area: 1 / 1;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2rem, 5.4vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: #fff;
  opacity: 0;
  transform: translateY(30px);
  text-wrap: balance;
  /* white holds up against the video's dark frames on its own; the dark
     shadow is what keeps it legible when the loop swings to a bright
     frame instead — robust either way, unlike navy which only worked
     against the bright ones */
  text-shadow:
    0 2px 10px rgba(0,0,0,.4), 0 10px 34px rgba(0,0,0,.4),
    0 0 60px rgba(0,0,0,.25);
}
.hero__line--accent::after {
  content: '';
  display: block;
  width: 160px;
  height: 6px;
  border-radius: 3px;
  margin: .6em auto 0;
  background: linear-gradient(90deg, var(--orange) 0 33%, var(--sky) 33% 66%, var(--green) 66% 100%);
}
.hero__cta {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%);
}


/* ============================================================
   2. CONTEXT
   ============================================================ */
.context {
  position: relative;
  padding: 14vh 6vw;
  background: var(--paper-soft);
  overflow: hidden;
}
.context__inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; text-align: left; }
.context__title { margin-bottom: 2.2rem; }
.context__logo { width: min(460px, 100%); height: auto; }
.context__block {
  margin-bottom: 2.2rem;
  padding-left: 1.4rem;
  border-left: 4px solid var(--orange);
}
.context__block:nth-child(2) { border-color: var(--sky); }
.context__block:nth-child(3) { border-color: var(--green); }
.context__block p {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.55;
  color: var(--body);
}
.context__signature {
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--navy);
  line-height: 1.5;
  margin: 2.4rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(27,20,100,.14);
}

/* ============================================================
   3. DIAMANTE SPOTLIGHT — dedicated section for the real spinning-medal
   footage (shot on black), not a small catalog thumbnail
   ============================================================ */
.diamante {
  position: relative;
  background: var(--dark);
  padding: 12vh 6vw 14vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.diamante .chip,
.diamante__media,
.diamante__content { position: relative; z-index: 1; }
.diamante__media {
  width: min(320px, 62vw);
  margin: .2rem 0 2rem;
}
.diamante__canvas {
  width: 100%;
  height: auto;
  display: block;
  /* frames are background-removed — no backing needed, the section's own
     dark bg shows through, so the medal reads as floating rather than
     sitting in a black box */
  background: transparent;
}
.diamante__content h2 {
  color: #fff;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: .7rem;
}
.diamante__content p {
  color: rgba(255,255,255,.72);
  font-size: 1.05rem;
  max-width: 460px;
  margin: 0 auto 1.8rem;
}

/* ============================================================
   4. PROOF — pinned crossfade
   ============================================================ */
.proof { position: relative; background: var(--dark); }
.proof__stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
/* photo and caption crossfade independently — photos blend smoothly into
   each other (nice), but captions must never be legible two-at-once, so
   they snap instead of blending (see the split tweens in main.js) */
.proof__item { position: absolute; inset: 0; }
.proof__item img { opacity: 0; }
.proof__item:first-of-type img { opacity: 1; }
.proof__item figcaption { opacity: 0; }
.proof__item:first-of-type figcaption { opacity: 1; }
.proof__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
/* this shot is framed with the medal low in the chest — the default crop
   was clipping it, the whole reason this photo is in the proof section */
.proof__item[data-proof="2"] img { object-position: center 62%; }
.proof__item figcaption {
  position: absolute;
  bottom: 6vh; left: 6vw; right: 6vw;
  color: #fff;
  /* keep clear of the fixed WhatsApp button in the bottom-right corner */
  padding-right: 76px;
}
.proof__quote {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  text-shadow: 0 4px 20px rgba(0,0,0,.5);
  max-width: 560px;
}
.proof__heading {
  position: absolute;
  top: 8vh; left: 6vw;
  z-index: 3;
  max-width: 480px;
}
.proof__heading h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  text-shadow: 0 4px 30px rgba(0,0,0,.5);
}
/* wrapper carries the dark footer bar; the button itself stays a normal
   compact inline-block pill like every other secondary CTA on the page —
   it previously had display:block directly on the button, stretching it
   into one giant full-width pill instead of matching the pattern */
.proof__cta-wrap { text-align: center; padding: 3rem 6vw; background: var(--dark); }
.proof__cta.btn--secondary { color: #fff; border-color: rgba(255,255,255,.35); }
.proof__cta.btn--secondary:hover { background: rgba(255,255,255,.08); }

/* ============================================================
   5. TESTIMONIALS
   ============================================================ */
.testimonials {
  position: relative;
  padding: 14vh 6vw;
  background: var(--paper);
  overflow: hidden;
  text-align: center;
}
.testimonials__header { position: relative; z-index: 1; margin-bottom: 3rem; }
.testimonials__header h2 {
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 800;
}
/* all four stay on one line — horizontal scroll instead of wrapping to a
   second row, on every viewport width */
.testimonials__grid {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  max-width: 1080px;
  margin: 0 auto 1rem;
  padding: 0 0 .5rem;
}
.testimonial {
  flex: 0 0 auto;
  width: min(300px, 78vw);
  scroll-snap-align: start;
  background: var(--paper-soft);
  border: 1px solid #ececf4;
  border-radius: 20px;
  padding: 2rem 1.8rem;
  text-align: left;
  /* animated in by the GSAP ScrollTrigger.batch in main.js */
  opacity: 0;
  transform: translateY(28px);
}
.testimonial__photo {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.1rem;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(27,20,100,.18);
}
.testimonial p {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--body);
  margin-bottom: 1.2rem;
}
.testimonial cite {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-style: normal;
  color: var(--navy);
  font-size: .92rem;
}

/* ============================================================
   6. CATALOG — pinned horizontal scroll-jack (GSAP-driven)
   ============================================================ */
.catalog { background: var(--paper); }
/* the CTA button lives inside the pin (revealed near the end of the
   horizontal scroll, see main.js) instead of after it in normal flow —
   a pinned element always needs one more full scroll-past of its own
   height once it releases, so anything living right after it in the
   document reads as a big dead gap. Keeping the button IN the pin avoids
   that entirely. */
.catalog__pin {
  /* without an explicit height this box is only as tall as its content,
     so on taller/narrower viewports (tablet portrait) the pinned box sits
     glued to the top with a big dead gap of page background below it for
     the whole horizontal-scroll duration. Matching it to the viewport
     lets justify-content: center spread that space evenly instead. */
  min-height: 100vh;
  min-height: 100svh;
  padding: 2vh 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6vh;
}
.catalog__cta {
  width: fit-content;
  margin: 0 auto;
  opacity: 0;
}
.catalog__header { padding: 0 6vw; text-align: center; }
.catalog__header h2 { font-size: clamp(1.7rem, 3.8vw, 2.8rem); font-weight: 800; }
.catalog__hint { margin-top: .6rem; font-size: .85rem; color: var(--body); opacity: .7; }
.catalog__track {
  display: flex;
  gap: 1.4rem;
  padding: 0 6vw;
  width: max-content;
  will-change: transform;
}
.catalog__card {
  flex: 0 0 auto;
  width: min(280px, 74vw);
  background: #fff;
  border-radius: 22px;
  padding: 2rem 1.6rem 2.2rem;
  text-align: center;
  border: 1px solid #ececf4;
  box-shadow: 0 18px 50px rgba(27,20,100,.08);
  /* animated in by GSAP ScrollTrigger in main.js */
  opacity: 0;
  transform: translateY(28px);
}
.catalog__medal { height: 200px; margin: 0 auto 1.2rem; display: flex; align-items: flex-start; justify-content: center; cursor: pointer; }
.catalog__medal img { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 12px 24px rgba(27,20,100,.18)); transition: transform .25s ease; }
.catalog__medal:hover img { transform: scale(1.05); }

/* ---------- medal lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8vh 6vw;
  background: rgba(13,10,46,.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__img {
  max-width: min(440px, 86vw);
  max-height: 82vh;
  width: auto; height: auto;
  filter: drop-shadow(0 24px 60px rgba(0,0,0,.5));
}
.lightbox__close {
  position: absolute;
  top: 20px; right: 24px;
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(255,255,255,.22); }
.catalog__name { font-size: 1.35rem; font-weight: 800; margin-bottom: .5rem; }
.catalog__name::after {
  content: '';
  display: block;
  width: 40px; height: 4px;
  border-radius: 2px;
  margin: .4em auto 0;
  background: var(--orange);
}
.catalog__card[data-medal="escolar"] .catalog__name::after { background: var(--yellow); }
.catalog__card[data-medal="regional"] .catalog__name::after { background: var(--orange); }
.catalog__card[data-medal="nacional"] .catalog__name::after { background: var(--sky); }
.catalog__card[data-medal="diamante"] .catalog__name::after { background: var(--navy); }
.catalog__card[data-medal="mencao"] .catalog__name::after { background: var(--green); }
.catalog__desc { font-size: .95rem; line-height: 1.5; }

/* ============================================================
   7. FAQ
   ============================================================ */
.faq { background: var(--paper-soft); padding: 14vh 6vw; }
.faq__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.faq__title { font-size: clamp(1.8rem, 3.8vw, 2.6rem); font-weight: 800; margin-bottom: 2.5rem; }
.faq__list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.4rem; text-align: left; }
.faq__item {
  background: #fff;
  border: 1px solid #ececf4;
  border-radius: 16px;
  padding: 1.3rem 1.6rem;
}
.faq__item summary {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: '+';
  flex: 0 0 auto;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--orange);
  transition: transform .25s ease;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { margin-top: 1rem; font-size: 1rem; line-height: 1.55; color: var(--body); }

/* ============================================================
   8. CTA
   ============================================================ */
.cta {
  position: relative;
  padding: 16vh 6vw;
  background: var(--navy);
  overflow: hidden;
  text-align: center;
}
.cta__media { position: absolute; inset: 0; }
/* source footage has ribbons filling the top ~60% of frame and medals
   only in the bottom ~40% — a centered crop on wide screens cuts right
   through the medals, the one thing this shot needs to show */
.cta__video { width: 100%; height: 100%; object-fit: cover; object-position: center 85%; }
.cta__media::after {
  /* wash reduced to the minimum needed for text contrast — the swinging
     medals stay clearly visible behind the headline instead of buried
     under a heavy tint */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,10,46,.1) 0%, rgba(27,20,100,.22) 55%, rgba(27,20,100,.4) 100%);
}
.cta__content { position: relative; z-index: 1; }
/* primary button sits on the navy section: invert to keep it visible */
.cta .btn--primary {
  background: var(--orange);
  color: var(--navy);
  box-shadow: 0 14px 40px rgba(0,0,0,.35);
}
.cta .btn--primary:hover { box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.cta__title { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.14; margin-bottom: 2rem; text-shadow: 0 4px 24px rgba(0,0,0,.55); }
.cta__foot { margin-top: 2.2rem; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: #fff; opacity: .85; text-shadow: 0 2px 12px rgba(0,0,0,.5); }

/* ============================================================
   WhatsApp fixed button
   ============================================================ */
.whatsapp-fab {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 60;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  transition: transform .2s ease;
}
.whatsapp-fab:hover { transform: scale(1.06); }
.whatsapp-fab svg { width: 28px; height: 28px; fill: #fff; }

/* hero CTA stops short of the fixed WhatsApp button's footprint so the
   two never overlap — proof/catalog CTAs are centered instead, so this
   doesn't apply to them (it was fighting their auto-centering margin) */
.hero__cta { margin-right: 0; }
@media (max-width: 480px) {
  .whatsapp-fab { right: 16px; bottom: 16px; width: 50px; height: 50px; }
  .whatsapp-fab svg { width: 24px; height: 24px; }
}

/* Site intentionally does not offer a reduced-motion fallback — the
   client wants the scroll-driven video experience identical on every
   device, tablets included, regardless of the OS/browser motion setting. */

@media (max-width: 640px) {
  .brand__logo { width: 108px; }
}
