/**
 * Gatus status surface — canonical token adapter.
 *
 * Gatus has no stylesheet of its own to import (its theme lives in
 * infrastructure/observability/gatus.*.yaml under `ui`), so the canonical
 * values are projected into `ui.custom-css` as a plain inline stylesheet.
 *
 * Gatus is a Vue + Tailwind (shadcn) app: its own compile-time stylesheet
 * (`/css/app.css`) is linked *after* this one, and paints through shadcn HSL
 * variables (`hsl(var(--background))`) and built-in Tailwind palette utilities
 * (`bg-green-500`). Two things follow:
 *
 *   1. The canonical palette is redeclared here as `--nervly-*` literals, so
 *      the adapter has no colour of its own.
 *   2. Gatus' own variables and status utilities are then re-pointed at those
 *      canonical values from higher-specificity selectors, because a same-
 *      specificity tie would lose to the later app.css.
 *
 * `scripts/sync-gatus.mjs` writes this file between the
 * `nervly-ui-tokens:begin/end` markers in both Gatus configs, and
 * `test/consumers.test.mjs` fails if either YAML drifts from this file, if a
 * `--nervly-*` literal drifts from `tokens.json`, or if the shadcn mapping
 * stops resolving to the canonical colour it claims.
 *
 * `@font-face` (Ticket 4): Gatus serves no font of its own — its bundled
 * `/css/app.css` pins Inter/system-ui — so the canonical faces are loaded from
 * the status edge. Caddy serves `infrastructure/caddy/status-fonts/` at
 * `/fonts/*` for `status.nervly.io` (see `infrastructure/caddy/Caddyfile`), and
 * these rules point at those bytes. They are the same Bricolage Grotesque /
 * Familjen Grotesk / Martian Mono binaries every other surface self-hosts.
 * `scripts/check-fonts.mjs` fails if a family named in a canonical stack has no
 * `@font-face` here or no file under that directory.
 */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-400-800-latin.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: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-400-800-latin-ext.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: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/familjen-grotesk-400-700-latin.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: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/familjen-grotesk-400-700-latin-ext.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: "Martian Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/martian-mono-latin.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: "Martian Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/martian-mono-latin-ext.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;
}

:root {
  --nervly-color-blackout: #0d0e0c;
  --nervly-color-obsidian: #0b0d11;
  --nervly-color-graphite: #171a1f;
  --nervly-color-graphite-raised: #1e232a;
  --nervly-color-sunken: #0f1116;
  --nervly-color-paper: #ede9e4;
  --nervly-color-bone: #c9c4bd;
  --nervly-color-chalk: #a8a29a;
  --nervly-color-carrier: #9bd1ff;
  --nervly-color-carrier-mid: #6fb1f0;
  --nervly-color-deep-carrier: #3e7dc4;
  --nervly-color-signal: #41dc82;
  --nervly-color-warning: #e8b45a;
  --nervly-color-error: #e5604c;
  --nervly-line-hairline: rgba(237, 233, 228, 0.08);
  --nervly-line-strong: rgba(237, 233, 228, 0.15);
  --nervly-light-ambient-glow: radial-gradient(120% 80% at 50% -10%, rgba(155, 209, 255, 0.1), transparent 62%);
  --nervly-light-specular-border: rgba(255, 255, 255, 0.08);
  --nervly-light-accent-glow: rgba(155, 209, 255, 0.35);
  --nervly-light-phosphor-warm: rgba(255, 184, 107, 0.14);
  --nervly-light-elevation-1: 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --nervly-font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --nervly-font-sans: "Bricolage Grotesque", "Familjen Grotesk", system-ui, sans-serif;
  --nervly-font-mono: "Martian Mono", ui-monospace, monospace;
  --nervly-font-numeric: tabular-nums;
  --nervly-type-tracking-heading: -0.01em;
  --nervly-type-tracking-display: -0.02em;
  --nervly-layout-radius-md: 10px;
}

/*
 * Gatus' own theme variables. Gatus computes every surface as
 * `hsl(var(--x))`, so the triplets below are the canonical colours expressed
 * in HSL-component form (the same unit Gatus declares). The `html:root` and
 * `html:root.dark` selectors deliberately outrank both `:root` and
 * `:root.dark`, which are declared in the later-loaded app.css.
 */
html:root,
html:root.dark {
  --background: 90 7.7% 5.1%; /* blackout */
  --foreground: 33.3 20% 91.2%; /* paper */
  --card: 217.5 14.8% 10.6%; /* graphite */
  --card-foreground: 33.3 20% 91.2%; /* paper */
  --popover: 217.5 14.8% 10.6%; /* graphite */
  --popover-foreground: 33.3 20% 91.2%; /* paper */
  --primary: 33.3 20% 91.2%; /* paper */
  --primary-foreground: 220 21.4% 5.5%; /* obsidian */
  --secondary: 215 16.7% 14.1%; /* graphite-raised */
  --secondary-foreground: 35 10% 76.5%; /* bone */
  --muted: 215 16.7% 14.1%; /* graphite-raised */
  --muted-foreground: 34.3 7.4% 63.1%; /* chalk */
  --accent: 215 16.7% 14.1%; /* graphite-raised */
  --accent-foreground: 33.3 20% 91.2%; /* paper */
  --destructive: 7.8 74.6% 59.8%; /* error */
  --destructive-foreground: 90 7.7% 5.1%; /* blackout — dark ink on the bright error fill */
  --border: 60 3.3% 17.8%; /* line-strong composited on blackout */
  --input: 60 3.3% 17.8%; /* line-strong composited on blackout */
  --ring: 207.6 100% 80.4%; /* carrier */
  --radius: var(--nervly-layout-radius-md);
}

/* Base surfaces and typography. `html:root` outranks app.css' `html` rule,
 * which otherwise pins Inter/system-ui and its own slate surfaces. */
html:root {
  background-color: var(--nervly-color-blackout);
  color: var(--nervly-color-paper);
  font-family: var(--nervly-font-sans);
}

#global {
  background-color: var(--nervly-color-blackout);
}

html:root a {
  color: var(--nervly-color-carrier);
}

.dashboard-container {
  color: var(--nervly-color-paper);
  background-image: var(--nervly-light-ambient-glow);
}

/* Editorial headers (pillar 2.4): Gatus' headings inherit the body sans; the
 * display serif carries the page and dashboard titles instead. */
header .container h1,
.dashboard-container h1 {
  font-family: var(--nervly-font-display);
  letter-spacing: var(--nervly-type-tracking-display);
}

.endpoint,
.endpoint-group,
.announcement-container {
  background-color: var(--nervly-color-graphite);
  border: 1px solid var(--nervly-light-specular-border);
  box-shadow: var(--nervly-light-elevation-1);
}

.endpoint-header,
.endpoint-group-header,
.announcement-header {
  background-color: var(--nervly-color-graphite-raised);
  border-bottom: 1px solid var(--nervly-light-specular-border);
  box-shadow: inset 0 1px 0 var(--nervly-light-specular-border);
  font-family: var(--nervly-font-display);
  letter-spacing: var(--nervly-type-tracking-heading);
}

.endpoint-content,
.endpoint-group-content,
.announcement-content {
  color: var(--nervly-color-bone);
  background-image: linear-gradient(var(--nervly-light-phosphor-warm), transparent 60%);
  font-variant-numeric: var(--nervly-font-numeric);
}

/*
 * Status semantics. Gatus' StatusBadge and uptime bars are compiled to
 * Tailwind's built-in greens/reds/yellows, which are not the canonical status
 * palette. `body .x` outranks the single-class utility; the `html.dark` variant
 * covers the dark-mode bars that app.css scopes under `.dark`.
 */
body .bg-green-500 {
  background-color: var(--nervly-color-signal);
}
body .bg-green-400 {
  background-color: var(--nervly-color-signal);
}
body .bg-green-700,
body .hover\:bg-green-700:hover {
  background-color: color-mix(in srgb, var(--nervly-color-signal) 70%, black);
}
body .bg-red-500 {
  background-color: var(--nervly-color-error);
}
body .bg-red-400 {
  background-color: var(--nervly-color-error);
}
body .bg-red-700,
body .hover\:bg-red-700:hover {
  background-color: color-mix(in srgb, var(--nervly-color-error) 70%, black);
}
body .bg-yellow-500 {
  background-color: var(--nervly-color-warning);
}
body .bg-yellow-400 {
  background-color: var(--nervly-color-warning);
}
body .bg-gray-400 {
  background-color: var(--nervly-color-chalk);
}
html.dark .dark\:bg-gray-700 {
  background-color: var(--nervly-color-graphite-raised);
}

/* Dark ink on the bright status fills keeps the badge labels above 4.5:1. */
body .bg-green-500.text-white,
body .bg-yellow-500.text-white {
  color: var(--nervly-color-blackout);
}

/* Phosphor luminescence on the status pill and its dot (pillar 2.4). */
body .rounded-full.bg-green-500 {
  box-shadow: 0 0 14px -3px var(--nervly-color-signal);
}
body .rounded-full.bg-yellow-500 {
  box-shadow: 0 0 14px -3px var(--nervly-color-warning);
}
body .rounded-full.bg-destructive {
  background-color: var(--nervly-color-error);
  box-shadow: 0 0 14px -3px var(--nervly-color-error);
}
