/* VertexBridge Status — the whole stylesheet, and the only place a colour is
 * written on this surface.
 *
 * 🔴 **Why this file holds its own palette instead of importing the shared
 * one.** This site is deployed as a folder, away from the platform, with no
 * build step of any kind — so it cannot import `packages/tokens/
 * vertexbridge.css` at build time and must not fetch it at runtime from a
 * server that may be the thing that is down. The values below are therefore a
 * DELIBERATE copy, prefixed `--vbs-`, and
 * `tests/brand-matches-the-token-file.test.mjs` fails if any one of them
 * drifts from its `--vb-` original. The duplication is real; the drift is not
 * possible.
 *
 * 🔴 `scripts/check-token-discipline.mjs` names this file as the `--vbs-`
 * palette's only definition file, so every other file in `site/` must use
 * `var(--vbs-…)` and may not reach for `--vb-` or `--zp-`.
 *
 * ⚠️ Light is the default and dark is the override, as in the shared palette:
 * a page that renders before its theme attribute lands must show the
 * readable-on-white values, never white on white.
 *
 * ⚠️ **Colour never carries a state on its own.** Each state pill has its own
 * SHAPE and its own WORD; the colour sits on the shape, which is a non-text
 * graphic at 3:1, and the pill's text is always ink on a 12% tint — the rule
 * the shared palette learned the hard way (state-coloured text on its own
 * tint measures 4.0–4.3:1 and fails AA).
 */

:root {
  /* ── Brand ──────────────────────────────────────────────────────────── */
  --vbs-violet:        #7A00F8;  /* = --vb-violet       — a FILL, never text */
  --vbs-violet-text:   #7A00F8;  /* = --vb-violet-text  — 6.60:1 on white    */
  --vbs-violet-deep:   #53179C;  /* = --vb-violet-deep                       */
  --vbs-on-violet:     #FFFFFF;  /* = --vb-on-violet                         */

  /* ── Semantic — a PAIR each, because one value cannot clear AA on both a
   * near-white and a near-black ground. The dark block below swaps them. */
  --vbs-success:       #007F3E;  /* = --vb-success      — 4.65:1 on light    */
  --vbs-success-dark:  #00E870;  /* = --vb-success-dark — 11.69:1 on dark    */
  --vbs-warning:       #856B00;  /* = --vb-warning      — 4.66:1 on light    */
  --vbs-warning-dark:  #F8C800;  /* = --vb-warning-dark — 12.13:1 on dark    */
  --vbs-danger:        #E1001C;  /* = --vb-danger       — 4.53:1 on light    */
  --vbs-danger-dark:   #FF455C;  /* = --vb-danger-dark  — 5.73:1 on dark     */
  --vbs-info:          #1D5FD0;  /* = --vb-info         — 5.83:1 on white    */
  --vbs-info-dark:     #6FA8FF;  /* = --vb-info-dark    — 7.37:1 on dark     */

  /* ── Night — the marketing site's ground, so this page is recognisably the
   * same product in the dark. Read only by the dark block. */
  --vbs-night:         #070A19;  /* = --vb-night                             */
  --vbs-night-card:    #151531;  /* = --vb-night-card                        */
  --vbs-night-border:  #262244;  /* = --vb-night-border                      */

  /* ── Light theme (default) ──────────────────────────────────────────── */
  --vbs-bg:            #F9F7FE;  /* = --vb-bg                                */
  --vbs-surface:       #FFFFFF;  /* = --vb-surface                           */
  --vbs-surface-sunk:  #F5F3FC;  /* = --vb-surface-sunk                      */
  --vbs-border:        #E8E4F2;  /* = --vb-border      — a hairline          */
  --vbs-border-strong: #8A869E;  /* = --vb-border-strong — 3.51:1, controls   */
  --vbs-ink:           #0E0D1E;  /* = --vb-ink         — 17.45:1             */
  --vbs-ink-muted:     #6F6D82;  /* = --vb-ink-muted   — 4.57:1             */

  /* ── Tints — derived, never picked. 12% of the state colour over the card,
   * so they track the theme without a second definition. */
  --vbs-success-tint:  color-mix(in srgb, var(--vbs-success) 12%, var(--vbs-surface));
  --vbs-warning-tint:  color-mix(in srgb, var(--vbs-warning) 12%, var(--vbs-surface));
  --vbs-danger-tint:   color-mix(in srgb, var(--vbs-danger) 12%, var(--vbs-surface));
  --vbs-info-tint:     color-mix(in srgb, var(--vbs-info) 12%, var(--vbs-surface));
  --vbs-neutral-tint:  color-mix(in srgb, var(--vbs-ink-muted) 12%, var(--vbs-surface));

  --vbs-focus:         var(--vbs-violet-text);

  /* ── Type — the product's own face, self-hosted beside this file. The
   * latin-ext file is not optional: it is the one that carries ₦ (U+20A6). */
  --vbs-font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --vbs-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --vbs-text-xs:   0.75rem;
  --vbs-text-sm:   0.875rem;
  --vbs-text-base: 1rem;
  --vbs-text-lg:   1.125rem;
  --vbs-text-xl:   1.5rem;
  --vbs-text-2xl:  2rem;

  --vbs-space-1: 0.25rem;
  --vbs-space-2: 0.5rem;
  --vbs-space-3: 0.75rem;
  --vbs-space-4: 1rem;
  --vbs-space-5: 1.25rem;
  --vbs-space-6: 1.5rem;
  --vbs-space-8: 2rem;
  --vbs-space-10: 2.5rem;

  --vbs-radius-sm:   6px;
  --vbs-radius-md:   12px;
  --vbs-radius-lg:   16px;
  --vbs-radius-full: 9999px;

  --vbs-shadow-sm: 0 1px 2px rgb(14 13 30 / 0.06);
  --vbs-shadow-md: 0 4px 12px rgb(14 13 30 / 0.08);

  --vbs-tap-min: 2.75rem;  /* 44px — the smallest thing a thumb hits */
  --vbs-gutter: 1rem;      /* 16px side gutters at phone width       */
  --vbs-content-max: 58rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --vbs-bg:            var(--vbs-night);
    --vbs-surface:       var(--vbs-night-card);
    --vbs-surface-sunk:  var(--vbs-night);
    --vbs-border:        var(--vbs-night-border);
    --vbs-border-strong: #66628A;   /* = dark --vb-border-strong */
    --vbs-ink:           #E7E7EE;   /* = dark --vb-ink           */
    --vbs-ink-muted:     #9B9BA7;   /* = dark --vb-ink-muted     */
    --vbs-violet-text:   #A854FF;   /* = dark --vb-violet-text   */
    --vbs-success:       var(--vbs-success-dark);
    --vbs-warning:       var(--vbs-warning-dark);
    --vbs-danger:        var(--vbs-danger-dark);
    --vbs-info:          var(--vbs-info-dark);
    --vbs-shadow-sm: none;
    --vbs-shadow-md: none;
  }
}

/* The same values, for an explicit opt-in that ignores the operating system.
 *
 * ⚠️ No `= dark --vb-…` pins repeated here, deliberately: two copies of the
 * same pin is two places to get it wrong. `brand-matches-the-token-file.test.mjs`
 * asserts this block and the one above declare an IDENTICAL map, which is the
 * drift that actually happens — somebody edits one theme block and not its twin,
 * and the bug only shows for readers who set the theme by hand. */
:root[data-theme="dark"] {
  --vbs-bg:            var(--vbs-night);
  --vbs-surface:       var(--vbs-night-card);
  --vbs-surface-sunk:  var(--vbs-night);
  --vbs-border:        var(--vbs-night-border);
  --vbs-border-strong: #66628A;
  --vbs-ink:           #E7E7EE;
  --vbs-ink-muted:     #9B9BA7;
  --vbs-violet-text:   #A854FF;
  --vbs-success:       var(--vbs-success-dark);
  --vbs-warning:       var(--vbs-warning-dark);
  --vbs-danger:        var(--vbs-danger-dark);
  --vbs-info:          var(--vbs-info-dark);
  --vbs-shadow-sm: none;
  --vbs-shadow-md: none;
}

/* ── The faces, self-hosted. No third-party request on a page whose whole job
 * is to be reachable when other things are not. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  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: "Plus Jakarta Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  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;
}

/* ── Base ───────────────────────────────────────────────────────────────── */

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

html {
  /* No horizontal scroll at any width, enforced rather than hoped for. */
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* 🔴 An explicit background, so the page is never the browser's default
   * white behind dark text that has already switched. */
  background: var(--vbs-bg);
  color: var(--vbs-ink);
  font-family: var(--vbs-font-sans);
  font-size: var(--vbs-text-base);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
code {
  font-family: var(--vbs-font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

a { color: var(--vbs-violet-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--vbs-focus);
  outline-offset: 2px;
  border-radius: var(--vbs-radius-sm);
}

.skip {
  position: absolute;
  inset-inline-start: var(--vbs-gutter);
  inset-block-start: var(--vbs-space-2);
  transform: translateY(-150%);
  z-index: 10;
  padding: var(--vbs-space-2) var(--vbs-space-4);
  border-radius: var(--vbs-radius-sm);
  background: var(--vbs-surface);
  color: var(--vbs-ink);
  box-shadow: var(--vbs-shadow-md);
}
.skip:focus { transform: translateY(0); }

/* ── Masthead ───────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vbs-space-4);
  max-width: var(--vbs-content-max);
  margin: 0 auto;
  padding: var(--vbs-space-5) var(--vbs-gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--vbs-space-3);
  color: var(--vbs-ink);
  text-decoration: none;
  min-height: var(--vbs-tap-min);
}
.brand__mark { display: block; width: 32px; height: 32px; }
.brand__word { font-weight: 800; letter-spacing: -0.01em; }
.brand__suffix {
  padding: 2px var(--vbs-space-2);
  border-radius: var(--vbs-radius-full);
  background: var(--vbs-neutral-tint);
  color: var(--vbs-ink);
  font-size: var(--vbs-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme {
  display: grid;
  place-items: center;
  width: var(--vbs-tap-min);
  height: var(--vbs-tap-min);
  border: 1px solid var(--vbs-border-strong);
  border-radius: var(--vbs-radius-full);
  background: var(--vbs-surface);
  color: var(--vbs-ink);
  cursor: pointer;
}
.theme__icon { width: 16px; height: 16px; fill: currentColor; }

/* ── Banner ─────────────────────────────────────────────────────────────── */

main {
  max-width: var(--vbs-content-max);
  margin: 0 auto;
  padding: 0 var(--vbs-gutter) var(--vbs-space-10);
  display: grid;
  gap: var(--vbs-space-6);
}

.banner {
  display: grid;
  gap: var(--vbs-space-3);
  justify-items: start;
  padding: var(--vbs-space-6);
  border: 1px solid var(--vbs-border);
  border-radius: var(--vbs-radius-lg);
  background: var(--vbs-surface);
  box-shadow: var(--vbs-shadow-sm);
  /* "Lit Frame": a thin violet edge on the leading side, so the banner reads
   * as the page's one lit element without shouting a colour at the reader. */
  border-inline-start: 4px solid var(--vbs-violet);
}
.banner[data-state="degraded"] { border-inline-start-color: var(--vbs-warning); }
.banner[data-state="down"]     { border-inline-start-color: var(--vbs-danger); }
.banner[data-state="maintenance"] { border-inline-start-color: var(--vbs-info); }

.banner__headline {
  font-size: var(--vbs-text-xl);
  font-weight: 800;
  letter-spacing: -0.015em;
}
@media (min-width: 40rem) {
  .banner__headline { font-size: var(--vbs-text-2xl); }
}
.banner__meta { color: var(--vbs-ink-muted); font-size: var(--vbs-text-sm); }
.banner__meta strong { color: var(--vbs-ink); font-weight: 600; }
.banner__warn {
  padding: var(--vbs-space-3) var(--vbs-space-4);
  border-radius: var(--vbs-radius-md);
  background: var(--vbs-warning-tint);
  color: var(--vbs-ink);
  font-size: var(--vbs-text-sm);
}

.button {
  min-height: var(--vbs-tap-min);
  padding: 0 var(--vbs-space-5);
  border: 0;
  border-radius: var(--vbs-radius-md);
  background: var(--vbs-violet);
  color: var(--vbs-on-violet);
  font-family: inherit;
  font-size: var(--vbs-text-sm);
  font-weight: 600;
  cursor: pointer;
}
.button:hover { background: var(--vbs-violet-deep); }
.button[disabled] { opacity: 0.55; cursor: progress; }

/* ── Panels and rows ────────────────────────────────────────────────────── */

.panel {
  display: grid;
  gap: var(--vbs-space-4);
  padding: var(--vbs-space-6) var(--vbs-space-5);
  border: 1px solid var(--vbs-border);
  border-radius: var(--vbs-radius-lg);
  background: var(--vbs-surface);
  box-shadow: var(--vbs-shadow-sm);
}
.panel__heading { font-size: var(--vbs-text-lg); font-weight: 700; }
.panel__sub { font-size: var(--vbs-text-base); font-weight: 700; margin-top: var(--vbs-space-2); }
.panel__lede { color: var(--vbs-ink-muted); font-size: var(--vbs-text-sm); }
.panel--method p { font-size: var(--vbs-text-sm); }

.rows { list-style: none; margin: 0; padding: 0; display: grid; }
.row {
  display: grid;
  gap: var(--vbs-space-2);
  padding: var(--vbs-space-4) 0;
  border-top: 1px solid var(--vbs-border);
}
.row:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 40rem) {
  .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--vbs-space-4);
  }
}
.row__name { display: grid; gap: 2px; min-width: 0; }
.row__title { font-weight: 600; }
.row__blurb { color: var(--vbs-ink-muted); font-size: var(--vbs-text-sm); }
.row__state { display: grid; gap: var(--vbs-space-2); justify-items: start; min-width: 0; }
@media (min-width: 40rem) {
  .row__state { justify-items: end; text-align: end; }
}
/* ⚠️ `max-width` is load-bearing, not tidying. A grid item under
 * `justify-items: end` is sized to its MAX-CONTENT, so a long reason — "it
 * answered, but this page was not permitted to read the answer" — rendered on
 * one line straight across the surface's own name in the column beside it. */
.row__detail { max-width: 100%; color: var(--vbs-ink-muted); font-size: var(--vbs-text-sm); }

/* ── The pill: shape + word, with colour on the shape only ──────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--vbs-space-2);
  padding: var(--vbs-space-1) var(--vbs-space-3);
  border-radius: var(--vbs-radius-full);
  background: var(--vbs-neutral-tint);
  color: var(--vbs-ink);
  font-size: var(--vbs-text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill__shape { width: 11px; height: 11px; flex: none; fill: var(--vbs-ink-muted); }
.pill--operational { background: var(--vbs-success-tint); }
.pill--operational .pill__shape { fill: var(--vbs-success); }
.pill--degraded { background: var(--vbs-warning-tint); }
.pill--degraded .pill__shape { fill: var(--vbs-warning); }
.pill--down { background: var(--vbs-danger-tint); }
.pill--down .pill__shape { fill: var(--vbs-danger); }
.pill--maintenance { background: var(--vbs-info-tint); }
.pill--maintenance .pill__shape { fill: var(--vbs-info); }

/* ── Maintenance and incidents ──────────────────────────────────────────── */

.empty { color: var(--vbs-ink-muted); font-size: var(--vbs-text-sm); }
.empty--bad {
  padding: var(--vbs-space-3) var(--vbs-space-4);
  border-radius: var(--vbs-radius-md);
  background: var(--vbs-warning-tint);
  color: var(--vbs-ink);
}

.window, .incident {
  display: grid;
  gap: var(--vbs-space-2);
  padding: var(--vbs-space-4);
  border: 1px solid var(--vbs-border);
  border-radius: var(--vbs-radius-md);
  background: var(--vbs-surface-sunk);
}
.window + .window, .incident + .incident { margin-top: var(--vbs-space-3); }
.window--active { border-color: var(--vbs-border-strong); }
.window__title, .incident__title { font-size: var(--vbs-text-base); font-weight: 700; }
.window__when, .window__affects, .window__detail,
.incident__affects { color: var(--vbs-ink-muted); font-size: var(--vbs-text-sm); }
.window__now { color: var(--vbs-ink); }
.incident__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vbs-space-2) var(--vbs-space-3);
  color: var(--vbs-ink-muted);
  font-size: var(--vbs-text-sm);
}
.incident__updates {
  margin: 0;
  padding-inline-start: var(--vbs-space-5);
  display: grid;
  gap: var(--vbs-space-1);
  font-size: var(--vbs-text-sm);
}
.update__at { color: var(--vbs-ink-muted); }

/* ── The method table ───────────────────────────────────────────────────── */

/* ⚠️ A scrollable REGION, not a squeezed table. At phone width the three
 * columns cannot fit, and the two ways out are both worse than this one:
 * wrapping an address mid-word makes it unreadable, and re-laying the table
 * out as blocks takes the table semantics away from a screen reader. So the
 * table keeps its shape and its wrapper scrolls — and the wrapper is
 * focusable and labelled in the markup, which is what makes a horizontal
 * scroll reachable from a keyboard. */
.tablewrap { overflow-x: auto; }
.tablewrap:focus-visible { outline: 2px solid var(--vbs-focus); outline-offset: 2px; }
.table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: var(--vbs-text-sm);
  text-align: start;
}
.table__caption {
  color: var(--vbs-ink-muted);
  font-size: var(--vbs-text-xs);
  text-align: start;
  padding-bottom: var(--vbs-space-2);
}
.table th, .table td {
  padding: var(--vbs-space-3);
  border-bottom: 1px solid var(--vbs-border);
  text-align: start;
  vertical-align: top;
}
.table thead th {
  background: var(--vbs-surface-sunk);
  font-size: var(--vbs-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vbs-ink-muted);
}
.table tbody th { font-weight: 600; white-space: nowrap; }
/* An address broken across lines is an address nobody can check. */
.table td code { white-space: nowrap; }

.meanings { display: grid; gap: var(--vbs-space-2); margin: 0; }
.meanings dt { margin-top: var(--vbs-space-2); }
.meanings dd {
  margin: 0;
  color: var(--vbs-ink-muted);
  font-size: var(--vbs-text-sm);
}
.limits {
  margin: 0;
  padding-inline-start: var(--vbs-space-5);
  display: grid;
  gap: var(--vbs-space-2);
  font-size: var(--vbs-text-sm);
  color: var(--vbs-ink-muted);
}
.limits strong { color: var(--vbs-ink); }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.footer {
  max-width: var(--vbs-content-max);
  margin: 0 auto;
  padding: var(--vbs-space-6) var(--vbs-gutter) var(--vbs-space-10);
  display: grid;
  gap: var(--vbs-space-3);
  border-top: 1px solid var(--vbs-border);
  color: var(--vbs-ink-muted);
  font-size: var(--vbs-text-sm);
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--vbs-space-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
