/* VEIN — basalt, bone and a blackbody vein. */

@font-face {
  font-family: 'Big Shoulders';
  src: url('/assets/fonts/big-shoulders.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('/assets/fonts/archivo.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('/assets/fonts/martian-mono.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --basalt: #171412;
  --shaft: #0f0d0c;
  --slate: #221e1b;
  --slate-hi: #2b2622;
  --seam: #3a332e;
  --bone: #eae3d7;
  --dust: #9c9189;
  --ember: #8a2a0a;
  --lava: #e2560b;
  --molten: #ff922b;
  --whitehot: #ffd9a0;
  --ok: #8fe3a7;
  --bad: #ff7a66;

  --display: 'Big Shoulders', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --text: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --rail: 0px;
  --depth-tint: 0;
  color-scheme: dark;
}

@media (min-width: 1180px) {
  :root { --rail: 108px; }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--basalt);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font: 400 17px/1.55 var(--text);
  font-stretch: 96%;
  color: var(--bone);
  /* The page darkens and warms as you go deeper. */
  background:
    radial-gradient(120% 70% at 70% 0%, rgba(255, 146, 43, calc(0.05 + var(--depth-tint) * 0.05)), transparent 60%),
    linear-gradient(180deg, #1b1715 0%, var(--basalt) 30%, #140f0d 70%, #110b09 100%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

img,
svg,
canvas { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--molten);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--molten); color: var(--shaft); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- 3D scene layer ---------- */

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.scene-fallback {
  position: fixed;
  right: 4vw;
  top: 14vh;
  width: min(46vw, 620px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s;
}
.no-webgl .scene-fallback { opacity: 1; }

.callouts {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}
.callouts svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.callout {
  position: absolute;
  width: 230px;
  font-size: 14px;
  line-height: 1.4;
  color: #d9d1c4;
  transform: translate(0, -50%);
  padding-left: 12px;
  border-left: 1px solid rgba(255, 217, 160, 0.5);
}
.callout b { display: block; font: 700 18px/1 var(--display); letter-spacing: 0.01em; color: var(--whitehot); margin-bottom: 3px; }

/* ---------- Header ---------- */

.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
  padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--rail) * 0.15);
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.92), rgba(20, 17, 15, 0.72));
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(58, 51, 46, 0.6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}
.brand img { width: 42px; height: 42px; margin: -4px -6px -4px -8px; filter: drop-shadow(0 0 6px rgba(255, 122, 26, 0.18)); }
.brand span {
  font: 900 30px/1 var(--display);
  letter-spacing: 0.06em;
  color: var(--bone);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 -1px 0 rgba(0, 0, 0, 0.7);
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 18px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 15px;
  font-stretch: 92%;
  color: var(--dust);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--bone); background: rgba(255, 255, 255, 0.04); }
.nav a[aria-current='true'] { color: var(--bone); }

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ca-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--seam);
  border-radius: 6px;
  background: rgba(15, 13, 12, 0.7);
  color: var(--bone);
  font: 500 12.5px/1 var(--mono);
  font-stretch: 88%;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ca-chip:hover:not([disabled]) { border-color: var(--dust); }
.ca-chip[disabled] { cursor: default; color: var(--dust); }
.ca-chip .k { color: var(--dust); font-family: var(--text); font-size: 13px; font-weight: 600; }
.ca-chip.copied .v { color: var(--ok); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--seam);
  border-radius: 6px;
  background: rgba(15, 13, 12, 0.7);
  color: var(--bone);
  transition: border-color 0.15s;
}
.icon-btn:hover { border-color: var(--dust); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Buttons: keycaps with a real edge ---------- */

.btn {
  --cap: var(--molten);
  --edge: #b4550f;
  --ink: #1a0f08;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffad57 0%, var(--cap) 55%, #f7831c 100%);
  color: var(--ink);
  font: 700 16px/1 var(--text);
  font-stretch: 96%;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--edge), 0 5px 18px -4px rgba(255, 120, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translateY(0);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge), 0 2px 8px -4px rgba(255, 120, 20, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn[disabled] { filter: grayscale(0.7) brightness(0.7); cursor: not-allowed; transform: none; }

.btn.stone {
  --edge: #090807;
  background: linear-gradient(180deg, #37302b 0%, #2a2420 100%);
  color: var(--bone);
  box-shadow: 0 5px 0 var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.btn.stone:active { box-shadow: 0 1px 0 var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn.small { height: 38px; padding: 0 14px; font-size: 14px; box-shadow: 0 4px 0 var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn.small.stone { box-shadow: 0 4px 0 var(--edge), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn.small:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }

.wallet-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* ---------- Depth rail ---------- */

.rail {
  position: fixed;
  left: 26px;
  top: 104px;
  bottom: 40px;
  width: 80px;
  z-index: 5;
  display: none;
}
@media (min-width: 1180px) { .rail { display: block; } }

.rail .shaft {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 9px;
  border-radius: 5px;
  background:
    repeating-linear-gradient(180deg, transparent 0 11px, rgba(156, 145, 137, 0.35) 11px 12px),
    linear-gradient(180deg, #2c2622, #1a1513 40%, #241512 85%, #3a1a0c);
  box-shadow: inset 0 0 0 1px rgba(58, 51, 46, 0.9), inset 2px 0 3px rgba(0, 0, 0, 0.6);
}
.rail .bit {
  position: absolute;
  left: 4px;
  width: 17px;
  height: 22px;
  margin-top: -11px;
  border-radius: 3px 3px 9px 9px;
  background: linear-gradient(90deg, #6d635b, #cfc5b8 45%, #6d635b);
  box-shadow: 0 0 14px rgba(255, 146, 43, 0.5);
  transition: top 0.12s linear;
}
.rail .bit::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 0; height: 0;
  margin-left: -6px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #b8ad9f;
}
.rail .depth {
  position: absolute;
  left: 30px;
  margin-top: -9px;
  font: 800 19px/1 var(--display);
  color: var(--whitehot);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: top 0.12s linear;
}
.rail ol { list-style: none; margin: 0; padding: 0; }
.rail li { position: absolute; left: 28px; margin-top: -8px; }
.rail li a {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: rgba(156, 145, 137, 0.75);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.rail li a span { display: block; font-variant-numeric: tabular-nums; color: rgba(156, 145, 137, 0.5); }
.rail li a:hover,
.rail li.active a { color: var(--bone); }
.rail li.near { opacity: 0; }

/* ---------- Layout ---------- */

main { position: relative; z-index: 2; }

.wrap {
  width: 100%;
  max-width: calc(1240px + var(--rail));
  margin: 0 auto;
  padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--rail));
}

section { position: relative; }
.band { padding: clamp(96px, 14vh, 170px) 0; }

h1,
h2,
h3 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: 0.005em; }

h2 {
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: 0.94;
  max-width: 14ch;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 -1px 0 rgba(0, 0, 0, 0.75), 0 10px 30px rgba(0, 0, 0, 0.5);
}
h3 { font-size: 26px; line-height: 1.05; font-weight: 700; }

.lede {
  max-width: 58ch;
  margin: 22px 0 0;
  font-size: 19px;
  line-height: 1.55;
  color: #d9d1c4;
}
.muted { color: var(--dust); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
}
.hero-copy { max-width: 640px; }
.hero h1 {
  font-size: clamp(56px, 6.3vw, 98px);
  line-height: 0.86;
  font-weight: 900;
  letter-spacing: -0.003em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.07), 0 -2px 0 rgba(0, 0, 0, 0.8), 0 18px 50px rgba(0, 0, 0, 0.55);
}
.hero .lede { max-width: 50ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.install {
  margin-top: 30px;
  max-width: 560px;
}
.install p { margin: 0 0 8px; font-size: 14px; color: var(--dust); }

.cmd {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 8px 0 16px;
  border: 1px solid var(--seam);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(10, 8, 7, 0.92), rgba(18, 15, 13, 0.88));
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.04);
  font: 500 13.5px/1.4 var(--mono);
  font-stretch: 90%;
}
.cmd + .cmd { margin-top: 8px; }
.cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 14px 0; scrollbar-width: none; }
.cmd code::-webkit-scrollbar { display: none; }
.cmd code::before { content: '$ '; color: var(--molten); }
.cmd code.plain::before { content: none; }
.copy {
  flex: none;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--seam);
  border-radius: 5px;
  background: var(--slate);
  color: var(--bone);
  font: 600 13px/1 var(--text);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.copy:hover { border-color: var(--dust); }
.copy.done { color: var(--ok); border-color: rgba(143, 227, 167, 0.4); }

.gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 42px;
}
@media (min-width: 1100px) {
  .hero .gauges {
    position: absolute;
    right: var(--gutter);
    bottom: 34px;
    margin: 0;
  }
}
.gauge {
  min-width: 150px;
  padding: 14px 16px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(43, 38, 34, 0.86), rgba(26, 22, 20, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 0 -1px rgba(9, 8, 7, 0.9), 0 6px 0 0 rgba(58, 51, 46, 0.6);
}
.gauge .v {
  display: block;
  font: 800 34px/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}
.gauge .l { display: block; margin-top: 6px; font-size: 13px; color: var(--dust); }
.gauge .meter { position: relative; height: 4px; margin-top: 10px; border-radius: 2px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.gauge .meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--lava), var(--molten), var(--whitehot)); box-shadow: 0 0 10px var(--molten); }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--dust); vertical-align: 2px; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 12px var(--ok); animation: blink 2.4s infinite; }
@keyframes blink { 50% { opacity: 0.45; } }

.scroll-hint {
  text-decoration: none;
  position: absolute;
  left: calc(var(--gutter) + var(--rail));
  bottom: 28px;
  font-size: 13px;
  color: var(--dust);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scroll-hint i { width: 1px; height: 34px; background: linear-gradient(var(--molten), transparent); }

/* ---------- Specimen ---------- */

.specimen-grid { display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 40px; align-items: center; min-height: 88vh; }
.label-card {
  position: relative;
  margin-top: 34px;
  padding: 26px 28px 22px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(234, 227, 215, 0.055), rgba(234, 227, 215, 0.02)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 2px, transparent 2px 4px),
    #1d1916;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 10px 0 -2px #0c0a09, 0 10px 0 -1px rgba(58, 51, 46, 0.8), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  transform: perspective(1200px) rotateY(4deg) rotateX(2deg);
  transform-origin: left center;
}
.label-card .no {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px dashed rgba(156, 145, 137, 0.35);
}
.label-card .no strong { font: 900 34px/1 var(--display); letter-spacing: 0.02em; }
.label-card .no span { font: 500 12px/1 var(--mono); color: var(--dust); }
.label-card dl { display: grid; grid-template-columns: 112px 1fr; margin: 0; }
.label-card dt,
.label-card dd { padding: 9px 0; border-bottom: 1px solid rgba(58, 51, 46, 0.55); }
.label-card dt { color: var(--dust); font-size: 14px; }
.label-card dd { margin: 0; font-size: 15px; }
.label-card dd code { font: 500 13px/1.3 var(--mono); font-stretch: 90%; color: var(--whitehot); }
.label-card dl > :nth-last-child(-n + 2) { border-bottom: 0; }

/* ---------- Steps: levels of the shaft ---------- */

.steps-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; margin-top: 54px; }
.steps { list-style: none; margin: 0; padding: 0 0 0 46px; position: relative; }
.steps::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 10px;
  bottom: 30px;
  width: 3px;
  background: linear-gradient(180deg, var(--seam), var(--lava) 80%, var(--molten));
  border-radius: 2px;
}
.step { position: relative; margin-bottom: 30px; }
.step .lvl {
  position: absolute;
  left: -46px;
  top: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a423b, #1c1816);
  box-shadow: 0 0 0 3px var(--basalt), 0 0 0 4px var(--seam);
  font: 800 18px/1 var(--display);
  color: var(--whitehot);
}
.slab {
  position: relative;
  padding: 22px 24px 24px;
  border-radius: 8px;
  background: linear-gradient(160deg, #2d2723 0%, #221d1a 60%, #1d1916 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 9px 0 -1px #0b0908, 0 9px 0 0 rgba(58, 51, 46, 0.75), 0 26px 40px -18px rgba(0, 0, 0, 0.9);
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  will-change: transform;
}
.slab h3 { margin-bottom: 8px; }
.slab p { margin: 0 0 14px; color: #d4ccbf; font-size: 16px; }
.slab p:last-child { margin-bottom: 0; }
.slab .cmd { margin-top: 12px; transform: translateZ(18px); }
.slab .btn { transform: translateZ(12px); }
.slab small { display: block; margin-top: 12px; color: var(--dust); font-size: 14px; }
.slab small code,
.lede code,
p code { font: 500 0.86em/1 var(--mono); font-stretch: 90%; color: var(--whitehot); }

.terminal-shot {
  position: sticky;
  top: 110px;
  margin: 0;
}
.terminal-shot .frame {
  border-radius: 10px;
  overflow: hidden;
  background: #121010;
  box-shadow: 0 0 0 1px rgba(58, 51, 46, 0.9), 0 12px 0 -2px #0a0807, 0 40px 90px -30px rgba(255, 120, 20, 0.28), 0 30px 60px -20px rgba(0, 0, 0, 0.9);
  transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
  transform-origin: right center;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.terminal-shot:hover .frame { transform: perspective(1400px) rotateY(-3deg) rotateX(1deg); }
.terminal-shot .bar { display: flex; gap: 6px; padding: 11px 13px; background: #1d1a18; border-bottom: 1px solid #2a2522; }
.terminal-shot .bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a332e; }
.terminal-shot img { width: 100%; height: auto; }
.terminal-shot figcaption { margin-top: 24px; font-size: 14px; color: var(--dust); }

/* ---------- Network ---------- */

.net-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; }
.seismo {
  position: relative;
  margin-top: 40px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(234, 227, 215, 0.035) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, rgba(234, 227, 215, 0.03) 0 1px, transparent 1px 30px),
    linear-gradient(180deg, #120f0e, #0d0b0a);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(58, 51, 46, 0.7), 0 10px 0 -2px #0a0807;
}
.seismo canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.seismo .tag { position: absolute; left: 14px; top: 12px; font-size: 13px; color: var(--dust); }

.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.readout {
  padding: 18px 18px 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(43, 38, 34, 0.6), rgba(26, 22, 20, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 7px 0 -1px #0b0908, 0 7px 0 0 rgba(58, 51, 46, 0.55);
}
.readout .v { display: block; font: 800 clamp(34px, 3.6vw, 48px)/1 var(--display); font-variant-numeric: tabular-nums; }
.readout .l { display: block; margin-top: 8px; font-size: 14px; color: var(--dust); }

.net-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; margin-top: 22px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; font-size: 13px; color: var(--dust); padding: 10px 12px; border-bottom: 1px solid var(--seam); }
td { padding: 11px 12px; border-bottom: 1px solid rgba(58, 51, 46, 0.5); font-size: 15px; }
td.r,
th.r { text-align: right; }
td.addr { font: 500 13px/1 var(--mono); font-stretch: 90%; }
tbody tr { transition: background 0.2s; }
tbody tr.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: rgba(255, 146, 43, 0.16); } to { background: transparent; } }
.panel {
  border-radius: 8px;
  background: rgba(20, 17, 15, 0.88);
  box-shadow: 0 0 0 1px rgba(58, 51, 46, 0.65);
}
.panel > h3 { padding: 18px 18px 6px; font-size: 22px; }
.panel .empty { padding: 26px 18px 28px; color: var(--dust); font-size: 15px; }

.log {
  height: 100%;
  min-height: 300px;
  max-height: 430px;
  overflow: hidden;
  padding: 14px 16px;
  font: 400 12.5px/1.75 var(--mono);
  font-stretch: 88%;
  color: #cfc6b9;
  background: linear-gradient(180deg, #0c0a09, #110e0c);
  border-radius: 8px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(58, 51, 46, 0.7);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}
.log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .t { color: #6f665f; margin-right: 10px; }
.log .s { color: var(--molten); }
.log .p { color: var(--ok); }

/* ---------- Yield ---------- */

.yield-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 60px); align-items: center; margin-top: 46px; }
.strata svg { width: 100%; height: auto; overflow: visible; }
.strata text { font-family: var(--text); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calc {
  margin-top: 18px;
  padding: 22px 22px 20px;
}
.calc label { display: block; font-size: 15px; color: #d4ccbf; }
.calc output { font: 800 24px/1 var(--display); color: var(--whitehot); font-variant-numeric: tabular-nums; }
.calc input[type='range'] { width: 100%; margin: 16px 0 18px; accent-color: var(--molten); }
.calc .rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc .rows div { padding: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.28); }
.calc .rows b { display: block; font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.calc .rows span { font-size: 13px; color: var(--dust); }
.calc .note { margin: 14px 0 0; font-size: 14px; color: var(--dust); }
.calc .toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: #d4ccbf; cursor: pointer; }
.calc .toggle input { accent-color: var(--molten); width: 16px; height: 16px; }

/* ---------- Miners ---------- */

.board { margin-top: 40px; }
.board .rank { width: 64px; font: 800 22px/1 var(--display); color: var(--dust); }
.board tr:nth-child(1) .rank { color: var(--whitehot); }
.board tr:nth-child(2) .rank { color: #f2b77a; }
.board tr:nth-child(3) .rank { color: #d88d55; }
.board td.mined { font: 800 22px/1 var(--display); }

/* ---------- Rig ---------- */

.rig-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: clamp(28px, 5vw, 80px); align-items: center; }
.rig-card {
  position: relative;
  padding: 30px 30px 28px;
  border-radius: 10px;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(255, 146, 43, 0.18), transparent 55%),
    linear-gradient(160deg, #332b26 0%, #231e1b 55%, #1b1714 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 0 -2px #0a0807, 0 12px 0 -1px rgba(90, 70, 55, 0.7), 0 40px 70px -24px rgba(0, 0, 0, 0.95), 0 0 80px -30px rgba(255, 146, 43, 0.4);
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
}
.rig-card .mult {
  font: 900 112px/0.8 var(--display);
  color: var(--whitehot);
  text-shadow: 0 0 30px rgba(255, 146, 43, 0.55), 0 2px 0 #b4550f, 0 4px 0 #7a3a0c;
  transform: translateZ(40px);
}
.rig-card .mult small { font-size: 0.34em; vertical-align: top; margin-left: 6px; color: var(--molten); text-shadow: none; }
.rig-card dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 26px 0 26px; transform: translateZ(20px); }
.rig-card dt { color: var(--dust); font-size: 14px; }
.rig-card dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rig-card .btn { transform: translateZ(30px); }

/* ---------- Final ---------- */

.final {
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 120px;
}
.final .wrap { text-align: center; }
.final h2 { margin: 0 auto; max-width: none; font-size: clamp(64px, 9vw, 136px); font-weight: 900; }
.final .lede { margin: 18px auto 0; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 0.9); }
.final .hero-actions { justify-content: center; }
.final .install { margin: 26px auto 0; text-align: left; }

footer {
  position: relative;
  z-index: 2;
  padding: 36px 0 44px;
  border-top: 1px solid rgba(58, 51, 46, 0.7);
  background: rgba(12, 9, 8, 0.85);
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer a { color: var(--dust); text-decoration: none; font-size: 15px; }
footer a:hover { color: var(--bone); }
footer p { margin: 0; color: var(--dust); font-size: 14px; }

/* ---------- Modal + toast ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 6, 5, 0.66);
  backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.sheet {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 12px;
  background: linear-gradient(170deg, #2a2420, #1b1714);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 0 -2px #090706, 0 40px 80px -20px rgba(0, 0, 0, 0.9);
}
.sheet h3 { font-size: 30px; }
.sheet p { margin: 8px 0 18px; color: var(--dust); font-size: 15px; }
.wallets { display: grid; gap: 8px; }
.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--seam);
  border-radius: 8px;
  background: rgba(15, 13, 12, 0.7);
  color: var(--bone);
  font: 600 16px/1 var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.wallet-option:hover { border-color: var(--molten); }
.wallet-option:active { transform: translateY(1px); }
.wallet-option img,
.wallet-option .ph { width: 28px; height: 28px; border-radius: 7px; background: var(--slate-hi); }
.wallet-option span { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--dust); }
.sheet .close { margin-top: 16px; width: 100%; }
.sheet .status { margin-top: 14px; font-size: 14px; color: var(--whitehot); min-height: 20px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 60;
  max-width: min(520px, calc(100% - 32px));
  padding: 13px 18px;
  border-radius: 8px;
  background: #2c2521;
  color: var(--bone);
  font-size: 15px;
  box-shadow: 0 0 0 1px var(--seam), 0 20px 40px -10px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { box-shadow: 0 0 0 1px rgba(255, 122, 102, 0.6), 0 20px 40px -10px rgba(0, 0, 0, 0.8); }

/* ---------- App pages (dashboard, authorize) ---------- */

.app { position: relative; z-index: 2; padding: 118px 0 90px; min-height: 100vh; }
.app .wrap { padding-left: var(--gutter); max-width: 1200px; }
.app h1 { font-size: clamp(48px, 6vw, 84px); line-height: 0.9; font-weight: 900; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 34px; }
.card {
  grid-column: span 6;
  padding: 22px;
  border-radius: 10px;
  background: linear-gradient(170deg, rgba(43, 38, 34, 0.85), rgba(26, 22, 20, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 9px 0 -1px #0b0908, 0 9px 0 0 rgba(58, 51, 46, 0.6);
}
.card.wide { grid-column: span 12; }
.card.third { grid-column: span 4; }
.card h3 { font-size: 24px; margin-bottom: 14px; }
.card .big { font: 900 clamp(54px, 6vw, 86px)/0.9 var(--display); font-variant-numeric: tabular-nums; color: var(--bone); text-shadow: 0 0 40px rgba(255, 146, 43, 0.2); }
.card .big small { font-size: 0.36em; color: var(--molten); margin-left: 8px; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stats-row div { padding: 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.28); }
.stats-row b { display: block; font: 800 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.stats-row span { font-size: 13px; color: var(--dust); }
.key-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(58, 51, 46, 0.5); font-size: 15px; font-variant-numeric: tabular-nums; }
.list li:last-child { border-bottom: 0; }
.list .amt { color: var(--ok); font-weight: 600; }
.progress { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.45); overflow: hidden; margin: 14px 0 10px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--lava), var(--molten), var(--whitehot)); box-shadow: 0 0 12px var(--molten); }
.confirm { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

.auth-box { max-width: 620px; margin-top: 30px; }
.code-big { font: 900 clamp(56px, 9vw, 104px)/1 var(--display); letter-spacing: 0.06em; color: var(--whitehot); text-shadow: 0 0 40px rgba(255, 146, 43, 0.3); }
.warn { margin: 16px 0 0; padding: 14px 16px; border-radius: 8px; background: rgba(255, 122, 102, 0.08); box-shadow: 0 0 0 1px rgba(255, 122, 102, 0.35); color: #f2c2b8; font-size: 15px; }

/* ---------- Responsive ---------- */

/* Tablets and narrow windows: the stone sits above the hero text (same rule as home.js). */
@media (max-width: 1100px) and (max-aspect-ratio: 5/4), (max-aspect-ratio: 9/10) {
  .hero { align-items: flex-end; padding-top: 47vh; }
  .hero-copy { max-width: 720px; }
  .hero h1 { font-size: clamp(56px, 8.4vw, 84px); }
}
@media (min-width: 721px) and (max-width: 1249px) and (min-aspect-ratio: 5/4) {
  .hero-copy { max-width: min(640px, 55vw); }
}

@media (max-width: 1100px) {
  .nav { display: none; }
  .specimen-grid,
  .steps-grid,
  .net-grid,
  .yield-grid,
  .rig-grid { grid-template-columns: minmax(0, 1fr); }
  .specimen-grid { min-height: 0; }
  .terminal-shot { position: relative; top: 0; }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card,
  .card.third { grid-column: span 12; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .ca-chip[disabled] .v { font-size: 0; }
  .ca-chip[disabled] .v::after { content: 'soon'; font-size: 11.5px; }
  .ca-chip .k { display: inline !important; }
  .wallet-btn { max-width: 118px; overflow: hidden; text-overflow: ellipsis; }
  .top { height: 60px; gap: 8px; }
  .brand span { font-size: 26px; }
  .brand img { width: 36px; height: 36px; }
  .ca-chip { padding: 0 9px; font-size: 11.5px; gap: 6px; }
  .wallet-btn .label-long { display: none; }
  .btn.small { padding: 0 11px; }
  .hero { align-items: flex-end; padding-top: 52vh; }
  .hero h1 { font-size: clamp(52px, 15vw, 76px); }
  .gauges { gap: 8px; }
  .gauge { min-width: 0; flex: 1 1 30%; padding: 12px; }
  .gauge .v { font-size: 26px; }
  .label-card { transform: none; padding: 20px; }
  .label-card dl { grid-template-columns: 96px 1fr; }
  .calc .rows { grid-template-columns: 1fr 1fr 1fr; }
  .calc .rows b { font-size: 20px; }
  .board th:nth-child(3),
  .board td:nth-child(3),
  .board th:nth-child(5),
  .board td:nth-child(5),
  .rounds th:nth-child(4),
  .rounds td:nth-child(4) { display: none; }
  .rig-card .mult { font-size: 88px; }
  .final h2 { font-size: clamp(56px, 17vw, 90px); }
  .scroll-hint { display: none; }
  .stats-row b { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 400px) {
  .top .brand span { display: none; }
  .top { padding-left: 16px; padding-right: 16px; }
}
