/*
 * nineholds-status - the status page's one stylesheet.
 *
 * COPIED, not designed. The token block, the light-scheme block, the base, typography, frame, nav,
 * brand, mark-ink, pairs and footer rules below are verbatim from the public site's stylesheet
 * (openrp-deploy/public/site/site.css in the parent tree) so the two surfaces stay one register:
 * steel neutrals, frost for eyebrows and links, dark first, light through prefers-color-scheme.
 * provenance.json pins this file's bytes and names its source; re-sync by hand and re-pin.
 *
 * What this file may not do, and why:
 *   - no imported stylesheet, no url function, no web font. The page is served under
 *     default-src 'none'; style-src 'self' and a remote font or image would be a third party on a
 *     page that is supposed to have none. System stacks only.
 *   - no colour outside the token block. The status accents below are tokens, and the status is
 *     legible without them: the word is always printed and a glyph sits beside it.
 *
 * The status-page rules at the end are this repository's own.
 */

:root {
  color-scheme: dark;

  --canvas: #0C0E11;
  --raised: #1E2228;
  --console: #14171B;
  --border: #30353D;
  --border-strong: #454C56;
  --text: #F4F6F8;
  --text-2: #AEB6C0;
  --muted: #8E97A3;

  --frost: #8FC4E8;
  --hairline: #3B8CC4;

  --ember: #E06A13;
  --ember-hover: #E88B3F;
  --on-ember: #0C0E11;

  --brand-steel: #AEB6C0;
  --brand-frost: #8FC4E8;
  --brand-edge: #5B6470;
  --brand-muted: #8E97A3;

  /* The hero plate is theme-invariant: the lockup is silver and needs a dark ground in both. */
  --plate: #0C0E11;
  --plate-glow: rgba(143, 196, 232, 0.18);
  --plate-edge: #30353D;
  --plate-frost: #8FC4E8;

  --font-display: Cambria, "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --canvas: #E9ECF0;
    --raised: #FFFFFF;
    --console: #F4F6F8;
    --border: #D5DAE1;
    --border-strong: #AEB6C0;
    --text: #14171B;
    --text-2: #454C56;
    --muted: #5B6470;

    --frost: #215677;
    --hairline: #2B6E9E;

    --brand-steel: #454C56;
    --brand-frost: #2B6E9E;
    --brand-edge: #8E97A3;
    --brand-muted: #5B6470;
  }
}

/* ------------------------------------------------------------------ base */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--frost);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

a:focus-visible,
.cta:focus-visible {
  outline: 2px solid var(--hairline);
  outline-offset: 3px;
}

p,
li {
  color: var(--text-2);
}

p {
  margin: 0 0 1rem;
}

strong {
  color: var(--text);
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text);
  background: var(--console);
  border: 1px solid var(--border);
  padding: 0.08em 0.4em;
  border-radius: 3px;
}

ol,
ul {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.5rem;
}

li:last-child {
  margin-bottom: 0;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ------------------------------------------------------------ typography */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.5rem;
  margin: 2.75rem 0 0.9rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.eyebrow {
  font-family: var(--font-display);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--frost);
  margin: 0 0 0.5rem;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-2);
}

.fine {
  font-size: 0.9rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ frame */

.wrap {
  max-width: 54rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  padding: 2.5rem 0 4rem;
}

/*
 * A framed panel with a corner tick at top-left and bottom-right: the hairline register the mark's
 * chevron sets. The ticks are pseudo-elements so they cost no markup.
 */
.panel {
  position: relative;
  background: var(--raised);
  border: 1px solid var(--border);
  padding: 1.25rem 1.4rem;
  margin: 1.25rem 0;
}

.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.panel::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--hairline);
  border-left: 2px solid var(--hairline);
}

.panel::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--hairline);
  border-bottom: 2px solid var(--hairline);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel h2 {
  margin-top: 0;
}

.notice {
  background: var(--console);
}

/* ------------------------------------------------------------------- nav */

.site-nav {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin: 1.25rem 0 0;
  padding: 0.7rem 1rem;
  background: var(--raised);
  border: 1px solid var(--border);
}

.site-nav::before,
.site-nav::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.site-nav::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--hairline);
  border-left: 2px solid var(--hairline);
}

.site-nav::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid var(--hairline);
  border-bottom: 2px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand:hover {
  color: var(--frost);
}

.mark {
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
}

.mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

/*
 * The mark carries ink ROLES, not colours. Each role resolves here, per theme. The chevron and the
 * inner hairline are open strokes with fill="none" in the file, and that must survive the role
 * rule, so it is restated after them.
 */
.mark [data-ink="steel"] {
  fill: var(--brand-steel);
}

.mark [data-ink="frost"] {
  fill: var(--brand-frost);
  stroke: var(--brand-frost);
}

.mark [data-ink="muted"] {
  fill: var(--brand-muted);
}

.mark [data-ink="edge"] {
  fill: var(--brand-edge);
  stroke: var(--brand-edge);
}

.mark [fill="none"] {
  fill: none;
}

dl.pairs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.25rem;
  margin: 0 0 1rem;
}

dl.pairs dt {
  color: var(--text);
  font-weight: 600;
}

dl.pairs dd {
  margin: 0;
  color: var(--text-2);
}

@media (max-width: 30rem) {
  dl.pairs {
    grid-template-columns: 1fr;
    gap: 0.15rem 0;
  }

  dl.pairs dd {
    margin-bottom: 0.6rem;
  }
}

/* ----------------------------------------------------------------- footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer p {
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.site-footer li {
  margin: 0;
  color: var(--muted);
}

.site-footer a {
  color: var(--frost);
}

/* ============================================================ status page (own) */

/*
 * The status line: a glyph of our own beside the word. Colour is an accent; the shape and the word
 * carry the meaning. The four accents are tokens: frost for online, ember for degraded, muted for
 * offline and unknown. Nothing here introduces a colour.
 */
.status-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
}

h1.status-line {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.glyph {
  display: inline-flex;
  flex: none;
  width: 1em;
  height: 1em;
  color: var(--muted);
}

.glyph svg {
  display: block;
  width: 100%;
  height: 100%;
}

.state-online .glyph {
  color: var(--frost);
}

.state-degraded .glyph {
  color: var(--ember);
}

.state-offline .glyph,
.state-unknown .glyph {
  color: var(--muted);
}

.status-panel .connected {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.status-panel .fine {
  margin-bottom: 0;
}

dl.pairs dd {
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------- widget */

body.widget {
  padding: 0.75rem;
}

.widget-card {
  position: relative;
  background: var(--raised);
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
}

.widget-card .brand {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.widget-card .mark {
  width: 28px;
  height: 28px;
}

.widget-card .status-line {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.35rem;
}

.widget-card .connected {
  margin-bottom: 0.35rem;
  color: var(--text-2);
}

.widget-card .fine {
  margin: 0;
}
