/* ScamFendr public site — shared foundations.
 *
 * Concept: a calm second opinion at the kitchen table, in morning light. We
 * lay out what we checked, one step at a time, so people can see it for
 * themselves. Paper-white field, soft sage bands, one slate-teal brand
 * colour, and a honey accent kept for the one thing that moves.
 *
 * Every value used by landing.html and how-it-works.html comes from the
 * tokens below. The rules live in docs/designs/calm-site/DESIGN.md.
 */

@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/nunito-latin.woff2") format("woff2");
}

:root {
  /* Colour roles (contrast measured in DESIGN.md) */
  --bg:           #f7f6f2;
  --surface:      #ffffff;
  --surface-2:    #f0f4f1;
  --band:         #e6eee9;
  --line:         #dde3de;
  --line-strong:  #7d8b85;
  --ink:          #1e2b29;
  --ink-2:        #4a5a56;
  --ink-3:        #5f6e69;
  --brand:        #2f6a64;
  --brand-ink:    #24534f;
  --brand-soft:   #d5e5df;
  --on-brand:     #ffffff;
  --accent:       #d9a35b;
  --accent-ink:   #8a5a10;
  --accent-wash:  #f6ead3;
  --caution-ink:  #734700;
  --caution-bg:   #fbefd4;
  --danger:       #b0281d;
  --danger-bg:    #fbe5e0;

  /* Type: 7 roles, rem so the browser's text size setting scales them */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Nunito', -apple-system, 'Segoe UI', sans-serif;
  --fs-display:   2.25rem;    --lh-display:  1.12;
  --fs-headline:  1.875rem;   --lh-headline: 1.18;
  --fs-title:     1.375rem;   --lh-title:    1.3;
  --fs-lead:      1.1875rem;  --lh-lead:     1.5;
  --fs-body:      1.0625rem;  --lh-body:     1.55;
  --fs-small:     0.9375rem;  --lh-small:    1.45;
  --fs-label:     0.8125rem;  --lh-label:    1.25;

  /* Space (4 pt) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --gutter: 16px;
  --max: 1120px;
  --measure: 600px;

  /* Shape and elevation */
  --r-sm: 8px; --r-md: 16px; --r-pill: 999px;
  --e-1: 0 1px 2px rgba(36, 83, 79, 0.06);
  --e-2: 0 2px 6px rgba(36, 83, 79, 0.05), 0 16px 40px rgba(36, 83, 79, 0.08);

  /* Motion */
  --dur-press:  100ms;
  --dur-quick:  180ms;
  --dur-move:   280ms;
  --dur-hop:    900ms;
  --dur-fill:   600ms;
  --ease-out:   cubic-bezier(0.23, 1, 0.32, 1);
  --ease-glide: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 768px) {
  :root {
    --fs-display: 3.375rem; --lh-display: 1.1;
    --fs-headline: 2.5rem;  --lh-headline: 1.15;
    --gutter: 32px;
  }
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-body); font-size: var(--fs-body); line-height: var(--lh-body);
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { max-width: 100%; display: block; }
::selection { background: var(--accent-wash); color: var(--ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: var(--r-sm); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s-4); top: -100px; z-index: 300;
  background: var(--brand); color: var(--on-brand); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); font-weight: 700; text-decoration: none;
}
.skip:focus { top: var(--s-3); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--s-8) 0; }
@media (min-width: 768px) { .section { padding: var(--s-9) 0; } }
.band { background: var(--band); --ring: var(--band); }
.panel { background: var(--surface-2); --ring: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-5); }
@media (min-width: 768px) { .panel { padding: var(--s-6); } }

/* ── Type roles ───────────────────────────────────────────────────────── */
.display, h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-display); line-height: var(--lh-display);
  color: var(--brand-ink); letter-spacing: -0.01em; text-wrap: balance;
}
.headline, h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--fs-headline); line-height: var(--lh-headline);
  color: var(--brand-ink); letter-spacing: -0.005em; text-wrap: balance;
}
.title, h3 {
  font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; color: var(--ink);
}
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); color: var(--ink-2); max-width: var(--measure); }
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
.eyebrow {
  display: inline-block; font-size: var(--fs-label); line-height: var(--lh-label);
  font-weight: 700; letter-spacing: 0.04em; color: var(--accent-ink); margin-bottom: var(--s-3);
}

/* ── Buttons and links ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font: 700 var(--fs-body)/1.2 var(--font-body);
  min-height: 48px; padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
  border: 2px solid transparent; cursor: pointer; text-decoration: none; text-align: center;
  transition: background var(--dur-quick), color var(--dur-quick), border-color var(--dur-quick),
              transform var(--dur-press) var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-secondary { border-color: var(--brand); color: var(--brand-ink); background: transparent; }
.btn-secondary:hover { background: var(--surface-2); }
.link {
  color: var(--brand-ink); font-weight: 700; text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1.5px;
  display: inline-flex; align-items: center; gap: var(--s-1); min-height: 44px;
}
.link:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }

/* ── Old colour names ─────────────────────────────────────────────────────
   The sign-in modal (_auth_modal.html) is shared with investigate.html, which
   keeps its own palette, so it still uses these names. */
:root {
  --cyprus: var(--brand); --cyprus-deep: var(--brand-ink); --sand: var(--on-brand);
  --sand-card: var(--surface); --sand-line: var(--line-strong); --muted: var(--ink-2);
  --mist: var(--surface-2); --white: #ffffff;
}

/* ── Logo: small mark + wordmark, one image (brand/logo-nav.svg) ──────── */
.logo { display: inline-flex; flex: none; align-items: center; min-height: 44px; text-decoration: none; }
.logo img { display: block; width: auto; height: 30px; }

/* ── Nav ──────────────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 200;
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topnav .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--s-4); min-height: 68px; }
.nav-links { display: flex; align-items: center; gap: var(--s-5); }
.nav-links a:not(.btn) {
  font-size: var(--fs-small); font-weight: 700; color: var(--ink-2); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap;
}
.nav-links a:not(.btn):hover { color: var(--brand-ink); }
.nav-links .btn { min-height: 44px; padding: var(--s-2) var(--s-4); font-size: var(--fs-small); white-space: nowrap; }
@media (max-width: 860px) { .nav-links a.nav-hide:not(.btn) { display: none; } }
/* Phones keep the name and both nav actions: "My cases" lives in the sign-in
   slot, so it can't be the one that goes. */
.topnav .logo img { height: clamp(21px, 5.8vw, 30px); }
@media (max-width: 420px) {
  .topnav .wrap { column-gap: var(--s-2); }
  .nav-links { gap: var(--s-2); }
  .nav-links .btn { padding-inline: var(--s-3); }
}
/* Too narrow for the name: crop the image to its mark. */
@media (max-width: 359px) {
  .topnav .logo img { width: 22px; height: 26px; object-fit: cover; object-position: left; }
}

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-5);
}

/* ── Footer: light, plain rows ────────────────────────────────────────── */
.site-foot { background: var(--band); color: var(--ink-2); padding: var(--s-8) 0 var(--s-7); }
.site-foot .logo { margin-bottom: var(--s-4); }
.foot-legal { font-size: var(--fs-small); line-height: var(--lh-small); max-width: var(--measure); margin-bottom: var(--s-2); }
.foot-links {
  display: flex; flex-wrap: wrap; gap: 0 var(--s-5);
  border-top: 1px solid var(--line); margin-top: var(--s-5); padding-top: var(--s-2);
}
.foot-links a {
  color: var(--brand-ink); font-size: var(--fs-small); font-weight: 700;
  display: inline-flex; align-items: center; min-height: 44px; text-decoration: none;
}
.foot-links a:hover { text-decoration: underline; }

/* ══ Flowcharts ═════════════════════════════════════════════════════════
 * A flow is an ordered list of steps joined by a line. When it scrolls into
 * view, the line fills step by step and each step settles in turn; the honey
 * tip of the line is the only thing on the page that travels. It plays once,
 * then rests on its final state. Without JS, in print, and with reduced
 * motion, the final state is all anyone sees.
 */
.flow { position: relative; }
.flow-steps { list-style: none; display: flex; flex-direction: column; }
.flow-step {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: var(--s-4);
  padding-bottom: var(--s-6);
}
.flow-step:last-child { padding-bottom: 0; }
/* The rail: a quiet track, and a fill that grows into each step. */
.flow-step:not(:last-child)::before,
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; left: 21px; top: 48px; bottom: 4px; width: 2px; border-radius: 2px;
}
.flow-step:not(:last-child)::before { background: var(--line); }
.flow-step:not(:last-child)::after {
  background: linear-gradient(to bottom, var(--brand) 0, var(--brand) calc(100% - 14px), var(--accent) 100%);
  transform-origin: top; transform: scaleY(1);
}
.flow-node {
  width: 44px; height: 44px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand);
  box-shadow: 0 0 0 6px var(--ring, var(--bg));
  position: relative; z-index: 1;
}
.flow-node svg { width: 22px; height: 22px; }
.flow-body { padding-top: 6px; min-width: 0; }
.flow-title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 700; color: var(--ink); }
.flow-text { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); margin-top: var(--s-1); max-width: 520px; }
.flow-extra { margin-top: var(--s-3); }

/* Animated states (only once site.js has marked the page as playable) */
.flows-armed .flow-step .flow-node { background: var(--surface); color: var(--line-strong); box-shadow: 0 0 0 6px var(--ring, var(--bg)), inset 0 0 0 2px var(--line); }
.flows-armed .flow-step .flow-body { opacity: 0.45; }
.flows-armed .flow-step::after { transform: scaleY(0); }
.flows-armed .flow-step .flow-node,
.flows-armed .flow-step .flow-body { transition: background var(--dur-move) var(--ease-out), color var(--dur-move) var(--ease-out),
  box-shadow var(--dur-move) var(--ease-out), opacity var(--dur-move) var(--ease-out); }
.flows-armed .flow-step::after { transition: transform var(--dur-fill) var(--ease-glide); }
.flows-armed .flow-step.is-on .flow-node { background: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 6px var(--ring, var(--bg)), 0 0 0 9px var(--brand-soft); }
.flows-armed .flow-step.is-done .flow-node { box-shadow: 0 0 0 6px var(--ring, var(--bg)); }
.flows-armed .flow-step.is-on .flow-body { opacity: 1; }
.flows-armed .flow-step.is-done::after { transform: scaleY(1); }

/* Staggered children inside a step: cards, chips, documents. */
.flows-armed [data-stagger] > * { opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur-move) var(--ease-out), transform var(--dur-move) var(--ease-out); }
.flows-armed [data-stagger] > .is-on { opacity: 1; transform: none; }

.flow-replay {
  margin-top: var(--s-5); background: none; border: 0; cursor: pointer;
  font: 700 var(--fs-small)/1 var(--font-body); color: var(--brand-ink);
  text-decoration: underline; text-underline-offset: 3px; min-height: 44px;
  display: none; align-items: center; gap: var(--s-2);
}
.flows-armed .flow-replay { display: inline-flex; }
.flow-replay svg { width: 16px; height: 16px; }

/* Register cards: three sources, checked at the same time. */
.sources { display: grid; gap: var(--s-2); }
.source {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--s-2) var(--s-3); min-width: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3); align-items: center;
}
.source b { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink); }
.source span { grid-column: 1; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--ink-2); }
.source .chip { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
@media (max-width: 400px) {
  .source { grid-template-columns: 1fr; }
  .source .chip { grid-column: 1; grid-row: auto; margin-top: var(--s-1); }
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 700; font-style: normal;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; flex: none; }
.chip-ok { background: var(--brand-soft); color: var(--brand-ink); }
.chip-warn { background: var(--danger-bg); color: var(--danger); }
.chip-quiet { background: var(--surface-2); color: var(--ink-2); }

/* The verdict a check ends on. Red is used for a real warning and nothing else. */
.verdict {
  display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--danger);
  border-radius: var(--r-sm); padding: var(--s-3) var(--s-4);
}
.verdict b { display: block; color: var(--ink); font-size: var(--fs-small); }
.verdict span { font-size: var(--fs-small); color: var(--ink-2); line-height: var(--lh-small); }

/* The path: six stages of an investment scam on one line. */
.path { position: relative; padding: var(--s-2) 0 0; }
/* From the middle of the first stop to the middle of the last, through their centres. */
.path-line { position: relative; height: 4px; border-radius: 2px; background: var(--line); margin: 10px calc(100% / 12) 0; }
.path-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px;
  width: calc(var(--reach, 3) / 5 * 100%);
  background: linear-gradient(to right, var(--brand), var(--accent));
  transform-origin: left; transform: scaleX(1);
}
.path-stops { position: relative; z-index: 1; list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin-top: -14px; }
.path-stops li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.path-stops .stop {
  width: 24px; height: 24px; border-radius: var(--r-pill); background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line-strong);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-2);
}
.path-stops li.passed .stop { background: var(--brand); box-shadow: none; color: var(--on-brand); }
.path-stops li.reached .stop { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); color: #fff; }
.path-stops .stop-name { font-size: 12px; line-height: 1.25; color: var(--ink-2); max-width: 84px; overflow-wrap: anywhere; hyphens: auto; }
.path-stops li.reached .stop-name { color: var(--ink); font-weight: 700; }
.path-groups { display: grid; grid-template-columns: 1fr 1fr; margin-top: var(--s-3); gap: var(--s-2); }
.path-groups span {
  font-size: var(--fs-label); font-weight: 700; color: var(--ink-2); text-align: center;
  border-top: 2px solid var(--line); padding-top: 6px;
}
/* Six columns are too narrow for the names on a phone, so it becomes a list. */
@media (max-width: 520px) {
  .path-line, .path-groups { display: none; }
  .path-stops { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); margin-top: 0; }
  .path-stops li { flex-direction: row; text-align: left; gap: var(--s-3); }
  .path-stops .stop { flex: none; }
  .path-stops .stop-name { max-width: none; font-size: var(--fs-small); }
}
.flows-armed .path-fill { transform: scaleX(0); transition: transform 1200ms var(--ease-glide); }
.flows-armed .is-on .path-fill { transform: scaleX(1); }
.flows-armed .path-stops li .stop { transition: background var(--dur-quick), box-shadow var(--dur-quick), color var(--dur-quick); }
.flows-armed .path-stops li:not(.lit) .stop { background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); color: var(--ink-2); }

/* A bot reply, as the person would see it. */
.reply {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  border-bottom-left-radius: 4px; padding: var(--s-3) var(--s-4); font-size: var(--fs-small);
  line-height: var(--lh-small); color: var(--ink); max-width: 460px;
}
.reply strong { color: var(--danger); }

/* Wizard steps and documents. */
.ministeps { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ministeps li {
  font-size: var(--fs-label); font-weight: 700; color: var(--brand-ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 6px 12px; display: inline-flex; gap: 6px; align-items: center;
}
.ministeps li i { font-style: normal; color: var(--ink-3); font-weight: 400; }
.docs { list-style: none; display: grid; gap: var(--s-2); }
.doc {
  display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s-3);
}
.doc svg { width: 32px; height: 32px; color: var(--brand); }
.doc b { display: block; font-size: var(--fs-small); color: var(--ink); line-height: var(--lh-small); }
.doc span { display: block; font-size: var(--fs-label); line-height: 1.4; color: var(--ink-2); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .flows-armed .flow-step .flow-node, .flows-armed .flow-step .flow-body,
  .flows-armed .flow-step::after, .flows-armed [data-stagger] > *,
  .flows-armed .path-fill { transition: none !important; }
}
@media print {
  .flows-armed .flow-step .flow-body, .flows-armed [data-stagger] > * { opacity: 1 !important; transform: none !important; }
  .flows-armed .flow-step::after, .flows-armed .path-fill { transform: none !important; }
}
