/* Spendcheck — design tokens mirror Spendcheck/UI/Colors.swift and Fonts.swift.
   Light: white background, brand blue primary, brand gold secondary.
   Dark:  systemGray6 background, brand gold primary, brand blue secondary. */

:root {
  --brand-blue: #112a62;
  --brand-gold: #f4e8b6;
  --icon-top: #1d3a7a;
  --icon-bottom: #04163e;

  --bg: #ffffff;
  --bg-deep: #f2f2f7;          /* Colors.darkBackground (light) = systemGray6 */
  --text: #000000;             /* UIColor.label */
  --text-2: rgba(0, 0, 0, 0.7);  /* Colors.heading */
  --text-3: rgba(0, 0, 0, 0.5);
  --primary: var(--brand-blue);
  --on-primary: var(--brand-gold);
  --surface: rgba(0, 0, 0, 0.025);
  --border: rgba(211, 211, 211, 0.45);
  --alert: #de332c;

  /* Category palette (Colors.swift) */
  --c-red: #e16161; --c-blue: #3b99cd; --c-green: #61ac3e; --c-yellow: #cfa90b;
  --c-orange: #ee9638; --c-purple: #9c69bf; --c-pink: #de5da4; --c-ocean: #40bfb3;
  --c-lime: #aebd24;

  --serif: "New York", ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 20px;
  --radius-lg: 32px;
  --max: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;             /* systemGray6 dark */
    --bg-deep: #141414;        /* Colors.darkBackground (dark) */
    --text: #ffffff;
    --text-2: rgba(255, 255, 255, 0.7);
    --text-3: rgba(255, 255, 255, 0.5);
    --primary: var(--brand-gold);
    --on-primary: var(--brand-blue);
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(211, 211, 211, 0.14);
    --alert: #fc5c56;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 99; background: var(--bg); padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--c-blue); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.site-header.on-blue {
  background: color-mix(in srgb, var(--brand-blue) 82%, transparent);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 21px; }
.on-blue .brand { color: var(--brand-gold); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-family: var(--sans); font-size: 15px; }
.nav-links a { color: var(--text-2); text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.on-blue .nav-links a { color: rgba(255, 255, 255, 0.75); }
.on-blue .nav-links a:hover { color: #fff; }
@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- Buttons (the app's gold "Get Started" button) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 19px;
  padding: 15px 26px; border-radius: var(--radius);
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-gold { background: var(--brand-gold); color: var(--brand-blue) !important; box-shadow: 0 6px 10px rgba(244, 232, 182, 0.2); }
.btn-gold:hover { box-shadow: 0 8px 22px rgba(244, 232, 182, 0.35); }
.btn-primary { background: var(--primary); color: var(--on-primary) !important; }
.btn-sm { font-size: 15px; padding: 9px 16px; border-radius: 14px; font-family: var(--sans); font-weight: 600; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Hero (OnboardingWelcomeView) ---------- */
.hero {
  background: radial-gradient(1200px 600px at 80% -10%, #1f3d80 0%, transparent 60%), var(--brand-blue);
  color: #fff; overflow: hidden; position: relative;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 88px; }
.hero-icon { width: 92px; height: 92px; border-radius: 22px; overflow: hidden; position: relative; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25); animation: sway 7s ease-in-out infinite; }
.hero-icon img { width: 100%; height: 100%; }
.hero-icon::after { /* IconShimmerOverlay */
  content: ""; position: absolute; top: -50%; left: 0; width: 70%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 242, 178, 0.18), transparent);
  transform: rotate(22deg); animation: shimmer 2s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-130%) rotate(22deg); } to { transform: translateX(240%) rotate(22deg); } }
@keyframes sway { 0%,100% { transform: perspective(500px) rotateY(-8deg) rotateX(4deg); } 50% { transform: perspective(500px) rotateY(8deg) rotateX(-4deg); } }
.hero h1 { font-size: clamp(42px, 6.4vw, 72px); margin: 30px 0 18px; }
.hero h1 em { font-style: normal; color: var(--brand-gold); }
.hero .lede { font-size: 21px; color: rgba(255, 255, 255, 0.72); max-width: 32ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: 34px; }
.hero-note { font-family: var(--sans); font-size: 14px; color: rgba(255, 255, 255, 0.55); }

/* Numbered sticker rows from the welcome screen */
.steps { list-style: none; padding: 0; margin: 44px 0 0; display: grid; gap: 22px; max-width: 460px; }
.steps li { display: grid; grid-template-columns: 38px 1fr; gap: 16px; align-items: start; }
.steps strong { display: block; font-size: 19px; font-weight: 600; }
.steps span { color: rgba(255, 255, 255, 0.7); font-size: 16px; }

.sticker {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--rounded); font-weight: 900; font-size: 19px; color: #fff;
  background: var(--c, var(--c-yellow));
  border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transform: rotate(-6deg);
}
.steps li:nth-child(2) .sticker { transform: rotate(5deg); }
.steps li:nth-child(3) .sticker { transform: rotate(-3deg); }

/* ---------- Phone mockup ---------- */
.phone {
  width: min(330px, 100%); aspect-ratio: 9 / 19.2; margin: 0 auto;
  border-radius: 52px; padding: 12px; background: #0b0b0d;
  box-shadow: 0 0 0 2px #2a2a2e, 0 40px 80px rgba(0, 0, 0, 0.45);
  position: relative;
}
.phone::before { content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 96px; height: 28px; border-radius: 20px; background: #000; z-index: 2; }
.screen {
  height: 100%; border-radius: 40px; overflow: hidden;
  background: #fff; color: #000; padding: 62px 18px 18px;
  display: flex; flex-direction: column; gap: 14px; font-size: 14px;
}
@media (prefers-color-scheme: dark) { .screen { background: #1c1c1e; color: #fff; } }
.screen .label { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.55; }
.screen .month { display: flex; justify-content: space-between; align-items: baseline; }
.screen .month b { font-size: 24px; font-weight: 700; }
.screen .safe { border-radius: 18px; padding: 16px; background: var(--brand-blue); color: var(--brand-gold); }
@media (prefers-color-scheme: dark) { .screen .safe { background: var(--brand-gold); color: var(--brand-blue); } }
.screen .safe .amt { font-size: 38px; font-weight: 700; line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.screen .safe .sub { font-family: var(--sans); font-size: 12px; opacity: 0.75; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 92px; padding: 0 2px; border-bottom: 1px dashed rgba(127, 127, 127, 0.35); }
.bars i { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--c); height: var(--h); animation: grow 1.2s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0s); transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: rgba(127, 127, 127, 0.07); }
.row .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-family: var(--rounded); font-weight: 800; font-size: 13px; border: 2px solid #fff; }
.row .name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.row .when { font-family: var(--sans); font-size: 11px; opacity: 0.55; }
.row .val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
.eyebrow { font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.section-title { font-size: clamp(32px, 4.4vw, 48px); max-width: 20ch; }
.section-lede { font-size: 20px; color: var(--text-2); margin-top: 16px; max-width: 46ch; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 52px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.card h3 { font-size: 22px; margin: 18px 0 8px; }
.card p { color: var(--text-2); font-size: 16.5px; }
.card .sticker { width: 42px; height: 42px; font-size: 18px; }
.card.wide { grid-column: span 2; }

/* Highlight band */
.band { background: var(--bg-deep); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; color: var(--text-2); }
.checks li::before { content: "✓"; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-family: var(--rounded); font-weight: 800; font-size: 14px; margin-top: 2px; }
.checks b { color: var(--text); font-weight: 600; }

.automation { display: grid; gap: 12px; }
.auto-step {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  font-size: 16px;
}
.auto-step .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: #fff; font-family: var(--rounded); font-weight: 800; }
.auto-step small { display: block; font-family: var(--sans); color: var(--text-3); font-size: 13px; }

/* Currencies */
.coins { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.coin-chip { font-family: var(--rounded); font-weight: 800; font-size: 22px; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #8a6a00; background: radial-gradient(circle at 35% 30%, #fff6d6, #e8cf7a 55%, #c9a227); box-shadow: inset 0 -3px 6px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.12); }

/* Languages */
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; font-family: var(--sans); font-size: 14px; }
.langs span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); }

/* FAQ */
.faq { margin-top: 40px; display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 22px; }
.faq summary { cursor: pointer; list-style: none; padding: 20px 0; font-weight: 600; font-size: 19px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--rounded); font-size: 24px; line-height: 1; color: var(--text-3); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 20px; color: var(--text-2); font-size: 17px; }

/* CTA */
.cta { background: var(--brand-blue); color: #fff; text-align: center; border-radius: var(--radius-lg); padding: 72px 24px; position: relative; overflow: hidden; }
.cta img { width: 96px; height: 96px; margin: 0 auto 24px; filter: drop-shadow(0 10px 18px rgba(0,0,0,0.3)); }
.cta h2 { font-size: clamp(32px, 4.4vw, 46px); }
.cta p { color: rgba(255,255,255,0.7); margin: 14px auto 30px; max-width: 40ch; font-size: 19px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px; font-family: var(--sans); font-size: 14px; color: var(--text-3); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ---------- Document pages (privacy, terms, support) ---------- */
.doc { padding: 64px 0 96px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(38px, 5vw, 54px); }
.doc .updated { font-family: var(--sans); font-size: 14px; color: var(--text-3); margin: 14px 0 40px; }
.doc h2 { font-size: 26px; margin: 44px 0 12px; }
.doc p, .doc li { color: var(--text-2); font-size: 18px; }
.doc p + p { margin-top: 14px; }
.doc ul { padding-left: 22px; margin: 12px 0; }
.doc li + li { margin-top: 8px; }
.doc strong { color: var(--text); font-weight: 600; }
.summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.contact-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; background: var(--brand-blue); color: #fff; border-radius: var(--radius); padding: 24px; margin: 8px 0 12px; }
.contact-card img { width: 56px; height: 56px; }
.contact-card a { color: var(--brand-gold); font-size: clamp(18px, 5vw, 21px); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 420px) { .contact-card { grid-template-columns: 1fr; } .contact-card img { display: none; } }
.contact-card span { display: block; color: rgba(255,255,255,0.65); font-family: var(--sans); font-size: 14px; }

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.notfound img { width: 120px; margin: 0 auto 26px; }
.notfound h1 { font-size: 46px; margin-bottom: 12px; }
.notfound p { color: var(--text-2); margin-bottom: 28px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .hero-grid { padding-top: 48px; padding-bottom: 72px; gap: 56px; }
  .features { grid-template-columns: 1fr 1fr; }
  .card.wide { grid-column: span 2; }
  section { padding: 72px 0; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .features { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .hero .lede { font-size: 19px; }
  .btn { width: 100%; }
  .nav .btn { width: auto; }
  .cta { border-radius: 24px; padding: 56px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
