/* ==========================================================================
   HabitLuma landing page
   Type: Bricolage Grotesque (display) + Manrope (body/UI)
   Palette: mint paper, deep teal ink, coral for "quitting", teal for "building"
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
  /* --- color: ink & paper --- */
  --ink: #0F2620;
  --ink-2: #3A5750;
  --ink-3: #6F8D86;
  --paper: #FAF9F4;
  --mint-50: #EEF7F2;
  --mint-100: #E1F3EA;
  --mint-200: #CBEBDD;
  --card: #FFFFFF;
  --line: rgba(15, 38, 32, 0.10);
  --line-soft: rgba(15, 38, 32, 0.06);

  /* --- color: brand teal (building / primary) --- */
  --teal-300: #6FE2D0;
  --teal-400: #34D6BE;
  --teal-500: #12B39D;
  --teal-600: #0C9284;
  --teal-700: #0A6E64;
  --teal-900: #0A2B26;

  /* --- color: coral (quitting / secondary accent) --- */
  --coral-100: #FBE4E0;
  --coral-300: #F5A79E;
  --coral-500: #EE6C5E;
  --coral-600: #DE5647;
  --coral-700: #B7402F;

  /* --- shadows --- */
  --shadow-sm: 0 1px 2px rgba(10, 43, 38, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(10, 43, 38, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(10, 43, 38, 0.28);
  --shadow-phone: 0 40px 80px -24px rgba(10, 43, 38, 0.35), 0 12px 28px -12px rgba(10, 43, 38, 0.22);

  /* --- type --- */
  /* Site-wide single font family, matching the header/brand wordmark. */
  --font-display: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;

  /* --- radii --- */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  /* --- layout --- */
  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 48px);
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0; }

:focus-visible {
  outline: 2.5px solid var(--teal-600);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-700);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(18, 179, 157, 0.18);
}
.eyebrow.coral { color: var(--coral-600); }
.eyebrow.coral::before { background: var(--coral-500); box-shadow: 0 0 0 4px rgba(238, 108, 94, 0.18); }

.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}
.section-head h2 { font-size: clamp(30px, 4vw, 42px); margin-top: 12px; }
.section-head p.lede {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- scroll progress thread ---------- */
.progress-thread {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  background: transparent;
  z-index: 200;
}
.progress-thread span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal-400), var(--coral-500));
  transition: width 80ms linear;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 26px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--teal-700); box-shadow: var(--shadow-lg); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(15,38,32,0.04); }

.btn-sm { padding: 10px 18px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-apple { flex: none; }

/* ---------- nav ---------- */
header.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 244, 0.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
header.site-nav.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 2px 16px rgba(10,43,38,0.05);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand img { width: 32px; height: 32px; border-radius: 9px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: color .15s ease;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }

.nav-cta { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--card);
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* mobile drawer */
.mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 10px var(--pad) 22px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a:not(.btn) {
  padding: 13px 4px;
  font-weight: 600;
  font-size: 15.5px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.mobile-drawer .btn { margin-top: 14px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(48px, 8vw, 88px);
  padding-bottom: 40px;
  overflow: hidden;
}
.hero-blob {
  position: absolute;
  top: -180px; right: -160px;
  width: 720px; height: 720px;
  background: radial-gradient(circle at 40% 40%, var(--mint-200) 0%, var(--mint-100) 45%, transparent 72%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}
.hero-blob.two {
  top: 220px; left: -260px; right: auto;
  width: 520px; height: 520px;
  background: radial-gradient(circle at 60% 40%, rgba(238,108,94,0.10) 0%, rgba(238,108,94,0.0) 70%);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(40px, 5.6vw, 68px);
}
.hero-copy h1 .accent { color: var(--teal-600); }
.hero-copy p.sub {
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 470px;
}
.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.phone-frame {
  position: relative;
  width: min(320px, 78vw);
  filter: drop-shadow(var(--shadow-phone));
  animation: float-y 6s ease-in-out infinite;
}
.phone-frame img { border-radius: 34px; width: 100%; aspect-ratio: 1339 / 2716; height: auto; display: block; }

@keyframes float-y {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-14px); }
}

.chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 10px 16px 10px 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 700;
  animation: float-y 5.5s ease-in-out infinite;
}
.chip .chip-ico {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex: none;
}
.chip small {
  display: block;
  font-weight: 600;
  color: var(--ink-3);
  font-size: 11px;
  margin-top: 1px;
}
.chip-streak {
  top: 6%;
  right: -6%;
  animation-delay: .2s;
}
.chip-streak .chip-ico { background: var(--coral-100); }
.chip-consistency {
  bottom: 10%;
  left: -9%;
  animation-delay: 1.1s;
}
.chip-consistency .chip-ico { background: var(--mint-100); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy p.sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-visual { margin-top: 20px; }
  .chip { font-size: 12.5px; padding: 8px 14px 8px 8px; }
  .chip-streak { right: 2%; }
  .chip-consistency { left: 0%; }
}

/* ---------- section spacing ---------- */
section { padding: clamp(64px, 9vw, 120px) 0; }
.bg-mint { background: var(--mint-50); }

/* ---------- two ways ---------- */
.two-ways-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.way-card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 36px 32px 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.way-card.coral { background: linear-gradient(180deg, var(--coral-100) 0%, #FFF7F5 46%); }
.way-card.teal { background: linear-gradient(180deg, var(--mint-100) 0%, #F5FBF9 46%); }

.way-tag {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 18px;
}
.way-card.coral .way-tag { background: var(--coral-500); color: #fff; }
.way-card.teal .way-tag { background: var(--teal-600); color: #fff; }

.way-card h3 { font-size: 25px; margin-bottom: 12px; }
.way-card p { color: var(--ink-2); font-size: 15.5px; line-height: 1.62; max-width: 40ch; }
.way-card .way-img {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}
.way-card .way-img img {
  width: 54%;
  aspect-ratio: 1339 / 2716;
  height: auto;
  border-radius: 22px;
  transform: translateY(2px);
}

@media (max-width: 860px) {
  .two-ways-grid { grid-template-columns: 1fr; }
}

/* ---------- how it works ---------- */
.steps-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 8px;
}
.steps-rail::before {
  content: "";
  position: absolute;
  top: 27px;
  left: 12%;
  right: 12%;
  height: 2px;
  background-image: radial-gradient(circle, var(--line) 1.5px, transparent 1.6px);
  background-size: 14px 2px;
  background-repeat: repeat-x;
  z-index: 0;
}
.step {
  position: relative;
  z-index: 1;
}
.step .num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--teal-700);
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  transition: background .3s ease, color .3s ease, border-color .3s ease, transform .3s ease;
}
.step.in-view .num {
  background: var(--ink);
  color: var(--teal-300);
  border-color: var(--ink);
  transform: scale(1.06);
}
.step h3 { font-size: 20px; margin-bottom: 10px; }
.step p { color: var(--ink-2); font-size: 15px; line-height: 1.6; margin-bottom: 0; }

@media (max-width: 860px) {
  .steps-rail { grid-template-columns: 1fr; gap: 44px; }
  .steps-rail::before { display: none; }
}

/* ---------- feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 24px 28px;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  background: var(--mint-100);
  color: var(--teal-700);
}
.feature-ico svg { width: 21px; height: 21px; }
.feature-card h3 { font-size: 17.5px; margin-bottom: 9px; }
.feature-card p { font-size: 14px; color: var(--ink-2); line-height: 1.58; margin-bottom: 0; }

@media (max-width: 980px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 6px 26px;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  gap: 20px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .plus {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  position: relative;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.faq-item .plus::before, .faq-item .plus::after {
  content: "";
  position: absolute;
  background: var(--ink);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.faq-item .plus::before { width: 10px; height: 1.6px; }
.faq-item .plus::after { width: 1.6px; height: 10px; }
.faq-item[open] .plus { background: var(--ink); border-color: var(--ink); transform: rotate(45deg); }
.faq-item[open] .plus::before, .faq-item[open] .plus::after { background: #fff; }
.faq-item .faq-a {
  padding-bottom: 22px;
  margin-top: -6px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------- final CTA ---------- */
.final-cta {
  border-radius: 32px;
  background: radial-gradient(120% 160% at 15% 0%, var(--teal-700) 0%, var(--teal-900) 60%);
  color: var(--paper);
  padding: clamp(48px, 8vw, 84px) clamp(24px, 6vw, 64px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.final-cta::before {
  content: "";
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(111,226,208,0.28), transparent 70%);
  top: -220px; right: -140px;
}
.final-cta h2 { color: #fff; font-size: clamp(30px, 4.4vw, 46px); position: relative; }
.final-cta .hero-cta { justify-content: center; position: relative; }
.final-cta .btn-primary { background: #fff; color: var(--teal-900); }
.final-cta .btn-primary:hover { background: var(--mint-100); }
.final-cta .btn-ghost { border-color: rgba(250,249,244,0.3); color: #fff; }
.final-cta .btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(250,249,244,0.6); }

/* ---------- footer ---------- */
footer.site-footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 44px;
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand p { color: var(--ink-3); font-size: 14px; line-height: 1.6; max-width: 30ch; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 16px; font-family: var(--font-body); font-weight: 700; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 14.5px; color: var(--ink-2); font-weight: 600; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13.5px;
  color: var(--ink-3);
}
@media (max-width: 780px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* ---------- reveal on scroll ---------- */
/* Visible by default. Only hides-then-fades once JS confirms it can run
   the reveal (class added on <html> by an inline script) and will always
   fall back to visible (see script.js safety timeout). This avoids any
   chance of content staying invisible if JS is slow, blocked, or errors. */
.has-js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in-view { opacity: 1 !important; transform: translateY(0) !important; }

/* staggered cascade for grid items, using the --i index set inline in HTML */
.feature-grid .reveal,
.steps-rail .reveal {
  transition-delay: calc(var(--i, 0) * 110ms);
}

@media (prefers-reduced-motion: reduce) {
  .has-js .reveal { opacity: 1; transform: none; }
  .phone-frame, .chip { animation: none; }
}

/* ---------- misc ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
