/* ───────────────────────────────────────────────────────────────────
   Design tokens. Loaded first by head.php, which every page uses — the
   public site and the client portal alike.

   This is the single source of truth for fonts, colour, type scale and
   spacing. It exists as its own file because header.css is loaded
   alongside style.css but is not owned by it, and header.css relies on
   roughly twenty of these values. Keeping them in style.css made that an
   undeclared dependency that happened to hold. Put new foundation values
   here, not in style.css.

   Matches the house system in
   maddervramsey.com/public/assets/css/tokens.css.
   ─────────────────────────────────────────────────────────────────── */

/* ─── Fonts ───────────────────────────────────────────────────────────
   Self-hosted, latin subset, woff2.

   Chakra Petch is not a variable font, so each weight is a separate file.
   Declaring the weights is the point: previously only Regular existed and
   every 600/700/900 rule was SYNTHESISED by the browser smearing the
   regular outlines, which is one of the more recognisable marks of an
   amateur site.

   JetBrains Mono is variable — one file covers 400-700, which is why it
   carries a weight range rather than a single value.
   ─────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Chakra Petch';
  src: url('/assets/fonts/chakra-petch-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/assets/fonts/chakra-petch-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/assets/fonts/chakra-petch-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/assets/fonts/chakra-petch-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/fonts/jetbrains-mono-variable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ─── Font stacks ───────────────────────────────────────────────
     The webfont goes FIRST. --mono previously opened with
     ui-monospace, so on macOS and iOS the system mono won and
     JetBrains Mono never rendered — downloaded on every page load and
     never shown. */

  --sans: 'Chakra Petch', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'IBM Plex Mono', Consolas, monospace;

  /* ─── Surfaces ──────────────────────────────────────────────────
     These lived in style.css, which meant header.css depended on a
     file it is not loaded with. That works only as long as every
     template happens to include both. Foundation values belong in the
     foundation file. */

  --bg-deep:       #050505;
  --bg-panel:      rgba(10, 0, 15, 0.85);
  --bg-tile:       rgba(20, 0, 30, 0.6);
  --bg-tile-hover: rgba(30, 0, 50, 0.85);

  /* ─── Neon palette ──────────────────────────────────────────────── */

  --neon-pink:   #ff2bb3;
  --neon-cyan:   #26ffe6;
  --neon-amber:  #ffbf00;
  --neon-violet: #a95eff;
  --neon-lime:   #5fc944;

  /* ─── Text ──────────────────────────────────────────────────────── */

  --text-primary: #e6e3ec;
  --text-dim:     #948ca1;

  /* ─── Borders ───────────────────────────────────────────────────── */

  --border-sharp: 1px solid rgba(169, 94, 255, 0.45);
  --border-soft:  1px solid rgba(169, 94, 255, 0.18);

  /* ─── Glows and shadows ─────────────────────────────────────────── */

  --shadow-glow-pink: 0 0 6px rgba(255, 43, 179, 0.45);
  --shadow-glow-cyan: 0 0 6px rgba(38, 255, 230, 0.45);
  --shadow-card:       0 2px 14px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 6px 22px rgba(38, 255, 230, 0.18);

  /* ─── Layout ────────────────────────────────────────────────────── */

  --maxw:      1140px;
  --radius:    8px;
  --radius-sm: 4px;
  --gap:       1.5rem;

  --focus-ring: 0 0 0 2px var(--bg-deep), 0 0 0 4px var(--neon-cyan);
  --transition: 0.2s ease;

  /* ─── Type scale ────────────────────────────────────────────────
     A 1.125 (major second) modular scale anchored at 1rem.

     The site previously carried 24 distinct font-size values, 19 of
     them between 0.58rem and 1.05rem — steps too small to read as
     deliberate, the signature of hand-nudging rather than a scale.
     Those values already clustered around this ratio, so this restores
     the scale the design implied rather than imposing a new one. No
     value moved by more than 0.8px.

     Use the tokens. Adding a one-off literal is how the drift starts. */

  --fs-3xs: 0.624rem;   /* stamps, FILE# labels, legal lines */
  --fs-2xs: 0.702rem;   /* nav, chips, small meta */
  --fs-xs:  0.790rem;   /* captions, table cells */
  --fs-sm:  0.889rem;   /* secondary body */
  --fs-md:  1rem;       /* body */
  --fs-lg:  1.125rem;   /* lead paragraphs */
  --fs-xl:  1.266rem;   /* h3 */
  --fs-2xl: 1.424rem;   /* h2 */
  --fs-3xl: 1.802rem;   /* h1 */
  --fs-4xl: 2.027rem;   /* hero, stat values */

  /* ─── Letter-spacing ────────────────────────────────────────────
     Was ten values mixing px and em. em scales with font-size and px
     does not, so a px value tuned for a heading goes wrong on a label.
     Three tokens, all em. */

  --ls-tight: 0.02em;   /* large headings, which need less */
  --ls-wide:  0.08em;   /* uppercase labels and nav */
  --ls-stamp: 0.14em;   /* monospace FILE# stamps */
  --ls-xwide: 0.2em;    /* widely tracked display labels */

  /* ─── Line height ───────────────────────────────────────────────── */

  --lh-tight: 1.15;     /* headings */
  --lh-snug:  1.4;      /* subheads, cards */
  --lh-body:  1.6;      /* body copy */
}
