/*
 * /opt/strava-web/webapp/static/css/home_effects.css
 *
 * Visual additions to the landing page (modern-minimalist polish):
 *   1. Animated aurora orbs + dot grid in the hero background.
 *   2. New "How It Works" 3-step section with cursor-tracked spotlight cards.
 *   3. Trust strip + "Built for" persona section.
 *
 * Layered on top of home.css — does not modify existing rules. Tokens are
 * reused from :root in home.css (--strava-orange, --brand-blue, --bg-*).
 *
 * THEMES: this file MUST honour all three themes declared in home.css:
 *   :root      → light (Strava orange accent)
 *   html.dark  → dark  (Strava orange accent on near-black)
 *   html.pro   → pro   (emerald-green accent on full black, --strava-orange
 *                       is itself overridden to #10b981 there)
 *
 * To avoid hard-coding hex/rgba in component rules we define per-theme
 * effect tokens here and reference them everywhere below.
 */

:root {
  /* Accent colour as an RGB triplet, for use inside rgba() */
  --fx-accent-rgb: 252, 82, 0;            /* Strava orange */
  /* Aurora-orb palette (3 blurred circles in hero) */
  --fx-orb-1: var(--strava-orange);
  --fx-orb-2: var(--brand-blue);
  --fx-orb-3: hsl(280, 80%, 65%);         /* violet */
  --fx-orb-opacity: 0.55;
  /* Persona-tag pill colours */
  --fx-tag-bg: rgba(252, 82, 0, 0.08);
  --fx-tag-border: rgba(252, 82, 0, 0.18);
  /* Spotlight glow inside step cards */
  --fx-spotlight: rgba(252, 82, 0, 0.10);
}

html.dark {
  --fx-accent-rgb: 252, 82, 0;
  --fx-orb-1: var(--strava-orange);
  --fx-orb-2: #3b9eff;
  --fx-orb-3: hsl(280, 70%, 55%);
  --fx-orb-opacity: 0.38;
  --fx-tag-bg: rgba(252, 82, 0, 0.12);
  --fx-tag-border: rgba(252, 82, 0, 0.25);
  --fx-spotlight: rgba(252, 82, 0, 0.18);
}

html.pro {
  /* Emerald-green theme — accent is #10b981 */
  --fx-accent-rgb: 16, 185, 129;
  --fx-orb-1: #10b981;                    /* emerald */
  --fx-orb-2: #047857;                    /* deep teal */
  --fx-orb-3: hsl(160, 70%, 40%);         /* keep aurora coherent in green */
  --fx-orb-opacity: 0.4;
  --fx-tag-bg: rgba(16, 185, 129, 0.10);
  --fx-tag-border: rgba(16, 185, 129, 0.25);
  --fx-spotlight: rgba(16, 185, 129, 0.18);
}

/* ============================================================
   1. HERO AURORA — animated gradient orbs + dot grid
   ============================================================ */

.hero-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-aurora .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: var(--fx-orb-opacity);
  will-change: transform;
}

.hero-aurora .orb-1 {
  top: -10%;
  left: -10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--fx-orb-1), transparent 70%);
  animation: orb-drift-a 22s ease-in-out infinite;
}

.hero-aurora .orb-2 {
  top: 30%;
  right: -15%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, var(--fx-orb-2), transparent 70%);
  animation: orb-drift-b 26s ease-in-out infinite;
}

.hero-aurora .orb-3 {
  bottom: -20%;
  left: 30%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--fx-orb-3), transparent 70%);
  animation: orb-drift-c 30s ease-in-out infinite;
  /* per-theme opacity already governed by --fx-orb-opacity; this card
     just sits slightly softer than the other two for layered depth */
  opacity: calc(var(--fx-orb-opacity) * 0.75);
}

@keyframes orb-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 100px) scale(0.95); }
}
@keyframes orb-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-120px, 80px) scale(1.15); }
}
@keyframes orb-drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(100px, -60px) scale(1.05); }
  80% { transform: translate(-60px, -40px) scale(0.9); }
}

/* Subtle dot grid lying over the orbs */
.hero-dotgrid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(
    circle,
    var(--text-tertiary) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  opacity: 0.18;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 75%);
          mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 75%);
}

html.dark .hero-dotgrid {
  opacity: 0.25;
}

/* Hero content must sit above the orbs */
.hero-section > .container,
.hero-section .hero-container {
  position: relative;
  z-index: 1;
}

/* ============================================================
   2. "HOW IT WORKS" SECTION — 3 steps
   ============================================================ */

.how-it-works-section {
  padding-top: clamp(3rem, 8vh, 6rem);
  padding-bottom: clamp(3rem, 8vh, 6rem);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  position: relative;
  margin-top: 3rem;
}

/* Faint connecting line behind the cards */
.steps-grid::before {
  content: "";
  position: absolute;
  top: 90px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-primary) 30%,
    var(--brand-blue) 70%,
    transparent
  );
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

.step-card {
  position: relative;
  padding: 2.25rem 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  z-index: 1;
  overflow: hidden;
}

/* Cursor-tracked spotlight (JS sets --mx / --my as % within the card).
   Glow colour comes from --fx-spotlight, which is theme-aware (orange
   in light/dark, emerald in pro). */
.step-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    var(--fx-spotlight),
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  border-radius: inherit;
}

.step-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.step-card:hover::after {
  opacity: 1;
}

.step-card .step-number {
  font-family: var(--font-sans);
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(
    135deg,
    var(--gradient-text-from),
    var(--gradient-text-to)
  );
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.25rem;
}

.step-card .step-icon {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: color var(--transition-base), background var(--transition-base);
}

.step-card:hover .step-icon {
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.step-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.step-card p {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   3. TRUST BADGES — slim row of credibility signals
   ============================================================ */

.trust-strip {
  padding: 1.5rem 0 0.5rem 0;
  position: relative;
  z-index: 1;
}

.trust-strip .trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.trust-strip .trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.trust-strip .trust-item:hover {
  color: var(--text-primary);
}

.trust-strip .trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* ============================================================
   4. "BUILT FOR" — persona-based marketing section
   ============================================================ */

.built-for-section {
  padding-top: clamp(3rem, 8vh, 6rem);
  padding-bottom: clamp(3rem, 8vh, 6rem);
}

.personas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.persona-card {
  position: relative;
  padding: 2rem 1.75rem 2.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  overflow: hidden;
}

.persona-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--gradient-text-from),
    var(--gradient-text-to)
  );
  opacity: 0;
  transition: opacity var(--transition-base);
}

.persona-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.persona-card:hover::before {
  opacity: 1;
}

.persona-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--fx-tag-bg);
  border: 1px solid var(--fx-tag-border);
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1.25rem;
}

.persona-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.35;
}

.persona-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
}

.persona-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.persona-tool {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
}

/* ============================================================
   5. QUOTE / SOCIAL-PROOF STRIP — minimal, single line
   ============================================================ */

.proof-strip {
  text-align: center;
  padding: 2rem 0 1rem;
  color: var(--text-tertiary);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.proof-strip strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ============================================================
   6. RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .steps-grid::before {
    display: none;
  }
  .hero-aurora .orb {
    filter: blur(60px);
    opacity: 0.35;
  }
  .personas-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .trust-strip .trust-list {
    gap: 0.5rem 1.25rem;
  }
  .trust-strip .trust-item {
    font-size: 0.8rem;
  }
}

/* ============================================================
   4. REDUCED MOTION — kill the drifts but keep the static look
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .hero-aurora .orb {
    animation: none !important;
  }
}
