/* =====================================================================
   Motion, hover effects, card refinements and tablet/phone layouts.
   Loaded after styles.css. Everything animated is switched off for
   visitors whose device asks for reduced motion (bottom of this file).
   ===================================================================== */
:root {
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-lg: 0 22px 50px rgba(23, 59, 89, 0.16);
}

/* ---------- Scroll reveal (main.js adds .reveal, then .is-visible) ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--delay, 0s); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.site-header { transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(23, 59, 89, 0.10); }
@media (min-width: 900px) {
  .site-nav a:not(.btn) { position: relative; }
  .site-nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--blue); border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
  .site-nav a:not(.btn):hover::after, .site-nav a.active::after { transform: scaleX(1); }
  .site-nav a.active { color: var(--blue-dark); }
}
.brand img { transition: transform .4s var(--ease); }
.brand:hover img { transform: translateX(4px); }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; }
.btn-primary { box-shadow: 0 6px 16px rgba(35, 157, 208, .28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(35, 157, 208, .38); }
.btn-ghost:hover { transform: translateY(-2px); background: #fff; }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.btn-arrow { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }
/* A light sweep across primary buttons on hover */
.btn-primary::before { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg); transition: left .6s var(--ease); }
.btn-primary:hover::before { left: 120%; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.hero::before { width: 420px; height: 420px; background: #BFE6F6; top: -140px; right: -120px; animation: drift 14s ease-in-out infinite alternate; }
.hero::after { width: 300px; height: 300px; background: #DDEFF8; bottom: -120px; left: -100px; animation: drift 18s ease-in-out infinite alternate-reverse; }
.hero-inner { position: relative; z-index: 1; }
.hero-copy > * { animation: rise .8s var(--ease) both; }
.hero-copy > *:nth-child(2) { animation-delay: .08s; }
.hero-copy > *:nth-child(3) { animation-delay: .16s; }
.hero-copy > *:nth-child(4) { animation-delay: .24s; }
.hero-copy > *:nth-child(5) { animation-delay: .32s; }
.hero-visual { position: relative; animation: rise 1s .2s var(--ease) both; }
.shot-hero { animation: float 7s ease-in-out infinite; }
.hero-badge { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-lg); font-size: .85rem; line-height: 1.25; border: 1px solid var(--line); }
.hero-badge strong { display: block; color: var(--navy); }
.hero-badge small { color: var(--muted); }
.badge-top { top: -18px; left: -14px; animation: float 6s ease-in-out infinite reverse; }
.badge-bottom { bottom: -20px; right: -10px; animation: float 6.5s 1s ease-in-out infinite; }
.badge-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--light-blue); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; }
.badge-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--blue-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge-green { background: #DCF5E6; }
.badge-green svg { stroke: #1F9254; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.1); } }

/* ---------- Screenshots ---------- */
.shot { transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.shot img { transition: transform .6s var(--ease); }
.guide-step .shot:hover, .tracking-inner .shot:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.guide-step .shot:hover img { transform: scale(1.02); }

/* ---------- Shared card hover ---------- */
.value-item, .stage, .feature, .audience { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease), background .35s var(--ease); }
.icon-circle { transition: background .3s ease, transform .4s var(--ease); }
.icon-circle svg { transition: stroke .3s ease; }
.feature:hover .icon-circle, .audience:hover .icon-circle, .value-item:hover .icon-circle { background: var(--blue); transform: rotate(-6deg) scale(1.06); }
.feature:hover .icon-circle svg, .audience:hover .icon-circle svg, .value-item:hover .icon-circle svg { stroke: #fff; }

/* Value items */
.value-item { border-radius: var(--radius); padding: 22px 16px; }
.value-item:hover { background: var(--bg); transform: translateY(-4px); }

/* How it works */
.stage:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #BFE0EF; }
.stage-num { transition: background .3s ease, transform .4s var(--ease); }
.stage:hover .stage-num { background: var(--blue); transform: scale(1.08); }

/* Journey: each stage lights up in turn once it scrolls into view */
.journey.is-visible .journey-steps li { animation: step-glow 6s infinite; }
.journey.is-visible .journey-steps li:nth-child(2) { animation-delay: 1.2s; }
.journey.is-visible .journey-steps li:nth-child(3) { animation-delay: 2.4s; }
.journey.is-visible .journey-steps li:nth-child(4) { animation-delay: 3.6s; }
.journey.is-visible .journey-steps li:nth-child(5) { animation-delay: 4.8s; }
@keyframes step-glow {
  0%, 18%, 100% { transform: none; box-shadow: none; }
  6% { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(35, 157, 208, .35); border-color: var(--blue); }
}

/* Features: numbered cards with an accent bar that grows on hover */
.feature-grid { counter-reset: feature; }
.feature { position: relative; overflow: hidden; counter-increment: feature; }
.feature::before { content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 100%; background: linear-gradient(90deg, var(--blue), var(--navy)); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.feature::after { content: counter(feature, decimal-leading-zero); position: absolute; top: 18px; right: 20px; font-weight: 800; font-size: .9rem; color: #D3DEE8; transition: color .3s ease; }
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #CFE7F3; }
.feature:hover::before { transform: scaleX(1); }
.feature:hover::after { color: var(--blue); }

/* Guide */
.getting-started { position: relative; overflow: hidden; }
.getting-started::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(35, 157, 208, .18); right: -60px; top: -80px; pointer-events: none; }
.step-tag { transition: background .3s ease, color .3s ease; }
.guide-step:hover .step-tag { background: var(--blue); color: #fff; }

/* Audience */
.audience .icon-circle { background: #fff; }
.audience:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #A9D8EE; background: #fff; }

/* FAQ: smooth open (main.js animates .faq-body height) */
.faq details { transition: border-color .3s ease, box-shadow .3s ease; }
.faq details:hover { border-color: #BFE0EF; }
.faq details[open] { border-color: var(--blue); box-shadow: 0 8px 22px rgba(23, 59, 89, .08); }
.faq summary::after { transition: transform .3s var(--ease); }
.faq details[open] summary::after { content: "+"; transform: translateY(-50%) rotate(45deg); }
.faq .faq-body { overflow: hidden; transition: height .35s var(--ease); }

/* Final call to action */
.final-cta { position: relative; overflow: hidden; }
.final-cta::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .14), transparent 40%); animation: drift 16s ease-in-out infinite alternate; pointer-events: none; }
.final-cta .container { position: relative; }

/* Footer */
.site-footer a { transition: color .2s ease, transform .2s ease; display: inline-block; }
.footer-links a:hover, .footer-contact a:hover { transform: translateX(3px); }

/* Back to top */
.back-to-top { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; background: var(--navy); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .3s ease, transform .3s var(--ease), background .2s ease; }
.back-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--blue); }
.back-to-top svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* =====================================================================
   Responsive layouts
   ===================================================================== */
/* Small phones (up to 380px) */
@media (max-width: 380px) {
  .container { padding: 0 16px; }
  h1 { font-size: 1.9rem; }
  .lead { font-size: 1rem; }
  .btn-lg { padding: 13px 18px; font-size: 1rem; }
  .stage { padding: 16px; gap: 12px; }
  .stage-num { flex-basis: 34px; height: 34px; }
  .journey-steps li { font-size: .72rem; padding: 6px 9px; }
  .hero-badge { font-size: .75rem; padding: 8px 10px; }
  .hero-badge small { display: none; }
}

/* Phones (up to 640px) */
@media (max-width: 640px) {
  .hero { padding-top: 32px; }
  .hero-visual { margin: 18px 6px 24px; }
  .badge-top { left: -4px; top: -24px; }
  .badge-bottom { right: -4px; bottom: -26px; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 28px; }
  .value { padding: 44px 0; }
  .value-item { padding: 16px 8px; }
  .getting-started { padding: 20px; }
  .guide { gap: 48px; }
  .faq summary { font-size: .97rem; }
  .final-cta { padding: 56px 0; }
  .final-cta .btn { width: 100%; }
  .footer-bottom { text-align: center; }
  .back-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* Tablets (641px to 1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
  .container { padding: 0 32px; }
  .hero { padding: 56px 0 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .hero-copy .lead { margin-left: auto; margin-right: auto; }
  .cta-row { justify-content: center; }
  .hero-visual { max-width: 720px; width: 100%; margin: 0 auto; }
  .section-head { margin-left: auto; margin-right: auto; text-align: center; }
  .value-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .stages { grid-template-columns: repeat(2, 1fr); }
  .stage:last-child { grid-column: 1 / -1; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-step { grid-template-columns: 1fr; gap: 20px; }
  .guide-step .guide-text { order: 0 !important; }
  .guide-step .shot { max-width: 680px; width: 100%; justify-self: center; }
  .tracking-inner { grid-template-columns: 1.1fr .9fr; gap: 36px; }
  .audience-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* Large screens */
@media (min-width: 1024px) {
  .hero-badge { font-size: .9rem; }
  .badge-top { left: -28px; }
  .badge-bottom { right: -24px; }
}

/* ---------- Reduced motion: no animation, everything visible ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
