/* hesti.app — shared stylesheet. Tokens mirror the Family Spend app (design-system/MASTER.md). */
:root {
  --canvas: #0B0F16;
  --glow: #221A3E;
  --t1: #F8FAFC;
  --t-rgb: 248,250,252;
  --glass-rgb: 255,255,255;
  --primary-start: #7C6BFF;
  --primary-end: #5B49E0;
  --link: #A79BFF;
  --positive: #10B981;
  --warning: #F59E0B;
  --radius: 18px;
  --radius-lg: 24px;
  --wrap: 1120px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --canvas: #F1EDE6;
    --glow: #FBF8FF;
    --t1: #1B1F22;
    --t-rgb: 27,31,34;
    --glass-rgb: 22,24,28;
    --link: #4A39C9;
    --positive: #2F7359;
    --warning: #9A5F1E;
    color-scheme: light;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-weight: 450;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--primary-start); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: rgba(var(--t-rgb), .68); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--canvas); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.site-header.solid { position: static; border-bottom: 1px solid rgba(var(--glass-rgb), .08); }
.wordmark { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--t1); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.on-dark .wordmark, .on-dark .nav a { color: #F8FAFC; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { color: var(--t1); text-decoration: none; font-size: 15px; font-weight: 600; padding: 10px 12px; border-radius: 12px; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover { background: rgba(var(--glass-rgb), .07); }
.on-dark .nav a:hover { background: rgba(255,255,255,.09); }
.nav .hide-sm { display: none; }
@media (min-width: 720px) { .nav .hide-sm { display: inline-flex; } }

/* ---------- Hero (always dark: the photo is a night kitchen) ---------- */
.hero { position: relative; background: #0B0F16; color: #F8FAFC; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::before { /* keeps the headline readable over the photo */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11,15,22,.80) 0%, rgba(11,15,22,.55) 38%, rgba(11,15,22,.86) 78%, #0B0F16 100%);
}
.hero .wrap { padding-top: 112px; padding-bottom: 0; display: grid; gap: 40px; }
.hero h1 { font-size: clamp(34px, 8.6vw, 60px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.hero h1 span { display: block; }
.hero h1 .resolve { color: #B5ABFF; }
.hero .lede { margin-top: 20px; font-size: clamp(18px, 2.4vw, 21px); color: rgba(248,250,252,.82); max-width: 34em; }
.cta-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; }
.hero .facts { margin-top: 18px; font-size: 14.5px; color: rgba(248,250,252,.7); }
.hero-shot { justify-self: center; width: min(78vw, 330px); }
@media (min-width: 900px) {
  .hero::before {
    background:
      linear-gradient(90deg, #0B0F16 0%, rgba(11,15,22,.94) 8%, rgba(11,15,22,.80) 42%, rgba(11,15,22,.30) 72%, rgba(11,15,22,.45) 100%),
      linear-gradient(180deg, rgba(11,15,22,.25) 0%, rgba(11,15,22,0) 45%, rgba(11,15,22,.85) 88%, #0B0F16 100%);
  }
  .hero .wrap { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; padding-top: 136px; gap: 56px; }
  .hero-copy { padding-bottom: 96px; }
  .hero-shot { width: 340px; align-self: end; justify-self: start; }
  .hero-bg img { transform: translateX(5%); } /* nudges the milk cartons out from behind the phone; the left edge is fully covered by the gradient */
}

/* Phone cutouts run off the bottom of the source image; fade them out instead of a hard edge. */
.shot img { width: 100%; -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, #000 78%, transparent 100%); }

/* ---------- App Store badge (Apple's artwork, supplied by Slava) ---------- */
.badge { display: inline-block; border-radius: 10px; line-height: 0; outline: 1px solid rgba(255,255,255,.38); outline-offset: -1px; }
.badge img { height: 60px; width: auto; }
.badge:hover { opacity: .9; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 104px 0; } }
.label { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); margin-bottom: 12px; }
h2 { font-size: clamp(28px, 5vw, 40px); line-height: 1.12; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.015em; font-weight: 700; }
.section-intro { margin-top: 14px; max-width: 38em; font-size: 18px; }

.card { background: rgba(var(--glass-rgb), .05); border: 1px solid rgba(var(--glass-rgb), .08); border-radius: var(--radius); padding: 24px; }

/* Three screenshots */
.shots { margin-top: 44px; display: grid; gap: 20px; }
.shots .card { padding: 28px 24px 0; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.shots .quote { font-size: 24px; line-height: 1.18; font-weight: 800; letter-spacing: -.025em; text-wrap: balance; }
.shots p { margin-top: 10px; }
.shots .shot { margin: 28px auto 0; width: min(100%, 290px); }
@media (min-width: 900px) { .shots { grid-template-columns: repeat(3, 1fr); } }

/* How it works */
.steps { margin-top: 40px; display: grid; gap: 16px; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 72px; }
.steps li::before {
  content: counter(step); position: absolute; top: 24px; left: 24px; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
}
.steps p { margin-top: 8px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.more { margin-top: 28px; font-weight: 650; font-size: 18px; }
.more.center { margin-top: 36px; text-align: center; }

/* Pricing */
.plans { margin-top: 40px; display: grid; gap: 20px; }
@media (min-width: 820px) { .plans { grid-template-columns: 1fr 1.15fr; align-items: stretch; } }
.plan { border-radius: var(--radius-lg); padding: 28px; }
.plan.premium { border-color: rgba(124,107,255,.55); background: linear-gradient(180deg, rgba(124,107,255,.13), rgba(124,107,255,.04)); }
.plan .price { margin-top: 10px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.plan .price small { font-size: 16px; font-weight: 600; letter-spacing: 0; color: rgba(var(--t-rgb), .68); }
.plan .alt { margin-top: 6px; }
.pill { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; color: var(--positive); border: 1px solid currentColor; vertical-align: 2px; }
.plan ul { margin-top: 20px; list-style: none; display: grid; gap: 10px; }
.plan li { padding-left: 28px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: .42em; width: 14px; height: 8px; border-left: 2.5px solid var(--positive); border-bottom: 2.5px solid var(--positive); transform: rotate(-45deg); }
.fineprint { margin-top: 24px; max-width: 60em; font-size: 12.5px; font-style: italic; color: rgba(var(--t-rgb), .68); }

/* Privacy */
.privacy-list { margin-top: 36px; display: grid; gap: 16px; list-style: none; }
@media (min-width: 820px) { .privacy-list { grid-template-columns: repeat(3, 1fr); } }
.privacy-list b { display: block; font-size: 19px; letter-spacing: -.01em; margin-bottom: 6px; }

/* What's new */
.changelog { margin-top: 36px; list-style: none; display: grid; gap: 0; border-left: 2px solid rgba(var(--glass-rgb), .12); }
.changelog li { padding: 0 0 28px 24px; position: relative; }
.changelog li:last-child { padding-bottom: 0; }
.changelog li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary-start); border: 2px solid var(--canvas); }
.changelog li.next::before { background: var(--canvas); border-color: var(--primary-start); }
.changelog .when { font-size: 14px; font-weight: 700; letter-spacing: .02em; color: rgba(var(--t-rgb), .68); }
.changelog p { margin-top: 4px; max-width: 46em; }

/* Maker */
.maker { max-width: 44em; }
.maker p { margin-top: 16px; font-size: 19px; }
.maker .sig { font-size: 16px; }

/* Closing CTA */
.closing { text-align: center; }
.closing .cta-row { justify-content: center; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid rgba(var(--glass-rgb), .08); padding: 40px 0 56px; font-size: 15px; }
footer .wrap { display: grid; gap: 18px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-left: -10px; }
footer nav a { padding: 10px; min-height: 44px; display: inline-flex; align-items: center; color: var(--t1); text-decoration: none; font-weight: 600; }
footer nav a:hover { text-decoration: underline; }

/* ---------- Article pages (start guide, support, 404) ---------- */
.page { padding: 56px 0 88px; }
.page .wrap { max-width: 820px; }
.page h1 { font-size: clamp(32px, 6.4vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
.page .lede { margin-top: 16px; font-size: 19px; }
.guide { margin-top: 48px; display: grid; gap: 24px; list-style: none; counter-reset: gstep; }
.guide > li { counter-increment: gstep; border-radius: var(--radius-lg); padding: 28px 24px 0; overflow: hidden; display: grid; gap: 24px; }
.guide > li.no-shot { padding-bottom: 28px; }
.guide .n { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.guide .n::after { content: " " counter(gstep); }
.guide h2 { font-size: 25px; margin-top: 6px; letter-spacing: -.025em; }
.guide p { margin-top: 10px; }
.guide .shot { width: min(100%, 260px); margin: 0 auto; }
.guide .key { border-color: rgba(124,107,255,.55); background: linear-gradient(180deg, rgba(124,107,255,.13), rgba(124,107,255,.04)); }
@media (min-width: 760px) {
  .guide > li { grid-template-columns: 1fr 250px; padding: 36px 36px 0; align-items: start; gap: 40px; }
  .guide > li.no-shot { grid-template-columns: 1fr; padding-bottom: 36px; }
  .guide .copy { padding-bottom: 36px; }
}
.stack { margin-top: 56px; }
.stack h2 { font-size: 28px; }
.faq { margin-top: 20px; display: grid; gap: 12px; }
.faq details { border-radius: var(--radius); padding: 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 48px 18px 22px; font-weight: 700; font-size: 18px; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 500; color: var(--link); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 22px 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 14px 24px; border-radius: 14px; font-weight: 700; font-size: 16px; color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--primary-start), var(--primary-end)); }
.btn:hover { opacity: .93; }
.btn.ghost { background: rgba(var(--glass-rgb), .05); border: 1px solid rgba(var(--glass-rgb), .12); color: var(--t1); }
.cards { margin-top: 36px; display: grid; gap: 16px; }
.cards .card p { margin-top: 8px; }
.cards .card .btn { margin-top: 16px; }

/* ---------- Legal pages (privacy, terms): same text, site styling ---------- */
.legal .wrap { max-width: 800px; }
.legal h1 { font-size: clamp(30px, 5.6vw, 42px); }
.legal .meta { margin-top: 12px; font-size: 14.5px; color: rgba(var(--t-rgb), .68); }
.legal h2 { font-size: 24px; letter-spacing: -.02em; margin: 48px 0 14px; padding-top: 28px; border-top: 1px solid rgba(var(--glass-rgb), .08); }
.legal h3 { font-size: 18px; margin: 28px 0 8px; }
.legal p { margin-bottom: 14px; }
.legal ul, .legal ol { margin: 0 0 16px 24px; }
.legal li { margin-bottom: 8px; }
.legal li::marker { color: var(--link); }
.legal strong { font-weight: 700; }
.legal .tldr { margin: 28px 0 8px; padding: 24px; border-radius: var(--radius-lg); border: 1px solid rgba(124,107,255,.55); background: linear-gradient(180deg, rgba(124,107,255,.13), rgba(124,107,255,.04)); }
.legal .tldr > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal .tldr ul { margin-bottom: 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 16px 0 22px; font-size: 15px; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid rgba(var(--glass-rgb), .12); padding: 10px 14px; text-align: left; vertical-align: top; }
.legal th { background: rgba(var(--glass-rgb), .05); font-weight: 700; white-space: nowrap; }
.legal .dim, .legal .caps { color: rgba(var(--t-rgb), .68); }
.legal .caps { font-size: 14.5px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
