/* sections.css — hero, showcase, pillars */

/* ---------- HERO ---------- */
.hero {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem);
  position: relative;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 60vh;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 22ch;
}

.hero__h1 {
  font-size: clamp(2.6rem, 5.5vw + 1rem, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
  font-family: var(--font-display);
}

.hero__h1 em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent-metrics), var(--accent-trends), var(--accent-activities));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: hue-shift 14s ease-in-out infinite alternate;
}

@keyframes hue-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hero__sub {
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 38ch;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* ---------- HERO CONSTELLATION ---------- */
.hero__constellation {
  position: relative;
  height: clamp(420px, 56vh, 560px);
  isolation: isolate;
}

.hero__constellation::before {
  /* soft halo behind cards */
  content: '';
  position: absolute;
  inset: 8% 6%;
  background:
    radial-gradient(60% 60% at 60% 40%, color-mix(in oklab, var(--accent-metrics) 22%, transparent), transparent 70%),
    radial-gradient(50% 50% at 30% 70%, color-mix(in oklab, var(--accent-trends) 22%, transparent), transparent 70%);
  filter: blur(40px);
  z-index: -1;
}

.hero__constellation > * {
  position: absolute;
  will-change: transform;
}

/* Card placement (desktop) — visually scattered, not overlapping */
.metric-card--calories { top: 4%;  left: 4%;   animation: float-a 7s ease-in-out infinite alternate; }
.metric-card--steps    { top: 38%; right: 6%;  animation: float-b 8.5s ease-in-out infinite alternate; }
.metric-card--minutes  { bottom: 6%; left: 18%; animation: float-c 9s ease-in-out infinite alternate; }
.hero-ring             { bottom: 16%; right: 12%; animation: float-b 6s ease-in-out infinite alternate; }

@keyframes float-a {
  from { transform: translateY(0)   rotate(-2deg); }
  to   { transform: translateY(-10px) rotate(-1deg); }
}
@keyframes float-b {
  from { transform: translateY(0) rotate(2deg); }
  to   { transform: translateY(-12px) rotate(3deg); }
}
@keyframes float-c {
  from { transform: translateY(0) rotate(-1deg); }
  to   { transform: translateY(-8px) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__h1 em,
  .metric-card--calories,
  .metric-card--steps,
  .metric-card--minutes,
  .hero-ring {
    animation: none !important;
  }
}

@media (max-width: 880px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    min-height: 0;
  }
  .hero__copy { max-width: none; }
  .hero__constellation {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
  }
  .hero__constellation > * {
    position: static;
    animation: none !important;
    transform: none !important;
  }
  .hero-ring {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .hero__constellation {
    grid-template-columns: 1fr;
  }
}

/* ---------- SHOWCASE (sticky-scroll) ---------- */
.showcase {
  position: relative;
  padding-block: var(--space-section);
}

.showcase__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.showcase__phone-col {
  position: sticky;
  top: 14vh;
  align-self: start;
  height: fit-content;
  display: grid;
  place-items: center;
}

.showcase__phone-col .phone-frame {
  max-width: 320px;
}

.showcase__sections {
  display: flex;
  flex-direction: column;
  gap: clamp(6rem, 18vh, 14rem);
  padding-block: 8vh;
}

.showcase__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 60vh;
  justify-content: center;
}

.showcase__section h2 {
  font-size: var(--fs-2);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.showcase__section h2 em {
  color: var(--accent);
  font-style: italic;
  transition: color var(--t-accent);
}

.showcase__section .showcase__sub {
  font-size: var(--fs-lead);
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.5;
}

/* Active state lifting */
.showcase__section.is-active h2 em { animation: hue-pop 600ms ease-out; }

@keyframes hue-pop {
  0% { filter: brightness(0.85); }
  100% { filter: brightness(1); }
}

/* Mobile: ditch sticky, stack as cards each with own phone */
@media (max-width: 900px) {
  .showcase__inner {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .showcase__phone-col { display: none; }
  .showcase__sections { gap: var(--space-section); padding-block: 0; }
  .showcase__section {
    min-height: auto;
    display: grid;
    gap: var(--space-5);
    text-align: left;
    place-items: start;
  }
  /* Inject inline phone for mobile via ::before / pseudo-clone — easier: use mobile-only img */
  .showcase__section .showcase__mobile-phone {
    display: block;
    margin-block: var(--space-4) var(--space-3);
  }
}
@media (min-width: 901px) {
  .showcase__section .showcase__mobile-phone { display: none; }
}

/* ---------- PILLARS ---------- */
.pillars {
  padding-block: var(--space-section);
}

.pillars__head {
  max-width: 50ch;
  margin-bottom: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.pillars__head h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.pillars__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

@media (max-width: 880px) {
  .pillars__grid { grid-template-columns: 1fr; }
}

/* ---------- PRIVACY ---------- */
.privacy {
  padding-block: clamp(3rem, 6vw, 5rem);
}
