/* bitflash.network — one stylesheet for every subdomain.
 *
 * Rules for anything added here:
 *   no border-radius, no blur, no translucency, no gradients, no shadows,
 *   no webfonts, no icon fonts, no javascript, no animation, no images.
 * Monospaced throughout, hairline rules, one accent colour.
 * White and black. The layout uses the whole screen: no centred column.
 */

:root {
  --bg:        #ffffff;
  --bg-2:      #f6f6f6;
  --fg:        #111111;
  --dim:       #6b6b6b;
  --line:      #d7d7d7;
  --line-hard: #111111;
  --accent:    #0b7a34;
  --accent-2:  #12a047;
  --on-accent: #ffffff;
  --warn:      #b8860b;
  --red:       #c0392b;
  --bar:       3rem;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas,
          "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #000000;
    --bg-2:      #0b0b0b;
    --fg:        #dcdcdc;
    --dim:       #8a8a8a;
    --line:      #242424;
    --line-hard: #4a4a4a;
    --accent:    #2ee06a;
    --accent-2:  #6bff9f;
    --on-accent: #001208;
    --warn:      #e0b341;
    --red:       #ff6b6b;
  }
}

:root[data-theme="dark"] {
  --bg: #000000; --bg-2: #0b0b0b; --fg: #dcdcdc; --dim: #8a8a8a;
  --line: #242424; --line-hard: #4a4a4a;
  --accent: #2ee06a; --accent-2: #6bff9f; --on-accent: #001208; --warn: #e0b341; --red: #ff6b6b;
}

:root[data-theme="light"] {
  --bg: #ffffff; --bg-2: #f6f6f6; --fg: #111111; --dim: #6b6b6b;
  --line: #d7d7d7; --line-hard: #111111;
  --accent: #0b7a34; --accent-2: #12a047; --on-accent: #ffffff; --warn: #b8860b; --red: #c0392b;
}

html {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--mono);
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

::selection { background: var(--accent); color: var(--on-accent); }

/* ----------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.6rem 2rem;
  flex-wrap: wrap;
  padding: 0.55rem clamp(0.8rem, 2vw, 2rem);
  background: var(--bg);
  border-bottom: 1px solid var(--line-hard);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: bold;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand:hover { background: none; color: var(--fg); }
.brand img { width: 22px; height: 22px; display: block; }

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.4rem;
  font-size: 0.86rem;
}
.topbar nav a { text-decoration: none; color: var(--dim); }
.topbar nav a::before { content: "/"; color: var(--line-hard); margin-right: 0.3rem; }
.topbar nav a:hover { color: var(--fg); background: none; text-decoration: underline; }
.topbar nav a[aria-current="page"] { color: var(--accent); font-weight: bold; }
.topbar nav a[aria-current="page"]::before { color: var(--accent); }

.topbar .meta {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--dim);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ shell */

.shell { display: grid; grid-template-columns: minmax(0, 1fr); }

.rail { display: none; }

@media (min-width: 1080px) {
  .shell { grid-template-columns: 15rem minmax(0, 1fr); }
  .rail {
    display: block;
    border-right: 1px solid var(--line);
    position: sticky;
    top: var(--bar);
    align-self: start;
    max-height: calc(100vh - var(--bar));
    overflow-y: auto;
    padding: 1.6rem 1rem 2rem 1.5rem;
    font-size: 0.82rem;
  }
}

.rail h2 {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
  margin: 0 0 0.8rem;
  border: 0;
  padding: 0;
}
.rail ol { list-style: none; margin: 0; padding: 0; counter-reset: rail; }
.rail li { counter-increment: rail; margin-bottom: 0.45rem; }
.rail a { text-decoration: none; color: var(--dim); display: block; }
.rail a::before {
  content: counter(rail, decimal-leading-zero) " ";
  color: var(--line-hard);
  margin-right: 0.3rem;
}
.rail a:hover { color: var(--accent); background: none; }

main { padding: 1.8rem clamp(0.9rem, 2.5vw, 3rem) 4rem; min-width: 0; }

/* ------------------------------------------------------------------- hero */

.hero { margin: 0 0 clamp(3rem, 7vw, 6rem); }

.hero h1 {
  font-size: clamp(2.1rem, 5.6vw, 5rem);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.02;
  margin: clamp(1.5rem, 5vw, 4rem) 0 clamp(1.2rem, 2vw, 2rem);
  max-width: 17ch;
}
.hero h1 b { color: var(--accent); font-weight: inherit; }

.hero-lede {
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  max-width: 58ch;
  color: var(--dim);
  margin: 0;
}

/* ---------------------------------------------------------------- metrics */

/* The numbers are the picture. No boxes, no rules between them: they carry
   themselves on size alone. */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: clamp(1.5rem, 3vw, 3.5rem);
  margin: clamp(2.5rem, 6vw, 5rem) 0 0.9rem;
}

.metric { min-width: 0; }

.metric b {
  display: block;
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.metric span {
  display: block;
  margin-top: 0.8rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--dim);
}
/* Marks a figure the page refreshes from the status daemon. */
.metric[data-live] span::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.6em;
  background: var(--line);
  vertical-align: baseline;
}
.metric[data-live].fresh span::before { background: var(--accent); }

/* ------------------------------------------------------------------- text */

h1 {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  letter-spacing: 0.02em;
  margin: 0 0 1rem;
  line-height: 1.2;
}

h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: bold;
  margin: clamp(3rem, 6vw, 5.5rem) 0 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
h2 .num { color: var(--accent); font-weight: normal; }

h3 { font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.1em; margin: 1.8rem 0 0.6rem; }
h4 { font-size: 0.86rem; color: var(--dim); margin: 1.4rem 0 0.5rem; }

p { margin: 0 0 0.9rem; max-width: 92ch; }
li { max-width: 92ch; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:visited { color: var(--accent); }
a:hover { background: var(--accent); color: var(--on-accent); text-decoration: none; }

strong { font-weight: bold; }
em { font-style: normal; color: var(--accent); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
ul { list-style: none; padding-left: 1.1rem; }
ul li::before { content: "·"; color: var(--accent); margin-left: -1.1rem; margin-right: 0.6rem; }
li { margin-bottom: 0.35rem; }

blockquote {
  margin: 1.2rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 2px solid var(--accent);
  color: var(--fg);
}
blockquote p:last-child { margin-bottom: 0; }

.lede { font-size: 1.05rem; color: var(--fg); max-width: 88ch; margin-bottom: 1.6rem; }

.note { color: var(--dim); font-size: 0.82rem; letter-spacing: 0.04em; }

/* ------------------------------------------------------------------- code */

code, kbd, samp { font-family: var(--mono); font-size: 0.92em; }

p code, li code, td code, dd code, h2 code, h3 code {
  color: var(--accent);
  white-space: nowrap;
}

pre {
  font-size: 0.84rem;
  line-height: 1.6;
  background: var(--bg-2);
  border-left: 2px solid var(--accent);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 0 0 1.2rem;
}
pre code { color: inherit; white-space: pre; }

/* A one-line data strip: BITFLASH -- BTF -- RandomX -- ... */
.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.9rem;
  align-items: center;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
  margin: 0 0 2rem;
}
.strip b { color: var(--fg); font-weight: bold; letter-spacing: 0.24em; }
.strip span::before { content: "//"; color: var(--accent); margin-right: 0.5rem; }

/* ----------------------------------------------------------------- tables */

.table-scroll { overflow-x: auto; margin: 0 0 1.6rem; }

table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }

th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 1.2rem 0.5rem 0;
  text-align: left;
  vertical-align: top;
}

thead th {
  border-bottom: 2px solid var(--line-hard);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--dim);
  white-space: nowrap;
}

tbody tr:hover { background: var(--bg-2); }

td.hash, .hash { color: var(--dim); word-break: break-all; font-size: 0.8rem; }

/* ------------------------------------------------------------------- grid */

/* Fills the width of a wide screen instead of stacking everything in a
   column. Separated by space, not by rules. */
.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  gap: clamp(1.6rem, 3vw, 3.5rem);
  margin: 0 0 1.5rem;
}
.row > * { min-width: 0; }
.row > * > :last-child { margin-bottom: 0; }
.row > * > h3:first-child { margin-top: 0; }

/* Key/value ledger, in as many columns as the screen allows. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 4rem);
  margin: 0 0 1.8rem;
  font-size: 0.85rem;
}
.facts div {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0;
  min-width: 0;
}
.facts dt {
  flex: 0 0 9rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.facts dd { margin: 0; flex: 1 1 auto; min-width: 0; word-break: break-word; }

/* ----------------------------------------------------------------- panels */

.panel {
  border-top: 2px solid var(--line-hard);
  padding: 1.1rem 0 0.4rem;
  margin: 0 0 2rem;
}
.panel > h2 {
  border: 0;
  margin: 0 0 0.8rem;
  padding: 0;
  font-size: 0.86rem;
}
.panel > :last-child { margin-bottom: 0; }
.panel-warn { border-top-color: var(--warn); }
.panel-warn > h2 { color: var(--warn); }

/* --------------------------------------------------------------- controls */

a.button {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  padding: 0.6rem 1.4rem;
  margin: 0 0.7rem 0.8rem 0;
}
a.button:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
a.button.secondary { background: transparent; color: var(--fg); border-color: var(--line-hard); }
a.button.secondary:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ----------------------------------------------------------------- status */

.dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.5em;
  background: var(--accent-2);
}
.dot-down { background: var(--red); }
.up { color: var(--accent); }
.down { color: var(--red); }

/* overall banner: one bold line saying whether the network is fine */
.status-banner {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 1.2rem;
  margin: 0.5rem 0 2rem;
  background: var(--bg-2);
  border-left: 3px solid var(--accent);
}
.status-banner.degraded { border-left-color: var(--warn); }
.status-banner.down { border-left-color: var(--red); }
.status-banner .dot { align-self: center; }
.status-banner .big {
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: bold;
}
.status-banner.degraded .big { color: var(--warn); }
.status-banner.down .big { color: var(--red); }
.banner-meta {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* components list, StatusPage-style but square and monospaced */
.components { margin: 0 0 1.4rem; }

.component {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.component:first-child { border-top: 1px solid var(--line); }

.component-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.component-name { font-weight: bold; }

.pill {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.12rem 0.5rem;
  border: 1px solid;
}
.pill.ok { color: var(--accent); border-color: var(--accent); }
.pill.down { color: var(--red); border-color: var(--red); }

.uptime {
  margin-left: auto;
  color: var(--dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.component-meta {
  color: var(--dim);
  font-size: 0.8rem;
  margin: 0.4rem 0 0;
}

/* the 90-day bar strip */
.bars {
  display: flex;
  gap: 2px;
  height: 30px;
  margin-top: 0.7rem;
  align-items: stretch;
}
.bars i {
  flex: 1 1 0;
  min-width: 2px;
  background: var(--line);          /* no data */
}
.bars i.up { background: var(--accent); }
.bars i.partial { background: var(--warn); }
.bars i.down { background: var(--red); }

/* ----------------------------------------------------------------- footer */

footer {
  border-top: 1px solid var(--line-hard);
  padding: 1.4rem clamp(0.9rem, 2.5vw, 3rem) 3rem;
  font-size: 0.78rem;
  color: var(--dim);
}
footer p { margin: 0 0 0.5rem; max-width: 100ch; }
footer a { color: var(--accent); }
footer .facts-line { letter-spacing: 0.1em; text-transform: uppercase; }
footer .facts-line span::before { content: "·"; margin: 0 0.6rem; color: var(--line-hard); }
footer .facts-line span:first-child::before { content: ""; margin: 0; }

/* ------------------------------------------------------------------ print */

@media print {
  html { background: #fff; color: #000; font-size: 10pt; }
  .topbar, .rail { display: none; }
  .shell { grid-template-columns: 1fr; }
  a { color: #000; }
}
