/* House Payoff — dark emerald, matches the app's Theme.swift palette. */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --brand: #3fbf93;
  --brand-deep: #0c6b4e;
  --green: #5dd3a8;
  --warm: #cba07a;
  --ink: #eaf1ed;
  --muted: #9aaaa3;
  --faint: #6d7f78;
  --bg: #0b1714;
  --bg-deep: #06100d;
  --card: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --glow: rgba(63, 191, 147, 0.35);
  --radius: 20px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-deep);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Drifting aurora, the same emerald light the onboarding uses. */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(120px); opacity: .5;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 620px; height: 620px; background: #12a273; top: -220px; left: -160px; }
.aurora span:nth-child(2) { width: 520px; height: 520px; background: #0c6b4e; top: 30%; right: -200px; animation-duration: 32s; animation-delay: -8s; }
.aurora span:nth-child(3) { width: 460px; height: 460px; background: #5dd3a8; bottom: -240px; left: 30%; opacity: .22; animation-duration: 38s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-40px, 70px) scale(.96); }
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: rgba(6, 16, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { margin-left: auto; display: flex; gap: 22px; font-size: 0.93rem; align-items: center; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); text-decoration: none; }
.nav-cta { padding: 8px 16px; border-radius: 999px; background: rgba(63,191,147,.14); border: 1px solid rgba(63,191,147,.3); color: var(--green) !important; font-weight: 600; }
@media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; text-align: center; } .hero .lede { margin-left: auto; margin-right: auto; } .cta-row, .trust { justify-content: center; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--green); background: rgba(63, 191, 147, 0.10);
  border: 1px solid rgba(63, 191, 147, 0.26);
  padding: 7px 14px; border-radius: 999px; margin-bottom: 22px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

h1 { font-size: clamp(2.5rem, 6vw, 4.1rem); line-height: 1.03; font-weight: 800; letter-spacing: -0.035em; margin-bottom: 20px; }
.grad {
  background: linear-gradient(110deg, var(--brand) 0%, var(--green) 45%, #b8f0d8 55%, var(--green) 65%, var(--brand) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%,100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 50ch; margin-bottom: 30px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px; font-weight: 650; font-size: 1rem;
  border: 1px solid transparent; transition: transform .15s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: linear-gradient(120deg, #12a273, var(--brand-deep)); color: #fff; box-shadow: 0 12px 34px rgba(18,162,115,.35); }
.btn-primary:hover { box-shadow: 0 16px 44px rgba(18,162,115,.5); }
.btn-primary svg { width: 20px; height: 20px; fill: currentColor; }
.btn-primary small { display: block; font-size: .68rem; font-weight: 500; opacity: .8; line-height: 1; }
.btn-primary b { display: block; line-height: 1.2; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }

.trust { margin-top: 24px; font-size: 0.88rem; color: var(--faint); display: flex; flex-wrap: wrap; gap: 18px; }
.trust span::before { content: '✓ '; color: var(--green); font-weight: 700; }

/* ---------- phone with rotating real screenshots ---------- */
.phone-stage { position: relative; display: grid; place-items: center; }
.phone-stage::before {
  content: ''; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 68%); filter: blur(30px);
  animation: pulse 5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .8 } 50% { transform: scale(1.12); opacity: 1 } }
.phone {
  position: relative; width: 290px; aspect-ratio: 1206 / 2622;
  border-radius: 50px; padding: 10px;
  background: linear-gradient(160deg, #2a3a34, #0a1210);
  box-shadow: 0 40px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08), inset 0 0 0 1px rgba(255,255,255,.05);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1deg); } }
.screen { position: relative; height: 100%; border-radius: 41px; overflow: hidden; background: var(--bg); }
.screen img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04); transition: opacity .9s ease, transform 1.2s ease;
}
.screen img.on { opacity: 1; transform: none; }
.float-chip {
  position: absolute; z-index: 3; padding: 10px 14px; border-radius: 14px;
  background: rgba(14, 30, 25, .82); border: 1px solid rgba(93,211,168,.28);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0,0,0,.4); font-size: .8rem; color: var(--muted); text-align: left;
  animation: float 6s ease-in-out infinite;
}
.float-chip strong { display: block; color: var(--ink); font-size: 1.05rem; letter-spacing: -.01em; }
.float-chip.a { top: 16%; left: -4%; animation-delay: -2s; }
.float-chip.b { bottom: 18%; right: -6%; animation-delay: -4s; }
.float-chip.b strong { color: var(--green); }
@media (max-width: 480px) { .float-chip.a { left: 0; } .float-chip.b { right: 0; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.stat { padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: center; }
.stat .num { font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; color: var(--green); font-variant-numeric: tabular-nums; }
.stat p { color: var(--muted); font-size: .92rem; }

/* ---------- sections ---------- */
section { padding: 72px 0; }
.sec-head { max-width: 62ch; margin-bottom: 40px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 750; letter-spacing: -0.028em; margin-bottom: 12px; line-height: 1.15; }
.sec-head p { color: var(--muted); font-size: 1.05rem; }

/* feature rows: screenshot + copy, alternating */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; padding: 36px 0; }
.feature:nth-child(even) .shot { order: 2; }
@media (max-width: 820px) { .feature { grid-template-columns: 1fr; gap: 28px; } .feature:nth-child(even) .shot { order: 0; } }
.shot { display: grid; place-items: center; }
.shot img {
  width: min(280px, 78vw); border-radius: 38px;
  box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
  transition: transform .5s ease;
}
.feature:hover .shot img { transform: translateY(-6px) rotate(-1deg); }
.feature h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 740; letter-spacing: -.025em; margin-bottom: 12px; line-height: 1.2; }
.feature p { color: var(--muted); font-size: 1.03rem; margin-bottom: 14px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green); margin-bottom: 10px; }
.tag.pro { color: var(--warm); }
.ticks { list-style: none; display: grid; gap: 8px; }
.ticks li { color: var(--muted); display: flex; gap: 10px; }
.ticks li::before { content: '✓'; color: var(--green); font-weight: 800; }

/* animated payoff chart */
.chart-card { padding: 28px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; font-size: .88rem; color: var(--muted); }
.chart-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
.line-base, .line-plan { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.line-base { stroke: var(--faint); }
.line-plan { stroke: var(--green); filter: drop-shadow(0 0 8px rgba(93,211,168,.6)); }
.area-plan { fill: url(#planFill); opacity: 0; }
.chart-card.in .line-base { animation: draw 2.2s ease-out forwards; }
.chart-card.in .line-plan { animation: draw 2.2s ease-out .5s forwards; }
.chart-card.in .area-plan { animation: fade 1s ease 2.2s forwards; }
.chart-card.in .marker { animation: fade .6s ease 2.6s forwards; }
.marker { opacity: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

/* gallery */
.gallery { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.gallery-track { display: flex; gap: 22px; width: max-content; animation: marquee 50s linear infinite; }
.gallery:hover .gallery-track { animation-play-state: paused; }
.gallery img { width: 220px; border-radius: 30px; box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.07); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: rgba(63,191,147,.35); }
.card .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; margin-bottom: 14px; background: rgba(63,191,147,.12); border: 1px solid rgba(63,191,147,.24); }
.card h3 { font-size: 1.06rem; font-weight: 680; margin-bottom: 7px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: .95rem; }

/* pricing */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.tier { padding: 30px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.tier.pro { border-color: rgba(203,160,122,.45); background: linear-gradient(160deg, rgba(203,160,122,.10), rgba(63,191,147,.05)); }
.tier h3 { font-size: 1.25rem; font-weight: 720; margin-bottom: 4px; }
.tier .note { color: var(--faint); font-size: .88rem; margin-bottom: 18px; }
.tier ul { list-style: none; display: grid; gap: 10px; }
.tier li { display: flex; gap: 10px; color: var(--muted); font-size: .95rem; }
.tier li::before { content: '✓'; color: var(--green); font-weight: 800; flex: none; }
.tier.pro li::before { color: var(--warm); }
.badge { float: right; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--warm); background: rgba(203,160,122,.12); border: 1px solid rgba(203,160,122,.32); padding: 4px 10px; border-radius: 999px; }
.fine { color: var(--faint); font-size: .85rem; margin-top: 18px; }

.strip { border-radius: var(--radius); border: 1px solid rgba(63,191,147,.24); background: linear-gradient(140deg, rgba(63,191,147,.10), rgba(12,107,78,.08)); padding: 40px 32px; text-align: center; }
.strip h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 740; letter-spacing: -.025em; margin-bottom: 10px; }
.strip p { color: var(--muted); max-width: 62ch; margin: 0 auto; }
.strip .cta-row { justify-content: center; margin-top: 24px; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--faint); font-size: .9rem; }
.foot-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.foot-row .links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 18px; }
.foot-row a { color: var(--muted); }
@media (max-width: 680px) { .foot-row .links { margin-left: 0; } }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- legal / doc pages ---------- */
.doc { padding: 60px 0 28px; }
.doc h1 { font-size: clamp(2.1rem, 4.5vw, 2.9rem); margin-bottom: 8px; }
.doc .lede { margin-bottom: 0; }
.doc-body { padding-bottom: 72px; }
.doc-body .updated { color: var(--faint); font-size: .9rem; margin-bottom: 18px; }
.doc-body .card { margin-bottom: 16px; }
.doc-body .card:hover { transform: none; }
.doc-body h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 12px; letter-spacing: -.015em; }
.doc-body h3 { font-size: 1.02rem; font-weight: 660; margin: 18px 0 6px; }
.doc-body p { color: var(--muted); margin-bottom: 12px; max-width: 76ch; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body strong { color: var(--ink); }
.callout { border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px; background: linear-gradient(140deg, rgba(63,191,147,.12), rgba(12,107,78,.08)); border: 1px solid rgba(63,191,147,.26); }
.callout p { color: var(--ink); margin-bottom: 0; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 26px; }
.contact-grid a { display: block; padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--ink); transition: transform .2s ease, border-color .2s ease; }
.contact-grid a:hover { text-decoration: none; transform: translateY(-3px); border-color: rgba(63,191,147,.4); }
.contact-grid span { display: block; font-size: 1.4rem; margin-bottom: 6px; }
.contact-grid small { display: block; color: var(--muted); font-size: .85rem; }
.doc-body details { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 16px 20px; margin-bottom: 10px; }
.doc-body details[open] { border-color: rgba(63,191,147,.32); }
.doc-body summary { cursor: pointer; font-weight: 640; list-style: none; }
.doc-body summary::-webkit-details-marker { display: none; }
.doc-body summary::after { content: '+'; float: right; color: var(--brand); font-weight: 700; }
.doc-body details[open] summary::after { content: '−'; }
.doc-body details p { margin-top: 10px; margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .line-base, .line-plan { stroke-dashoffset: 0; }
  .area-plan, .marker { opacity: 1; }
  html { scroll-behavior: auto; }
}

@media (min-width: 1600px) {
  :root { font-size: 17.5px; }
  .wrap { max-width: 1320px; }
  .phone { width: 330px; }
}
