/* ===== HabitSprout website ===== */
:root {
  --accent: #FF6B4A;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --bg: #FFF7EF;
  --card: #FFFFFF;
  --ink: #1F1A2E;
  --muted: #8D8698;
  --line: rgba(31, 26, 46, 0.08);
  --success: #35C46B;
  --shield: #7C5CFF;
  --radius: 24px;
  --shadow: 0 20px 50px -20px rgba(31, 26, 46, 0.25);
  --shadow-sm: 0 8px 24px -12px rgba(31, 26, 46, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171224;
    --card: #221C33;
    --ink: #F5F1FA;
    --muted: #9A93B0;
    --line: rgba(255, 255, 255, 0.08);
    --success: #3ED97D;
    --shield: #A784FF;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 800; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
p { margin: 0 0 16px; }

.container { width: min(1140px, 100% - 48px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 48px); }
.accent-text { color: var(--accent); transition: color .4s; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600;
  box-shadow: 0 10px 24px -10px var(--accent);
  transition: transform .2s, box-shadow .2s, background .4s;
}
.btn:hover { transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn-ghost:hover { color: var(--accent); }

.appstore-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 22px 10px 18px; border-radius: 14px;
  background: var(--ink); color: var(--bg);
  transition: transform .2s;
}
.appstore-badge:hover { transform: translateY(-2px); }
.appstore-badge span { display: flex; flex-direction: column; font-weight: 600; font-size: 1.15rem; line-height: 1.1; }
.appstore-badge small { font-size: .68rem; font-weight: 400; opacity: .8; }
.appstore-badge.light { background: #fff; color: #1F1A2E; }

/* ----- Nav ----- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.brand img { border-radius: 10px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; gap: 32px; font-weight: 500; font-size: .95rem; }
.nav-links a { color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }

/* ----- Hero ----- */
.hero { position: relative; padding: 140px 0 100px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.pill {
  display: inline-block; padding: 6px 14px; margin-bottom: 20px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-weight: 600; font-size: .85rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 520px; margin-bottom: 32px; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 44px; }
.hero-stats { display: flex; gap: 36px; list-style: none; padding: 0; margin: 0; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.6rem; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: .85rem; }

.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; pointer-events: none; }
.blob-1 { width: 520px; height: 520px; background: var(--accent); top: -160px; right: -120px; transition: background .4s; }
.blob-2 { width: 380px; height: 380px; background: #56B4B8; bottom: -160px; left: -140px; opacity: .25; }

.hero-visual { position: relative; display: flex; justify-content: center; }

/* ----- Phone mockup ----- */
.phone {
  position: relative; width: 300px; height: 620px; padding: 12px;
  border-radius: 48px; background: #14101E;
  box-shadow: var(--shadow), inset 0 0 0 2px #2c2640;
  transform: rotate(-3deg);
  animation: float 6s ease-in-out infinite;
}
.phone-notch {
  position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 26px; border-radius: 20px; background: #14101E; z-index: 2;
}
.screen {
  position: relative; height: 100%; border-radius: 38px; overflow: hidden;
  background: #FFF7EF; color: #1F1A2E; padding: 58px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.scr-header { display: flex; justify-content: space-between; align-items: center; }
.scr-muted { color: var(--muted); font-size: .72rem; margin: 0; letter-spacing: .04em; }
.screen .scr-muted { color: #8D8698; }
.scr-title { font-weight: 700; font-size: 1.15rem; margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #F5B833); transition: background .4s; }
.scr-week { display: flex; justify-content: space-between; margin: 4px 0 6px; }
.scr-week span {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 32px; padding: 6px 0; border-radius: 12px; font-size: .62rem; color: #8D8698;
}
.scr-week b { font-size: .82rem; color: #1F1A2E; }
.scr-week .on { background: var(--accent); color: #fff; transition: background .4s; }
.scr-week .on b { color: #fff; }

.hcard {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 18px; padding: 10px 12px;
  box-shadow: 0 4px 14px -8px rgba(31,26,46,.25);
}
.hcard.done { background: #FFF0EB; }
.hicon {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-size: 1.1rem;
  background: color-mix(in srgb, var(--c) 18%, white);
}
.hbody { flex: 1; min-width: 0; }
.hbody p { margin: 0; font-weight: 600; font-size: .85rem; }
.hbody small { color: #8D8698; font-size: .7rem; }
.bar { height: 5px; border-radius: 4px; background: #F1ECE8; margin-top: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: background .4s; }
.hcheck {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem; transition: background .4s;
}
.hstreak { font-size: .75rem; font-weight: 600; }
.scr-tabbar {
  margin-top: auto; display: flex; justify-content: space-around; align-items: center;
  background: #fff; border-radius: 22px; padding: 8px; color: #8D8698; font-size: 1.1rem;
  box-shadow: 0 4px 14px -8px rgba(31,26,46,.25);
}
.scr-tabbar .on { color: var(--accent); }
.scr-tabbar .fab {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 1.4rem; transition: background .4s;
}

.float-chip {
  position: absolute; padding: 10px 16px; border-radius: 16px;
  background: var(--card); box-shadow: var(--shadow); font-size: .9rem; white-space: nowrap;
}
.chip-streak { top: 18%; left: -2%; animation: float 5s ease-in-out infinite reverse; }
.chip-shield { bottom: 16%; right: -2%; animation: float 7s ease-in-out infinite; color: var(--shield); font-weight: 600; }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

/* ----- Sections ----- */
.section { padding: 110px 0; position: relative; }
.section-tint { background: color-mix(in srgb, var(--accent) 6%, var(--bg)); transition: background .4s; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  display: inline-block; margin-bottom: 12px;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); transition: color .4s;
}

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature {
  background: var(--card); border-radius: var(--radius); padding: 30px;
  border: 1px solid var(--line); transition: transform .25s, box-shadow .25s;
}
.feature:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.ficon {
  width: 52px; height: 52px; border-radius: 16px; margin-bottom: 18px;
  display: grid; place-items: center; font-size: 1.5rem;
  background: color-mix(in srgb, var(--c) 16%, transparent);
}

/* Split layout */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.split-copy p { color: var(--muted); font-size: 1.05rem; }
.split-copy b { color: var(--ink); }
.split-visual { display: flex; justify-content: center; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.checks li::before {
  content: "✓"; flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success);
}

/* Streak card */
.streak-card, .insight-card {
  width: min(420px, 100%); background: var(--card); border-radius: 32px;
  padding: 30px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.big-num { font-size: 3.2rem; font-weight: 800; line-height: 1; margin: 6px 0 4px; }
.big-num small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.flame { font-size: 2.6rem; animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }

.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 24px 0; }
.heatmap i {
  aspect-ratio: 1; border-radius: 8px; background: color-mix(in srgb, var(--ink) 7%, transparent);
  transition: background .4s, transform .3s;
}
.heatmap i.on { background: var(--accent); }
.heatmap i.mid { background: color-mix(in srgb, var(--accent) 50%, transparent); }
.heatmap i.shield { background: var(--shield); position: relative; }
.heatmap i.shield::after { content: "🛡"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .7rem; }

.shield-row {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  border-radius: 18px; background: color-mix(in srgb, var(--shield) 12%, transparent);
}
.shield-row p { margin: 0; }
.shield-row small { color: var(--muted); }
.shield-badge {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--shield); font-size: 1.3rem;
}

/* Templates marquee */
.marquee { overflow: hidden; padding: 8px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: scroll 40s linear infinite; }
.marquee.reverse .marquee-track { animation-direction: reverse; animation-duration: 46s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  padding: 14px 24px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-weight: 500; white-space: nowrap; box-shadow: var(--shadow-sm);
}
@keyframes scroll { to { transform: translateX(calc(-50% - 7px)); } }

/* Themes */
.reverse-on-desktop .split-copy { order: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.swatch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 8px; border-radius: 999px; cursor: pointer;
  font: 500 .9rem "Poppins", sans-serif; color: var(--ink);
  background: var(--card); border: 2px solid var(--line); transition: border-color .2s, transform .2s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch i { width: 24px; height: 24px; border-radius: 50%; background: var(--c); }
.swatch.active { border-color: var(--c); }

.insight-card .big-num { margin: 8px 0; }
.ring-wrap { position: relative; width: 140px; height: 140px; margin: 20px auto 0; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring-bg { stroke: color-mix(in srgb, var(--ink) 7%, transparent); }
.ring-fg {
  stroke: var(--accent); stroke-dasharray: 314; stroke-dashoffset: 314;
  transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1), stroke .4s;
}
.insight-card.visible .ring-fg { stroke-dashoffset: 44; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-weight: 700; font-size: 1.3rem; line-height: 1.1; }
.ring-label small { font-size: .75rem; color: var(--muted); font-weight: 500; }
.bars { display: flex; justify-content: space-between; align-items: flex-end; height: 110px; gap: 8px; margin-top: 12px; }
.bars span {
  flex: 1; height: var(--h); border-radius: 10px; background: var(--accent); position: relative;
  transform-origin: bottom; transform: scaleY(0); transition: transform .8s cubic-bezier(.2,.8,.2,1), background .4s;
}
.insight-card.visible .bars span { transform: scaleY(1); }
.bars span:nth-child(2) { transition-delay: .05s; } .bars span:nth-child(3) { transition-delay: .1s; }
.bars span:nth-child(4) { transition-delay: .15s; } .bars span:nth-child(5) { transition-delay: .2s; }
.bars span:nth-child(6) { transition-delay: .25s; } .bars span:nth-child(7) { transition-delay: .3s; }
.bars i { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-style: normal; font-size: .7rem; color: var(--muted); }
.insight-card { padding-bottom: 44px; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.steps li { background: var(--card); border-radius: var(--radius); padding: 32px; border: 1px solid var(--line); }
.steps li > span {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; margin-bottom: 18px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1.2rem; transition: background .4s;
}
.steps p { color: var(--muted); margin: 0; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details {
  background: var(--card); border-radius: 18px; padding: 4px 24px; border: 1px solid var(--line);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; font-weight: 400; color: var(--accent); transition: transform .3s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 8px; }

/* CTA */
.cta {
  text-align: center; padding: 72px 32px; border-radius: 40px; color: #fff;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.22), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(0,0,0,.15), transparent 45%),
    var(--accent);
  box-shadow: 0 30px 60px -30px var(--accent);
  transition: background-color .4s;
}
.cta h2 { max-width: 560px; margin-inline: auto; }
.cta p { opacity: .9; margin-bottom: 28px; font-size: 1.05rem; }
.cta-icon { margin: 0 auto 24px; border-radius: 24px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.35); }

/* Footer */
.footer { padding: 40px 0; border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer nav { display: flex; gap: 24px; }
.footer nav a, .copyright { color: var(--muted); font-size: .9rem; margin: 0; }
.footer nav a:hover { color: var(--accent); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .hero { padding-top: 120px; }
  .hero-inner, .split { grid-template-columns: 1fr; gap: 56px; }
  .hero-copy { text-align: center; }
  .lead { margin-inline: auto; }
  .hero-ctas, .hero-stats { justify-content: center; }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .split-copy { text-align: center; }
  .checks { justify-content: center; }
  .swatches { justify-content: center; }
  .reverse-on-desktop .split-visual { order: 2; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .hero-stats { gap: 22px; }
  .phone { zoom: .88; }
  .chip-streak { top: 4%; left: 0; }
  .chip-shield { right: 0; }
  .checks li { text-align: left; }
}

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