/*
 * NorthGate brand tokens, v0.1 (2026-09-30)
 * Dark, calm, one warm accent. Every site copies this file together with fonts/ (paths are relative).
 *
 * Fonts are self-hosted OFL woff2 files (from the @fontsource 5.3.0 npm packages). No third-party
 * font requests. Licences: fonts/OFL-InstrumentSerif.txt, fonts/OFL-Inter.txt, fonts/OFL-JetBrainsMono.txt.
 * Preload the two faces used above the fold (adjust the path to where brand/ is served):
 *   <link rel="preload" href="/brand/fonts/instrument-serif-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin>
 *   <link rel="preload" href="/brand/fonts/inter-latin-wght-normal.woff2" as="font" type="font/woff2" crossorigin>
 *
 * Rule for --lamp: it is the light. Use it for the beam and for lit / recorded states only.
 * Never for body text, links, headings, borders or decoration.
 */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #0A0A0B;
  --bg-raised: #111113;
  --vignette: radial-gradient(ellipse 72% 58% at 50% 0%, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 72%);
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.16); /* hover / active borders only */

  /* text (contrast on --bg / --bg-raised) */
  --text: #EDEDED;   /* 16.9 : 1 / 16.1 : 1 */
  --text-2: #A1A1A1; /*  7.7 : 1 /  7.3 : 1 */
  --text-3: #808080; /*  5.0 : 1 /  4.8 : 1  (the brief said #6B6B6B, which is 3.7 : 1 and fails AA for body-size text) */

  /* the light: beam and lit / recorded states only, sparingly */
  --lamp: #F0C674;      /* 12.3 : 1 on --bg */
  --lamp-core: #FFF4DA;
  --lamp-rgb: 240, 198, 116;

  /* buttons */
  --btn-bg: #EDEDED;
  --btn-bg-hover: #FFFFFF;
  --btn-text: #0A0A0B;   /* 16.9 : 1 */
  --focus: #EDEDED;      /* focus ring: neutral, never the lamp */

  /* type */
  --font-display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-h1: clamp(44px, 7vw, 88px);
  --fs-h2: clamp(32px, 4.6vw, 56px);
  --fs-h3: 19px;
  --fs-lede: 18px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-label: 12px;

  /* layout */
  --container: 1120px;
  --gutter: 24px;
  --section-y: 120px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 768px) {
  :root { --fs-body: 17px; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; --section-y: 72px; --fs-lede: 17px; }
}

/* ---------- base (zero-specificity, so site CSS always wins) ---------- */
:where(html) {
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
:where(body) {
  margin: 0;
  min-height: 100vh;
  background: var(--vignette) 50% 0 / 100% 960px no-repeat, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
:where(h1, .h1) {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
}
:where(h2, .h2) {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--text);
  text-wrap: balance;
}
:where(h3, .h3) {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
:where(p) { text-wrap: pretty; }
:where(a) { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:where(code, kbd, samp, pre) { font-family: var(--font-mono); font-size: 0.9em; }
:where(hr) { border: 0; border-top: 1px solid var(--hairline); margin: 0; }
::selection { background: rgba(255, 255, 255, 0.18); color: var(--text); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- text styles ---------- */
.lede { font-size: var(--fs-lede); line-height: 1.6; color: var(--text-2); max-width: 34em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-filled { background: var(--btn-bg); color: var(--btn-text); }
.btn-filled:hover { background: var(--btn-bg-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--hairline); }
.btn-ghost:hover { border-color: var(--hairline-strong); background: rgba(255, 255, 255, 0.03); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- pill ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-2);
  white-space: nowrap;
}
/* a lit dot, for "recorded" states only */
.pill-lit::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 8px rgba(var(--lamp-rgb), 0.55);
}

/* ---------- layout ---------- */
.container {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.surface {
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}
.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

@media (prefers-reduced-motion: reduce) {
  :where(html) { scroll-behavior: auto; }
  .btn { transition: none; }
}
