/* My Budget Tracker marketing — tokens aligned with app theme (Inter, forest green, sage stone). */
:root {
  --primary: #24905c;
  --primary-dark: #1b6e46;
  --on-primary: #ffffff;
  --surface: #f3f5f4;
  --surface-low: #ffffff;
  --surface-mid: #ecefed;
  --surface-high: #e4e9e6;
  --ink: #1a1f1c;
  --muted: #5a635c;
  --line: rgba(36, 144, 92, 0.14);
  --line-strong: rgba(36, 144, 92, 0.28);
  --overspend: #ff453a;
  --success: #30d158;
  --shadow: 0 10px 28px rgba(26, 31, 28, 0.08);
  --shadow-lift: 0 18px 40px rgba(26, 31, 28, 0.12);
  --radius-control: 14px;
  --radius-card: 16px;
  --radius-hero: 24px;
  --radius-sheet: 20px;
  --max: 1100px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(920px 520px at 12% -10%, rgba(36, 144, 92, 0.16), transparent 58%),
    radial-gradient(780px 480px at 96% 6%, rgba(36, 144, 92, 0.10), transparent 52%),
    radial-gradient(640px 420px at 50% 110%, rgba(36, 144, 92, 0.08), transparent 55%),
    var(--surface);
}
img { max-width: 100%; height: auto; display: block; }
a {
  color: var(--primary);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: var(--primary-dark); }
code {
  font-size: 0.86em;
  background: var(--surface-mid);
  padding: 0.12em 0.4em;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Header (glass) —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px rgba(26, 31, 28, 0.05);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(36, 144, 92, 0.28);
}
.brand span { font-size: 1.05rem; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.92rem;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--primary); }
.nav-cta {
  display: inline-flex !important;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary) !important;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(36, 144, 92, 0.28);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s ease !important;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(36, 144, 92, 0.34);
  color: var(--on-primary) !important;
}

/* —— Hero —— */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5rem);
  min-height: min(82vh, 760px);
}
.hero-copy { max-width: 34rem; }
.brand-mark {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary);
  margin: 0 0 0.85rem;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(36, 144, 92, 0.18);
  animation: pulse-dot 2.4s var(--ease-out) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(36, 144, 92, 0.16); }
  50% { box-shadow: 0 0 0 8px rgba(36, 144, 92, 0.05); }
}
h1 {
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin: 0 0 1rem;
  font-weight: 800;
  color: var(--ink);
}
.lede {
  font-size: 1.12rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 32rem;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  margin-bottom: 1.2rem;
}
.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.75rem;
}
.store-badge {
  display: inline-flex;
  line-height: 0;
  border-radius: 10px;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}
a.store-badge:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}
.store-badge img {
  height: 56px;
  width: auto;
  display: block;
  border-radius: 10px;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.25rem;
  min-height: 56px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface-low) 80%, transparent);
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out);
}
.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--surface-low);
  color: var(--primary-dark);
  transform: translateY(-1px);
}
.trust {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Stage: phone + floating remaining card */
.stage {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.stage-glow {
  position: absolute;
  width: min(420px, 90%);
  height: min(420px, 90%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 144, 92, 0.22), transparent 68%);
  filter: blur(8px);
  z-index: 0;
  animation: glow-breathe 5s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}
.phone {
  width: min(248px, 56vw);
  position: relative;
  z-index: 2;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(26, 31, 28, 0.08),
    0 28px 60px rgba(26, 31, 28, 0.22);
  animation: phone-float 6s ease-in-out infinite;
  transform-origin: center bottom;
}
.stage-promo .phone.promo-frame {
  width: min(300px, 72vw);
  border-radius: 22px;
}
.promo-frame {
  background: #0b3d2a;
}
.promo-frame img {
  display: block;
  width: 100%;
  height: auto;
}
@keyframes phone-float {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-10px) rotate(-0.5deg); }
}
.phone img { width: 100%; height: auto; }
.tablet {
  position: absolute;
  width: min(340px, 70%);
  right: -4%;
  bottom: 8%;
  z-index: 1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  opacity: 0.92;
  transform: rotate(4deg);
  animation: tablet-drift 7s ease-in-out infinite;
}
@keyframes tablet-drift {
  0%, 100% { transform: rotate(4deg) translateY(0); }
  50% { transform: rotate(3deg) translateY(8px); }
}
.tablet img { width: 100%; }

/* App signature: filled period remaining card — sits beside the phone, not over the hero. */
.remaining-card {
  position: absolute;
  right: -2%;
  bottom: 18%;
  left: auto;
  top: auto;
  z-index: 3;
  width: min(200px, 48%);
  padding: 0.95rem 1rem 1.05rem;
  border-radius: var(--radius-hero);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 18px 40px rgba(36, 144, 92, 0.38);
  animation: card-pop 7s var(--ease-out) infinite;
}
@keyframes card-pop {
  0%, 100% { transform: translateY(0) rotate(2.5deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
.remaining-card .rc-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.82;
}
.remaining-card .rc-amount {
  margin: 0.15rem 0 0.55rem;
  font-size: clamp(1.65rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.remaining-card .rc-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.remaining-card .rc-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--on-primary);
  transition: width 1.2s var(--ease-out);
}
.remaining-card.is-live .rc-bar > span { width: 62%; }
.remaining-card .rc-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.9;
}

/* —— Sections —— */
.section-head {
  max-width: 40rem;
  margin-bottom: 1.75rem;
}
.section-head h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -0.035em;
  font-weight: 800;
  line-height: 1.15;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}
.section-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-dark);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}
.feature {
  background: var(--surface-low);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, border-color 0.28s ease;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--line-strong);
}
.feature .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-low));
  color: var(--primary);
  margin-bottom: 0.85rem;
}
.feature .icon svg { width: 22px; height: 22px; }
.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— Showcase theater —— */
.showcase {
  padding: 3.5rem 0 1rem;
  background:
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--primary) 6%, var(--surface)) 18%, transparent 100%);
}
.showcase-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  padding: 0 1rem 1.25rem;
}
.showcase-tabs button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-low);
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out);
}
.showcase-tabs button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}
.showcase-tabs button[aria-selected="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 18px rgba(36, 144, 92, 0.28);
}
.theater {
  width: min(100% - 1.5rem, 720px);
  margin: 0 auto 1.5rem;
}
.theater-stage {
  position: relative;
  min-height: 520px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}
.theater-stage[data-kind="tablet"] { min-height: 360px; }
.theater-stage[data-kind="phone"] .device-phone.promo-frame {
  width: min(320px, 72vw);
  border-radius: 22px;
}
.theater-peeks { position: absolute; inset: 0; pointer-events: none; }
.peek {
  position: absolute;
  top: 8%;
  width: min(180px, 28vw);
  border-radius: 22px;
  overflow: hidden;
  opacity: 0.35;
  filter: blur(1px) saturate(0.9);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.peek-left { left: 4%; transform: rotate(-8deg) scale(0.92); }
.peek-right { right: 4%; transform: rotate(8deg) scale(0.92); }
.device-phone,
.device-tablet {
  position: relative;
  z-index: 2;
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(26, 31, 28, 0.08),
    0 24px 50px rgba(26, 31, 28, 0.2);
  transition: opacity 0.35s var(--ease-out), transform 0.45s var(--ease-out);
}
.device-phone {
  width: min(280px, 62vw);
}
.device-tablet {
  width: min(560px, 92%);
  border-radius: 16px;
}
.theater.is-switching .device-phone,
.theater.is-switching .device-tablet {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}
.theater-caption {
  text-align: center;
  max-width: 28rem;
  margin: 1.25rem auto 0;
}
.theater-caption h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.theater-caption p {
  margin: 0;
  color: var(--muted);
}

.story-rail { padding: 1rem 0 2.5rem; }
.story-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 180px);
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.story-card {
  margin: 0;
  scroll-snap-align: start;
  transition: transform 0.25s var(--ease-out);
}
.story-card:hover { transform: translateY(-4px); }
.story-card .device-phone {
  width: 100%;
  border-radius: 20px;
}
.story-card .story-tablet { border-radius: 12px; }
.story-card figcaption {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
}

/* —— CTA band (period hero fill) —— */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem 1.5rem 1.6rem;
  border-radius: var(--radius-hero);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 20px 44px rgba(36, 144, 92, 0.28);
  margin: 2rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.cta-band h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 2.5vw, 1.7rem);
  letter-spacing: -0.03em;
}
.cta-band p {
  margin: 0;
  max-width: 32rem;
  opacity: 0.9;
}
.cta-band .store-badge {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

/* —— Footer —— */
footer.wrap {
  padding: 0 0 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1.75rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  align-content: flex-start;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.footer-links a:hover { color: var(--primary); }
.launch-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}
.launch-badges a {
  line-height: 0;
  text-decoration: none;
}
.launch-badges img {
  display: block;
  height: auto;
}
.launch-badges .badge-producthunt {
  width: 250px;
}
.launch-badges .badge-peerlist {
  width: auto;
  height: 72px;
}
.legal {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* —— Reveal on scroll (ListEntrance-ish) —— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
.hero-copy > * {
  opacity: 0;
  transform: translateY(16px);
  animation: hero-in 0.7s var(--ease-out) forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: 40ms; }
.hero-copy > *:nth-child(2) { animation-delay: 100ms; }
.hero-copy > *:nth-child(3) { animation-delay: 160ms; }
.hero-copy > *:nth-child(4) { animation-delay: 220ms; }
.hero-copy > *:nth-child(5) { animation-delay: 280ms; }
.hero-copy > *:nth-child(6) { animation-delay: 340ms; }
@keyframes hero-in {
  to { opacity: 1; transform: translateY(0); }
}
.stage {
  opacity: 0;
  animation: hero-in 0.85s var(--ease-out) 0.2s forwards;
}

.hide-sm { display: inline; }

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 1.25rem;
  }
  .stage { min-height: 460px; order: -1; }
  .tablet { display: none; }
  .remaining-card {
    right: 4%;
    bottom: 6%;
    width: min(176px, 46%);
  }
  .features { grid-template-columns: 1fr 1fr; }
  .peek { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .features { grid-template-columns: 1fr; }
  .cta-band { padding: 1.25rem; }
  .nav-links { gap: 0.35rem 0.65rem; font-size: 0.85rem; }
  .remaining-card {
    right: 2%;
    bottom: 4%;
    width: min(158px, 44%);
    padding: 0.8rem 0.85rem 0.9rem;
  }
  .remaining-card .rc-amount { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
  .reveal, .hero-copy > *, .stage {
    opacity: 1 !important;
    transform: none !important;
  }
  .remaining-card .rc-bar > span { width: 62% !important; }
}
