/* ─────────────────────────────────────────────────────────────
   Design tokens — replica do tema cool + rounded do app principal.
   Se algum token for editado aqui, espelhar em src/index.css.
   ───────────────────────────────────────────────────────────── */
:root {
  --background: 210 25% 6%;
  --foreground: 200 15% 96%;
  --card: 210 22% 10%;
  --muted-foreground: 210 10% 62%;
  --border: 210 18% 20%;
  --primary: 188 72% 58%;
  --primary-foreground: 210 30% 8%;
  --ring: 188 72% 58%;

  --radius-card: 20px;
  --radius-control: 12px;

  --font-heading: "Poppins", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Poppins", "Inter", ui-sans-serif, system-ui, sans-serif;

  /* Accent gradient (mesh multi-hue) — IDV cool signature */
  --gradient-accent:
    radial-gradient(35% 110% at 10% 10%, #6fcdf2 0%, #6fcdf2 30%, transparent 75%),
    radial-gradient(30% 95% at 20% 40%, #f4f0c8 0%, #f4f0c8 20%, transparent 85%),
    radial-gradient(28% 200% at 35% 15%, #fbd8f2 0%, #fbd8f2 22%, transparent 85%),
    radial-gradient(28% 250% at 40% 12.5%, #ee6ee1 0%, #ee6ee1 38%, transparent 85%),
    radial-gradient(26% 275% at 60% 5%, #9d7bee 0%, #9d7bee 25%, transparent 80%),
    radial-gradient(50% 300% at 75% 5%, #8fb4f0 0%, #8fb4f0 22%, transparent 84%),
    radial-gradient(20% 50% at 50% 60%, #f0f2f7 0%, #f0f2f7 40%, transparent 10%),
    linear-gradient(#e9e6f2, #e9e6f2);
  --gradient-accent-foreground: 240 30% 12%;

  --bg-ambient:
    radial-gradient(1200px 800px at 20% -10%, hsl(195 80% 60% / 0.06), transparent 55%),
    radial-gradient(900px 700px at 100% 60%, hsl(310 65% 62% / 0.04), transparent 55%),
    radial-gradient(700px 600px at 30% 110%, hsl(256 65% 65% / 0.04), transparent 60%);
}

/* Reset mínimo */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: hsl(var(--background));
  background-image: var(--bg-ambient);
  background-attachment: fixed;
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   Topbar — typographic wordmark (mesma técnica do src/components/Logo.jsx):
   "quantt" recebe o --gradient-accent via background-clip:text; ".academy"
   fica em muted-foreground pra manter a hierarquia da IDV.
   ───────────────────────────────────────────────────────────── */
.topbar {
  padding: 24px clamp(20px, 5vw, 48px);
  display: flex;
  justify-content: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  user-select: none;
  transition: opacity 200ms ease;
}
.logo:hover {
  opacity: 0.8;
}
.logo-mark {
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo-suffix {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   Hero
   ───────────────────────────────────────────────────────────── */
.hero {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) clamp(20px, 5vw, 48px) 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.headline {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  font-weight: 700;
  color: hsl(var(--foreground));
  max-width: 20ch;
}

.subheadline {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  max-width: 56ch;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   Vídeo
   ───────────────────────────────────────────────────────────── */
.video-wrap {
  width: 100%;
  margin-top: 20px;
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    0 30px 80px -20px hsl(0 0% 0% / 0.5),
    0 0 0 1px hsl(var(--border) / 0.4);
}

/* Clip trick — YouTube ignora modestbranding em 2024+ e mostra título,
   share, "watch on YouTube" e watermark de qualquer jeito. Solução:
   iframe 300% wider + shift left -100%, .yt-clip com overflow:hidden.
   Só o miolo central 33.33% (que é EXATAMENTE onde o vídeo 16:9 fica
   pillarboxed pelo YT dentro do iframe ultra-wide) aparece na tela.
   As bordas horizontais — onde toda UI do YT vive — ficam clipadas. */
.yt-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.yt-clip > #player,
.yt-clip iframe {
  position: absolute;
  top: 0;
  left: -100%;
  width: 300%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

/* Cover transparente — captura TODO clique sobre o iframe. Bloqueia
   right-click útil, drag, e qualquer interação nativa do YouTube que
   sobrou (endscreen com "watch on YouTube", etc). Único handler:
   toggle play/pause via YT API. */
.video-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: pointer;
  /* touch-action: manipulation elimina o 300ms tap delay do WebView e
     evita gestos de double-tap-zoom competindo com o click. Necessário
     em Instagram Android browser (Chrome WebView) — sem isso, o tap
     as vezes só é reconhecido depois de 300ms de espera silenciosa. */
  touch-action: manipulation;
  /* Remove o flash cinza padrão do Android WebView. Nosso próprio
     feedback visual (video-play-btn-flash) roda no lugar dele. */
  -webkit-tap-highlight-color: transparent;
  /* iOS Safari + WebView pedem user-select:none pra não abrir menu
     de "copy" no long-press sobre transparent overlay. */
  -webkit-user-select: none;
  user-select: none;
}

/* Thumb custom — sobrepõe TUDO até o primeiro PLAYING. pointer-events
   none pra clique passar pro cover atrás. Some com fade suave e não
   volta em pauses subsequentes. */
.video-thumb {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transition: opacity 400ms ease;
}
.video-thumb.is-hidden {
  opacity: 0;
}

/* Big play button central — visível SÓ quando pausado/unstarted.
   pointer-events:none pra clique passar pro cover atrás. */
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  border: 0;
  background: hsl(0 0% 100% / 0.95);
  color: hsl(210 30% 8%);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  box-shadow: 0 10px 40px hsl(0 0% 0% / 0.4);
}
.video-play-btn svg {
  margin-left: 4px; /* offset ótico do triângulo */
}
.video-play-btn.is-visible {
  opacity: 1;
}
.video-cover:hover ~ .video-play-btn.is-visible {
  transform: translate(-50%, -50%) scale(1.06);
}
/* Feedback visual de tap — fica visível por ~180ms depois de qualquer
   toque no cover, mesmo quando o player ainda não carregou. Confirma
   pro user que o clique foi registrado enquanto a YT API sobe. */
.video-play-btn.is-tapped {
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.92);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}

/* Barra fake — fica na base do frame, sem tempo, sem seek. Fill usa
   primary com transição suave pro tick de 250ms não parecer degrau. */
.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px;
  z-index: 3;
  background: linear-gradient(to top, hsl(0 0% 0% / 0.55), transparent);
  pointer-events: none;
}
.fake-progress {
  width: 100%;
  height: 4px;
  background: hsl(0 0% 100% / 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.fake-progress-fill {
  height: 100%;
  width: 0%;
  background: hsl(var(--primary));
  border-radius: 999px;
  transition: width 300ms linear;
}

/* Overlay sólido acionado no state ENDED — esconde qualquer endscreen
   do YouTube (grid de related videos etc). */
.video-end-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: hsl(var(--card));
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.video-end-cover.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─────────────────────────────────────────────────────────────
   CTA — hidden by default, revelado após 20 min de vídeo
   ───────────────────────────────────────────────────────────── */
.cta-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}
.cta-slot.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--radius-control);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  color: hsl(var(--gradient-accent-foreground));
  background-image: var(--gradient-accent);
  background-size: 200% 200%;
  background-position: 0% 50%;
  border: 1px solid hsl(var(--border));
  box-shadow:
    0 20px 40px -12px hsl(195 80% 60% / 0.25),
    0 0 0 1px hsl(var(--foreground) / 0.06);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    background-position 600ms ease;
  cursor: pointer;
}
.cta:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow:
    0 24px 48px -12px hsl(195 80% 60% / 0.35),
    0 0 0 1px hsl(var(--foreground) / 0.1);
}
.cta:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 3px;
}
.cta-arrow {
  transition: transform 200ms ease;
}
.cta:hover .cta-arrow {
  transform: translateX(3px);
}

.cta-hint {
  margin: 0;
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

/* ─────────────────────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────────────────────── */
.footer {
  padding: 24px clamp(20px, 5vw, 48px);
  border-top: 1px solid hsl(var(--border) / 0.5);
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  text-align: center;
}
