/* ==========================================================================
   Yieldly — yieldly.org
   Design system + components. Plain CSS, no framework.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --violet-500: #8b5cf6;

  /* Neutrals (light) */
  --bg: #ffffff;
  --bg-soft: #f8f9fa;
  --bg-elevated: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --text-soft: #1f2937;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  /* Accents */
  --green-500: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.12);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  /* Layout */
  --maxw: 1140px;
  --gutter: 24px;
  --nav-h: 68px;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --hero-grad: linear-gradient(180deg, var(--blue-100) 0%, #ffffff 70%);
  --brand-grad: linear-gradient(135deg, var(--blue-500) 0%, var(--violet-500) 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-soft: #0f172a;
    --bg-elevated: #131c2e;
    --border: #1f2a3d;
    --text: #f1f5f9;
    --text-soft: #e2e8f0;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --hero-grad: linear-gradient(180deg, #1e3a8a 0%, #0f172a 70%);
  }
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--text); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 800; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--text-soft); }

:focus-visible { outline: 3px solid var(--blue-500); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout primitives ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--soft { background: var(--bg-soft); }
.center { text-align: center; }
.maxw-prose { max-width: 720px; margin-left: auto; margin-right: auto; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 12px;
}

.lead { font-size: 1.18rem; color: var(--text-muted); }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
  min-height: 48px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--blue-700); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--blue-500); color: var(--blue-600); }
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

/* App store badges */
.store-badges { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  min-width: 190px;
  border: 1px solid #0f172a;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-badge:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-badge svg { width: 26px; height: 26px; flex: none; fill: #fff; }
.store-badge .sb-top { display: block; font-size: 0.7rem; opacity: 0.85; line-height: 1.1; }
.store-badge .sb-bot { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.2; }
@media (prefers-color-scheme: dark) {
  .store-badge { background: #f1f5f9; color: #0b1220; border-color: #f1f5f9; }
  .store-badge svg { fill: #0b1220; }
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text-soft); font-weight: 600; font-size: 0.97rem; padding: 8px 14px; border-radius: 8px; }
.nav-links a:hover { color: var(--blue-600); background: var(--bg-soft); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--blue-600); }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; color: var(--text); }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 20px;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1.05rem; }
  .nav-cta { margin: 8px 0 0; }
  .nav-links .btn { width: 100%; }
}

/* ---------- Hero ---------- */
.hero { background: var(--hero-grad); padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 7vw, 80px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: 18px; }
.hero .lead { color: var(--text-soft); max-width: 540px; }
.hero-cta { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.hero-note { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.hero-phones { display: flex; justify-content: center; gap: 18px; position: relative; }
.hero-phones img {
  width: 240px;
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
}
.hero-phones img:nth-child(2) { margin-top: 36px; }
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .hero-cta { align-items: center; }
  .store-badges { justify-content: center; }
  .hero-phones { margin-top: 36px; }
  .hero-phones img { width: min(42vw, 220px); }
}
@media (max-width: 480px) {
  .hero-phones img:nth-child(2) { display: none; }
  .hero-phones img { width: min(64vw, 260px); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.98rem; }
.feature-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--blue-100);
  color: var(--blue-600);
  margin-bottom: 16px;
}
@media (prefers-color-scheme: dark) {
  .feature-icon { background: rgba(59, 130, 246, 0.16); }
}
.feature-icon svg { width: 26px; height: 26px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; color: var(--blue-600); letter-spacing: -0.03em; }
.stat .label { color: var(--text-muted); font-size: 0.95rem; }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Feature split rows ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split + .split { margin-top: clamp(56px, 8vw, 96px); }
.split.reverse .split-media { order: 2; }
.split-media { display: flex; justify-content: center; }
.split-media img { width: min(300px, 80%); border-radius: 28px; box-shadow: var(--shadow-lg); }
.split ul { list-style: none; padding: 0; margin: 18px 0 0; }
.split li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--text-soft); }
.split li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--blue-100);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563eb'%3E%3Cpath d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-size: 14px; background-repeat: no-repeat; background-position: center;
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse .split-media { order: 0; }
}

/* ---------- How it works ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { position: relative; padding-top: 8px; }
.step .step-num {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-grad); color: #fff; font-weight: 800;
  margin-bottom: 14px;
}
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; max-width: 860px; margin: 0 auto; align-items: start; }
.price-card { position: relative; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.price-card.featured { border-color: var(--blue-500); box-shadow: var(--shadow-md); }
.price-badge { position: absolute; top: -13px; left: 32px; background: var(--brand-grad); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; }
.price-card h3 { font-size: 1.4rem; }
.price-amount { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 2px; line-height: 1.1; }
.price-amount--label { font-size: 2rem; }
.price-amount small { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.price-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; line-height: 1.5; }
.feature-list { list-style: none; padding: 0; margin: 20px 0 24px; }
.feature-list li { position: relative; padding-left: 30px; margin-bottom: 12px; color: var(--text-soft); font-size: 0.98rem; }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 20px; height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563eb'%3E%3Cpath d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
}
.feature-list li.muted { color: var(--text-faint); }
.feature-list li.muted::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M19 13H5v-2h14v2z'/%3E%3C/svg%3E");
}
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }

/* Comparison table */
.compare { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.97rem; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.compare thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; }
.compare .yes { color: var(--green-500); font-weight: 700; }
.compare .no { color: var(--text-faint); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--bg-elevated); overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-size: 1.05rem; font-weight: 600; color: var(--text);
  padding: 18px 52px 18px 20px; position: relative; font-family: inherit;
}
.faq-q::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--blue-600); font-weight: 400; line-height: 1;
}
.faq-item.open .faq-q::after { content: "\2013"; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-item.open .faq-a { max-height: 600px; }
.faq-a-inner { padding: 0 20px 18px; color: var(--text-muted); }
.faq-a-inner p { margin: 0; color: var(--text-muted); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--brand-grad); color: #fff; border-radius: var(--radius-lg); padding: clamp(36px, 6vw, 64px); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.92); }
.cta-band .store-badge { background: #fff; color: #0b1220; border-color: #fff; }
.cta-band .store-badge svg { fill: #0b1220; }
.cta-band .store-badges { justify-content: center; }

/* ---------- Article / legal ---------- */
.doc { max-width: 760px; margin: 0 auto; }
.doc h1 { margin-bottom: 8px; }
.doc .updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 32px; }
.doc h2 { font-size: 1.5rem; margin-top: 40px; }
.doc h3 { margin-top: 28px; }
.doc ul, .doc ol { padding-left: 22px; color: var(--text-soft); }
.doc li { margin-bottom: 8px; }
.doc a { text-decoration: underline; }
.callout { background: var(--blue-50); border: 1px solid var(--blue-100); border-left: 4px solid var(--blue-500); border-radius: var(--radius-sm); padding: 16px 20px; margin: 20px 0; }
.callout p { margin: 0; color: var(--text-soft); }
@media (prefers-color-scheme: dark) {
  .callout { background: rgba(59,130,246,0.10); border-color: rgba(59,130,246,0.25); }
}

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }
.post-card { display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.post-card .post-thumb { aspect-ratio: 16 / 9; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; padding: 20px; text-align: center; }
.post-card .post-body { padding: 22px; }
.post-card .post-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue-600); }
.post-card h3 { margin: 8px 0 8px; }
.post-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.post-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 56px 0 32px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-brand p { color: var(--text-muted); font-size: 0.92rem; max-width: 280px; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-soft); font-size: 0.95rem; }
.footer-col a:hover { color: var(--blue-600); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.88rem; }
.footer-disclaimer { max-width: 640px; }
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--blue-600); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
