/* ---------- Hero: miner terminal feeding the 3D chain ---------- */
@media (min-width: 901px) { .hero-inner { grid-template-columns: 1.12fr 1fr; } }
.scene { height: 490px; }
.chain { top: 14%; }

.miner {
  position: absolute; left: 4%; right: 0; bottom: 34px; z-index: 2;
  border-radius: var(--radius); overflow: hidden;
  background: rgba(11, 12, 15, .92);
  border: 1px solid var(--slate);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  transition: box-shadow .6s ease, border-color .6s ease;
}
.miner.hit {
  border-color: rgba(245, 165, 36, .55);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 38px rgba(255, 106, 43, .28);
}
.miner-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--slate);
  background: #15171B; font-size: .72rem; color: var(--snow-dim); white-space: nowrap;
}
.miner-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2F333A; }
.miner-bar span { margin-left: 8px; font-family: var(--font-mono); }
.miner-bar em {
  margin-left: 12px; font-style: normal; font-size: .66rem; letter-spacing: .04em;
  color: var(--snow-dim); opacity: .7;
}
.miner-bar .rate { margin-left: auto; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--amber); font-family: var(--font-mono); }
.miner-bar .bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.miner-bar .bars i { width: 3px; border-radius: 1px; background: linear-gradient(var(--amber), var(--glow)); opacity: .85; transition: height .6s ease; }

/* Flight of a found block from the terminal into the chain */
.mh-flyer, .mh-trail, .mh-spark, .mh-ring { position: absolute; z-index: 4; pointer-events: none; }
.mh-flyer { width: 0; height: 0; perspective: 500px; }
.mh-spin { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; transform-style: preserve-3d; animation: mhSpin 1.5s cubic-bezier(.4,0,.3,1); }
.mh-mini { --s: 26px; --heat: 1; --fade: 1; position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-26deg) rotateY(-42deg); }
.mh-mini .f { box-shadow: 0 0 14px rgba(255,106,43,.7), inset 0 0 8px rgba(245,165,36,.5); }
@keyframes mhSpin { from { transform: rotateY(-360deg) rotateX(30deg); } to { transform: none; } }
.mh-trail { width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: radial-gradient(circle, #FFE1A0 0, #F5A524 35%, rgba(255,106,43,.0) 70%); filter: blur(.5px); }
.mh-spark { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #FFD27A; box-shadow: 0 0 8px #FF6A2B; }
.mh-ring { width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%;
  border: 2px solid rgba(245,165,36,.85); box-shadow: 0 0 26px rgba(255,106,43,.6), inset 0 0 18px rgba(255,106,43,.35); }
.miner-log {
  margin: 0; height: 172px; padding: 10px 14px;
  overflow: hidden; white-space: pre;
  display: flex; flex-direction: column; justify-content: flex-end;
  font-family: var(--font-mono); line-height: 1.6;
  /* scale so the longest line (~62 chars) always fits the window */
  font-size: min(.74rem, calc((100cqi - 30px) / 38));
  color: #C9C5BE;
}
.miner { container-type: inline-size; }
.miner-log .ln { display: block; overflow: hidden; text-overflow: ellipsis; }
.miner-log .tg { color: #6F7A86; }
.miner-log .tg.cu { color: #8FB8D8; }
.miner-log .tg.m { color: var(--amber); }
.miner-log .tm, .miner-log .src { color: #5C6168; }
.miner-log .ok { color: #7FDCA4; font-weight: 600; }
.miner-log .hs { color: var(--snow); font-weight: 600; }
.miner-log .dim { color: #8B8F96; }
.miner-log .ln.hitln { background: linear-gradient(90deg, rgba(255,106,43,.18), transparent 80%); }
.miner-log .ln.new { animation: lnIn .5s ease-out; }
@keyframes lnIn { from { opacity: 0; transform: translateY(6px); } }

.scene-caption { transition: color .4s ease; }
.scene-caption.hot { color: var(--amber); }

/* Live chain: JS moves the blocks, so the looping keyframes are switched off. */
.chain.live .block {
  animation: none;
  transition: transform 1.1s cubic-bezier(.2, .75, .2, 1), --heat 3s ease, --fade 1s ease;
}

@media (max-width: 760px) {
  .scene { order: 0; height: 380px; margin: 28px 0 0; }
  .chain { top: 27%; }
  .miner { left: 0; bottom: 0; }
  .miner-log { height: 128px; padding: 8px 10px; font-size: min(.7rem, calc((100cqi - 22px) / 32)); }
  .miner-log .src { display: none; }
  .miner-bar .bars, .miner-bar .gpu { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .miner, .miner-log .ln.new, .scene-caption { animation: none; transition: none; }
}
