/* WAFER visual layer — fab floor on top of the machine */

:root {
  --hood-glow: rgba(0, 200, 5, 0.45);
  --hood-mist: rgba(0, 200, 5, 0.14);
  --shadow-lift: 8px 8px 0 #0a0b0d;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 70% -10%, var(--hood-mist), transparent 60%),
    radial-gradient(800px 500px at 0% 100%, rgba(10,11,13,0.05), transparent 55%);
}

.fx-grain,
.fx-grain:after {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
}
.fx-grain {
  opacity: 0.07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.fx-scan {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 79;
  background: repeating-linear-gradient(
    to bottom,
    rgba(10,11,13,0.03) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.35;
}

/* chrome polish */
.sidebar {
  background:
    linear-gradient(180deg, #fff 0%, #f7f8fa 100%);
}
.brand .chip-mark {
  filter: drop-shadow(0 0 6px var(--hood-glow));
  animation: chip-idle 3.6s steps(1) infinite;
}
@keyframes chip-idle {
  0%, 86%, 100% { filter: drop-shadow(0 0 6px var(--hood-glow)); }
  88%, 92% { filter: drop-shadow(0 0 0 transparent) brightness(0.55); }
}
.chain-badge {
  background: rgba(0, 200, 5, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 200, 5, 0.25);
}
.nav-link {
  transition: border-color 120ms, background 120ms, transform 120ms, box-shadow 120ms;
}
.nav-link:hover {
  transform: translate(-1px, -1px);
}
.nav-link.is-on {
  background: linear-gradient(180deg, #39e639 0%, var(--hood) 100%);
}
.round-card {
  background:
    linear-gradient(180deg, #fff, var(--paper));
  box-shadow: inset 0 0 0 1px rgba(0,200,5,0.15);
}
.live-pill {
  box-shadow: 0 0 0 0 rgba(0, 200, 5, 0.7);
  animation: soon-pulse 2.2s ease-out infinite;
}
@keyframes soon-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 5, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(0, 200, 5, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 5, 0); }
}
.tape {
  background: linear-gradient(90deg, #050607, #0a0b0d 40%, #07140a);
}
.tape-sym { text-shadow: 0 0 8px rgba(0,200,5,0.35); }
.topbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
}
.search:focus-within {
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn {
  position: relative;
  overflow: hidden;
  transition: transform 80ms, box-shadow 80ms, background 120ms;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-hood {
  background: linear-gradient(180deg, #4dff4d 0%, var(--hood) 55%, #00b305 100%);
}
.btn-hood:hover { background: linear-gradient(180deg, #6eff6e, var(--hood-hover)); }
.btn-hood:after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg);
  animation: shine 3.8s ease-in-out infinite;
}
@keyframes shine {
  0%, 55% { left: -40%; }
  80%, 100% { left: 140%; }
}

.card {
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
}
.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
}
.card-hood {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,0.45), transparent 50%),
    linear-gradient(160deg, #5dff5d 0%, var(--hood) 42%, #00a308 100%);
  overflow: hidden;
}
.card-hood:before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 60%;
  height: 80%;
  background: rgba(255,255,255,0.18);
  transform: rotate(18deg);
  pointer-events: none;
}
.card-hood .lede,
.card-hood .stat-sub,
.card-hood .kicker { color: var(--label-on-hood); }

h1.display {
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.stat-num {
  letter-spacing: -0.03em;
}

.split-bar > i,
.stock-track > i {
  transform-origin: left center;
  animation: fill-bar 1.1s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes fill-bar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.stock-row {
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 2px;
  transition: background 120ms;
}
.stock-row:hover { background: rgba(0,200,5,0.08); }

/* ---------- FAB HERO ---------- */
.stage-hero {
  position: relative;
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #070808;
  color: #fff;
  min-height: 540px;
  box-shadow: var(--shadow-card);
}
.stage-hero .kicker { color: #9dff9d; }
.stage-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 36px 28px 40px;
}
.stage-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 56px);
  line-height: 0.95;
  margin: 0;
  color: #fff;
  text-shadow: 4px 4px 0 #000, 0 0 24px rgba(0,200,5,0.25);
}
.stage-copy .lede {
  color: #c9d0c9;
  max-width: 38ch;
  font-size: 17px;
}
.stage-copy .stat-sub { color: #8a948a; }
.stage-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stage-meta span {
  border: 1px solid rgba(0,200,5,0.55);
  color: #b8ffb8;
  background: rgba(0,200,5,0.1);
  padding: 5px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.wafer-rig {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.wafer-glow {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,5,0.45) 0%, rgba(0,200,5,0.08) 42%, transparent 68%);
  filter: blur(8px);
  animation: glow-breathe 4.5s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.wafer-disc {
  position: relative;
  width: min(78%, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 3px #0a0b0d,
    0 0 0 6px rgba(0,200,5,0.35),
    0 30px 60px rgba(0,0,0,0.55);
  animation: wafer-spin 80s linear infinite;
}
.wafer-disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wafer-disc:after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    conic-gradient(from 220deg, transparent 0 40%, rgba(255,255,255,0.18) 48%, transparent 58%);
  mix-blend-mode: screen;
  animation: sheen 7s ease-in-out infinite;
}
@keyframes wafer-spin {
  to { transform: rotate(360deg); }
}
@keyframes sheen {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.7; }
}

.mascot {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: min(32%, 168px);
  height: auto;
  max-height: 44%;
  object-fit: contain;
  object-position: center;
  /* left pin + bottom prongs: optical center of the face, not the bitmap */
  transform: translate(-58%, -46%);
  mix-blend-mode: normal;
  filter: drop-shadow(0 14px 16px rgba(0,0,0,0.55)) drop-shadow(0 0 14px rgba(0,200,5,0.4));
  animation: mascot-float 4.2s ease-in-out infinite;
  image-rendering: pixelated;
}
.btn-lg { padding: 14px 20px; font-size: 13px; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: 4px 4px 0 #000;
}
.btn-ghost:hover { background: #fff; color: #0a0b0d; }
@keyframes mascot-float {
  0%, 100% { transform: translate(-58%, -46%); }
  50% { transform: translate(-58%, calc(-46% - 8px)); }
}

.orbit {
  position: absolute;
  inset: 12%;
  z-index: 2;
  animation: wafer-spin 28s linear infinite reverse;
  pointer-events: none;
}
.orbit span {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--hood);
  box-shadow: 2px 2px 0 #000;
  clip-path: polygon(20% 0, 100% 0, 100% 70%, 80% 100%, 0 100%, 0 30%);
}
.orbit span:nth-child(1) { top: 0; left: 50%; }
.orbit span:nth-child(2) { right: 8%; top: 38%; background: #ffd12f; }
.orbit span:nth-child(3) { bottom: 6%; left: 22%; background: #fff; }
.orbit span:nth-child(4) { left: 6%; top: 28%; background: #0a0b0d; box-shadow: 2px 2px 0 var(--hood); }

.traces {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.35;
  background-image:
    linear-gradient(90deg, rgba(0,200,5,0.15) 1px, transparent 1px),
    linear-gradient(rgba(0,200,5,0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 40% 50%, #000 20%, transparent 75%);
}

.pol-rings {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}
.ring {
  --p: 15;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    conic-gradient(#0a0b0d calc(var(--p) * 1%), rgba(255,255,255,0.35) 0);
  box-shadow: 4px 4px 0 #0a0b0d, inset 0 0 0 8px rgba(10,11,13,0.12);
  position: relative;
}
.ring:after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--hood);
  box-shadow: inset 0 0 0 2px #0a0b0d;
}
.ring-85 { --p: 85; }

.reveal {
  animation: rise 0.7s cubic-bezier(.16,.8,.2,1) both;
}
.reveal:nth-child(2) { animation-delay: 0.06s; }
.reveal:nth-child(3) { animation-delay: 0.12s; }
.reveal:nth-child(4) { animation-delay: 0.18s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.die {
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.die:hover {
  transform: translate(-3px, -3px) rotate(-2deg);
  box-shadow: 5px 5px 0 var(--ink);
}

.modal-card {
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(0,200,5,0.18), transparent 50%),
    #fff;
}
.tabbar { box-shadow: 0 -6px 0 rgba(10,11,13,0.04); }

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.wallet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 80ms, box-shadow 80ms, background 120ms;
}
.wallet-row:hover {
  background: var(--paper);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.wallet-row:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}
.wallet-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--chalk);
}
.wallet-name { flex: 1; font-size: 14px; }
.wallet-meta {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--hood-deep);
}
.wallet-error {
  min-height: 1.2em;
  margin: 12px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--danger);
}
.btn.is-connected {
  background: var(--ink);
  color: var(--hood);
  letter-spacing: 0.04em;
}
[hidden] { display: none !important; }

@media (min-width: 1024px) {
  .stage-hero {
    grid-template-columns: 1.15fr 0.95fr;
    min-height: 620px;
  }
  .stage-copy { padding: 48px 48px 48px 8px; }
  .main { gap: 28px; }
}
@media (max-width: 1023px) {
  .stage-hero { min-height: 0; }
  .wafer-rig { min-height: 340px; order: -1; }
  .mascot { width: min(42%, 150px); max-height: 42%; }
  .stage-copy h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .wafer-disc, .orbit, .mascot, .live-pill, .btn-hood:after, .brand .chip-mark {
    animation: none;
  }
}
