/* ==========================================================================
   Atleta do Vôlei — Tutorial de Eventos
   ========================================================================== */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/dmsans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/dmsans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;

  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #0b1633;
  --ink-soft: #5d6684;
  --ink-faint: #a3a9bd;
  --line: rgba(11, 22, 51, 0.08);

  --orange: #f0641e;
  --orange-deep: #cc5f31;
  --gold: #f8bd43;
  --blue: #3c5198;
  --navy: #071d40;
  --grad: linear-gradient(100deg, var(--gold) 0%, var(--orange) 55%, var(--orange-deep) 100%);

  --radius: clamp(18px, 2vw, 28px);
  --gutter: clamp(16px, 5vw, 64px);
  --container: 1240px;
  --dock-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 30px 60px -28px rgba(7, 29, 64, 0.45), 0 12px 24px -16px rgba(7, 29, 64, 0.3);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- Tipografia ---------- */

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange-deep);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}

h1 {
  font-size: clamp(2.5rem, 1.4rem + 4vw, 4.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.section-head h2,
.outro h2 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.75rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  max-width: 34ch;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.35rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  box-shadow: 0 14px 30px -14px rgba(11, 22, 51, 0.6);
}
.btn svg { width: 18px; height: 18px; fill: var(--gold); }
.btn:hover { transform: translateY(-2px); background: var(--navy); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 0 0 0 transparent;
}
.btn--ghost:hover { background: var(--surface); }

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

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  width: min(100%, var(--container));
  margin-inline: auto;
  padding: clamp(28px, 6vw, 72px) var(--gutter) clamp(24px, 6vw, 96px);
}

.hero__glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 120%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 45% at 85% 30%, rgba(240, 100, 30, 0.14), transparent 70%),
    radial-gradient(35% 40% at 10% 10%, rgba(60, 81, 152, 0.12), transparent 70%);
  filter: blur(10px);
}

.hero__text {
  display: grid;
  justify-items: start;
  gap: clamp(18px, 2.4vw, 28px);
}

.hero__logo {
  width: clamp(170px, 18vw, 230px);
  height: auto;
  margin-bottom: clamp(16px, 4vw, 48px);
  animation: intro 1s var(--ease) both;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 8px;
}

.meta {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-faint);
}

[data-intro] { animation: intro 1s var(--ease) both; }
[data-intro]:nth-child(2) { animation-delay: 0.08s; }
[data-intro]:nth-child(3) { animation-delay: 0.16s; }
[data-intro]:nth-child(4) { animation-delay: 0.24s; }
[data-intro]:nth-child(5) { animation-delay: 0.32s; }

@keyframes intro {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ---------- Seção de tutoriais ---------- */

.tutorials {
  width: min(100%, var(--container));
  margin-inline: auto;
  padding: clamp(48px, 10vw, 140px) var(--gutter) clamp(40px, 8vw, 120px);
}

.section-head {
  display: grid;
  justify-items: start;
  gap: 18px;
  margin-bottom: clamp(40px, 7vw, 96px);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(28px, 4vw, 56px);
}

/* ---------- Card de vídeo ---------- */

.step {
  display: grid;
  gap: 18px;
  align-content: start;
  justify-items: center;
}

.step__info {
  display: flex;
  gap: 14px;
  align-items: baseline;
  width: 100%;
}

.step__num {
  flex: none;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--orange);
}

.step__title {
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.step__desc {
  margin-top: 4px;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.step__info .check {
  margin-left: auto;
  align-self: center;
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.step__info .check svg { width: 14px; height: 14px; stroke: var(--gold); stroke-width: 3; fill: none; }
.step.is-done .check { opacity: 1; transform: none; }

.player {
  position: relative;
  width: 100%;
  margin: 0;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--navy);
  box-shadow: var(--shadow);
  isolation: isolate;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}

.player__frame,
.player iframe,
.player__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--navy);
}

.player__poster {
  object-fit: cover;
  transition: transform 1.2s var(--ease), opacity 0.4s ease;
}
.player.has-frame .player__poster { opacity: 0; pointer-events: none; }
.player iframe { border: 0; }

/* Depois do primeiro toque, os controles são os do YouTube. */
.player.is-started:not(.is-waiting) .player__play { pointer-events: none; }
.player.is-started:not(.is-waiting) .player__play span { opacity: 0; transform: scale(0.8); }

/* Botão central */
.player__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
}
.player__play span {
  width: clamp(64px, 18%, 84px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 10px 30px rgba(0, 0, 0, 0.25);
  transition: transform 0.45s var(--ease), background 0.45s var(--ease), opacity 0.3s ease;
}
.player__play svg { width: 34%; fill: #fff; margin-left: 6%; }
.player__play:hover span { transform: scale(1.08); background: rgba(240, 100, 30, 0.85); }

.player.is-playing .player__play span { opacity: 0; transform: scale(0.8); }

/* Carregando */
.player.is-waiting .player__play span {
  opacity: 1;
  transform: none;
  background: rgba(255, 255, 255, 0.12);
}
.player.is-waiting .player__play svg { display: none; }
.player.is-waiting .player__play span::after {
  content: "";
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Duração (antes de iniciar) */
.player__badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(7, 29, 64, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}
.player.is-started .player__badge { opacity: 0; }

/* ---------- Revelação no scroll ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(48px) scale(0.96);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

.js [data-reveal] .player__poster { transform: scale(1.12); }
.js [data-reveal].is-visible .player__poster { transform: scale(1); }

/* Destaque do vídeo em reprodução */
.step.is-current .player { box-shadow: 0 0 0 3px var(--orange), var(--shadow); }
.has-playing .step.is-visible:not(.is-current) { opacity: 0.5; transition-delay: 0s; }

/* ---------- Fechamento ---------- */

.outro {
  display: grid;
  justify-items: center;
  gap: 28px;
  text-align: center;
  padding: clamp(40px, 8vw, 120px) var(--gutter) clamp(48px, 8vw, 100px);
}
.outro__icon { width: 72px; height: 72px; border-radius: 22px; box-shadow: var(--shadow); }
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.footer {
  padding: 32px var(--gutter) calc(var(--dock-h) + 48px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-faint);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Dock (navegação estilo stories) ---------- */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 50;
  width: min(calc(100% - 24px), 460px);
  height: var(--dock-h);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(7, 29, 64, 0.35);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.4s ease;
}
.dock.is-visible { transform: translate(-50%, 0); opacity: 1; }

.dock__btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.25s ease;
}
.dock__btn:hover { background: rgba(11, 22, 51, 0.06); }
.dock__btn:disabled { opacity: 0.3; cursor: default; background: none; }
.dock__btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.dock__body { flex: 1; min-width: 0; display: grid; gap: 7px; }

.dock__label {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
}
.dock__label [data-dock-num] { color: var(--orange); font-variant-numeric: tabular-nums; }
.dock__label [data-dock-title] { overflow: hidden; text-overflow: ellipsis; }

.dock__segments { display: flex; gap: 4px; }
.dock__seg {
  position: relative;
  flex: 1;
  height: 12px;
  display: flex;
  align-items: center;
}
.dock__seg::before,
.dock__seg i {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 4px;
  border-radius: 4px;
}
.dock__seg::before { background: rgba(11, 22, 51, 0.12); }
.dock__seg i {
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 0.25s linear;
}

/* ==========================================================================
   Responsivo
   ========================================================================== */

/* Tablet: 2 colunas com leve desalinhamento */
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps .step:nth-child(even) { margin-top: clamp(48px, 8vw, 120px); }
}

/* Desktop: hero em duas colunas + grade de 3 em cascata */
@media (min-width: 1080px) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    min-height: min(100vh, 1000px);
  }
  .step--intro { justify-self: end; width: min(100%, calc((100vh - 140px) * 9 / 16), 400px); }

  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: clamp(32px, 4vw, 64px); }
  .steps .step:nth-child(even) { margin-top: 0; }
  .steps .step:nth-child(3n + 2) { margin-top: 110px; }
  .steps .step:nth-child(3n) { margin-top: 220px; }

  .step:hover .player { transform: translateY(-6px); }
  .step:hover .player__poster { transform: scale(1.03); }
}

/* Celular: experiência de Reels — um vídeo por tela, com snap */
@media (max-width: 719.98px) {
  html { scroll-snap-type: y proximity; }

  .hero { padding-bottom: 0; }
  .hero__text { justify-items: center; text-align: center; }
  .hero__text .lead { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .eyebrow::before { display: none; }

  .section-head { justify-items: center; text-align: center; margin-bottom: 8px; }

  .tutorials { padding-top: 64px; }
  .steps { gap: 0; }

  .step {
    min-height: 100svh;
    align-content: center;
    gap: 14px;
    padding: 20px 0 calc(var(--dock-h) + 28px + env(safe-area-inset-bottom));
    scroll-snap-align: center;
    scroll-snap-stop: normal;
  }
  .step__info,
  .step .player {
    width: min(100%, calc((100svh - var(--dock-h) - 170px) * 9 / 16));
  }
  .step__info { margin-inline: auto; }

  .js .step[data-reveal] { transform: translateY(32px) scale(0.94); }
  .has-playing .step.is-visible:not(.is-current) { opacity: 1; }
}

/* Movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
