/* ============================================================
   MOZAIC FINANCE - LANDING v2 · below-the-fold styles
   Split out of the homepages' inline <style> (issue #4522) to cut
   render-blocking CSS: the critical/above-the-fold rules (tokens, resets,
   buttons, global chrome, hero, trust-strip) stay inline in each of
   en/es/fr/zh.html; everything from the SECTIONS block down lives here and
   loads non-render-blocking (media=print/onload swap + <noscript> fallback).

   Cascade: this sheet is linked AFTER the inline <style> in every homepage,
   so — exactly as when these rules were inline — it wins over shared.css at
   equal specificity. Keep it that way if you reorder the <head>.

   Byte-identical across all four locales (the locale deltas — fr's .hero-qc,
   zh's CJK font stacks — are all above this boundary, so they stay inline).
   To move the split boundary: hand-move rules below the SECTIONS banner between
   this file and the four en/es/fr/zh.html inline <style> blocks, keeping those
   blocks free of below-the-fold rules. The guard tests in
   backend/tests/infrastructure/test_landing_pages_seo.py pin the split.
   Served no-cache+ETag by nginx (see the exact-match location), like
   shared.css, so a deploy is never paired with a stale sheet.
   ============================================================ */

/* ============ SECTIONS ============ */
/* ============ CASH-FLOW SANKEY - recreated vector mock (income → total → categories → subcategories) ============ */
.cashflow .section-head{ margin-bottom:clamp(22px,3vh,34px); }
.sankey-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:0 0 var(--r-xl) var(--r-xl); }
.sankey-wrap{ padding:clamp(14px,2vw,22px) clamp(16px,2.4vw,28px); }
.sankey-svg{ width:100%; height:auto; display:block; }
@media(max-width:820px){ .sankey-svg{ min-width:720px; } }
.sk-kick{ font-family:var(--f-mono); font-size:9px; letter-spacing:.14em; fill:var(--muted); }
.sk-total{ font-family:var(--f-serif); font-size:16px; font-weight:600; letter-spacing:-.01em; fill:var(--ink); }
.sk-src-name{ font-family:var(--f-sans); font-size:14px; font-weight:700; fill:var(--ink); }
.sk-src-fig{ font-family:var(--f-mono); font-size:10.5px; fill:var(--muted); }
.sk-leaf{ font-family:var(--f-sans); }
.sk-ic{ font-size:12px; }
.sk-leaf-name{ font-size:12.5px; font-weight:600; fill:var(--ink); }
.sk-leaf-pct{ font-family:var(--f-mono); font-size:10px; fill:var(--muted); }
.section { padding: 120px 0; }
.section-head { max-width: 720px; }
.section-head.centered { margin: 0 auto; text-align: center; }
.section-kicker {
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
  display: flex; align-items: center; gap: 10px;
}
.section-head.centered .section-kicker { justify-content: center; }
.section-kicker::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.section-title {
  font-family: var(--f-serif); font-weight: 500;
  font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -.02em;
  margin: 18px 0 0;
  text-wrap: balance;
}
.section-title em { font-style: italic; color: var(--accent); }
.section-sub { color: var(--ink-3); font-size: 17.5px; margin: 18px 0 0; max-width: 56ch; text-wrap: pretty; }
.section-head.centered .section-sub { margin-left: auto; margin-right: auto; }

/* features - bento (asymmetric) grid */
.feat-grid{ display:grid; grid-template-columns:repeat(6,1fr); gap:20px; margin-top:56px; }
.feat{ grid-column:span 2; background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-2xl); padding:28px;
  display:flex; flex-direction:column; gap:20px; box-shadow:0 14px 34px -24px rgba(17,24,39,.16), 0 1px 2px rgba(17,24,39,.03); transition:box-shadow .25s var(--ease), transform .25s var(--ease); }
.feat.w4{ grid-column:span 4; } .feat.w6{ grid-column:span 6; }
/* wide cards lay the viz beside the copy for an editorial rhythm */
.feat.wide{ flex-direction:row; align-items:center; gap:28px; }
.feat.wide .fviz{ flex:1.05; min-height:170px; }
.feat.wide .feat-copy{ flex:1; }
/* .feat cards are non-interactive (no link) - no hover lift/shadow (#4155) */
@media(max-width:1020px){
  .feat-grid{ grid-template-columns:repeat(2,1fr); }
  .feat,.feat.w4,.feat.w6{ grid-column:span 1; }
  .feat.wide{ flex-direction:column; align-items:stretch; gap:18px; }
  .feat.wide .fviz{ min-height:148px; }
}
@media(max-width:680px){ .feat-grid{ grid-template-columns:1fr; } }
.feat h3, .feat h4{ margin:0; font-size:18px; font-weight:700; letter-spacing:-.012em; }
.feat p{ margin:6px 0 0; color:var(--ink-3); font-size:14.5px; line-height:1.55; text-wrap:pretty; }
.fviz{ border:0; border-radius:var(--r-lg); background:#F4F5F7; padding:20px; min-height:148px;
  display:flex; flex-direction:column; justify-content:center; gap:10px; }
.fviz-label{ font-family:var(--f-mono); font-size:9.5px; letter-spacing:.13em; text-transform:uppercase; color:var(--muted-2); }
.fviz-big{ font-family:var(--f-serif); font-weight:600; font-size:24px; letter-spacing:-.01em; }
.fviz-big small{ font-family:var(--f-sans); font-size:13px; font-weight:500; color:var(--muted); }
.fbar{ height:7px; border-radius:99px; background:var(--line); overflow:hidden; }
.fbar i{ display:block; height:100%; border-radius:99px; }
.fmeta{ display:flex; justify-content:space-between; font-size:11.5px; color:var(--muted); }
.frows{ display:flex; flex-direction:column; gap:8px; }
.frow{ display:flex; align-items:center; justify-content:space-between; gap:10px; background:var(--surface);
  border:1px solid var(--line-2); border-radius:var(--r-sm); padding:8px 12px; font-size:12.5px; }
.frow .l{ display:flex; align-items:center; gap:9px; font-weight:600; }
.frow .l i{ width:9px; height:9px; border-radius:3px; flex:none; }
.frow .r{ font-family:var(--f-mono); font-size:11.5px; color:var(--ink-3); }
.fchip{ align-self:flex-start; font-family:var(--f-mono); font-size:10px; letter-spacing:.05em; border-radius:99px; padding:4px 11px; }
.fspark{ display:flex; align-items:flex-end; gap:5px; height:54px; }
.fspark i{ flex:1; border-radius:3px 3px 0 0; background:var(--c,var(--teal)); opacity:.85; }
/* Dark mode: the viz well pins a light raw-hex ground the token layer can't
   reach — re-ground it on the dark page canvas (same move as the hero mock's
   .app), so the surface-toned .frow cards inside read as cards again. */
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .fviz { background: var(--bg); }
}
/* Forced dark (manual toggle): mirror of the media rule above — same
   gate/mirror pattern as shared.css; edit both together. */
:root[data-theme="dark"] .fviz { background: var(--bg); }


/* ============ COMPARE ============ */
.compare-wrap { margin-top: 56px; overflow-x: auto; }
.compare {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  overflow: hidden; min-width: 760px; box-shadow: var(--shadow-md);
}
.compare th, .compare td { padding: 18px 24px; text-align: left; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: 0; }
.compare thead th { background: var(--surface-2); font-size: 13.5px; }
.compare thead th .who { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.compare thead th .who img { width: 18px; height: 18px; }
.compare thead th small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; margin-top: 2px; }
.compare .feature-name { font-weight: 600; color: var(--ink-2); width: 34%; }
.compare .feature-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 1px; }
.compare .col-mozaic { background: color-mix(in oklab, var(--accent) 4.5%, var(--surface)); }
.compare thead .col-mozaic { background: color-mix(in oklab, var(--accent) 9%, var(--surface)); box-shadow: inset 0 3px 0 var(--accent); }
.mark-yes, .mark-no, .mark-part {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600;
}
.mark-yes::before, .mark-no::before, .mark-part::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background-position: center; background-repeat: no-repeat;
}
.mark-yes { color: #047857; }
.mark-yes::before { background-color: var(--mint-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2 4.2 7.4 8 3' stroke='%23047857' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.mark-no { color: var(--muted-2); font-weight: 500; }
.mark-no::before { background-color: var(--line-2); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M3 5h4' stroke='%239CA3AF' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.mark-part { color: #92400E; font-weight: 500; }
.mark-part::before { background-color: var(--amber-soft); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='2' fill='%2392400E'/%3E%3C/svg%3E"); }
.compare-note { margin-top: 14px; font-size: 12px; color: var(--muted-2); font-family: var(--f-mono); }
/* Mid-page CTA under the comparison table - the moment of conviction for the
   visitors who scroll (audit: only ~16% reach the bottom, so the final CTA
   alone never asks most scrollers to act). */
.compare-cta { margin-top: 44px; text-align: center; }

/* ============ SECURITY ============ */
.security { background: var(--ink); color: #F9FAFB; border-radius: var(--r-2xl); padding: 72px 64px; position: relative; overflow: hidden; }
.security::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 60% at 90% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 65%),
    radial-gradient(30% 50% at 0% 100%, color-mix(in oklab, var(--teal) 14%, transparent), transparent 65%);
}
@media (max-width: 860px) { .security { padding: 48px 28px; } }
.security .section-kicker { color: color-mix(in oklab, var(--accent) 55%, #fff); }
.security .section-title { color: #fff; position: relative; }
.security .section-title em { color: color-mix(in oklab, var(--accent) 60%, #fff); }
.sec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px; margin-top: 52px; position: relative; }
@media (max-width: 1020px) { .sec-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .sec-grid { grid-template-columns: 1fr; } }
.sec-item h4 { margin: 0; font-size: 15.5px; font-weight: 700; color: #fff; }
.sec-item p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: #9CA3AF; text-wrap: pretty; }
.sec-item .sec-ico {
  width: 36px; height: 36px; border-radius: 11px; margin-bottom: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  display: grid; place-items: center;
}
.sec-item .sec-ico i { width: 12px; height: 12px; border-radius: 4px; }
/* Dark mode: this is an inverted dark panel — its background is var(--ink)
   (near-black in light) under hardcoded white headings. In dark mode --ink
   flips light, stranding the white text on a pale ground. Pin the panel to the
   dark card surface + a hairline so it stays legible and reads as a card. */
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .security { background: var(--surface); border: 1px solid var(--paper-3); }
}
/* Forced dark (manual toggle): mirror of the media rule above — same
   gate/mirror pattern as shared.css; edit both together. */
:root[data-theme="dark"] .security { background: var(--surface); border: 1px solid var(--paper-3); }

/* ============ PRICING ============ */
.price-card {
  max-width: 880px; margin: 64px auto 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2xl);
  box-shadow: var(--shadow-float);
  display: grid; grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
}
@media (max-width: 820px) { .price-card { grid-template-columns: 1fr; } }
.price-left { padding: 44px 48px; }
.price-right { padding: 44px 48px; background: var(--surface-2); border-left: 1px solid var(--line-2); }
@media (max-width: 820px) { .price-right { border-left: 0; border-top: 1px solid var(--line-2); } }
.price-amount { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; }
.price-amount .big { font-family: var(--f-serif); font-weight: 600; font-size: 64px; letter-spacing: -.025em; line-height: 1; }
.price-amount .per { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.price-alt { margin-top: 10px; font-size: 14px; color: var(--ink-3); }
.price-alt b { font-weight: 600; }
.price-cta { margin-top: 30px; }
.price-fine { margin-top: 14px; font-family: var(--f-mono); font-size: 11.5px; color: var(--muted-2); }
.price-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.price-list li { display: flex; gap: 12px; font-size: 14.5px; color: var(--ink-2); align-items: flex-start; }
.price-list li::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none; margin-top: 1px;
  background-color: var(--mint-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2 4.2 7.4 8 3' stroke='%23047857' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center; background-repeat: no-repeat;
}

/* ============ FAQ ============ */
.faq-list { max-width: 760px; margin: 56px auto 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.faq-item {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 0 2px;
  transition: border-color .15s ease;
}
.faq-item[open] { border-bottom-color: var(--muted-2); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 24px 0;
  font-weight: 600; font-size: 16.5px;
  transition: color .15s ease;
}
.faq-item summary:hover { color: var(--teal-ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--f-mono); font-size: 18px; color: var(--muted-2);
  transition: transform .18s ease; flex: none;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 0 22px; color: var(--ink-3); font-size: 15px; line-height: 1.6; max-width: 60ch; text-wrap: pretty; }

/* ============ GUIDES ============ */
.guides-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 52px; }
@media (max-width: 900px) { .guides-grid { grid-template-columns: 1fr; } }
.guide-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-2xl);
  padding: 28px 28px 26px; text-decoration: none; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.guide-card:hover { border-color: var(--muted-2); transform: translateY(-2px); }
.guide-card .g-kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.guide-card h3 { font-family: var(--f-serif); font-weight: 600; font-size: 21px; line-height: 1.25; letter-spacing: -.01em; }
.guide-card p { color: var(--ink-3); font-size: 14.5px; line-height: 1.55; text-wrap: pretty; }
.guide-card .g-more { margin-top: auto; padding-top: 8px; font-family: var(--f-mono); font-size: 13px; color: var(--teal-ink); }
.guides-links { margin-top: 28px; text-align: center; font-size: 14.5px; color: var(--ink-3); text-wrap: pretty; }
.guides-links a { color: var(--teal-ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.guides-links a:hover { border-bottom-color: var(--teal-ink); }

/* ============ FINAL CTA + FOOTER ============ */
.final { text-align: center; padding: 128px 0 116px; position: relative; }
.final::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 70% at 50% 100%, color-mix(in oklab, var(--accent) 9%, transparent), transparent 70%);
}
.final .h-display { font-size: clamp(38px, 5vw, 68px); }
/* .footer styles come from shared.css (footer rendered by site-chrome.js). */

/* base display / CTA utilities (used by the final CTA) */
.h-display {
  font-family: var(--f-serif); font-weight: 500;
  font-size: clamp(44px, 6.2vw, 86px); line-height: 1.04; letter-spacing: -.022em;
  margin: 26px auto 0; max-width: 18ch; position: relative; text-wrap: balance;
}
.h-display em { font-style: italic; color: var(--accent); }
.hero-actions { position: relative; display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 34px; }
.hero-fine { position: relative; margin-top: 18px; font-family: var(--f-mono); font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

/* reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .feat.reveal:nth-child(2){ transition-delay:.06s; }
  .js .feat.reveal:nth-child(3){ transition-delay:.12s; }
  .js .feat.reveal:nth-child(5){ transition-delay:.06s; }
  .js .feat.reveal:nth-child(6){ transition-delay:.12s; }
}

/* ============ MOBILE PHONE TIER (≤560px) - issue #4234 ============
   Existing breakpoints stop at 560–620px, so true phone widths inherited
   laptop spacing. This additive tier tightens vertical rhythm and the few
   components that stayed cramped; the ≥561px design is untouched. */
@media (max-width: 560px) {
  /* Vertical rhythm - 104px section padding left ~200px of dead space per
     section on a phone-height screen. */
  .section { padding: 56px 0; }
  .final { padding: 64px 0 56px; }

  /* Pricing card - shrink the generous laptop padding and fluid-scale the
     price so the longer localized strings (fr/es) never crowd or clip. */
  .price-left, .price-right { padding: 30px 24px; }
  .price-amount .big { font-size: clamp(46px, 13vw, 64px); }

  /* Comparison table - the 760px min-width cut the Mozaic value mid-word at
     375px. A narrower min-width + tighter cells make the feature and Mozaic
     columns fully visible with a peek of the next column, which itself
     signals the row scrolls sideways. Still isolated inside .compare-wrap. */
  .compare-wrap { margin-top: 36px; }
  .compare { min-width: 540px; }
  .compare th, .compare td { padding: 12px 13px; }
}
