/* ==========================================================================
   house.css — Boscaern XRPL Operations Design System
   Self-contained. Offline-first. Zero network dependencies.
   ========================================================================== */

:root {
  /* Bedrock & panels */
  --ground: #101315;
  --sunk:   #0c0e10;
  --panel:  #171a1d;
  --line:   #282f33;
  --rule:   #343d41;

  /* Typography values */
  --muted:  #4b4e55;
  --dim:    #798186;
  --text:   #cacccc;
  --warm:   #cbc2be;
  --bright: #a5aeb4;

  /* Baseline status triad (House Solitude) */
  --ok:     #798186;
  --watch:  #c9c2b4;
  --crit:   #de6145;

  /* Telemetry state extension (Agreement Report & Diagnostics) */
  --tel-good:         #3f5147; /* Subdued moss-slate for nominal agreement */
  --tel-miss:         #de6145; /* Solid crit reserved for validator missed ledgers */
  --tel-degraded:     #c88a38; /* Smoky amber for collector failure */
  --tel-unattributed: #8f78ad; /* Slate violet for unattributed keys */
  --tel-none:         #1d2226; /* Sunken border tone for unobserved days */
  --tel-diverge:      #7fa6a0; /* Track-B witness divergence: a finding, not a fault */

  /* Typography stacks: Local/System first, no external Google Fonts required */
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --r: 6px;
  color-scheme: dark;
}

/* Light daytime variant — the same Solitude hues turned for paper. Dark stays
   the base (the :root above); light applies when the viewer's system prefers
   light (unless they have forced dark), and whenever the theme toggle sets
   data-theme="light". Only tokens are redefined here; every component below
   draws from them, so both themes stay consistent. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #eceeec; --sunk: #dfe1dd; --panel: #fbfbf9; --line: #d4d6d1; --rule: #bdbfb9;
    --muted: #86887f; --dim: #5c6064; --text: #242728; --warm: #282420; --bright: #3a3e42;
    --ok: #5c6265; --watch: #846615; --crit: #bf4328;
    --tel-good: #45554b; --tel-miss: #bf4328; --tel-degraded: #956518; --tel-unattributed: #675189;
    --tel-none: #dddfda; --tel-diverge: #3d6a63;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ground: #eceeec; --sunk: #dfe1dd; --panel: #fbfbf9; --line: #d4d6d1; --rule: #bdbfb9;
  --muted: #86887f; --dim: #5c6064; --text: #242728; --warm: #282420; --bright: #3a3e42;
  --ok: #5c6265; --watch: #846615; --crit: #bf4328;
  --tel-good: #45554b; --tel-miss: #bf4328; --tel-degraded: #956518; --tel-unattributed: #675189;
  --tel-none: #dddfda; --tel-diverge: #3d6a63;
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* --- Document Baseline --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background: var(--ground);
  color-scheme: dark;
}

body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  padding-inline: 20px;
  padding-block: 28px 48px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* --- Typography & Headings --- */
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  letter-spacing: -.018em;
  color: var(--warm);
  text-wrap: balance;
}

h2 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: 9px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

h2 span {
  color: var(--muted);
  letter-spacing: .08em;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--warm);
  letter-spacing: -.008em;
}

p {
  color: var(--text);
  font-size: 13.5px;
  max-width: 68ch;
}

a {
  color: var(--dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}

a:hover, a:focus-visible {
  color: var(--warm);
  outline: none;
}

code, .code {
  font-family: var(--mono);
  font-size: 12px;
}

/* --- Layout Elements --- */
.head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- Navigation --- */
.adminnav, .site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.adminnav a, .site-nav a {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  transition: color .15s ease, border-color .15s ease;
}

.adminnav a:hover, .adminnav a:focus-visible,
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--warm);
  border-color: var(--muted);
  outline: none;
}

.adminnav a.active, .site-nav a.active {
  color: var(--warm);
  border-color: var(--rule);
  background: var(--panel);
}

/* --- Verdict / Status Banners --- */
.verdict {
  border-left: 2px solid var(--ok);
  padding: 11px 0 11px 15px;
  color: var(--bright);
  max-width: 66ch;
}

.verdict.crit {
  border-color: var(--crit);
  background: linear-gradient(90deg, rgba(222, 97, 69, .06), transparent 62%);
}

.verdict.watch {
  border-color: var(--watch);
  background: linear-gradient(90deg, rgba(201, 194, 180, .05), transparent 62%);
}

.verdict.degraded {
  border-color: var(--tel-degraded);
  background: linear-gradient(90deg, rgba(200, 138, 56, .06), transparent 62%);
}

.verdict b {
  color: var(--warm);
  font-weight: 600;
}

.err {
  background: var(--panel);
  border-left: 2px solid var(--crit);
  padding: 14px 16px;
  color: var(--bright);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* --- Findings / Attention Items --- */
.finds {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
}

.find {
  background: var(--panel);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 4px 16px;
  align-items: baseline;
}

.sev {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .13em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sev::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.s-crit        { color: var(--crit); }
.s-watch       { color: var(--watch); }
.s-ok          { color: var(--ok); }
.s-degraded    { color: var(--tel-degraded); }
.s-unattributed{ color: var(--tel-unattributed); }

.find .who {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.find .body {
  grid-column: 2;
  color: var(--dim);
  font-size: 13.5px;
  max-width: 66ch;
}

.find .body em {
  color: var(--bright);
  font-style: normal;
}

@media(max-width: 560px) {
  .find { grid-template-columns: 1fr; }
  .find .who, .find .body { grid-column: 1; }
}

/* --- Host / Node Cards --- */
.hosts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
}

.card {
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hn {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--warm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.role {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}

.v {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-all;
}

.v.crit  { color: var(--crit); }
.v.watch { color: var(--watch); }
.v.quiet { color: var(--dim); }
.v small { color: var(--muted); font-size: 10.5px; }

/* --- Tables & Drive Wear --- */
.drives, .table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
  font-family: var(--mono);
  font-size: 12.5px;
}

th {
  font-size: 10px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  text-align: right;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--rule);
}

th:nth-child(-n+3) { text-align: left; }

td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td:nth-child(-n+3) { text-align: left; }
td.h { color: var(--warm); }
td.m { color: var(--muted); font-size: 11.5px; }

.sn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: -.01em;
  white-space: nowrap;
}

tr.crit td.life  { color: var(--crit); }
tr.watch td.life { color: var(--watch); }
tr.ok td.life    { color: var(--ok); }

.bar {
  display: inline-block;
  width: 64px;
  height: 4px;
  background: var(--sunk);
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 8px;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--ok);
}

tr.crit .bar i  { background: var(--crit); }
tr.watch .bar i { background: var(--watch); }

/* --- Telemetry Patterns & Agreement Strip (1,100-day safe) --- */

/* Hatching: Pure CSS repeating linear gradients */
.pat-scored {
  background-color: var(--line);
}

.pat-missed {
  background-color: var(--tel-miss) !important;
}

.pat-degraded {
  background: repeating-linear-gradient(
    45deg,
    var(--tel-degraded),
    var(--tel-degraded) 2px,
    var(--sunk) 2px,
    var(--sunk) 5px
  ) !important;
}

.pat-unattributed {
  background: repeating-linear-gradient(
    135deg,
    var(--tel-unattributed),
    var(--tel-unattributed) 2px,
    var(--sunk) 2px,
    var(--sunk) 5px
  ) !important;
}

.pat-norecord {
  background-color: var(--sunk);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* 1,100-day Observer Strip Container */
.observer-strip-card {
  background: var(--panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.strip-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.strip-viewport {
  width: 100%;
  overflow-x: auto;
  background: var(--sunk);
  padding: 4px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* Flex tick rail for up to 1,200 continuous days without DOM strain */
.strip-rail {
  display: flex;
  height: 28px;
  min-width: 100%;
  gap: 1px;
  background: var(--line);
  align-items: stretch;
}

.strip-day {
  flex: 1 0 1px;
  min-width: 1px;
  position: relative;
  cursor: crosshair;
}

.strip-day:hover {
  outline: 1px solid var(--warm);
  z-index: 10;
}

/* Telemetry Legend */
.tel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.tel-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
}

.tel-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex: none;
}

.tel-swatch.sw-scored       { background-color: var(--line); }
.tel-swatch.sw-missed       { background-color: var(--tel-miss); }
.tel-swatch.sw-degraded     { background: repeating-linear-gradient(45deg, var(--tel-degraded), var(--tel-degraded) 2px, var(--sunk) 2px, var(--sunk) 4px); }
.tel-swatch.sw-unattributed { background: repeating-linear-gradient(135deg, var(--tel-unattributed), var(--tel-unattributed) 2px, var(--sunk) 2px, var(--sunk) 4px); }
.tel-swatch.sw-norecord     { background-color: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); }

/* --- Footer --- */
footer {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}

footer a {
  color: var(--dim);
}
