/* Hero animation: a phone showing talk → building → pay link → "Link copied".
   hero.js sets data-step on #hero-demo (talk, stop, build, link, tap, copied, fade);
   every rule below just says what each step looks like. Colors match the app (theme.ts). */

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.hero-phone { margin: 0 auto; }

/* The phone */
.phone {
  width: 300px; height: 610px; padding: 11px; border-radius: 50px;
  background: #111111; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
}
.phone-screen {
  position: relative; height: 100%; overflow: hidden;
  border-radius: 40px; background: #F2F2F7; color: #000000;
}
.status-bar {
  position: relative; height: 44px; padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600;
}
.island {
  position: absolute; top: 10px; left: 50%; width: 88px; height: 26px;
  margin-left: -44px; border-radius: 13px; background: #000000;
}
.battery { width: 24px; height: 11px; border-radius: 3px; border: 1.5px solid #000000; position: relative; }
.battery::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; border-radius: 1px; background: #000000; }

/* Each screen sits on top of the others and fades in on its own step */
.scene {
  position: absolute; top: 44px; left: 16px; right: 16px; bottom: 18px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
[data-step="talk"] .scene-talk,
[data-step="stop"] .scene-talk,
[data-step="build"] .scene-build,
[data-step="link"] .scene-link,
[data-step="tap"] .scene-link,
[data-step="copied"] .scene-link { opacity: 1; transform: none; }

/* Screen 1: talking */
.scene-talk { display: flex; flex-direction: column; }
.talk-title { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; margin-top: 8px; }
.speech {
  flex: 1; display: flex; flex-wrap: wrap; align-content: center; gap: 0 6px;
  font-size: 23px; line-height: 1.3; font-weight: 600; letter-spacing: -0.3px;
}
.word { opacity: 0; transform: translateY(8px); transition: opacity 0.25s ease, transform 0.25s ease; }
.word.shown { opacity: 1; transform: none; }
.talk-bottom { display: flex; flex-direction: column; align-items: center; }
.waves { display: flex; align-items: center; gap: 4px; height: 28px; }
.waves i { width: 4px; height: 6px; border-radius: 2px; background: #FF3B30; }
[data-step="talk"] .waves i { animation: wave 0.9s ease-in-out infinite; }
.waves i:nth-child(2) { animation-delay: -0.2s; }
.waves i:nth-child(3) { animation-delay: -0.5s; }
.waves i:nth-child(4) { animation-delay: -0.1s; }
.waves i:nth-child(5) { animation-delay: -0.6s; }
.waves i:nth-child(6) { animation-delay: -0.3s; }
.waves i:nth-child(7) { animation-delay: -0.7s; }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 26px; } }
.rec-time { font-size: 14px; color: #8A8A8E; font-variant-numeric: tabular-nums; margin: 6px 0 14px; }
.rec-btn {
  width: 76px; height: 76px; border-radius: 50%; background: #FF3B30;
  box-shadow: 0 0 0 10px #FFE5E3; display: grid; place-items: center;
  transition: transform 0.15s ease;
}
.rec-square { width: 26px; height: 26px; border-radius: 7px; background: #FFFFFF; }
[data-step="stop"] .rec-btn { transform: scale(0.88); }
.rec-hint { font-size: 14px; color: #8A8A8E; margin-top: 18px; }

/* Screen 2: building */
.scene-build { display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.skeleton-card { background: #FFFFFF; border-radius: 20px; padding: 18px; display: grid; gap: 12px; }
.skeleton-card i { height: 12px; border-radius: 6px; background: #E5E5EA; animation: pulse 1s ease-in-out infinite; }
.skeleton-card i:nth-child(1) { width: 45%; }
.skeleton-card i:nth-child(2) { width: 70%; height: 26px; }
.skeleton-card i:nth-child(3) { width: 90%; }
.skeleton-card i:nth-child(4) { width: 80%; }
@keyframes pulse { 50% { opacity: 0.45; } }
.build-text { text-align: center; font-size: 15px; color: #8A8A8E; }

/* Screen 3: the pay link. Its parts slide in one after another. */
.review-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; margin: 6px 0 12px; }
.inv-card { background: #FFFFFF; border-radius: 20px; padding: 16px 14px; font-size: 13px; }
.inv-biz { font-weight: 600; }
.inv-due { color: #8A8A8E; font-size: 12px; margin-top: 10px; }
.inv-amount { font-size: 32px; font-weight: 600; letter-spacing: -0.6px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.inv-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid #E5E5EA; }
.inv-row em, .sched-row em { display: block; font-style: normal; font-size: 11px; color: #007AFF; margin-top: 2px; }
.inv-schedule { background: #F2F2F7; border-radius: 12px; padding: 10px 8px; margin-top: 8px; font-size: 12px; }
.sched-title { font-size: 11px; font-weight: 600; color: #8A8A8E; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
/* Amounts never shrink or wrap; the words get whatever room is left (and wrap only if they truly must).
   Fonts differ by device (iPhone's is wider than Windows'), so nothing here may assume a width. */
.sched-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.sched-text { flex: 1; min-width: 0; }
.sched-row > span:last-child, .inv-row > span:last-child { flex: none; white-space: nowrap; padding-left: 6px; }
.sched-row em { color: #8A8A8E; }
/* Same icons as the app's Payment schedule: green check for what's due today, blue arrows for repeating */
.sched-icon { width: 16px; height: 16px; flex: none; }
.icon-paid circle { fill: #34C759; }
.icon-paid path { fill: none; stroke: #FFFFFF; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.icon-repeat path { fill: none; stroke: #007AFF; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.scene-link .inv-card > *,
.scene-link .copy-btn { opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease, transform 0.3s ease; }
[data-step="link"] .scene-link .inv-card > *,
[data-step="tap"] .scene-link .inv-card > *,
[data-step="copied"] .scene-link .inv-card > *,
[data-step="link"] .scene-link .copy-btn,
[data-step="tap"] .scene-link .copy-btn,
[data-step="copied"] .scene-link .copy-btn { opacity: 1; transform: none; }
.inv-card > :nth-child(2) { transition-delay: 0.05s; }
.inv-card > :nth-child(3) { transition-delay: 0.1s; }
.inv-card > :nth-child(4) { transition-delay: 0.2s; }
.inv-card > :nth-child(5) { transition-delay: 0.3s; }
.inv-card > :nth-child(6) { transition-delay: 0.4s; }
.scene-link .copy-btn { transition-delay: 0.5s; }

/* Copy link → Link copied. It stays green through "fade", so the blue button never flashes before the loop restarts. */
.copy-btn {
  position: absolute; left: 0; right: 0; bottom: 4px; height: 50px; border-radius: 14px;
  background: #007AFF; color: #FFFFFF; font-size: 16px; font-weight: 600;
  display: grid; place-items: center;
}
[data-step="tap"] .copy-btn { transform: scale(0.96); transition-delay: 0s; }
[data-step="copied"] .copy-btn,
[data-step="fade"] .copy-btn { background: #34C759; transition: background 0.25s ease; }
.copy-label, .copied-label { grid-area: 1 / 1; transition: opacity 0.2s ease; }
.copied-label { display: flex; align-items: center; gap: 6px; opacity: 0; }
[data-step="copied"] .copy-label,
[data-step="fade"] .copy-label { opacity: 0; }
[data-step="copied"] .copied-label,
[data-step="fade"] .copied-label { opacity: 1; }
.copied-label svg { fill: none; stroke: #FFFFFF; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.copied-label path { stroke-dasharray: 22; stroke-dashoffset: 22; }
[data-step="copied"] .copied-label path,
[data-step="fade"] .copied-label path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.35s ease 0.1s; }

/* The "finger" tapping Copy link */
.tap-dot {
  position: absolute; left: 50%; bottom: 13px; width: 32px; height: 32px; margin-left: -16px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.25); opacity: 0; transform: scale(1.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
[data-step="tap"] .tap-dot { opacity: 1; transform: scale(1); }

/* People who turn off motion on their device see the finished pay link, still. */
@media (prefers-reduced-motion: reduce) {
  .phone-screen *, .phone-screen *::after { transition: none !important; animation: none !important; }
}
