@font-face { font-family: "Jersey 10"; src: url(/fonts/jersey10.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url(/fonts/pixelify-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url(/fonts/pixelify-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #160f1d;
  --paper: #f6f1e7;
  --sky: #8fd3ff;
  --dirt: #6b4428;
  --stone: #3b3a45;
  --gold: #ffcf3a;
  --gold-deep: #d49a1c;
  --crystal: #7a3ad1;
  --magma: #ff4d1f;
  --shadow: 0 4px 0 var(--ink);
  --display: "Jersey 10", "Pixelify Sans", system-ui, sans-serif;
  --body: "Pixelify Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--paper); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

canvas { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

/* ---------- top bar */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px var(--gutter);
}
.brand { font-family: var(--display); font-size: 32px; color: var(--ink); text-decoration: none; line-height: 1; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.topbar nav a:hover { text-decoration: underline; color: var(--ink); }

/* ---------- strata */
.stratum {
  position: relative;
  padding: 120px var(--gutter) 110px;
  background-color: var(--stone);
  background-size: 64px 64px;
  image-rendering: pixelated;
  border-top: 4px solid var(--ink);
}
.stratum::after { /* jagged seam into the next layer */
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 8px; z-index: 2;
  background: linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 16px) 0 0 / 24px 4px repeat-x;
}
.surface {
  border-top: 0;
  padding-top: 110px;
  background: linear-gradient(var(--sky) 0 72px, #5cb84a 72px 84px, #3d8a33 84px 92px, transparent 92px), var(--dirt);
  background-repeat: no-repeat, repeat;
}

.col {
  max-width: 720px;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.col-wide { max-width: 980px; }
.surface .stage { max-width: none; }
@media (min-width: 1101px) { .stratum, .bedrock { padding-right: calc(var(--gutter) + 72px); } .topbar { padding-right: calc(var(--gutter) + 72px); } }

/* readable plate on top of the busy rock textures */
.stratum .col > :not(.stage):not(.grid):not(.logo):not(.layers):not(.steps):not(.rules):not(.prompt):not(.ctas):not(.wallet-row):not(.live) {
  text-shadow: 2px 2px 0 var(--ink);
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1; margin: 0; }
h2 { font-size: clamp(44px, 7vw, 72px); color: var(--gold); text-shadow: 3px 3px 0 var(--ink); margin-bottom: 18px; }
h3 { font-size: 32px; }
p { margin: 0 0 16px; }

/* ---------- hero */
.logo {
  font-size: clamp(88px, 18vw, 184px);
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink), 6px 8px 0 var(--ink);
  margin: 8px 0 12px;
}
.lede { font-size: 22px; max-width: 34em; text-shadow: 2px 2px 0 var(--ink); }
.stage {
  margin: 32px 0 20px;
  border: 4px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(22, 15, 29, .55);
  max-width: 620px;
}
.stage canvas { width: 100%; height: auto; aspect-ratio: 96 / 44; }
.live { display: flex; align-items: center; gap: 10px; font-size: 20px; text-shadow: 2px 2px 0 var(--ink); }
.dot { width: 12px; height: 12px; background: #8e98a6; box-shadow: 2px 2px 0 var(--ink); flex: none; }
.dot.on { background: #5cb84a; animation: blink 1.2s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.on { animation: none; } }

.ctas, .wallet-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px; }

/* ---------- buttons: chunky pixel blocks */
.btn {
  font: 600 18px/1 var(--body);
  display: inline-block;
  padding: 14px 20px;
  color: var(--ink);
  background: var(--paper);
  border: 4px solid var(--ink);
  box-shadow: inset -4px -4px 0 rgba(22, 15, 29, .25), 4px 4px 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: inset -4px -4px 0 rgba(22, 15, 29, .25), 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: inset 4px 4px 0 rgba(22, 15, 29, .25), 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-gold { background: var(--gold); }
.btn-small { padding: 9px 14px; font-size: 16px; }

/* ---------- panels sit on the rock as stone slabs */
.steps, .layers, .rules, .prompt {
  background: rgba(22, 15, 29, .93);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(22, 15, 29, .5);
  padding: 22px 24px;
  margin: 0 0 18px;
}
.steps { list-style: none; counter-reset: s; display: grid; gap: 22px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; }
.steps li::before {
  content: counter(s);
  grid-row: span 2;
  font: 40px/52px var(--display);
  width: 52px; height: 52px; text-align: center;
  background: var(--gold); color: var(--ink);
  box-shadow: inset -4px -4px 0 var(--gold-deep);
}
.steps h3 { color: var(--paper); margin-bottom: 4px; }
.steps p { margin: 0; color: #d9d0c0; }

.layers { list-style: none; display: grid; gap: 4px; padding: 14px; }
.layers li { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center; padding: 8px; }
.layers li + li { border-top: 2px dashed rgba(246, 241, 231, .14); }
.layers img { width: 76px; height: 76px; image-rendering: pixelated; border: 3px solid var(--ink); }
.layers h3 { font-size: 30px; color: var(--paper); }
.layers p { margin: 2px 0 0; font-size: 16px; color: #cfc6b6; }
.odds { font: 36px/1 var(--display); color: var(--gold); text-align: right; }
.odds small { display: block; font: 14px var(--body); color: #cfc6b6; }

.rules { display: grid; gap: 0; padding: 8px 24px; }
.rules div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 12px 0; }
.rules div + div { border-top: 2px dashed rgba(246, 241, 231, .14); }
.rules dt { color: var(--gold); }
.rules dd { margin: 0; }

.prompt { border-color: var(--ink); background: rgba(13, 10, 18, .9); }
.prompt p { font-size: 18px; color: #e3c2ff; }
.agent-lookup { margin: 18px 0 8px; }
.agent-lookup label { display: block; color: var(--gold); margin-bottom: 8px; }
.lookup-row { display: flex; flex-wrap: wrap; gap: 12px; }
.lookup-row input { flex: 1 1 250px; min-width: 0; padding: 12px 14px; color: var(--paper); background: var(--ink); border: 3px solid var(--ink); font: inherit; }
.lookup-row input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.lookup-row button:disabled { opacity: .6; cursor: progress; }
.code-sample {
  overflow-x: auto; max-width: 100%; margin: 0 0 18px; padding: 18px;
  color: #e3c2ff; background: rgba(13, 10, 18, .94); border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 rgba(22, 15, 29, .5); font: 14px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre;
}
.code-sample code { font: inherit; }

/* ---------- miners grid */
.note { min-height: 1.5em; margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin: 12px 0 32px; }
.grid-title { font-size: 40px; color: var(--paper); margin-top: 18px; text-shadow: 3px 3px 0 var(--ink); }
.card { background: var(--ink); border: 4px solid var(--ink); box-shadow: 5px 5px 0 rgba(0,0,0,.45); }
.card img { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated; background: #0d0a12; }
.card .cap { padding: 8px 10px 10px; font-size: 15px; line-height: 1.3; }
.card .cap b { font: 26px/1 var(--display); color: var(--gold); display: block; font-weight: 400; }
.card.rare { border-color: var(--gold); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 10px 12px; font-size: 14px; }
.card-actions a, .activity-nfts a { color: var(--gold); }
.card-actions a + a, .activity-nfts a + a { margin-left: 12px; }
.activity-nfts { flex: 1 0 100%; margin-left: 34px; font-size: 14px; color: #d9d0c0; }
.activity-nfts summary { cursor: pointer; width: fit-content; color: var(--gold); }
.activity-nfts > span { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 12px; padding: 8px 0; }
.activity { list-style: none; padding: 0; margin: 12px 0 36px; border-top: 2px solid rgba(246, 241, 231, .18); }
.activity li { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 14px 10px; border-bottom: 2px dashed rgba(246, 241, 231, .18); background: rgba(13, 10, 18, .55); }
.activity li > span { display: flex; align-items: center; gap: 12px; min-width: 0; }
.activity-kind { flex: 0 0 auto; font: 22px/1 var(--display); color: var(--gold); }
.activity-kind.reveal { color: #e3c2ff; }
.activity-description { overflow-wrap: anywhere; }
.activity-meta { flex: 0 0 auto; color: #b9b0c1; font-size: 14px; }
.activity-meta a { white-space: nowrap; }

.bedrock { background: #0d0a12; padding: 40px var(--gutter) 60px; border-top: 4px solid var(--magma); }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.fine { color: #8d8496; font-size: 15px; }

/* ---------- depth meter + shaft (desktop) */
.meter {
  position: fixed; left: 14px; bottom: 18px; z-index: 30;
  font: 30px/1 var(--display); color: var(--paper);
  background: var(--ink); padding: 8px 10px 6px; box-shadow: 4px 4px 0 rgba(0,0,0,.4);
}
.meter-u { color: var(--gold); margin-left: 2px; }
.shaft {
  position: fixed; top: 0; bottom: 0; right: 16px; width: 40px; z-index: 5;
  background: rgba(13, 10, 18, .72);
  border-left: 4px solid var(--ink); border-right: 4px solid var(--ink);
}
.rope { position: absolute; left: 50%; top: 0; width: 4px; margin-left: -2px; background: #c9a46a; height: 40px; }
.cage { position: absolute; left: 2px; width: 36px; height: 42px; top: 40px; }
@media (max-width: 1100px) {
  .shaft { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .meter { font-size: 22px; left: 8px; bottom: 8px; }
  .topbar nav { gap: 14px; font-size: 15px; }
  .stratum { padding-top: 96px; padding-bottom: 80px; }
  .rules div { grid-template-columns: 1fr; gap: 2px; }
  .layers li { grid-template-columns: 56px 1fr auto; gap: 10px; }
  .layers img { width: 56px; height: 56px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .activity li { align-items: flex-start; flex-direction: column; gap: 6px; }
  .activity-meta { flex-wrap: wrap; }
}
