/* The network page. Uses the tokens lab.css defines.

   Chart colours are not the brand cyan and violet themselves but steps of them that hold on this
   dark surface: both sit in the lightness band where a mark is neither glaring nor lost, and the
   pair stays apart under the common colour-vision deficiencies. Status colours are a separate set,
   and are never used alone: every one comes with an icon and words. */

.net {
  --surface: #0a0c18;
  --series-1: #12a3c7;
  --series-2: #8b5cf6;
  --grid: rgba(140, 160, 255, 0.09);
  --axis: rgba(140, 160, 255, 0.24);
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  position: relative;
}

/* lab.css spaces consecutive sections on content pages; this page is a grid. */
main.net-main { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 1.25rem 16px 3rem; }
.net .hidden { display: none !important; }

.net-simbar { background: rgba(250, 178, 25, 0.12); border: 1px solid rgba(250, 178, 25, 0.45); color: #fde3a3; border-radius: 10px; padding: 0.45rem 0.9rem; font-size: 0.88rem; margin-bottom: 1rem; }

/* header */
.net-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.net-title { display: flex; align-items: center; gap: 0.8rem; }
.net-crumb { display: block; font-size: 0.82rem; color: var(--ink-dim); margin-bottom: 0.1rem; }
.net-title h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.net-sub { color: var(--ink-dim); font-size: 0.92rem; }
.net-controls { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.net-clock { display: flex; align-items: center; gap: 0.55rem; color: var(--ink-dim); font-size: 0.9rem; }
.net-clock .utc { color: var(--ink); font-variant-numeric: tabular-nums; padding-left: 0.6rem; border-left: 1px solid var(--glass-border); }

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); }
.live-dot[data-state="on"] { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6); animation: net-pulse 2s infinite; }
.live-dot[data-state="stale"] { background: var(--warning); }
@keyframes net-pulse { 70% { box-shadow: 0 0 0 9px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }

.seg { display: inline-flex; border: 1px solid var(--glass-border); border-radius: 999px; padding: 3px; background: var(--glass-bg); }
.seg button { font: inherit; font-size: 0.9rem; color: var(--ink-dim); background: none; border: 0; border-radius: 999px; padding: 0.3rem 0.95rem; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: rgba(139, 92, 246, 0.28); color: var(--ink); }
.seg button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.seg.small button { font-size: 0.8rem; padding: 0.2rem 0.7rem; }

/* grid */
.net-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.ncard { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 1.15rem 1.3rem; min-width: 0; }
.hero { grid-column: span 7; }
.verdict { grid-column: span 5; }
.tile { grid-column: span 2; }
.c-blocks { grid-column: span 8; }
.c-feed { grid-column: span 4; }
.c-hashrate, .c-ramp { grid-column: span 6; }
.c-seeds { grid-column: span 12; }
.c-miners { grid-column: span 4; }
.c-seeds:has(+ .c-miners:not(.hidden)) { grid-column: span 8; }

.eyebrow { color: var(--ink-dim); font-size: 0.82rem; letter-spacing: 0.09em; text-transform: uppercase; }

/* hero */
.hero { display: flex; flex-direction: column; justify-content: center; min-height: 250px; background: radial-gradient(40rem 16rem at 12% 0%, rgba(110, 231, 255, 0.09), transparent 70%), radial-gradient(34rem 18rem at 100% 100%, rgba(139, 92, 246, 0.16), transparent 70%), var(--glass-bg); }
.countdown { display: flex; gap: clamp(0.5rem, 1.6vw, 1.25rem); margin: 0.6rem 0 0.7rem; }
.cd { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 12rem; min-width: 0; padding: 0.7rem 0.5rem 0.6rem; border-radius: 14px; background: rgba(4, 5, 10, 0.55); border: 1px solid var(--glass-border); }
.cd span { font-size: clamp(2.4rem, 7.5vw, 6.6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cd small { color: var(--ink-dim); font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; margin-top: 0.45rem; }
.hero-figure { font-size: clamp(3.4rem, 10vw, 8.5rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; margin: 0.25rem 0 0.35rem; }
.hero-figure.bump span { display: inline-block; animation: net-bump 0.7s ease-out; }
@keyframes net-bump { 0% { transform: translateY(0.14em); opacity: 0.35; } 100% { transform: none; opacity: 1; } }
.hero-note { color: var(--ink-dim); font-size: 0.95rem; }

.pace { margin-top: 1.1rem; max-width: 34rem; }
.pace-track { position: relative; height: 8px; border-radius: 999px; background: rgba(18, 163, 199, 0.18); }
.pace-fill { height: 100%; border-radius: 999px; background: var(--series-1); transition: width 0.25s linear; max-width: 100%; }
.pace[data-level="warn"] .pace-track { background: rgba(250, 178, 25, 0.18); }
.pace[data-level="warn"] .pace-fill { background: var(--warning); }
.pace[data-level="crit"] .pace-track { background: rgba(208, 59, 59, 0.2); }
.pace[data-level="crit"] .pace-fill { background: var(--critical); }
.pace-target { position: absolute; left: 25%; top: -4px; width: 2px; height: 16px; background: var(--ink); border-radius: 1px; }
.pace-cap { display: flex; justify-content: space-between; color: var(--ink-dim); font-size: 0.85rem; margin-top: 0.45rem; font-variant-numeric: tabular-nums; }

/* status: an icon and words, always; the colour only repeats them */
.status { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 1.35rem; line-height: 1.2; }
.status.small { font-size: 0.86rem; font-weight: 500; gap: 0.4rem; white-space: nowrap; }
.status-icon { display: inline-grid; place-items: center; flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; font-size: 0.72em; font-weight: 700; color: #04050a; background: var(--ink-faint); }
[data-level="ok"] > .status-icon { background: var(--good); color: #fff; }
[data-level="warn"] > .status-icon { background: var(--warning); }
[data-level="serious"] > .status-icon { background: var(--serious); }
[data-level="crit"] > .status-icon { background: var(--critical); color: #fff; }
[data-level="wait"] > .status-icon, [data-level="nodata"] > .status-icon { background: rgba(154, 163, 189, 0.3); color: var(--ink); }

.verdict { display: flex; flex-direction: column; }
.verdict-head { margin: 0.55rem 0 0.9rem; }
.checks { list-style: none; display: grid; gap: 0.7rem; }
.checks li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.93rem; }
.checks .status-icon { font-size: 0.74rem; margin-top: 0.1rem; }
.checks strong { display: block; font-weight: 600; }
.checks span:not(.status-icon) { color: var(--ink-dim); }

/* stat tiles */
.tile { display: flex; flex-direction: column; position: relative; overflow: hidden; min-height: 132px; }
.tile-label { color: var(--ink-dim); font-size: 0.86rem; }
.tile-value { font-size: clamp(1.45rem, 2.1vw, 1.95rem); font-weight: 650; line-height: 1.2; margin-top: 0.3rem; white-space: nowrap; }
.tile-sub { color: var(--ink-faint); font-size: 0.8rem; line-height: 1.35; margin-top: 0.15rem; }
.spark { width: 100%; height: 30px; margin-top: auto; padding-top: 0.4rem; }
.meter { height: 6px; border-radius: 999px; background: rgba(18, 163, 199, 0.18); margin-top: auto; overflow: hidden; }
.meter-fill { height: 100%; background: var(--series-1); border-radius: 999px; min-width: 2px; transition: width 0.4s; }
.meter[data-level="warn"] { background: rgba(250, 178, 25, 0.18); }
.meter[data-level="warn"] .meter-fill { background: var(--warning); }
.meter[data-level="serious"] { background: rgba(236, 131, 90, 0.2); }
.meter[data-level="serious"] .meter-fill { background: var(--serious); }

/* charts */
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.chart-head > div:first-child { flex: 1 1 14rem; min-width: 0; }
.chart-head .seg, .chart-head .legend { flex: none; }
.chart-head h2 { font-size: 1.05rem; }
.chart-sub { color: var(--ink-faint); font-size: 0.84rem; line-height: 1.4; margin-top: 0.15rem; }
.chart { display: flex; flex-direction: column; }
.plot { position: relative; flex: 1; min-height: 220px; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plot-empty { color: var(--ink-faint); font-size: 0.9rem; }
.plot > .plot-empty { position: absolute; inset: 0; display: grid; place-items: center; }

.net svg text { fill: var(--ink-faint); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.net svg text.label { fill: var(--ink); font-size: 12px; font-weight: 600; }
.net svg .grid { stroke: var(--grid); stroke-width: 1; }
.net svg .axis { stroke: var(--axis); stroke-width: 1; }
.net svg .bar { fill: var(--series-1); }
.net svg .bar.lit { fill: #4fd0ee; }
.net svg .notch { fill: var(--surface); }
.net svg .target { stroke: var(--ink); stroke-width: 1; opacity: 0.7; }
.net svg .reorg-mark { fill: var(--warning); stroke: var(--surface); stroke-width: 2; }
.net svg .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.net svg .line.thin { stroke-width: 1.5; }
.net svg .line.ghost { stroke: var(--axis); }
.net svg .area { fill: var(--series-1); opacity: 0.1; }
.net svg .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.net svg .dot.small { stroke-width: 1.5; }
.net svg .cross { stroke: var(--axis); stroke-width: 1; }
.net svg .hit { fill: transparent; }

.legend { list-style: none; display: flex; gap: 1rem; color: var(--ink-dim); font-size: 0.82rem; }
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.key-line { width: 16px; height: 0; border-top: 1px solid var(--ink); opacity: 0.7; }
.key-reorg { width: 9px; height: 9px; background: var(--warning); transform: rotate(45deg); }

.tip { position: absolute; z-index: 20; pointer-events: none; display: grid; gap: 0.1rem; background: #11142a; border: 1px solid var(--glass-border-hover); border-radius: 10px; padding: 0.5rem 0.7rem; font-size: 0.82rem; color: var(--ink-dim); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); white-space: nowrap; }
.tip strong { color: var(--ink); }

/* tables */
.net table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.net th { text-align: left; font-weight: 500; color: var(--ink-faint); font-size: 0.78rem; letter-spacing: 0.04em; padding: 0 0.6rem 0.45rem 0; white-space: nowrap; }
.net td { padding: 0.5rem 0.6rem 0.5rem 0; border-top: 1px solid var(--grid); font-variant-numeric: tabular-nums; white-space: nowrap; }
.net td.num, .net th.num { text-align: right; }
.net td.dim { color: var(--ink-dim); }
.net td.strong { font-weight: 600; }
.net td.plot-empty { border-top: 0; }
.net code { font-size: 0.84rem; color: var(--ink-dim); }
.feed tr.fresh td { animation: net-fresh 1.6s ease-out; }
@keyframes net-fresh { 0% { background: rgba(18, 163, 199, 0.28); } 100% { background: transparent; } }
.table-scroll { overflow-x: auto; }
.meter-row { display: flex; align-items: center; gap: 0.7rem; min-width: 190px; }
.meter-row .meter { flex: 1; margin-top: 0; }
.meter-row span { color: var(--ink-dim); font-size: 0.84rem; }

/* who is finding blocks */
.miners-figures { display: flex; gap: 2rem; margin-bottom: 0.9rem; }
.bars { list-style: none; display: grid; gap: 0.5rem; }
.bars li { display: grid; grid-template-columns: 1.6rem 1fr 3.2rem; align-items: center; gap: 0.6rem; font-size: 0.84rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.bar-track { height: 10px; }
.bar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-value { text-align: right; color: var(--ink); }

/* Before genesis there are no blocks: the panels that would be empty step aside. */
.net[data-phase="prelaunch"] :is(.c-blocks, .c-feed, #tile-hashrate, #tile-blocktime, #tile-reward, #tile-mempool) { display: none; }
.net[data-phase="prelaunch"] .tile { grid-column: span 6; min-height: 0; }

/* notes */
.net-notes { margin-top: 2.5rem; max-width: 60rem; color: var(--ink-dim); font-size: 0.92rem; }
.net-notes h2 { font-size: 1.05rem; color: var(--ink); margin-bottom: 0.7rem; }
.net-notes ul { padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.net-notes strong { color: var(--ink); font-weight: 600; }

@media (max-width: 1180px) {
  .hero, .verdict { grid-column: span 12; }
  .tile { grid-column: span 4; }
  .c-blocks, .c-feed, .c-hashrate, .c-ramp, .c-miners, .c-seeds, .c-seeds:has(+ .c-miners:not(.hidden)) { grid-column: span 12; }
}
@media (max-width: 640px) {
  .tile { grid-column: span 6; }
  .hero { min-height: 0; }
  .status { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot[data-state="on"], .hero-figure.bump span, .feed tr.fresh td { animation: none; }
  .pace-fill, .meter-fill { transition: none; }
}

/* Stream view (?view=stream): one 16:9 frame for a broadcast, with no site chrome and nothing
   below the fold. Sizes follow the viewport height so a 1080p and a 720p capture look the same. */
html.stream { font-size: 1.48vh; }
html.stream body { overflow: hidden; font-size: 1rem; height: 100vh; min-height: 0; }
html.stream .nav, html.stream .foot, html.stream .net-notes, html.stream .net-sub, html.stream .net-crumb, html.stream #range-switch, html.stream #simbar { display: none; }
html.stream main.net-main { max-width: none; height: 100vh; min-height: 0; padding: 1.4vh 1.6vw; display: flex; }
html.stream .net { flex: 1; display: flex; flex-direction: column; min-height: 0; }
html.stream .net-head { margin-bottom: 1.2vh; }
html.stream .net-crumb { display: block; font-size: 0.82rem; color: var(--ink-dim); margin-bottom: 0.1rem; }
.net-title h1 { font-size: 2.1rem; }
html.stream .net-mark { width: 2.6rem; height: 2.6rem; }
html.stream .net-grid { flex: 1; min-height: 0; gap: 1.2vh; grid-template-rows: minmax(0, 31fr) minmax(0, 13fr) minmax(0, 27fr) minmax(0, 29fr); }
html.stream .ncard { padding: 1.4vh 1.1vw; overflow: hidden; display: flex; flex-direction: column; }
html.stream .hero { min-height: 0; grid-column: span 5; }
html.stream .verdict { grid-column: span 7; }
html.stream #net-switch { display: none; }
html.stream .checks { grid-template-columns: 1fr 1fr; column-gap: 2vw; }
html.stream .cd { min-width: 8.5vw; }
html.stream .cd span { font-size: 11vh; }
html.stream .cd small { font-size: 1rem; }
html.stream .hero-figure { font-size: 13vh; }
html.stream .hero-note { font-size: 1.15rem; }
html.stream .status { font-size: 1.7rem; }
html.stream .status.small { font-size: 0.95rem; }
html.stream .checks { gap: 0.9vh; }
html.stream .checks li { font-size: 1.05rem; }
html.stream .tile { min-height: 0; }
html.stream .tile-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.stream .spark { display: none; }
html.stream .plot { flex: 1; height: auto; min-height: 0; }
html.stream .chart-sub { display: none; }
html.stream .chart-head { margin-bottom: 0.6vh; }
html.stream .net svg text { font-size: 1.25vh; }
html.stream .net svg text.label { font-size: 1.4vh; }
html.stream .net td { padding-top: 0.55vh; padding-bottom: 0.55vh; }
html.stream .c-blocks { grid-column: span 8; }
html.stream .c-feed { grid-column: span 4; }
html.stream .c-hashrate { grid-column: span 4; }
html.stream .c-ramp { grid-column: span 3; }
html.stream .c-seeds, html.stream .c-seeds:has(+ .c-miners:not(.hidden)) { grid-column: span 5; }
html.stream .c-miners { display: none; }
html.stream .net[data-phase="prelaunch"] .net-grid { grid-template-rows: minmax(0, 47fr) minmax(0, 13fr) minmax(0, 40fr); }
html.stream .net[data-phase="prelaunch"] .hero { grid-column: span 8; }
html.stream .net[data-phase="prelaunch"] .verdict { grid-column: span 4; }
html.stream .net[data-phase="prelaunch"] .checks { grid-template-columns: 1fr; }
html.stream .net[data-phase="prelaunch"] .cd { max-width: none; }
html.stream .net[data-phase="prelaunch"] .cd span { font-size: 18vh; }
html.stream .net[data-phase="prelaunch"] .eyebrow { font-size: 1.2rem; }
html.stream .seeds th:nth-child(4), html.stream .seeds td:nth-child(4), html.stream .seeds th:nth-child(7), html.stream .seeds td:nth-child(7) { display: none; }
html.stream .meter-row { min-width: 8vw; }
