/* =====================================================================
   mefin.ai — PUBLIC WEBSITE layer
   Visual language returned to the earlier MEFIN FAQ/Home (design system):
   light editorial page + deep-navy header/footer + restrained gold,
   with the dark "instrument" reserved for product visuals.
   The public site deliberately commits to ONE light look (no dark mode):
   `.public` pins every shared token to its light value.
   ===================================================================== */

.public {
  --p-page: #f6f6f3;        /* off-white, faintly warm */
  --p-pale: #eceef1;        /* alternating section ground */
  --p-deep: #0c1d27;        /* header, footer (ground-deep) */
  --p-brand: #25405d;       /* Stargazer: high-impact sections */
  --p-line-brand: #45607f;

  /* pin shared component tokens to light values */
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #eef0f3; --line: #dfe3e9; --line-strong: #c3cbd5;
  --ink: #23292e; --ink-2: #5d6773; --ink-3: #6f7985;
  --gold-ink: #7A5F1E; --gold-soft: #F6ECD2; --pos: #23704f; --pos-soft: #e3f1ea;
  --caution: #9a4a06; --caution-mark: #d9791f; --caution-soft: #fcecdc;
  --protect: #395272; --protect-soft: #dfe7f1; --focus: #25405d;
  --shadow-1: 0 1px 2px rgba(35,41,46,.04), 0 10px 28px rgba(35,41,46,.07);
  --shadow-2: 0 2px 6px rgba(12,29,39,.08), 0 30px 64px rgba(12,29,39,.18);
  color-scheme: light;
  background: var(--p-page); color: var(--ink);
  font-size: 17px; line-height: 1.65;
}
html:has(body.public) { background: var(--p-deep, #0c1d27); color-scheme: light; }

/* ---------- layout primitives ---------- */
.public .wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: clamp(20px, 5.8vw, 32px); }
.public .pad { padding-block: clamp(56px, 10vw, 104px); }
.ground-page { background: var(--p-page); color: var(--ink); }
.ground-pale { background: var(--p-pale); color: var(--ink); }
.ground-deep { background: var(--p-deep); color: #fcfcfc; }
.ground-brand { background: var(--p-brand); color: #fcfcfc; }
.on-dark-muted { color: #b9c0cb; }

/* ---------- type ---------- */
.public .display-xl { font-size: clamp(38px, 7.2vw, 68px); line-height: 1.04; font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
.public .display-l { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; }
.public .display-m { font-size: clamp(24px, 4.2vw, 30px); line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.public .lead { font-size: clamp(17px, 2.3vw, 20px); line-height: 1.6; }
.public .body-sm { font-size: 15px; line-height: 1.6; }
.public .muted { color: var(--ink-2); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.3; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-ink); }
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--yellow); flex: none; }
.ground-deep .eyebrow, .ground-brand .eyebrow { color: var(--yellow); }
.rail { font-size: clamp(11px, 1.7vw, 13px); font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; display: flex; flex-wrap: wrap; align-items: center; gap: 0.7em; }
.rail .sep { color: var(--yellow); font-weight: 400; letter-spacing: 0; }

/* ---------- header (HOME · FAQ · TRY IT · LOG IN — nothing else) ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 14px 16px; padding-block: 22px; }
.ground-deep .topbar { background: transparent; position: static; backdrop-filter: none; border: 0; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: #fcfcfc; flex: none; }
.wordmark .name { font-weight: 300; letter-spacing: 0.02em; font-size: 22px; line-height: 1; white-space: nowrap; }
.wordmark .name .fin { font-weight: 800; }
.wordmark .mark { height: 40px; display: block; flex: none; }
.wordmark .mark svg { height: 100%; width: auto; display: block; }
.topnav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 10px; }
.pill-nav { text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; border: 1px solid; border-radius: 999px; padding: 9px 18px; line-height: 1.2; transition: background-color .18s ease, color .18s ease; }
.pill-nav.link { color: #d7dce3; border-color: #4a5d70; }
.pill-nav.link:hover { border-color: #b9c0cb; color: #fff; }
.pill-nav.link[aria-current="page"] { color: var(--yellow); border-color: var(--yellow); }
.pill-nav.try { background: var(--yellow); border-color: var(--yellow); color: var(--iron); }
.pill-nav.try:hover { background: #E0BF78; }
.pill-nav:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
@media (max-width: 620px) {
  .topbar { padding-block: 14px; gap: 8px; }
  .wordmark .name { font-size: 18px; }
  .wordmark .mark { height: 30px; }
  .topnav { gap: 5px; }
  .pill-nav { padding: 7px 11px; font-size: 11px; letter-spacing: 0.03em; }
}
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .wordmark .name { font-size: 16px; }
  .topnav { gap: 4px; }
  .pill-nav { padding: 6px 8px; font-size: 10px; }
}

/* ---------- buttons ---------- */
.public .btn { min-height: 50px; padding: 0 24px; font-size: 15px; }
.btn-outline-dark { border: 1px solid var(--line-strong); color: var(--ink); background: transparent; }
.btn-outline-dark:hover { border-color: var(--ink-2); }

/* ---------- hero (light) ---------- */
.hero { padding-block: clamp(48px, 8vw, 88px) 0; }
.hero h1 { max-width: 15ch; }
.hero .sub { margin-top: clamp(18px, 2.5vw, 24px); max-width: 42ch; color: var(--ink-2); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: clamp(26px, 3.5vw, 34px); }
.hero-visual { margin-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(56px, 8vw, 96px); }
/* Home hero headline, brought down to the same restrained scale as the
   FAQ page title -- overrides the shared .display-xl size for this one
   element only (compound selector, same specificity as .public
   .display-xl, wins on source order) so nothing else using that shared
   class is affected. */
.display-xl.hero-title { font-size: clamp(28px, 5vw, 32px); }
.lead.sub { font-size: clamp(16px, 1.5vw, 18px); }

/* product frame: the dark instrument sitting on the light page */
.product-frame { border-radius: 24px; padding: clamp(18px, 3vw, 32px); box-shadow: var(--shadow-2); }
.pf-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px 40px; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--inst-line); margin-bottom: 8px; }
.pf-top .fig-xl { font-size: clamp(36px, 5vw, 54px); }
.pf-attn { display: grid; gap: 8px; justify-items: end; text-align: right; }
@media (max-width: 760px) { .pf-top { grid-template-columns: minmax(0, 1fr); } .pf-attn { justify-items: start; text-align: left; } }

/* ---------- "a different question" (stage cards from the earlier home) ---------- */
.stages { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 18px; align-items: stretch; margin-top: clamp(28px, 5vw, 44px); }
.stage { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 10px; min-height: 210px; }
.stage .who { font-size: 12.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.stage .q { font-size: 19px; line-height: 1.4; color: var(--ink); font-weight: 600; margin: auto 0 0; letter-spacing: -0.01em; }
.stage .note { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.stage.is-mefin { background: var(--p-brand); border-color: transparent; box-shadow: var(--shadow-2); }
.stage.is-mefin .who { color: var(--yellow); font-size: 14px; }
.stage.is-mefin .q { color: #fcfcfc; font-size: clamp(21px, 2.6vw, 25px); line-height: 1.25; letter-spacing: -0.02em; }
.stage.is-mefin .note { color: #b9c0cb; }
@media (max-width: 820px) { .stages { grid-template-columns: minmax(0, 1fr); } .stage { min-height: 0; } .stage .q { margin-top: 6px; } }

/* ---------- TRACK | CHOOSE | PREDICT ---------- */
.tcp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: clamp(28px, 5vw, 44px); }
.tcp > div { padding: 28px 28px 4px 0; display: grid; gap: 10px; align-content: start; }
.tcp > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.tcp .word { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: .04em; line-height: 1; }
.tcp h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.tcp p { color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 820px) { .tcp { grid-template-columns: minmax(0, 1fr); } .tcp > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); } .tcp > div { padding: 22px 0; } }

/* ---------- split feature ---------- */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.split > * { min-width: 0; }
.split.rev > :first-child { order: 2; }
@media (max-width: 900px) { .split, .split.rev { grid-template-columns: minmax(0, 1fr); } .split.rev > :first-child { order: 0; } }
.feature-copy { display: grid; gap: 18px; }
.feature-copy .lead { color: var(--ink-2); }
.mock { border-radius: 24px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; }
.mock-pad { padding: clamp(18px, 3vw, 28px); display: grid; gap: 16px; }
.balance-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.balance-vs .metric:last-child { padding: 16px; border-radius: 16px; background: var(--gold-soft); }
@media (max-width: 520px) { .balance-vs { grid-template-columns: 1fr; } .balance-vs > .i { transform: rotate(90deg); } }

/* ---------- Vault / Engine callout (from the earlier FAQ) ---------- */
.roles { max-width: 820px; background: var(--p-brand); color: #fcfcfc; border-radius: 24px; padding: clamp(26px, 3.8vw, 36px); box-shadow: var(--shadow-2); }
.roles .role + .role { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--p-line-brand); }
.roles .k { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); }
.roles .v { margin-top: 8px; font-size: clamp(19px, 2.6vw, 23px); line-height: 1.35; font-weight: 600; letter-spacing: -0.015em; }

/* ---------- closing / CTA ---------- */
.closing .display-l { max-width: 16ch; }
.closing .rail { margin-top: 18px; color: #b9c0cb; }
.closing .hero-ctas { margin-top: 30px; }
.faq-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.faq-links a { padding: 22px 24px 22px 0; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq-links a + a { padding-left: 24px; border-left: 1px solid var(--line); }
.faq-links a:hover { color: var(--gold-ink); }
.faq-links .chev path { stroke: var(--gold-ink); stroke-width: 1.9; fill: none; stroke-linecap: round; transform-origin: center; }
@media (max-width: 700px) { .faq-links { grid-template-columns: minmax(0, 1fr); } .faq-links a + a { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; } }

/* ---------- footer ---------- */
.site-foot { padding-block: 20px 18px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 10px 28px; flex-wrap: wrap; align-items: center; }
.site-foot .stack { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 20px !important; }
.site-foot .wordmark .name { font-size: 18px; }
.site-foot p { width: auto !important; }
.foot-links { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 14px; }
.foot-links a { color: #b9c0cb; text-decoration: none; }
.foot-links a:hover { color: #fff; }

/* =====================================================================
   FAQ — expandable rows (interaction model of the earlier FAQ)
   ===================================================================== */
.faq-hero { padding-block: clamp(40px, 6vw, 64px) clamp(8px, 2vw, 16px); }
.faq-hero .sub { margin-top: 18px; max-width: 46ch; color: var(--ink-2); }
.faq-toc { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.faq-toc a { font-size: 13.5px; font-weight: 600; color: var(--ink); text-decoration: none; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; }
.faq-toc a:hover { border-color: var(--ink-2); }
/* One consistent gap between numbered FAQ sections -- overrides only
   the specific padding side that faces the adjacent section (the
   shared .pad class's own clamp(56px,10vw,104px) on BOTH sides of
   every section was the cause: two adjacent .pad sections stacked
   their padding rather than sharing a single gap). Scoped to FAQ only
   via .faq-section-gap-top/-bottom -- .pad itself, and every other
   page that uses it (including the homepage), is untouched. */
.pad.faq-section-gap-bottom { padding-bottom: clamp(20px, 3.5vw, 28px); }
.pad.faq-section-gap-top { padding-top: clamp(20px, 3.5vw, 28px); }
/* Compact page title ("MEFIN FAQ") -- visually related to the header
   wordmark (22px), only moderately larger, never hero-scale. */
.faq-title { font-size: clamp(26px, 7vw, 32px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
/* Stepped-down FAQ content hierarchy, subordinate to .faq-title above --
   overrides the shared .display-m/.lead sizes for this FAQ-only content
   so the homepage's own (unrelated) use of those shared classes is
   never affected. */
.faq-head { max-width: 26ch; margin-top: 10px; }
.display-m.faq-head { font-size: clamp(22px, 4.5vw, 27px); }
.faq-intro { margin-top: 8px; max-width: 60ch; color: var(--ink-2); }
.lead.faq-intro { font-size: clamp(16px, 1.8vw, 18px); }
.faq-list { margin-top: clamp(26px, 3.8vw, 38px); max-width: 820px; }
.qa { border-bottom: 1px solid var(--line); }
.qa:first-child { border-top: 1px solid var(--line); }
.qa-q { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; text-align: left; cursor: pointer; background: none; border: 0; padding: 22px 2px; font: inherit; font-size: clamp(15px, 1.6vw, 17px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; color: var(--ink); }
.qa-q:hover { color: var(--gold-ink); }
.qa-q:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }
.chev { flex: none; margin-top: 6px; transition: transform .28s cubic-bezier(.4,0,.2,1); }
.chev path { stroke: var(--gold-ink); stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.qa-q[aria-expanded="true"] .chev { transform: rotate(180deg); }
.qa-a { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s cubic-bezier(.4,0,.2,1); }
.qa.is-closed .qa-a { grid-template-rows: 0fr; }
.qa-in { overflow: hidden; }
.qa-pad { padding: 0 2px 26px; max-width: 68ch; }
.qa-a p { margin-top: 12px; font-size: 16px; line-height: 1.68; color: var(--ink-2); }
.qa-a p:first-child { margin-top: 0; }
.qa-a p.short { color: var(--ink); font-weight: 700; font-size: 17px; }
.pull { margin-top: 18px; padding-left: 18px; border-left: 2px solid var(--yellow); font-size: clamp(17px, 2.2vw, 19px); line-height: 1.5; font-weight: 600; color: var(--ink); }
.qa-a .quote { margin-top: 14px; padding: 14px 18px; background: var(--p-pale); border-radius: 14px; font-size: 16px; font-weight: 500; color: var(--ink); }
.ground-pale .qa-a .quote { background: #fff; }
.pair { margin-top: 16px; display: grid; gap: 10px; }
.pair .row2 { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 14px; align-items: baseline; font-size: 16px; line-height: 1.55; }
.pair .who { font-weight: 700; color: var(--ink); }
.pair .what { color: var(--ink-2); }
@media (max-width: 560px) { .pair .row2 { grid-template-columns: minmax(0, 1fr); } }
.bullets { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.bullets li { position: relative; padding-left: 20px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 2px; border-radius: 2px; background: var(--yellow); }
.qa-a .example { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }

/* the visible comparison at the top of "Understanding MEFIN" */
.compare { display: grid; gap: 14px; margin-top: clamp(26px, 3.8vw, 36px); max-width: 920px; }
.compare-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.cmp { border-radius: 20px; padding: 22px 24px; display: grid; gap: 8px; align-content: start; background: #fff; border: 1px solid var(--line); }
.cmp .who { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.cmp .q { font-size: clamp(18px, 2.3vw, 21px); font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; color: var(--ink); }
.cmp .d { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.cmp.mefin { background: var(--p-brand); border-color: transparent; }
.cmp.mefin .who { color: var(--yellow); }
.cmp.mefin .q { color: #fcfcfc; }
.cmp.mefin .d { color: #b9c0cb; }
@media (max-width: 700px) { .compare-row { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .qa-a, .chev { transition: none; } }

/* ---------- Home page: tighter vertical rhythm ---------- */
.home .pad { padding-block: clamp(36px, 5.2vw, 60px); }
.home .hero { padding-block: clamp(20px, 3vw, 32px) 0; }
.home .hero .sub { margin-top: clamp(8px, 1.2vw, 12px); }
.home .hero-ctas { margin-top: clamp(18px, 2.6vw, 26px); }
.home .hero-visual { margin-top: clamp(18px, 2.6vw, 28px); padding-bottom: clamp(36px, 5.2vw, 60px); }
.home .stages, .home .tcp { margin-top: clamp(20px, 3vw, 30px); }
.home .stage { min-height: 168px; padding: 20px 22px; }
.home .tcp > div { padding-top: 22px; }
.home .split { gap: clamp(26px, 4.5vw, 52px); }
.home .feature-copy { gap: 14px; }

/* ---------- Full-width header + Home hero/Financial Picture content ----------
   The shared .wrap (max-width: 1080px) left a large unused column on wide
   viewports. The header (shared by every page) and the Home hero's own
   .wrap (headline + sub + Financial Picture card all live in the same
   wrap, so widening it keeps their left/right edges identical by
   construction) now span the viewport with a responsive gutter instead,
   while every other .wrap -- including all of FAQ's content and every
   other Home section -- keeps its existing 1080px-capped width
   untouched. The headline/sub stay compact because .hero h1's own
   max-width: 15ch and .hero .sub's own max-width: 42ch (both unchanged)
   constrain the TEXT regardless of how wide the surrounding wrap is. */
.wrap.topbar { max-width: none; padding-inline: clamp(20px, 4vw, 56px); }
.home .hero .wrap { max-width: none; padding-inline: clamp(20px, 4vw, 56px); }
/* Now that the hero's outer .wrap spans the full viewport, the old
   fixed 15ch/42ch text widths (sized for the previous 1080px-capped
   page) read as a narrow stranded column on wide desktop screens.
   Fluid instead of a single min-width breakpoint: grows/shrinks
   continuously with the viewport (no awkward jump at one width),
   floored at the original mobile values so narrow windows keep
   exactly their previous compact wrap, capped so very wide windows
   don't stretch the copy unreasonably far from the card's own edges. */
/* No character-count cap: the headline uses whatever width its
   container (.home .hero .wrap, already full-viewport with the
   standard gutters) actually has, and wraps only when the real
   available space runs out -- never a manufactured line count.
   The supporting copy gets the same rule, plus a generous 90ch
   ceiling that is a pure readability safeguard for extremely wide
   monitors, not a line-break mechanism (it only ever binds far
   beyond any width tested here). */
.hero h1 { max-width: 100%; }
.hero .sub { max-width: min(100%, 90ch); }
