/* Flowfield Holdings design system — components, screen scale.
   The investor deck's patterns, generalised for web pages, docs and app UI. Needs tokens.css
   (and fonts.css unless fonts are loaded another way). Every class is prefixed ff- so it can
   sit next to any framework. Slides keep the deck's own 1920x1080 classes (hq/deck/src).

   Surfaces: put .ff-dark or .ff-light on any container. Each one sets the same role
   variables (--fg, --fg-soft, --fg-muted, --rule, --rule-strong, --emph, --line), so the
   components below work on either without a dark-mode variant of their own. */

/* ---------- surfaces ---------- */
.ff-dark {
  --bg: var(--ground); --bg-soft: var(--ground-soft);
  --fg: var(--on-dark); --fg-soft: var(--on-dark-muted); --fg-muted: var(--on-dark-muted);
  --rule: var(--rule-dark); --rule-strong: var(--rule-dark-strong);
  --emph: var(--highlight-on-dark);   /* emphasis type on dark = sand */
  --line: var(--accent-on-dark);      /* bars, key lines = sage */
  background: var(--bg); color: var(--fg);
}
.ff-light {
  --bg: var(--paper); --bg-soft: var(--paper-soft);
  --fg: var(--ink); --fg-soft: var(--ink-soft); --fg-muted: var(--ink-muted);
  --rule: var(--rule-light); --rule-strong: var(--rule-light-strong);
  --emph: var(--accent-ink);          /* small emphasis type on light = teal ink */
  --line: var(--accent);              /* bars, key lines = deep teal */
  background: var(--bg); color: var(--fg);
}
/* The deck's "dark panel": deep-teal ground for one callout on a light page. */
.ff-panel {
  --bg: var(--accent-ink); --fg: var(--on-dark); --fg-soft: var(--pale-sage); --fg-muted: var(--pale-sage);
  --rule: var(--rule-dark); --rule-strong: var(--rule-dark-strong);
  --emph: var(--sand); --line: var(--sand);
  background: var(--bg); color: var(--fg); padding: var(--space-6) var(--space-7);
}

.ff-body-text, .ff-dark, .ff-light, .ff-panel {
  font-family: var(--font-body); font-size: var(--text-body); line-height: 1.5;
  letter-spacing: -0.005em; -webkit-font-smoothing: antialiased;
}

/* ---------- type ---------- */
.ff-display, .ff-h1, .ff-h2, .ff-figure { font-family: var(--font-display); font-weight: 400;
  font-variant-numeric: lining-nums; text-wrap: balance; margin: 0; }
.ff-display { font-size: var(--text-display); line-height: 1.04; letter-spacing: -0.035em; }
.ff-h1 { font-size: var(--text-h1); line-height: 1.08; letter-spacing: -0.025em; }
.ff-h2 { font-size: var(--text-h2); line-height: 1.18; letter-spacing: -0.02em; }
.ff-h3 { font-family: var(--font-body); font-size: var(--text-h3); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.ff-figure { font-size: var(--text-figure); line-height: 1; letter-spacing: -0.04em; }
.ff-small { font-size: var(--text-small); line-height: 1.45; }
.ff-soft { color: var(--fg-soft); }
.ff-muted { color: var(--fg-muted); }
/* Emphasis is colour only — no highlighter swipe, no underline. */
.ff-emph { color: var(--emph); }
/* Large display type on light may take the accent fill (>=3:1 large text). */
.ff-light :is(.ff-display, .ff-h1, .ff-h2, .ff-figure) .ff-emph,
.ff-light :is(.ff-display, .ff-h1, .ff-h2, .ff-figure).ff-emph { color: var(--accent); }
/* ...but a panel inside a light page keeps its own (sand) emphasis. */
.ff-panel :is(.ff-display, .ff-h1, .ff-h2, .ff-figure) .ff-emph,
.ff-panel :is(.ff-display, .ff-h1, .ff-h2, .ff-figure).ff-emph { color: var(--emph); }

.ff-label, .ff-eyebrow {
  font-family: var(--font-mono); font-size: var(--text-label); font-weight: 400;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--fg-muted);
}
.ff-eyebrow { color: var(--emph); letter-spacing: 0.16em; }

/* ---------- wordmark lockup (the site's) ---------- */
.ff-wordmark { display: inline-flex; flex-direction: column; align-items: center; gap: 0.24em; }
.ff-wordmark b { font-family: var(--font-display); font-weight: 600; font-size: 1em; line-height: 1;
  letter-spacing: var(--track-wordmark); text-indent: var(--track-wordmark); white-space: nowrap; color: var(--fg); }
.ff-wordmark span { font-family: var(--font-display); font-weight: 500; font-size: 0.29em; line-height: 1;
  letter-spacing: var(--track-subtitle); text-indent: var(--track-subtitle); white-space: nowrap; color: var(--fg-soft); }
/* One-line chrome version (deck header/footer, nav). */
.ff-wordmark-inline { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.20em; text-transform: uppercase; color: var(--fg); }

/* ---------- structure ---------- */
.ff-rule { border: 0; height: var(--hairline); background: var(--rule); margin: 0; }
.ff-stack { display: flex; flex-direction: column; gap: var(--gap, var(--space-4)); }
.ff-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--gap, var(--space-7)); }
@media (max-width: 720px) { .ff-grid { grid-template-columns: 1fr; } }

/* ---------- stat ---------- */
.ff-stat { display: flex; flex-direction: column; gap: var(--space-3); }
.ff-stat .ff-figure { color: var(--fg); }
.ff-stat-strip { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--space-8);
  padding: var(--space-7) 0; border-top: var(--hairline) solid var(--rule); border-bottom: var(--hairline) solid var(--rule); }
@media (max-width: 720px) { .ff-stat-strip { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ---------- cards ---------- */
/* Pillar: a hairline on top, no box. The default card. */
.ff-pillar { padding-top: var(--space-5); border-top: var(--hairline) solid var(--rule); }
.ff-pillar .ff-label { display: block; color: var(--emph); margin-bottom: var(--space-3); }
.ff-pillar h4 { margin: 0 0 var(--space-2); font-size: var(--text-h3); font-weight: 500; letter-spacing: -0.01em; }
.ff-pillar p { margin: 0; font-size: var(--text-small); line-height: 1.45; color: var(--fg-soft); }
/* Box card: a hairline box on the soft surface (the deck's arc-card on dark, ex-card on light). */
.ff-card { padding: var(--space-5); border: var(--hairline) solid var(--rule-strong); background: var(--bg-soft); }
.ff-dark .ff-card { border-radius: var(--radius-md); }

/* ---------- numbered step ---------- */
.ff-step .ff-n { font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: 0.18em; color: var(--emph); }
.ff-step h4 { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-h3); font-weight: 500; letter-spacing: -0.01em; }
.ff-step ul { margin: var(--space-3) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }
.ff-step li { position: relative; padding-left: 14px; font-size: var(--text-small); line-height: 1.45; }
.ff-step li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 1px; background: currentColor; opacity: 0.5; }

/* ---------- check item (the deck's crit-card) ---------- */
.ff-check { display: grid; grid-template-columns: 22px 1fr; gap: 4px var(--space-3); padding: var(--space-4) 0; border-top: var(--hairline) solid var(--rule); }
.ff-check::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent-soft); color: var(--emph); font: 12px var(--font-mono); }
.ff-check > * { grid-column: 2; margin: 0; }
.ff-check > :first-child { grid-row: 1; font-weight: 500; }

/* ---------- table (the deck's workflow table) ---------- */
.ff-table { width: 100%; border-collapse: collapse; font-size: var(--text-small); line-height: 1.4; }
.ff-table th, .ff-table td { text-align: left; vertical-align: top; padding: 9px 14px 9px 0; border-bottom: var(--hairline) solid var(--rule); }
.ff-table thead th { font: 400 11px var(--font-mono); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--fg-soft); padding-bottom: 12px; border-bottom-color: var(--rule-strong); }
.ff-table .ff-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ff-table tr.ff-total td { border-top: var(--hairline) solid var(--rule-strong); border-bottom: 0; font-weight: 500; }

/* ---------- tags and pills ---------- */
.ff-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ff-tag { font: 400 11px var(--font-mono); letter-spacing: 0.10em; text-transform: uppercase; padding: 6px 12px;
  border: var(--hairline) solid var(--rule-strong); border-radius: var(--radius-pill); color: var(--fg-soft); }
.ff-chip { display: inline-block; padding: 6px 12px; background: var(--accent-soft); font-size: var(--text-small); color: var(--fg-soft); }

/* ---------- controls ---------- */
.ff-button { display: inline-flex; align-items: center; gap: var(--space-2); padding: 10px 18px; border-radius: var(--radius-0);
  font: 500 var(--text-small) var(--font-body); letter-spacing: 0; cursor: pointer; text-decoration: none;
  border: var(--hairline) solid var(--fg); background: var(--fg); color: var(--bg);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.ff-button:hover { background: transparent; color: var(--fg); }
.ff-button.ff-ghost { background: transparent; color: var(--fg); border-color: var(--rule-strong); }
.ff-button.ff-ghost:hover { border-color: var(--fg); }
.ff-link { color: inherit; text-decoration: none; border-bottom: var(--hairline) solid var(--line); }
.ff-link:hover { color: var(--emph); border-bottom-color: currentColor; }
:where(.ff-dark, .ff-light, .ff-panel) :focus-visible { outline: 2px solid var(--emph); outline-offset: 2px; }

/* ---------- status: dot + word (colour never carries meaning alone) ---------- */
.ff-status { display: inline-flex; align-items: center; gap: var(--space-2); font: 500 var(--text-small) var(--font-body); color: var(--st); }
.ff-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ff-dark .ff-success, .ff-panel .ff-success { --st: var(--success-on-dark); }
.ff-dark .ff-caution, .ff-panel .ff-caution { --st: var(--caution-on-dark); }
.ff-dark .ff-danger, .ff-panel .ff-danger { --st: var(--danger-on-dark); }
.ff-light .ff-success { --st: var(--success-ink); }
.ff-light .ff-caution { --st: var(--caution-ink); }
.ff-light .ff-danger { --st: var(--danger-ink); }

/* ---------- fine print: one sources line per page/slide ---------- */
.ff-fineprint { font-size: 12px; line-height: 1.4; color: var(--fg-muted); }

@media (prefers-reduced-motion: reduce) { .ff-button { transition: none; } }
