/* ============================================================
   Digital FortyThree — site design system
   Dark-first, data-visualization-forward fintech identity.
   Chart palette validated (dataviz six checks, dark surface #0E1627):
   actual #26A96C · forecast #3987E5 · budget #B5862B (dashed = secondary encoding)
   ============================================================ */

:root {
  /* Ground (figure/ground: deep navy ground, luminous data figures).
     Raised 2026-08-26 from #0A101C, which was navy by hex but read as black.
     The whole family moved together so panels, cards and rules keep the same
     separation from the page they always had. */
  --bg0: #0C1730;        /* page plane */
  --bg1: #101C36;        /* chart / panel surface */
  --card: #152442;       /* raised card */
  --card-hi: #1A2B4E;    /* hover / active card */
  --line: #263455;       /* hairline */
  --line-soft: #1A2843;  /* recessive grid */
  --baseline: #354566;   /* chart baseline / axis */
  --panel-deep: #080D17; /* figure well - deeper than the page, for diagrams
                            that need to read as their own dark surface */

  /* ink */
  --ink: #E9EDF5;
  --ink-2: #A9B4CC;
  --muted: #7C89A6;

  /* brand */
  --cream: #FAF5E6;      /* logo cream — display headings */
  --brass: #C9A45C;      /* UI accent (non-chart duty) */
  --green-ui: #38C388;   /* UI accent: buttons, links, focus */
  --green-ui-deep: #2AA372;

  /* chart series (validated) */
  --s-actual: #26A96C;
  --s-forecast: #3987E5;
  --s-budget: #B5862B;

  /* status (icon + label always; never color alone) */
  --good: #0CA30C;
  --warn: #FAB219;
  --crit: #D03B3B;

  /* template color-control roles (Genesis product language) */
  --role-pink: #D9A0B0;
  --role-blue: #93A9D6;
  --role-grey: #B8C2D4;

  --font-display: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--cream); line-height: 1.14; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 14px 0; max-width: 62ch; }
a { color: var(--green-ui); text-decoration: none; }
a:hover { color: #5CD8A5; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green-ui); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
}
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.lede { font-size: 18px; color: var(--ink-2); }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  height: 68px;
  background: linear-gradient(180deg, rgba(12,23,48,0.92) 0%, rgba(12,23,48,0.75) 70%, rgba(12,23,48,0) 100%);
  backdrop-filter: blur(6px);
}
.nav .mark { display: flex; align-items: center; gap: 12px; color: var(--cream); }
.nav .mark .glyph { display: block; flex: none; margin: -5px 0; opacity: .95; }
.nav .mark .word { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }
.nav .mark .sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--muted); display: block; margin-top: 2px; }
.nav .links { display: flex; align-items: center; gap: clamp(16px, 3vw, 34px); }
.nav .links a { font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.nav .links a:hover { color: var(--cream); }
.nav .links a.active { color: var(--cream); border-bottom: 2px solid var(--green-ui); padding-bottom: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15.5px;
  padding: 13px 24px;
  border-radius: 7px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn-primary { background: var(--green-ui-deep); color: #071410; }
.btn-primary:hover { background: var(--green-ui); color: #071410; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-2); color: var(--cream); }
.btn-sm { padding: 9px 18px; font-size: 14px; }

/* ---------- cards & chips ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 26px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--bg1);
}

/* ---------- chart chrome ---------- */
.viz-surface { background: var(--bg1); border: 1px solid var(--line); border-radius: 12px; }
.viz-grid line { stroke: var(--line-soft); stroke-width: 1; }
.viz-axis { stroke: var(--baseline); stroke-width: 1; }
.viz-tick { font-family: var(--font-mono); font-size: 10.5px; fill: var(--muted); }
.viz-label { font-family: var(--font-body); font-size: 12px; fill: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.legend .key { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.legend .swatch { width: 18px; height: 0; border-top: 2.5px solid; border-radius: 2px; }
.legend .swatch.dashed { border-top-style: dashed; }
.legend .swatch.dotted { border-top-style: dotted; }
.delta { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--good); }
.delta.down { color: var(--crit); }

/* stat tile — the figure, then its label.
   The label wraps onto as many lines as it needs and the tiles stretch to match, so a long
   subheader ("Prebooked Revenue Pending Deliveries") never widens one tile past its row or
   pushes its rule out of line with the others. */
.tile {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px;
  min-width: 0;                       /* long labels wrap instead of stretching the track */
  height: 100%;                       /* every tile in a row ends level */
  justify-content: flex-start;
}
.tile .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--cream); }
.tile .k {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  line-height: 1.45;                  /* readable once it runs to two or three lines */
  text-wrap: balance;                 /* splits evenly rather than orphaning a word */
  overflow-wrap: break-word;
  margin-top: auto;                   /* labels sit on a common baseline across the row */
  padding-top: 4px;
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  /* 68px to match the nav exactly — the page is then bracketed by two bars of
     the same weight instead of a light one on top and a heavy one below. The
     34px badge sets the floor, so the padding is vertical-free and the height
     does the work. */
  min-height: 68px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: var(--bg0);
}
.footer span, .footer a { font-size: 12.5px; color: var(--muted); }
.footer a:hover { color: var(--ink-2); }
.footer .badge { width: 34px; height: 34px; border-radius: 0; }
/* narrow screens: let it wrap onto two lines rather than crush the content */
@media (max-width: 620px) { .footer { min-height: 0; padding: 16px clamp(20px, 4vw, 56px); } }

/* ---------- utilities ---------- */
.tnum { font-variant-numeric: tabular-nums; }
.scrollwrap { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Do not zero-out animation-duration site-wide. Windows "Animation effects"
     off maps to this media query and would freeze the product figures, the
     flow cubes, and the Meet Genesis board on any machine that has it off. */
}
