/* ============================================================
   STOQI — Landing Page Styles
   Colors: #f8aa1a (primary amber), #ff9500 (accent orange)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ---------- Design Tokens ---------- */
:root {
  --primary:   #f8aa1a;
  --secondary: #f8aa1a;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-600:  #4b5563;
  --gray-900:  #111827;
  --white:     #ffffff;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);

  /* ── Motion tokens ── */
  /* Durations */
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 240ms;
  --dur-4: 300ms;
  --dur-5: 500ms;
  --dur-hero: 800ms;   /* marketing hero — steep early curve, long tail is fine */
  --dur-reveal: 640ms; /* scroll reveals on marketing page */

  /* Easing */
  --ease-out-quart: cubic-bezier(.165, .84, .44, 1);   /* default enter/exit     */
  --ease-out-expo:  cubic-bezier(.19,  1,  .22, 1);    /* hero — dramatic snappy */
  --ease-in-out-cubic: cubic-bezier(.645, .045, .355, 1); /* on-screen morph     */
}

/* ---------- Utilities ---------- */
.text-primary { color: var(--primary); }

.container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.container--narrow { max-width: 960px; }
.max-w-5 { max-width: 960px; margin-inline: auto; }

/* ---------- Scroll Animation ----------
   Pattern: entering viewport → ease-out (fast start, calm landing)
   Marketing context → longer durations are fine
   Only transform + opacity — compositor-only, no layout thrashing
   ------------------------------------------------------------ */
.reveal,
.reveal-left,
.reveal-right {
  opacity: 0;
  /* --ease-out-quart: snappy acceleration, smooth settle */
  transition:
    opacity  var(--dur-reveal) var(--ease-out-quart),
    transform var(--dur-reveal) var(--ease-out-quart);
}

/* Keep offsets modest — big values feel synthetic */
.reveal      { transform: translateY(20px); }
.reveal-left { transform: translateX(-24px); }
.reveal-right{ transform: translateX( 24px); }

/* Visible state — no !important needed, same specificity wins by order */
.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible { opacity: 1; transform: none; }

/* ── Hero entrance (on-load, no scroll trigger) ──
   --ease-out-expo: aggressive initial burst, very long tail
   Perfect for a marketing hero — feels alive without feeling slow  */
.animate-fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeUp var(--dur-hero) var(--ease-out-expo) forwards;
}

/* Stagger each hero child */
.hero__content > .animate-fade-up:nth-child(1) { animation-delay: 60ms;  }
.hero__content > .animate-fade-up:nth-child(2) { animation-delay: 160ms; }
.hero__content > .animate-fade-up:nth-child(3) { animation-delay: 240ms; }
.hero__content > .animate-fade-up:nth-child(4) { animation-delay: 320ms; }
.hero__image.animate-fade-up                   { animation-delay: 200ms; }

@keyframes heroFadeUp {
  to { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */
.section {
  padding-block: 6rem;
}
.section--white { background: var(--white); }
.section--gray  { background: var(--gray-50); }
.section--primary {
  background: var(--gradient-primary);
  overflow: hidden;
}

.section__header {
  text-align: center;
  margin-bottom: 4rem;
}
.section__header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
  line-height: 1.2;
}
.section--primary .section__header h2,
.section--primary h2 { color: var(--white); }
.section__header p {
  font-size: 1.25rem;
  color: var(--gray-600);
  max-width: 640px;
  margin-inline: auto;
}

/* ---------- Buttons ----------
   Hover: subtle lift — ease (150ms) per decision tree for state changes
   Shadow: same timing so they travel together                          */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  border-radius: 9999px;
  font-size: 1.125rem;
  font-weight: 500;
  /* Compositor-only: transform + box-shadow */
  transition:
    transform    150ms ease,
    box-shadow   150ms ease;
}
@media (hover: hover) {
  /* Lift on hover — scale instead of translateY avoids hit-area flicker */
  .btn:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
  }
}
/* Active press — quick snap down, ease-out-quart for responsiveness */
.btn:active {
  transform: scale(0.98);
  transition-duration: var(--dur-1);
}
.btn--white { background: var(--white); color: var(--primary); box-shadow: var(--shadow-lg); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--gradient-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Floating particles */
.hero__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero__particles::before,
.hero__particles::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding-block: 5rem;
}
@media (min-width: 1024px) {
  .hero__inner {
    flex-direction: row;
    align-items: center;
  }
}

.hero__content {
  flex: 1;
  text-align: center;
}
@media (min-width: 1024px) {
  .hero__content { text-align: left; }
}

.hero__logo img {
  height: 4rem;
  margin-inline: auto;
}
@media (min-width: 1024px) {
  .hero__logo img { margin-inline: 0; }
}

.hero__logo { margin-bottom: 3rem; }

.hero__content h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 400;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}
.hero__content h1 strong { font-weight: 700; }

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: rgba(255,255,255,0.9);
  max-width: 680px;
  margin-inline: auto;
  line-height: 1.7;
}
@media (min-width: 1024px) {
  .hero__sub { margin-inline: 0; }
}

.hero__cta { margin-top: 2.5rem; display: flex; justify-content: center; }
@media (min-width: 1024px) { .hero__cta { justify-content: flex-start; } }

.hero__image {
  flex: 1;
  display: flex;
  justify-content: center;
}
@media (min-width: 1024px) { .hero__image { justify-content: flex-end; } }

/* ── Phone image: bounce-in on load, then gentle ambient float ──────────
   phoneBounce  — ease-out-expo drop, overshoot, settle (1000ms)
                  Large marketing element + steep early curve = long dur OK
   phoneFloat   — ease-in-out symmetric loop (always on-screen morph)
                  Starts exactly when bounce finishes: delay = 200 + 1000ms
   ──────────────────────────────────────────────────────────────────────── */
.phone-bounce {
  width: min(18rem, 80vw);

  /* Chain: bounce once → hand off to infinite float */
  animation:
    phoneBounce 1000ms cubic-bezier(.19, 1, .22, 1) 200ms both,
    phoneFloat  4200ms ease-in-out              1200ms infinite;
}
@media (min-width: 768px) { .phone-bounce { width: 24rem; } }

/* Drop in from slightly above with a spring-like overshoot:
   0 → 50%: accelerates hard (expo), reaches below target
   70%: rebounds slightly above
   85%: settles just below
   100%: rests at natural position                         */
@keyframes phoneBounce {
  0%   { opacity: 0; transform: translateY(-28px) scale(0.95); }
  50%  { opacity: 1; transform: translateY(10px)  scale(1.02); }
  70%  {             transform: translateY(-5px)  scale(0.99); }
  85%  {             transform: translateY(3px)   scale(1.005);}
  100% { opacity: 1; transform: translateY(0)     scale(1);    }
}

/* Gentle bob: slow enough to be ambient, not distracting
   ease-in-out = natural pendulum (accelerates into + out of extremes) */
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0px);   }
  50%       { transform: translateY(-14px); }
}

/* Animated dots via pseudo */
.hero__particles { position: absolute; inset: 0; }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Cards ----------
   Hover: subtle float — ease-out-quart (snappy) on both shadow and lift
   Scale origin: center (card-level hover, no position shift)           */
.card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  /* box-shadow doesn't hit compositor, but pairing with transform
     keeps the lifted feel coherent; 200ms is medium-frequency-safe */
  transition:
    box-shadow var(--dur-3) var(--ease-out-quart),
    transform  var(--dur-3) var(--ease-out-quart);
}
@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-3px);
  }
}

.card__icon {
  width: 4rem;
  height: 4rem;
  background: var(--gradient-primary);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--white);
  flex-shrink: 0;
}
.card__icon--sm {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  margin-bottom: 0;
}

.card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}
.card p {
  color: var(--gray-600);
  line-height: 1.7;
}

/* Horizontal card variant */
.card--horizontal {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}
.card--horizontal h3 { margin-bottom: 0.5rem; }

/* ---------- Split Layout ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 1024px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse .split__text { order: -1; }
  /* App features section: text gets a little more room since the
     phone screenshot is portrait-narrow; image column is centered  */
  .split--reverse { grid-template-columns: 1.15fr 0.85fr; align-items: center; }
}

.split__image {
  position: relative;
}
.split__image-glow {
  position: absolute;
  inset: -1rem;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-2xl);
  filter: blur(2rem);
}
.split__image img {
  position: relative;
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  width: 100%;
  object-fit: cover;
  max-height: 480px;
}

.split__text h2 {
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}
.split__text p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.8;
}

/* White text split (app section) */
.section--white .split__text h2 { color: var(--gray-900); }
.section--white .split__text p  { color: var(--gray-600); margin-bottom: 2rem; }

.feature-list { margin-top: 1.5rem; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  color: rgba(255,255,255,0.95);
  padding-block: 0.3rem;
}
.dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--white);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  position: relative;
}
@media (min-width: 768px)  { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, 1fr); } }

.step { text-align: center; }

.step__icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.step__icon-bg {
  position: absolute;
  width: 6rem;
  height: 6rem;
  background: rgba(248,170,26,0.15);
  border-radius: 50%;
}
.step__icon {
  position: relative;
  width: 5rem;
  height: 5rem;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}
.step__number {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 2rem;
  height: 2rem;
  background: var(--white);
  border: 4px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
}
.step h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}
.step p { color: var(--gray-600); line-height: 1.7; }

/* ---------- CTA Banner ---------- */
.cta-banner {
  margin-top: 4rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-2xl);
  padding: 3rem;
  text-align: center;
  color: var(--white);
}
.cta-banner__title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  margin-bottom: 0.75rem;
}
.cta-banner__title strong { font-weight: 700; }
.cta-banner__sub {
  font-size: 1.125rem;
  opacity: 0.9;
}

/* ---------- Feature Items ---------- */
.feature-items { display: flex; flex-direction: column; gap: 0.75rem; }
.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--gray-50);
  padding: 1rem;
  border-radius: var(--radius-lg);
}
.feature-item__icon {
  width: 3rem;
  height: 3rem;
  background: var(--gradient-primary);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}
.feature-item span {
  font-size: 1.125rem;
  color: var(--gray-900);
}

/* ---------- Phone Mockup (real screenshot) ----------
   The screenshot already has a phone frame baked in.
   Wrapper handles glow + the bounce-in/float animations
   injected by watchPhoneMockup() in main.js.
   reveal-right is NOT on this element — the JS observer
   owns the entrance so there's no double-animation conflict. */
.phone-mockup {
  position: relative;
  /* Cap width so portrait screenshot stays proportional
     in the 50% grid column without feeling tiny or huge */
  max-width: 300px;
  width: 100%;
  margin-inline: auto;
}

/* Ambient glow that echoes the brand gradient behind the phone */
.phone-mockup__glow {
  position: absolute;
  inset: -3rem -2rem;
  background: var(--gradient-primary);
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(4rem);
  pointer-events: none;
}

/* The screenshot image — drop-shadow mimics phone depth */
.phone-mockup__img {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  /* Matches the rounded corners of the phone frame in the image */
  border-radius: 2.75rem;
  filter: drop-shadow(0 28px 56px rgba(0, 0, 0, 0.35));
}

/* ---------- Article Section ---------- */
.article { display: flex; flex-direction: column; gap: 1.5rem; }

.article__card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.article__card p {
  font-size: 1.125rem;
  color: var(--gray-600);
  line-height: 1.8;
}

.article__cta {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  color: var(--white);
  margin-top: 1.5rem;
}
.article__cta h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.3;
}
.article__cta-body { display: flex; flex-direction: column; gap: 1rem; }
.article__cta p {
  font-size: 1.125rem;
  opacity: 0.95;
  line-height: 1.8;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--gradient-primary);
  color: var(--white);
  padding-block: 3rem;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}
.footer__logo { height: 4rem; }
.footer__tagline {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 640px;
  line-height: 1.7;
}
.footer__copy { opacity: 0.75; font-size: 0.9rem; }

/* ---------- Step icon ring pulse ----------
   Low-frequency / decorative → linear infinite, no easing needed
   Keeps the ring from feeling mechanical with a soft opacity fade    */
@keyframes ringPulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  60%  { transform: scale(1.35); opacity: 0;   }
  100% { transform: scale(1.35); opacity: 0;   }
}
.step__icon-bg {
  animation: ringPulse 2.4s linear infinite;
}
/* Stagger each step's ring so they don't all pulse simultaneously */
.step:nth-child(2) .step__icon-bg { animation-delay: 0.6s; }
.step:nth-child(3) .step__icon-bg { animation-delay: 1.2s; }
.step:nth-child(4) .step__icon-bg { animation-delay: 1.8s; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  .section { padding-block: 4rem; }
  .cta-banner { padding: 2rem 1.5rem; }
  .article__cta { padding: 2rem 1.5rem; }
}

/* ---------- Accessibility: reduced motion ----------
   Users who prefer less movement get instant transitions.
   Particles and pulse are also silenced.                  */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
