/* Gradien — fincore/mono
   Tokens, base, type scale, nav, scrollbar, reveal primitive.

   DIVERGENCE FROM THE HOUSE KIT: this variant runs an all-lowercase display
   voice at weight 400 and a 12px edge gutter (brand-guidelines/css sets a
   1200px centred container and sentence-case headings). It also swaps the
   house display face: the reference sets everything in PP Frama (Pangram
   Pangram, commercial — not licensable for us). Plus Jakarta Sans is the
   closest freely-licensed substitute, chosen by measurement, not taste:
   across 29 candidates it scored best on both normalised advance-width
   proportions and per-glyph raster overlap against PP Frama at matched
   x-height (0.727 mean Jaccard; Satoshi, the house face, is well outside
   the top ten — PP Frama sits 15% taller on the body with ~30% wider round
   bowls). Colours, spacing and motion durations remain house tokens, and
   IBM Plex Mono still carries every technical label.
   Font: Plus Jakarta Sans 2.071, SIL OFL 1.1 — see assets/fonts/OFL-*.txt. */

@font-face { font-family: 'Jakarta'; src: url('assets/fonts/plus-jakarta-sans-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('assets/fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* surfaces — two fields plus one signal band */
  --base: #F4F2F2;
  --ink: #111111;
  --black: #050505;
  --signal: #2A5FD6;
  --line: #C9C5C5;
  --line-soft: #E4E1E1;
  --muted: #5F5F5F;

  /* per-surface roles, overridden by [data-theme] */
  --bg: var(--base);
  --fg: var(--ink);
  --rule: var(--line);
  --quiet: var(--muted);

  --gutter: 12px;
  --maxw: 1440px;
  --nav-h: 42px;

  --d-xl: clamp(2.5rem, 5.42vw, 4.875rem);   /* 40 → 78 */
  --d-l:  clamp(1.75rem, 3.75vw, 3.375rem);  /* 28 → 54 */
  --d-m:  clamp(1.375rem, 2.5vw, 2.25rem);   /* 22 → 36 */
  --d-s:  clamp(1.125rem, 1.66vw, 1.5rem);   /* 18 → 24 */
  --body: 0.9375rem;                          /* 15 */
  --micro: 0.75rem;                           /* 12 */
  --numeral: clamp(5rem, 16.6vw, 15rem);      /* 80 → 240 */

  --ease: cubic-bezier(0.77, 0, 0.18, 1);
  --dur: 600ms;
}

[data-theme="ink"]    { --bg: var(--black); --fg: var(--base); --rule: rgba(244,242,242,.28); --quiet: rgba(244,242,242,.64); }
[data-theme="signal"] { --bg: var(--signal); --fg: var(--base); --rule: rgba(244,242,242,.34); --quiet: rgba(244,242,242,.72); }

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--base); -webkit-text-size-adjust: 100%; }
html.js { scrollbar-width: none; }
html.js::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font: 400 var(--body)/1.4 'Jakarta', system-ui, sans-serif;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd, dt, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
[data-theme="signal"] :focus-visible, [data-theme="ink"] :focus-visible { outline-color: var(--base); }

.mn-skip { position: fixed; top: -60px; left: var(--gutter); z-index: 40; padding: 8px 14px; background: var(--ink); color: var(--base); font: 400 var(--micro)/1 'IBM Plex Mono', ui-monospace, monospace; transition: top 180ms var(--ease); }
.mn-skip:focus { top: 8px; }

.mn-wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* The lowercase voice is authored in the copy, not forced by a transform —
   the brand name keeps its capital G, acronyms keep their case. */
.mn-d-xl, .mn-d-l, .mn-d-m, .mn-d-s {
  font-weight: 400; letter-spacing: -0.01em; line-height: 1.2; text-wrap: pretty;
}
.mn-d-xl { font-size: var(--d-xl); }
.mn-d-l  { font-size: var(--d-l); }
.mn-d-m  { font-size: var(--d-m); }
.mn-d-s  { font-size: var(--d-s); line-height: 1.3; }
.mn-indent { text-indent: 8em; }
.mn-tc { text-align: center; }
.mn-tr { text-align: right; }
.mn-num { font-size: var(--numeral); font-weight: 400; letter-spacing: -0.03em; line-height: 0.78; display: block; }

.mn-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: var(--micro); letter-spacing: 0.04em; line-height: 1.5; color: var(--quiet); }
.mn-eyebrow { margin-bottom: 1.5rem; }
.mn-note { font-size: var(--micro); color: var(--quiet); }

/* ---- nav ---- */
.mn-nav {
  position: sticky; top: 0; z-index: 30;
  display: grid; grid-template-columns: auto 288px 1fr auto auto; align-items: center; gap: 16px;
  height: var(--nav-h); padding-inline: var(--gutter);
  background: var(--bg); color: var(--fg);
  border-bottom: 1px solid var(--rule);
  transition: background 400ms var(--ease), color 400ms var(--ease), border-color 400ms var(--ease);
}
.mn-nav__brand { display: flex; align-items: center; gap: 8px; font-size: var(--body); }
.mn-nav__brand img { width: 16px; height: 16px; }
[data-theme="ink"] .mn-nav__brand img, [data-theme="signal"] .mn-nav__brand img { filter: invert(1) brightness(1.6); }

.mn-nav__prog { position: relative; height: var(--nav-h); overflow: hidden; border-inline: 1px solid var(--rule); }
.mn-nav__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: color-mix(in srgb, currentColor 10%, transparent); }
.mn-nav__labels { position: absolute; inset: 0; display: flex; align-items: center; gap: 48px; padding-left: 24px; white-space: nowrap; will-change: transform; }
.mn-nav__labels a { font-size: var(--body); opacity: .55; transition: opacity 240ms var(--ease); }
.mn-nav__labels a.is-active { opacity: 1; }
.mn-nav__doc { grid-column: 4; font-size: var(--body); }
.mn-nav__cta { font-size: var(--body); border-bottom: 1px solid currentColor; }
.mn-nav__cta:hover { opacity: .6; }

/* Small screens: the 288px ticker window and the secondary link do not fit
   beside brand + CTA at a 12px gutter — drop them, keep the two anchors. */
@media (max-width: 900px) {
  .mn-nav { grid-template-columns: auto 1fr auto; gap: 12px; }
  .mn-nav__prog, .mn-nav__doc { display: none; }
  .mn-nav__cta { grid-column: 3; }
}

/* ---- custom scrollbar (js only; native stays for no-js / reduced motion) ---- */
.mn-sb { display: none; }
html.js .mn-sb { display: block; position: fixed; z-index: 35; top: 0; right: 2px; width: 4px; height: 100vh; pointer-events: none; }
.mn-sb__thumb { width: 100%; height: 0; background: var(--ink); opacity: 0; transform: translateY(0); transition: opacity 400ms var(--ease); }
.mn-sb.is-live .mn-sb__thumb { opacity: .38; }

/* ---- reveal primitive ---- */
html.js [data-reveal] { opacity: 0; transform: translateY(14px); clip-path: inset(0 0 12% 0); }
html.js [data-reveal].is-in {
  opacity: 1; transform: none; clip-path: inset(0 0 0 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), clip-path var(--dur) var(--ease);
  transition-delay: calc(var(--rd, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1; transform: none; clip-path: none; }
  html.js { scrollbar-width: auto; }
  html.js::-webkit-scrollbar { display: initial; }
  html.js .mn-sb { display: none; }
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
