/* Content pages (How it works, Security, Pricing, FAQ) in the stage theme. Each page has one
   thing to look at; copy stays short. Animations move only transform and opacity, loop only
   while their block is on screen (.playing, set by script), and show their final frame for
   reduced motion: the default styles ARE the final frame, keyframes start from the earlier one. */

.page-head h1 { max-width: 16em; }
.seg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -12px 0 28px; }
.seg-label { font-weight: 700; color: var(--muted); }

/* ---------- How it works: storyboard ---------- */

.lane-heads {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--muted);
  text-align: center;
}
.lane-heads span:last-child { grid-column: 3; }
.storyboard { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.step {
  counter-increment: step;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  padding: 18px 22px 22px;
}
.step-title { font-size: 1.3rem;margin: 0 0 14px; display: flex; align-items: center; gap: 12px; }
.step-title::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--lemon); color: var(--on-lemon);
  font-size: 1rem;
}
.lanes { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: center; }
.lane { display: grid; justify-items: center; gap: 10px; text-align: center; }
.cap { margin: 0; max-width: 24em; color: var(--text); font-weight: 600; line-height: 1.45; }
.cap .soon { margin-right: 6px; }

.mini {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg);
  border: 2px solid var(--border);
  overflow: hidden;
  padding: 10px;
}
.mini.laptop { width: min(100%, 300px); aspect-ratio: 16 / 10; border-radius: 12px; }
.mini.phone { width: 128px; aspect-ratio: 9 / 16; border-radius: 22px; padding: 14px 10px; }

.m-btn { padding: 6px 12px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; font-size: 0.85rem; }
.m-code { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: 0.1em; }
.mini.phone .m-code { font-size: 1rem; }
.m-url { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.m-qr {
  width: 64px; height: 64px; border-radius: 6px;
  background:
    conic-gradient(from 90deg at 30% 30%, var(--brand-ink) 25%, #fff 0) 0 0 / 16px 16px,
    #fff;
  border: 6px solid #fff;
}
.mini.phone .m-qr { width: 48px; height: 48px; }
.m-joined { padding: 4px 10px; border-radius: 999px; background: var(--good); color: var(--on-good); font-weight: 700; font-size: 0.8rem; }
.m-q { font-weight: 700; font-size: 0.85rem; line-height: 1.3; text-align: center; }
.mini.phone .m-q { font-size: 0.75rem; }
.m-opts { display: grid; gap: 4px; width: 100%; }
.m-opts .opt { display: block; padding: 4px 6px; border-radius: 6px; background: var(--surface-2); font-size: 0.7rem; font-weight: 600; text-align: left; }
.m-opts.tapped .opt.pick { background: var(--lemon); color: var(--on-lemon); }
.m-count { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.m-count b { display: block; font-family: var(--display); font-size: 2.6rem; color: var(--text); line-height: 1; }
.m-bars { display: grid; gap: 5px; width: 100%; }
.bar-row { position: relative; display: block; border-radius: 6px; background: var(--surface-2); overflow: hidden; font-size: 0.75rem; font-weight: 700; text-align: left; }
.mb-fill { position: absolute; inset: 0; background: var(--stage-ultra); opacity: 0.6; transform-origin: left center; transform: scaleX(var(--w, 0)); }
.bar-row.top .mb-fill { background: var(--good-fill); opacity: 1; }
.bar-text { position: relative; display: block; padding: 4px 8px; }
.m-result { padding: 8px 10px; border-radius: 10px; background: var(--good); color: var(--on-good); font-weight: 700; font-size: 0.8rem; text-align: center; }
.m-file { padding: 10px 14px 10px 30px; border-radius: 8px; background: var(--surface-2); font-weight: 700; position: relative; }
.m-file::before { content: ''; position: absolute; left: 10px; top: 50%; width: 12px; height: 15px; margin-top: -7.5px; border-radius: 2px; background: var(--lemon); }
.m-push { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 0.75rem; font-weight: 600; text-align: left; align-self: stretch; }

/* The wire between the two lanes; dots show which way the data goes. */
.wire { position: relative; height: 2px; margin: 0 6px; background: var(--border); }
.w-dot { position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--lemon); opacity: 0; }
.wire.left .w-dot { left: auto; right: 0; }

@keyframes a-press { 0%, 20% { transform: scale(1); } 26% { transform: scale(0.9); } 32%, 100% { transform: scale(1); } }
@keyframes a-pop { 0%, 30% { opacity: 0; transform: translateY(6px) scale(0.96); } 42%, 100% { opacity: 1; transform: none; } }
@keyframes a-scan { 0%, 10% { transform: translateY(-30%) scale(0.8); opacity: 0.4; } 40%, 100% { transform: none; opacity: 1; } }
@keyframes a-tick { 0% { transform: scale(0.9); opacity: 0.4; } 50%, 100% { transform: none; opacity: 1; } }
@keyframes w-right { 0%, 25% { transform: translateX(0); opacity: 0; } 30% { opacity: 1; } 55% { transform: translateX(var(--run, 44px)); opacity: 1; } 60%, 100% { transform: translateX(var(--run, 44px)); opacity: 0; } }
@keyframes w-left { 0%, 25% { transform: translateX(0); opacity: 0; } 30% { opacity: 1; } 55% { transform: translateX(calc(-1 * var(--run, 44px))); opacity: 1; } 60%, 100% { transform: translateX(calc(-1 * var(--run, 44px))); opacity: 0; } }
@keyframes bar-grow { 0%, 20% { transform: scaleX(0); } 60%, 100% { transform: scaleX(var(--w, 0)); } }

.step.playing .a-press { animation: a-press 4s ease-in-out infinite; }
.step.playing .a-pop { animation: a-pop 4s ease-out infinite; }
.step.playing .a-scan { animation: a-scan 4s ease-out infinite; }
.step.playing .a-tick { animation: a-tick 1s ease-out infinite; }
.step.playing .wire.right .w-dot { animation: w-right 4s ease-in-out infinite; }
.step.playing .wire.left .w-dot { animation: w-left 4s ease-in-out infinite; }
.step.playing .wire .d2 { animation-delay: 0.35s; }
.step.playing .wire .d3 { animation-delay: 0.7s; }
.step.playing .mb-fill { animation: bar-grow 4s ease-out infinite; }

@media (max-width: 699px) {
  .lane-heads { display: none; }
  .lanes { grid-template-columns: 1fr; gap: 10px; }
  .wire { width: 2px; height: 36px; margin: 0 auto; }
  .wire .w-dot { top: 0; left: -4px; }
  .wire.left .w-dot { right: auto; top: auto; bottom: 0; }
  @keyframes w-right { 0%, 25% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 55% { transform: translateY(26px); opacity: 1; } 60%, 100% { transform: translateY(26px); opacity: 0; } }
  @keyframes w-left { 0%, 25% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 55% { transform: translateY(-26px); opacity: 1; } 60%, 100% { transform: translateY(-26px); opacity: 0; } }
}

.also { margin-top: 48px; }
.also h2 { font-size: 1.6rem;margin-bottom: 14px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tiles li { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface); color: var(--muted); line-height: 1.45; }
.tiles b { display: block; color: var(--text); font-family: var(--display); font-size: 1.1rem; margin-bottom: 4px; }
.soon-tiles li { border-style: dashed; background: transparent; }

/* ---------- Security: where things live ---------- */

.zones { display: grid; gap: 16px; grid-template-columns: 1.15fr 1fr 1fr; align-items: start; }
.zone { border-radius: 22px; padding: 18px; background: var(--surface); border: 2px solid var(--border); }
.zone h2 { font-size: 1.25rem;margin: 0 0 12px; }
.zone.laptop-zone { border-color: var(--good); }
.zone.server-zone { border-style: dashed; }
.keep { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.keep li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-weight: 650; }
.keep .tag { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--lemon); color: var(--on-lemon); white-space: nowrap; }
.carry { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.carry li { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); font-weight: 600; }
.provider { margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
/* The optional provider sits under the laptop, joined by a dashed path: an optional route that
   bypasses Odigos entirely. */
.provider-path { grid-column: 1; grid-row: 2; justify-self: center; position: relative; width: 0; height: 44px; border-left: 2px dashed var(--lemon); margin: -16px 0; }
.provider-path span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 0.85rem; font-weight: 700; color: var(--lemon); }
.provider-zone { grid-column: 1; grid-row: 3; border-style: dashed; border-color: var(--lemon); }
.provider-zone p { margin: 0; color: var(--muted); line-height: 1.5; }
.optional { font-family: var(--font); font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--lemon); color: var(--lemon); vertical-align: middle; margin-left: 6px; }

/* The flow: chips that travel the real paths between the zones. */
.flow { position: relative; margin: 18px 0 8px; height: 76px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.track { position: absolute; left: 12px; right: 12px; height: 28px; }
.track.out { top: 8px; }
.track.back { bottom: 8px; }
.rider { position: absolute; inset: 0; }
.flow-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.track.out .flow-chip { background: var(--lemon); color: var(--on-lemon); }
.track.back .flow-chip { background: var(--accent); color: #fff; }
.track.back .rider { text-align: right; }
@keyframes ride-out { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateX(78%); opacity: 0; } }
@keyframes ride-back { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateX(-78%); opacity: 0; } }
.flow.playing .track.out .rider { animation: ride-out 4.5s linear infinite; }
.flow.playing .track.back .rider { animation: ride-back 4.5s linear infinite; animation-delay: 2.2s; }
.flow-labels { display: grid; grid-template-columns: 1fr 1fr 1fr; text-align: center; color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-bottom: 28px; }

.zones ~ .col-title { margin-top: 40px; }
.promises { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 8px; }
.promises details { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 14px 16px; }
.promises summary { cursor: pointer; font-family: var(--display); font-weight: 750; font-size: 1.1rem; line-height: 1.25; }
.promises summary:focus-visible { outline: 3px solid var(--lemon); outline-offset: 3px; border-radius: 6px; }
.promises details p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.fine { margin-top: 28px; color: var(--muted); max-width: 46rem; line-height: 1.55; }
.fine a { color: var(--text); }

@media (max-width: 899px) {
  .zones { grid-template-columns: 1fr; }
  .flow, .flow-labels { display: none; }
  /* One column: the provider stays right under the laptop it connects to. */
  .provider-path, .provider-zone { grid-row: auto; }
  .laptop-zone { order: 0; }
  .provider-path { order: 1; }
  .provider-zone { order: 2; }
  .server-zone { order: 3; }
  .phones-zone { order: 4; }
}

/* ---------- Pricing ---------- */

.free-stage {
  position: relative;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--stage-ultra) 30%, transparent), transparent 60%),
    var(--surface);
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
}
.free-word {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4.2rem, 13vw, 9rem);
  line-height: 0.9;
  margin: 0;
  padding: 0 0.08em;
  background: var(--lemon);
  color: var(--on-lemon);
  border-radius: 0.06em;
}
.free-sub { font-size: 1.3rem; font-weight: 650; margin: 14px 0 6px; }
.free-note { color: var(--muted); margin: 0 auto 22px; max-width: 34em; }
.later { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.later li { border-left: 4px solid var(--lemon); padding: 6px 0 6px 14px; color: var(--muted); line-height: 1.5; }
.later b { display: block; color: var(--text); font-size: 1.1rem; }

/* ---------- FAQ ---------- */

.faq-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.faq-search { flex: 1 1 280px; max-width: 420px; }
.faq-search input { min-height: 48px; font-size: 1.05rem; }
.faq-group { margin-top: 28px; }
.faq-group h2 { font-size: 1.45rem;margin-bottom: 10px; }
.faq-list { display: grid; gap: 8px; }
.faq-list details { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 2px 16px; }
.faq-list summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; padding: 12px 0; }
.faq-list summary:focus-visible { outline: 3px solid var(--lemon); outline-offset: 2px; border-radius: 6px; }
.faq-list details p { margin: 0 0 14px; line-height: 1.6; color: var(--muted); max-width: 44rem; }
.faq-list details p a { color: var(--text); }
.faq-empty { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .step .a-press, .step .a-pop, .step .a-scan, .step .a-tick, .step .w-dot, .step .mb-fill, .flow .rider { animation: none !important; }
  .w-dot { opacity: 0; }
}
