/* ============================================================
   AVALOON — Scrollytelling "App em ação"
   Pinned phone + scroll-driven scene. Isolated from base styles.
   ============================================================ */

/* Browser-framed real screenshot (reused in Plataforma) */
.browser-shot {
  border-radius: 16px;
  overflow: hidden;
  background: #0b0f16;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.browser-shot .bs-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px;
  background: rgba(18,24,34,.9);
  border-bottom: 1px solid var(--border);
}
.browser-shot .bs-dots { display: flex; gap: 7px; }
.browser-shot .bs-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a434f; }
.browser-shot .bs-dots i:nth-child(1) { background: #ff5f57; }
.browser-shot .bs-dots i:nth-child(2) { background: #febc2e; }
.browser-shot .bs-dots i:nth-child(3) { background: #28c840; }
.browser-shot .bs-url {
  flex: 1; text-align: center;
  font-size: 12.5px; color: var(--ink-mute);
  background: rgba(10,14,20,.7);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 12px;
  max-width: 320px; margin-inline: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.browser-shot img { display: block; width: 100%; height: auto; }

/* webmobilefirst screencast embed */
.video-embed {
  position: relative;
  width: min(360px, 82%);
  margin-inline: auto;
  aspect-ratio: 9 / 19.5;
  border-radius: 26px;
  overflow: hidden;
  background: #05070b center/cover no-repeat;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(254,128,38,.14);
}
.video-embed .poster {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.video-embed video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.video-embed iframe {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  border: 0; display: block;
}
.video-embed-cap {
  margin-top: 18px; text-align: center;
}
.video-embed-cap a {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--orange);
  text-decoration: none;
}
.video-embed-cap a .ic { width: 15px; height: 15px; }
.video-embed-cap a:hover { text-decoration: underline; }

.scrolly {
  position: relative;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(254,128,38,.06), transparent 60%),
    var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: clip;
}

/* Intro head sits above the pinned stage */
.scrolly-intro { padding-block: clamp(72px, 10vw, 120px) 0; }

/* The tall track that provides scroll distance */
.scrolly-track { position: relative; }

/* Pinned viewport */
.scrolly-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scrolly-stage {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
}

/* ---------- Phone side ---------- */
.scrolly-phone {
  position: relative;
  justify-self: center;
  width: min(300px, 68vw);
  aspect-ratio: 985 / 2009;
}
.scrolly-phone .glow {
  position: absolute; inset: -12% -18%;
  background: radial-gradient(closest-side, rgba(254,128,38,.24), transparent 72%);
  filter: blur(24px); z-index: 0; opacity: .7;
  animation: scGlow 6s ease-in-out infinite;
}
@keyframes scGlow { 0%,100%{ transform: scale(1); opacity:.55 } 50%{ transform: scale(1.06); opacity:.8 } }

/* frame is now a pass-through layer — the cropped phone floats on its own */
.scrolly-frame {
  position: absolute; inset: 0; z-index: 1;
  overflow: visible;
}
.scrolly-phone .shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: translateY(24px) scale(1.02);
  filter: saturate(1.04) drop-shadow(0 30px 50px rgba(0,0,0,.6)) drop-shadow(0 0 26px rgba(254,128,38,.4));
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1);
  will-change: opacity, transform;
  pointer-events: none;
}
.scrolly-phone .shot.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.scrolly-phone .shot.is-past {
  opacity: 0;
  transform: translateY(-22px) scale(1.02);
}

/* floating status pills that swap per step */
.scrolly-pill {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--ink);
  background: rgba(18,24,34,.82);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(8px) scale(.9);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.3,1);
}
.scrolly-pill .ic { width: 15px; height: 15px; color: var(--orange); }
.scrolly-pill.is-active { opacity: 1; transform: translateY(0) scale(1); }
.scrolly-pill.p-a { top: 12%; left: -6%; }
.scrolly-pill.p-b { bottom: 16%; right: -8%; }
.scrolly-pill.p-b .ic { color: var(--teal); }

/* ---------- Copy side ---------- */
.scrolly-copy { position: relative; min-height: 320px; }
.sc-rail {
  position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: var(--border-strong); border-radius: 2px;
}
.sc-rail .fill {
  position: absolute; left: 0; top: 0; width: 100%; height: 0%;
  background: linear-gradient(var(--orange), var(--orange-700));
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(254,128,38,.6);
  transition: height .2s linear;
}
.sc-steps { position: relative; padding-left: 30px; }

.sc-step {
  position: absolute; inset: 0 0 auto 30px;
  opacity: 0; transform: translateY(22px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.3,1);
  pointer-events: none;
}
.sc-step.is-active { position: relative; opacity: 1; transform: translateY(0); pointer-events: auto; }

.sc-step .sc-n {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: var(--orange);
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--orange-soft); border: 1px solid var(--orange-line);
  margin-bottom: 18px;
}
.sc-step h3 { font-size: clamp(26px, 3.4vw, 40px); margin: 0 0 14px; }
.sc-step p { font-size: clamp(16px, 1.4vw, 18.5px); color: var(--ink-soft); margin: 0 0 22px; max-width: 46ch; }
.sc-step .sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sc-step .sc-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); font-size: 15.5px; }
.sc-step .sc-list .tick {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center; margin-top: 1px;
  background: var(--orange-soft); border: 1px solid var(--orange-line); color: var(--orange);
}
.sc-step .sc-list .tick .ic { width: 13px; height: 13px; }

/* step counter dots */
.sc-dots { display: flex; gap: 10px; margin-top: 34px; padding-left: 30px; }
.sc-dots i {
  width: 30px; height: 4px; border-radius: 3px; background: var(--border-strong);
  transition: background .3s, box-shadow .3s;
}
.sc-dots i.on { background: var(--orange); box-shadow: 0 0 10px rgba(254,128,38,.6); }

/* scroll hint */
.sc-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; z-index: 4;
  font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-mute);
  transition: opacity .4s ease;
}
.sc-hint .ic { width: 16px; height: 16px; animation: scBob 1.6s ease-in-out infinite; }
@keyframes scBob { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(4px) } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .scrolly-stage { grid-template-columns: 1fr; gap: 26px; justify-items: center; text-align: center; }
  .scrolly-phone { width: min(260px, 62vw); }
  .scrolly-pill.p-a { left: 2%; } .scrolly-pill.p-b { right: 0%; }
  .scrolly-copy { min-height: 260px; width: 100%; max-width: 520px; }
  .sc-rail { display: none; }
  .sc-steps, .sc-dots { padding-left: 0; }
  .sc-step { inset: 0 0 auto 0; }
  .sc-step p { margin-inline: auto; }
  .sc-step .sc-list { text-align: left; max-width: 360px; margin-inline: auto; }
  .sc-dots { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .scrolly-phone .shot, .scrolly-pill, .sc-step { transition: opacity .2s ease; transform: none !important; }
  .scrolly-phone .glow, .sc-hint .ic { animation: none; }
}
