/* bc3.online — formspråk enligt godkänt designförslag (fas 1).
   Mörkt är default (miner-publik); ljust läge följer systemet och kan togglas. */

:root {
  --bg: #14110F;
  --surface: #1D1916;
  --surface2: #26201B;
  --line: #37302A;
  --text: #F0EAE2;
  --muted: #A2978C;
  --faint: #6E645B;
  --accent: #E07A3F;
  --accent-ink: #1A120C;
  --data: #3EC9B8;
  --ok: #56C271;
  --warn: #E2B04C;
  --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F7F3EE;
    --surface: #FFFFFF;
    --surface2: #EFE9E1;
    --line: #DFD6CA;
    --text: #221B15;
    --muted: #6E6259;
    --faint: #9C8F84;
    --accent: #C95F27;
    --accent-ink: #FFF6EF;
    --data: #178F80;
    --ok: #2E9E52;
    --warn: #B07E1D;
  }
}
:root[data-theme="light"] {
  --bg: #F7F3EE;
  --surface: #FFFFFF;
  --surface2: #EFE9E1;
  --line: #DFD6CA;
  --text: #221B15;
  --muted: #6E6259;
  --faint: #9C8F84;
  --accent: #C95F27;
  --accent-ink: #FFF6EF;
  --data: #178F80;
  --ok: #2E9E52;
  --warn: #B07E1D;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .btn, .navlinks a, .stat-title, .eyebrow {
  font-family: 'Chakra Petch', sans-serif;
}
h1 { font-weight: 700; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-weight: 600; font-size: 24px; margin: 0 0 8px; }
h3 { font-weight: 600; font-size: 16px; margin: 0; }
p { margin: 0; max-width: 64ch; }
.muted { color: var(--muted); }
code, .mono {
  font-family: 'Spline Sans Mono', monospace;
  font-variant-numeric: tabular-nums;
}
code { background: var(--surface2); border-radius: 4px; padding: 1px 6px; font-size: 0.92em; }

/* Header */
header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand .wordmark { font-family: 'Chakra Petch', sans-serif; font-weight: 700; font-size: 22px; }
.brand .wordmark span { font-weight: 500; opacity: .45; }
.navlinks { display: flex; gap: 22px; align-items: center; }
.navlinks a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: .04em; }
.navlinks a:hover, .navlinks a.active { color: var(--accent); }
#theme-toggle {
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); cursor: pointer; padding: 6px 10px; font-size: 14px;
}

/* Hero */
.hero { padding: 56px 0 40px; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 58ch; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.btn {
  display: inline-block; font-weight: 600; font-size: 15px; letter-spacing: .03em;
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 8px;
  padding: 12px 22px; cursor: pointer; text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* Sections & cards */
section { padding: 32px 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.card p { font-size: 14.5px; color: var(--muted); }

/* Stat tiles */
.stat-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.stat-value { font-family: 'Spline Sans Mono', monospace; font-size: 26px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; color: var(--muted); }

/* Chart */
#chart-card { overflow-x: auto; }
.u-legend { font-family: 'Spline Sans Mono', monospace; font-size: 12px; }

/* Block timeline — horisontell, mempool-style, nyaste till vänster. */
.timeline-wrap { position: relative; }
.timeline {
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 12px;
  scrollbar-width: thin;
}
.block-cube {
  flex: 0 0 132px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px 12px; position: relative;
  display: flex; flex-direction: column; gap: 3px;
}
/* Trippellager-motivet som kubens "topp": tre staplade band. */
.block-cube .layers { display: flex; flex-direction: column; gap: 2px; margin-bottom: 7px; }
.block-cube .layers i { display: block; height: 3px; border-radius: 2px; background: var(--line); }
.block-cube .layers i:nth-child(2) { background: var(--faint); }
.block-cube.ours { border-color: var(--accent); }
.block-cube.ours .layers i:nth-child(2) { background: var(--accent); }
.block-cube .height {
  font-family: 'Spline Sans Mono', monospace; font-size: 16.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.block-cube .pool {
  font-family: 'Chakra Petch', sans-serif; font-size: 11.5px; font-weight: 600;
  letter-spacing: .03em; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.block-cube.ours .pool { color: var(--accent); }
.block-cube .meta { font-size: 11px; color: var(--faint); font-family: 'Spline Sans Mono', monospace; }
@media (prefers-reduced-motion: no-preference) {
  .block-cube.arriving { animation: cube-in .45s cubic-bezier(.2,.8,.3,1); }
  @keyframes cube-in {
    from { opacity: 0; transform: translateX(-24px) scale(.94); }
    to   { opacity: 1; transform: none; }
  }
}

/* SPA-vyer */
.view.hidden { display: none; }

/* Tabs (PPLNS / Solo) */
.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  font-family: 'Chakra Petch', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .04em;
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 10px 18px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabpane.hidden { display: none; }
.tabpane { display: flex; flex-direction: column; gap: 18px; }
.endpoint {
  font-family: 'Spline Sans Mono', monospace; font-size: 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 16px; overflow-x: auto; white-space: nowrap;
}
.endpoint .label { font-family: 'Chakra Petch', sans-serif; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-right: 10px; }

/* Miners table */
.table-wrap { overflow-x: auto; }
table.miners { width: 100%; border-collapse: collapse; font-size: 14px; }
table.miners th {
  font-family: 'Chakra Petch', sans-serif; font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
}
table.miners td {
  font-family: 'Spline Sans Mono', monospace; font-variant-numeric: tabular-nums;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.miners tr:last-child td { border-bottom: none; }
table.miners td.addr { color: var(--text); }
table.miners td.dim { color: var(--muted); }

/* Steps */
ol.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
ol.steps strong { color: var(--text); }

/* Footer */
footer.site { padding: 40px 0 60px; color: var(--faint); font-size: 13.5px; border-top: 1px solid var(--line); margin-top: 40px; }
footer.site a { color: var(--muted); }

.warn-box {
  border-left: 3px solid var(--warn); background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; font-size: 14.5px; color: var(--muted);
}
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 7px; }
.status-dot.down { background: var(--warn); }
