/* NANDFLY -- dark wetware identity. Accent: BNB gold (#F0B90B family),
   distinct from FlyMarket's pink/green and Outguess's crimson. */

:root {
  --bg: #08070c;
  --bg-raised: #100e17;
  --bg-card: #16131f;
  --border: #29243a;
  --text: #eae7f5;
  --text-dim: #9a94b3;
  --text-faint: #665f80;
  --accent: #F0B90B;
  --accent-bright: #F8D33A;
  --accent-dim: #9c7f28;
  --accent-glow: rgba(248, 211, 58, 0.35);
  --ok: #6ee7b7;
  --warn: #ffb454;
  --danger: #ff6b81;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); color-scheme: dark; scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, #120f1c 0%, var(--bg) 60%);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
}

a { color: var(--accent); }
a:hover { color: var(--accent-bright); }

code, pre { font-family: var(--mono); }

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
.wordmark span { color: var(--accent); }

nav.site-nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 18px;
  font-size: 0.88rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}
nav.site-nav a:hover { color: var(--text); }

section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: none; }

/* --- Hero: fly canvas is the hero, everything else overlays it --- */
.hero-stage {
  position: relative;
  overflow: hidden;
  height: 78vh;
  min-height: 460px;
  max-height: 720px;
  border-bottom: 1px solid var(--border);
  padding: 0;
}
@media (max-width: 760px) {
  .hero-stage {
    height: 58vh;
    min-height: 340px;
    max-height: 480px;
  }
}

.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #171227 0%, #0c0a13 80%);
}
.hero-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

.hero-scrim-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(4, 3, 6, 0.75) 0%, rgba(4, 3, 6, 0) 100%);
  pointer-events: none;
}
.hero-scrim-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 62%;
  background: linear-gradient(0deg, rgba(4, 3, 6, 0.88) 0%, rgba(4, 3, 6, 0.45) 55%, rgba(4, 3, 6, 0) 100%);
  pointer-events: none;
}

.hero-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.hero-copy {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  margin: 0 auto;
  padding-bottom: clamp(22px, 5vh, 56px);
  max-width: 640px;
  text-align: center;
}
.hero-copy .chip {
  display: inline-block;
  font-family: var(--mono);
  color: var(--accent);
  background: rgba(16, 14, 23, 0.7);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.82rem;
  margin: 0 0 14px;
}
.hero-headline {
  font-size: clamp(1.7rem, 4.4vw, 2.7rem);
  line-height: 1.12;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-dim);
  margin: 0 0 22px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}
.hero-copy .btn-cta {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1rem;
  padding: 14px 26px;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(240, 185, 11, 0.28);
}


h2 { font-size: 1.5rem; margin-top: 0; }
h2 .kicker {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 6px;
}

.story-block p { color: var(--text-dim); max-width: 700px; }

/* --- Live layer: compact strip below the hero (the fly canvas itself now
   lives in .hero-stage) --- */
.live-strip {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 8px;
}
.live-strip .status-row { flex: 0 0 auto; margin-bottom: 0; padding-top: 4px; }
.live-strip .live-feed { flex: 1 1 320px; }

.live-label {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 8px;
}
.live-label strong { color: var(--text-dim); }

.live-feed {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  max-height: 160px;
  overflow-y: auto;
}
.live-feed h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.feed-item {
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 7px 8px;
  margin: 2px 0;
  border-bottom: 1px dashed var(--border);
  border-left: 2px solid transparent;
  color: var(--text-dim);
}
.feed-item:last-child { border-bottom: none; }
.feed-item .feed-time { color: var(--text-faint); margin-right: 6px; }

/* Visual hierarchy: ordinary ambient blocks are the quietest thing in the
   feed (routine chain noise, can never fire the reflex -- see
   live-layer.js's _ambientStimulus); a whale-sized block is a notch
   brighter as a preview of the loom/jump events it triggers; a
   loom-survived event is brighter still (something big happened and the
   fly resisted it); a jump is the loudest thing in the feed -- the actual
   money moment. */
.feed-item.ambient-block { color: var(--text-faint); font-size: 0.78rem; }
.feed-item.whale-block { color: var(--text-dim); border-left-color: var(--warn); }
.feed-item.loom { color: var(--text); border-left-color: var(--warn); }
.feed-item.jump {
  color: var(--text);
  font-weight: 600;
  background: rgba(240, 185, 11, 0.12);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  box-shadow: 0 0 0 1px rgba(240, 185, 11, 0.22);
  animation: feed-jump-pulse 0.9s ease-out;
}
@keyframes feed-jump-pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  35% { box-shadow: 0 0 16px 2px var(--accent-glow); }
  100% { box-shadow: 0 0 0 1px rgba(240, 185, 11, 0.22); }
}

/* Test-hook-injected events (site/js/live-layer.js's gated
   window.__nandflyTestHook) are always visually distinct from real chain
   events -- this treatment is NOT conditional on the hook being enabled, so
   a cropped screenshot of a synthetic event can never pass as a real one. */
.feed-item.synthetic {
  border: 1px dashed var(--warn);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 2px 0;
}
.synthetic-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #1a1408;
  background: var(--warn);
  border-radius: 4px;
  padding: 1px 5px;
  margin-right: 6px;
}

.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-right: 4px;
}
.status-dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status-dot.err { background: var(--danger); }

/* --- Swat --- */
.swat-builder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.swat-group h5 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.swat-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 4px 0;
  color: var(--text-dim);
  cursor: pointer;
}
.swat-toggle input { accent-color: var(--accent); width: 15px; height: 15px; }

.swat-presets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.swat-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.btn {
  font-family: var(--sans);
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover { border-color: var(--accent-dim); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #1a1200;
  border: none;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }

.badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.swat-verdict { min-height: 60px; }
.verdict-line {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 4px;
}
.verdict-meta { color: var(--text-faint); font-family: var(--mono); font-size: 0.8rem; margin: 0; }
.swat-error { color: var(--danger); }
.swat-hint { color: var(--text-dim); font-size: 0.9rem; }

/* --- The whole brain (soma point cloud) --- */
.brain-canvas-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: radial-gradient(ellipse at center, #14101f 0%, #0b0912 85%);
  overflow: hidden;
}
.brain-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 440px;
  cursor: grab;
}
.brain-canvas-wrap canvas:active { cursor: grabbing; }
@media (max-width: 700px) {
  .brain-canvas-wrap canvas { height: 300px; }
}
.brain-tooltip {
  position: absolute;
  transform: translate(-50%, -100%);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-bright);
  background: rgba(16, 14, 23, 0.92);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 4px 10px;
  pointer-events: none;
  white-space: nowrap;
}

.swat-tx-panel { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; }
.oneclick-swat { margin: 12px 0 4px; }
.oneclick-swat .oneclick-swat-btn { margin-bottom: 6px; }
.oneclick-swat .oneclick-status { margin: 4px 0 0; }
.birth-gauge-note { max-width: 640px; }
.swat-tx-panel summary { cursor: pointer; color: var(--text-dim); font-weight: 600; }
.calldata {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-size: 0.78rem;
  color: var(--accent);
}
.hint { color: var(--text-faint); font-size: 0.85rem; }

/* --- Circuit viewer --- */
.circuit-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.circuit-group h4 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.circuit-cards { display: flex; flex-direction: column; gap: 8px; }
.circuit-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--sans);
}
.circuit-card:hover { border-color: var(--accent-dim); }
.circuit-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.circuit-card-id { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; }
.circuit-card-type { font-weight: 600; font-size: 0.9rem; }
.circuit-card-gates { color: var(--text-faint); font-size: 0.75rem; margin-top: 2px; }

.circuit-total { color: var(--text-faint); font-size: 0.85rem; margin-top: 16px; }

.circuit-flow { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.flow-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-merge { display: flex; align-items: center; gap: 8px; padding-left: 40%; }
.flow-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--bg-card);
  color: var(--text-dim);
  transition: box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.flow-box.flow-box-out { color: var(--text); }
.flow-arrow { color: var(--text-faint); }
.flow-box.selected-neuron {
  border-color: var(--accent);
  background: rgba(240, 185, 11, 0.14);
  color: var(--text);
}
.flow-box.pulse {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 14px var(--accent-glow);
  animation: pulse-flash 0.9s ease-out;
}
@keyframes pulse-flash {
  0% { box-shadow: 0 0 0 var(--accent-glow); }
  30% { box-shadow: 0 0 22px var(--accent-glow); }
  100% { box-shadow: 0 0 4px var(--accent-glow); }
}

/* --- Birth section --- */
.birth-gauge {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: 12px;
}
.birth-gauge-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); }
.birth-gauge-label { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); margin-top: 6px; }
.wallet-policy {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* --- Birth certificate: an unclaimed slot styled like a document fragment.
   The vacancy IS the message -- the signed-by line stays prominent but
   visibly empty until config.js's birth.certificate.claimedBy is set. --- */
.birth-certificate {
  position: relative;
  background: linear-gradient(160deg, rgba(240, 185, 11, 0.05) 0%, var(--bg-card) 45%);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  padding: 18px 20px;
  margin-top: 16px;
  max-width: 640px;
}
.certificate-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.certificate-seal {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--accent-bright), var(--accent) 60%, var(--accent-dim));
  box-shadow: 0 0 10px var(--accent-glow);
  flex: 0 0 auto;
}
.certificate-title {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.certificate-signed {
  font-family: var(--mono);
  font-size: 1.02rem;
  color: var(--text);
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.certificate-signed .unclaimed {
  color: var(--text-faint);
  font-style: italic;
  letter-spacing: 0.04em;
}
.certificate-copy {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0 0 10px;
}
.certificate-fineprint {
  color: var(--text-faint);
  font-size: 0.78rem;
  margin: 0;
}
@media (max-width: 760px) {
  .birth-certificate { padding: 14px 14px; }
  .certificate-signed { font-size: 0.94rem; }
}

/* --- Scoreboard --- */
.scoreboard { display: flex; gap: 24px; flex-wrap: wrap; }
.stat { min-width: 110px; }
.stat-value { font-size: 1.8rem; font-weight: 700; font-family: var(--mono); color: var(--accent); }
.stat-label { color: var(--text-faint); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* --- Honesty block --- */
.honesty-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.honesty-block p { color: var(--text-dim); margin: 0; }

/* --- Footer --- */
footer.site-footer {
  padding: 32px 20px 60px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}
footer.site-footer a { color: var(--text-dim); margin: 0 8px; }
footer.site-footer a:hover { color: var(--accent); }

/* --- METHODS page --- */
.methods table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.85rem;
}
.methods th, .methods td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}
.methods th { color: var(--text-dim); background: var(--bg-card); }
.methods td { color: var(--text-dim); }
.methods .shipped { color: var(--accent); font-weight: 600; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
  margin: 16px 0;
  color: var(--text-dim);
}

.credits-list { color: var(--text-dim); }
