/* ReignVoIP v2 — intro, call path, softphone, savings, timeline, reveals */

/* ---------- Intro: the call ---------- */
.intro { display: none; }
.js-intro .intro {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: var(--ink); transition: opacity .6s ease, visibility .6s;
}
.js-intro.intro-done .intro { opacity: 0; visibility: hidden; }
.js-intro body { overflow: hidden; }
.intro-num { font: 700 clamp(1.6rem, 4vw, 2.8rem)/1 var(--font-display); color: var(--paper); letter-spacing: .04em; min-height: 1em; }
.intro-num::after { content: ""; display: inline-block; width: 3px; height: .9em; margin-left: 6px; background: var(--gold); vertical-align: -.1em; animation: blink 1s steps(1) infinite; }
.intro-state { font-size: .95rem; color: var(--mist); min-height: 1.2em; }
.intro-wave { width: min(640px, 80vw); height: 90px; transition: transform .7s cubic-bezier(.7, 0, .2, 1); }
.intro-wave path { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; }
.intro-out .intro-wave { transform: scaleX(3); }
.intro-skip { position: absolute; right: 24px; bottom: 24px; color: var(--mist); font-size: .85rem; padding: 10px 14px; border-radius: 8px; }
.intro-skip:hover { color: var(--paper); }

/* hero entrance (plays after intro or on load) */
.js .hero2 .hero2-badge, .js .hero2 .hero2-title > *, .js .hero2 .hero2-desc, .js .hero2 .hero2-cta, .js .hero2 .hero-facts, .js .hero2 .hero2-side {
  opacity: 0; transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.22, 1, .36, 1), transform .9s cubic-bezier(.22, 1, .36, 1);
}
.hero2 .hero2-title > * { display: block; }
.hero-in .hero2 .hero2-badge, .hero-in .hero2 .hero2-title > *, .hero-in .hero2 .hero2-desc,
.hero-in .hero2 .hero2-cta, .hero-in .hero2 .hero-facts, .hero-in .hero2 .hero2-side { opacity: 1; transform: none; }
.hero-in .hero2 .hero2-title > :nth-child(1) { transition-delay: .08s; }
.hero-in .hero2 .hero2-title > :nth-child(2) { transition-delay: .2s; }
.hero-in .hero2 .hero2-desc { transition-delay: .32s; }
.hero-in .hero2 .hero2-cta { transition-delay: .42s; }
.hero-in .hero2 .hero-facts { transition-delay: .52s; }
.hero-in .hero2 .hero2-side { transition-delay: .25s; }

/* ---------- Heading line reveal ---------- */
.rv-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.rv-w > span { display: inline-block; will-change: transform; }

/* photos outside the hero: scroll-driven reveal instead of ken burns */
.photo-frame img { animation: none; transform: none; }
.hero2 .photo-frame img { animation: kenburns 22s ease-in-out infinite alternate; }

/* ---------- Call path ---------- */
.callpath { position: relative; background: var(--ink); border-top: 1px solid var(--line); }
.callpath-pin { min-height: 100vh; display: flex; align-items: center; padding: 96px 0; }
.cp-head { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.cp-stage { position: relative; padding: 0 2%; }
.cp-track { position: relative; height: 2px; background: var(--line-strong); margin: 0 10%; }
.cp-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--sky), var(--gold)); transform-origin: left; transform: scaleX(var(--p, 0)); }
.cp-signal { position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 6px rgba(245, 184, 61, .2), 0 0 30px 6px rgba(245, 184, 61, .5); }
.cp-nodes { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin: -23px 0 0; padding: 0; }
.cp-node { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--mist); transition: color .4s; }
.cp-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); border: 2px solid var(--line-strong); font: 700 .9rem/1 var(--font-display); color: var(--mist); transition: border-color .4s, color .4s, background .4s, box-shadow .4s; }
.cp-txt { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cp-node b { font-size: .95rem; font-weight: 700; max-width: 16ch; line-height: 1.3; }
.cp-desc { display: none; color: var(--mist); line-height: 1.65; font-size: .95rem; }
.cp-node.is-on { color: var(--paper); }
.cp-node.is-on .cp-dot { border-color: var(--gold); color: var(--ink); background: var(--gold); box-shadow: 0 0 0 8px rgba(245, 184, 61, .12); }
.cp-panels { position: relative; max-width: 640px; margin: 56px auto 0; min-height: 120px; text-align: center; }
.cp-panel { position: absolute; inset: 0; opacity: 0; transform: translateY(14px); transition: opacity .45s, transform .45s; }
.cp-panel.is-on { opacity: 1; transform: none; }
.cp-panel h3 { font: 700 1.35rem/1.25 var(--font-display); color: #fff; margin: 0 0 10px; }
.cp-panel p { color: var(--mist); line-height: 1.7; margin: 0; }
.cp-ring { display: inline-flex; align-items: flex-end; gap: 4px; height: 28px; margin-top: 14px; }
.cp-ring i { width: 4px; border-radius: 2px; background: var(--gold); height: 20%; animation: wave 1s ease-in-out infinite; }
.cp-ring i:nth-child(2n) { animation-delay: .15s; } .cp-ring i:nth-child(3n) { animation-delay: .3s; }

.cp-viz { display: flex; align-items: center; justify-content: center; gap: 5px; height: 90px; margin: 40px auto 0; max-width: 760px; opacity: calc(.25 + var(--p, 0) * .75); }
.cp-viz i { flex: 1; max-width: 8px; border-radius: 4px; background: linear-gradient(var(--gold), var(--sky)); height: calc(8% + var(--p, 0) * var(--h, 50%)); animation: cpBar 1.4s ease-in-out infinite; transform-origin: center; }
@keyframes cpBar { 50% { transform: scaleY(.45); } }
.cp-static .cp-viz { display: none; }
@media (max-width: 899px) { .cp-viz { display: none; } }
@media (prefers-reduced-motion: reduce) { .cp-viz i { animation: none; } }

/* static fallback: vertical stepper */
.cp-static .cp-track, .cp-static .cp-signal { display: none; }
@media (max-width: 899px) {
  .callpath-pin { min-height: 0; padding: 72px 0; }
  .cp-track { display: none; }
  .cp-nodes { grid-template-columns: 1fr; margin: 0; gap: 0; border-left: 2px solid var(--line-strong); margin-left: 21px; }
  .cp-node { flex-direction: row; text-align: left; align-items: flex-start; gap: 16px; margin-left: -23px; padding-bottom: 26px; color: var(--paper); }
  .cp-node .cp-dot { border-color: var(--gold); color: var(--gold); flex: none; }
  .cp-txt { align-items: flex-start; padding-top: 10px; }
  .cp-node b { max-width: none; font-size: 1.05rem; }
  .cp-desc { display: block; }
  .cp-panels { display: none; }
}
/* static (reduced motion / no GSAP) on desktop: show descriptions under nodes */
.cp-static .callpath-pin { min-height: 0; }
.cp-static .cp-desc { display: block; font-size: .85rem; }
.cp-static .cp-panels { display: none; }
.cp-static .cp-node { color: var(--paper); }
.cp-static .cp-dot { border-color: var(--gold); color: var(--gold); }

/* ---------- Softphone (interactive) ---------- */
.dial-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: center; }
.phone { background: linear-gradient(180deg, #111c36, #0b1426); border: 1px solid var(--line-strong); border-radius: 36px; padding: 26px 24px 24px; box-shadow: 0 50px 100px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06); }
.ph-screen { min-height: 132px; padding: 8px 6px 18px; text-align: center; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ph-num { font: 700 1.9rem/1.2 var(--font-display); color: #fff; letter-spacing: .03em; min-height: 1.2em; word-break: break-all; }
.ph-num:empty::before { content: "+"; color: var(--mist); }
.ph-country { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 28px; margin-top: 10px; color: var(--paper); font-weight: 700; }
.ph-country img { width: 26px; height: auto; border-radius: 3px; }
.ph-rate { margin-top: 6px; color: var(--gold); font-weight: 700; font-size: .95rem; min-height: 1.4em; }
.ph-hint { color: var(--mist); font-size: .85rem; }
.ph-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ph-key { aspect-ratio: 1.35; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 1.35rem/1 var(--font-display); transition: background .15s, transform .1s, border-color .2s; touch-action: manipulation; }
.ph-key small { font: 600 .62rem/1 var(--font-family, Manrope); color: var(--mist); letter-spacing: .12em; min-height: .62rem; }
.ph-key:hover { background: rgba(255, 255, 255, .09); border-color: var(--line-strong); }
.ph-key:active, .ph-key.is-press { transform: scale(.94); background: rgba(245, 184, 61, .18); border-color: var(--gold); }
.ph-actions { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 12px; margin-top: 14px; align-items: center; }
.ph-call { height: 58px; border-radius: 29px; background: #10b981; color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; position: relative; transition: transform .15s, box-shadow .3s; }
.ph-call svg { width: 22px; height: 22px; }
.ph-call.is-ready { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); animation: ring 1.8s infinite; }
.ph-call[aria-disabled="true"] { background: #1f2b44; color: var(--mist); pointer-events: none; }
.ph-small { height: 46px; border-radius: 14px; color: var(--mist); display: grid; place-items: center; border: 1px solid var(--line); }
.ph-small:hover { color: var(--paper); border-color: var(--line-strong); }
.ph-small svg { width: 20px; height: 20px; }
.ph-small[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.dial-copy p { color: var(--mist); line-height: 1.75; margin: 0 0 18px; max-width: 56ch; }
.dial-try { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dial-try button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--paper); font-weight: 700; font-size: .9rem; }
.dial-try button:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Savings ---------- */
.sav { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; background: var(--navy); border: 1px solid var(--line); border-radius: 28px; padding: 44px; }
.sav-field { margin-bottom: 26px; }
.sav-field label { display: flex; justify-content: space-between; color: var(--paper); font-weight: 700; margin-bottom: 12px; }
.sav-field output { color: var(--gold); font-family: var(--font-display); }
.sav select { width: 100%; height: 52px; border-radius: 14px; background: var(--ink); color: var(--paper); border: 1px solid var(--line-strong); padding: 0 16px; font: 600 1rem var(--font-family, Manrope); }
.sav input[type="range"] { width: 100%; accent-color: var(--gold); height: 28px; }
.sav-scale { display: flex; justify-content: space-between; color: var(--mist); font-size: .8rem; }
.sav-out { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sav-box { padding: 20px; border-radius: 18px; background: var(--ink); border: 1px solid var(--line); }
.sav-box small { display: block; color: var(--mist); font-size: .85rem; margin-bottom: 6px; }
.sav-box strong { font: 700 1.5rem/1.1 var(--font-display); color: var(--paper); font-variant-numeric: tabular-nums; }
.sav-box.big { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(245, 184, 61, .16), rgba(245, 184, 61, .04)); border-color: rgba(245, 184, 61, .4); }
.sav-box.big strong { font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--gold); }
.sav-note { color: var(--mist); font-size: .8rem; margin-top: 14px; grid-column: 1 / -1; }

/* ---------- Timeline ---------- */
.timeline { position: relative; z-index: 1; margin: 88px auto 0; max-width: 980px; }
.timeline h3 { font: 700 1.5rem/1.2 var(--font-display); color: #fff; margin: 0 0 36px; text-align: center; }
.tl { position: relative; list-style: none; margin: 0; padding: 0; }
.tl::before, .tl::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--line-strong); }
.tl::after { background: linear-gradient(var(--sky), var(--gold)); transform-origin: top; transform: scaleY(var(--tp, 1)); }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; padding: 18px 0; }
.tl-item::before { content: ""; position: absolute; left: 50%; top: 26px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid var(--gold); z-index: 1; }
.tl-year { font: 800 2rem/1 var(--font-display); color: var(--gold); text-align: right; padding-top: 14px; }
.tl-text { color: var(--paper); line-height: 1.65; padding-top: 12px; max-width: 42ch; }
.tl-item:nth-child(even) .tl-year { order: 2; text-align: left; }
.tl-item:nth-child(even) .tl-text { order: 1; text-align: right; justify-self: end; }

@media (max-width: 1024px) {
  .dial-grid, .sav { grid-template-columns: 1fr; }
  .dial-grid .phone { max-width: 380px; margin: 0 auto; width: 100%; }
}
@media (max-width: 640px) {
  .sav { padding: 24px; }
  .sav-out { grid-template-columns: 1fr; }
  .tl::before, .tl::after { left: 7px; }
  .tl-item, .tl-item:nth-child(even) { grid-template-columns: 1fr; gap: 4px; padding-left: 34px; }
  .tl-item::before { left: 7px; }
  .tl-year, .tl-item:nth-child(even) .tl-year { order: 0; text-align: left; font-size: 1.5rem; }
  .tl-item:nth-child(even) .tl-text { order: 1; text-align: left; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .hero2 .hero2-badge, .hero2 .hero2-title > *, .hero2 .hero2-desc, .hero2 .hero2-cta, .hero2 .hero-facts, .hero2 .hero2-side { opacity: 1; transform: none; transition: none; }
  .ph-call.is-ready, .cp-ring i { animation: none; }
}
