/* ------------------------------------------------------------------------- */
/* Zenith Burn: the one stylesheet, used by every page.                      */
/* ------------------------------------------------------------------------- */

/* ---- Colours ------------------------------------------------------------ */

/* Dark only: black is part of the identity. docs/ui_design.md explains each
   token. Quiet neutrals, and accents used rarely so they stand out. */
:root {
  color-scheme: dark;

  /* Neutrals */
  --color-background: #000000;
  --color-surface: #0d0d12;
  --color-border: #2a2a33;
  --color-line-quiet: #3a3a46;
  --color-text-muted: #82828f;
  --color-text: #bcbcca;
  --color-text-strong: #ffffff;

  /* Accents */
  --color-accent: #fc8339;
  --color-accent-live: #46ff18;

  /* Series colours for multi-line charts, in fixed order. 1 to 7 are the
     core set; 8 to 12 only with a name on every line. */
  --series-1: #fc8339;
  --series-2: #46ff18;
  --series-3: #00e5ff;
  --series-4: #ff2bd6;
  --series-5: #ffe14a;
  --series-6: #9b6bff;
  --series-7: #3d9bff;
  --series-8: #ff3b3b;
  --series-9: #ff8fc8;
  --series-10: #3dffb8;
  --series-11: #ffb000;
  --series-12: #d4b8ff;
}

/* ---- Font --------------------------------------------------------------- */

/* IBM Plex Sans, self-hosted so visitors aren't sent to a font service.
   Files from IBM's @ibm/plex-sans 1.1.0 package (SIL Open Font License,
   site/fonts/ibm_plex_license.txt). Split by alphabet with the package's own
   unicode ranges, so a page downloads only the subsets it uses. Latin1 and
   Latin2 cover every character the site shows today. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm_plex_sans_regular_latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153,
    U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E,
    U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122,
    U+2212, U+FB01-FB02;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm_plex_sans_regular_latin2.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F,
    U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B,
    U+0237, U+0259, U+1E80-1E85, U+1E9E;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm_plex_sans_medium_latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153,
    U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E,
    U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122,
    U+2212, U+FB01-FB02;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ibm_plex_sans_medium_latin2.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F,
    U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B,
    U+0237, U+0259, U+1E80-1E85, U+1E9E;
}

/* ---- Base --------------------------------------------------------------- */

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

h1,
h2,
h3 {
  color: var(--color-text-strong);
  font-weight: 500;
  line-height: 1.2;
}

/* Links are too common to be orange all the time: orange on hover only. */
a {
  color: var(--color-text);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent);
}

/* Keyboard users must always be able to see where they are. One of the few
   places orange is always used, because it must never be missed. */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Skip link: hidden until reached with the keyboard ------------------ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 8px 12px;
  background: var(--color-surface);
}

.skip-link:focus {
  top: 8px;
}

/* ---- Layout ------------------------------------------------------------- */

.site-header,
main,
.site-footer {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Grows to push the footer to the bottom of short pages. */
main {
  flex: 1;
  padding-block: 32px;
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 16px;
  border-bottom: 1px solid var(--color-border);
}

/* The logo is inline SVG so its text uses the self-hosted Plex font. Sized
   by height: present but modest, smaller on phones. */
.site-name {
  display: block;
  line-height: 0;
}

.logo {
  width: auto;
  height: 24px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

@media (min-width: 640px) {
  .logo {
    height: 30px;
  }
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a[aria-current="page"] {
  color: var(--color-text-strong);
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
}

/* ---- Home page ---------------------------------------------------------- */

.lead {
  max-width: 65ch;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.card p {
  margin: 0;
  color: var(--color-text-muted);
}

/* Not a link yet, so it should not look like one. */
.card-placeholder {
  border-style: dashed;
}

/* ---- Shared text and helpers -------------------------------------------- */

.note {
  max-width: 65ch;
  color: var(--color-text-muted);
}

/* Read by screen readers, not shown on screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- Chart legends ------------------------------------------------------ */

/* Each item is a toggle button. Quiet but legible when not selected; in its
   series colour when selected. The chart sets --item-color on each item. */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  cursor: pointer;
}

.legend-item::before {
  width: 12px;
  height: 2px;
  background: var(--color-line-quiet);
  content: "";
}

.legend-item:hover,
.legend-item[aria-pressed="true"] {
  color: var(--item-color, var(--color-accent));
}

.legend-item:hover::before,
.legend-item[aria-pressed="true"]::before {
  background: var(--item-color, var(--color-accent));
}

.legend-item[aria-pressed="true"] {
  font-weight: 500;
}

/* ---- Footer ------------------------------------------------------------- */

.site-footer {
  padding-block: 16px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}
