/* The Memory Miner. Layout system: one container (1200 + 24 gutters), one left edge, spacing 8/16/24/32/48/64/96,
   one section header (amber index + Bitter title), one card (deeper paper, radius 14, padding 24/32). */
@font-face { font-family: "Bitter"; src: url("/fonts/bitter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #F4E3CF;      /* the ground, measured off the generated pictures */
  --paper-2: #EBD3B8;    /* cards */
  --paper-3: #FBF1E4;    /* fields */
  --ink: #2A2A2A;        /* ferrite */
  --ink-2: #5B4636;      /* secondary text, 7:1 on paper */
  --copper: #B87333;     /* hairlines, wire */
  --copper-ink: #87461A; /* accent text, 5.4:1 on paper */
  --amber: #FFB000;      /* signal: primary action, lit rings */
  --wood: #8C6A4A;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --wrap: 1200px;
  --gutter: 24px;
  --display: "Bitter", Georgia, serif;
  --text: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 18px/1.55 var(--text); font-variant-numeric: tabular-nums; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
b { font-weight: 800; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s2); top: -64px; background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 10px; z-index: 50; }
.skip:focus { top: var(--s2); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.wrap { max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- top row: the hat, five words ---------- */
.top { position: relative; z-index: 20; height: 72px; display: flex; align-items: center; gap: var(--s3);
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.mark img { width: 44px; height: 44px; border-radius: 10px; }
.nav { display: flex; gap: var(--s1); }
.nav a { text-decoration: none; font-weight: 700; font-size: 17px; padding: 12px 18px; border-radius: 10px; color: var(--ink-2); }
.nav a:hover { color: var(--ink); background: rgba(184, 115, 51, 0.12); }
.nav a[aria-current="page"] { color: var(--ink); background: rgba(184, 115, 51, 0.18); }
.menu { display: none; margin-left: auto; font: 700 17px var(--text); background: var(--ink); color: var(--paper); border: 0; border-radius: 12px; min-height: 48px; padding: 0 22px; cursor: pointer; }
.drawer { position: fixed; inset: 72px 0 auto 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--copper); padding: var(--s2) var(--gutter) var(--s3); box-shadow: 0 20px 40px rgba(60, 30, 10, 0.12); }
.drawer nav { display: grid; gap: var(--s1); }
.drawer a { text-decoration: none; font: 700 20px var(--text); padding: 14px 16px; border-radius: 12px; background: var(--paper-2); }

/* ---------- first screen ---------- */
.first { position: relative; display: grid; grid-template-columns: minmax(0, 41fr) minmax(0, 59fr); align-items: start;
  min-height: calc(100svh - 72px); padding-left: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); margin-top: -72px; }
.copy { position: relative; z-index: 3; padding-top: calc(72px + var(--s3)); padding-bottom: var(--s4); padding-right: var(--s3); }
.kicker { margin: 0 0 var(--s2); font-weight: 800; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--copper-ink); }
.kicker .tick { margin-left: 10px; white-space: nowrap; }
.tick { color: var(--ink); letter-spacing: 0.02em; }
.name { margin: 0; font: 850 clamp(56px, 5.95vw, 104px)/0.94 var(--display); letter-spacing: -0.025em; white-space: nowrap; }
.headline { margin: var(--s2) 0 0; font: 750 clamp(28px, 2.5vw, 40px)/1.15 var(--display); letter-spacing: -0.01em; }
.headline em { font-style: normal; color: var(--copper-ink); }
.lede { margin: var(--s2) 0 0; max-width: 34em; font-size: 18px; }
.potline { margin: var(--s2) 0 0; max-width: 34em; font-size: 17px; color: var(--ink-2); min-height: 3.2em; }
.potline .meter { display: block; height: 10px; margin-top: 10px; border-radius: 10px; background: rgba(42, 42, 42, 0.12); overflow: hidden; max-width: 420px; }
.potline .meter i { display: block; height: 100%; width: var(--fill, 0%); background: linear-gradient(90deg, var(--copper), var(--amber)); transition: width 0.4s ease-out; }
.paused { color: var(--copper-ink); font-weight: 700; }

/* the brass plate: contract, copy, pump.fun, X (generated brass, nine-sliced) */
.plate { margin-top: var(--s3); max-width: 560px; border: 30px solid transparent; border-image: url("/img/brass-v1.webp") 96 fill / 30px stretch; padding: 4px 6px 0; }
.ca { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; background: var(--paper-3); border-radius: 12px; padding: 10px 10px 10px 18px; box-shadow: inset 0 2px 4px rgba(90, 50, 10, 0.25); }
.ca-label { font-weight: 800; font-size: 16px; color: var(--copper-ink); }
.ca-value { font-family: var(--mono); font-size: 16px; color: var(--ink-2); overflow-wrap: anywhere; user-select: all; line-height: 1.35; }
.ca-value:not(.set) { font-family: var(--text); font-weight: 600; font-size: 17px; }
.ca-value.set { color: var(--ink); }
.links { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.howlink { margin-left: auto; font-weight: 800; font-size: 17px; color: var(--ink); text-underline-offset: 4px; padding: 12px 4px; }
.ca-msg { margin: 6px 0 0; min-height: 1.5em; font-size: 16px; font-weight: 700; color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 0;
  font: 800 17px/1 var(--text); text-decoration: none; cursor: pointer; transition: transform 0.12s ease-out, background-color 0.15s; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #3a3a3a; }
.btn-paper { background: var(--paper-3); color: var(--ink); box-shadow: 0 2px 0 rgba(90, 50, 10, 0.35); }
.btn-paper:hover { background: #fff8ee; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.link img { width: 22px; height: 22px; object-fit: contain; }

/* the rig: the plane (one box with the picture's aspect), rings, pulses, the tag; the console under the frame */
.rig { position: relative; z-index: 1; }
.plane { position: relative; width: min(100%, calc((100svh - 212px) * 1.5)); aspect-ratio: 1536 / 1024; margin-left: auto; }
.plane-img { width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%), linear-gradient(0deg, transparent 0, #000 5%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 6%), linear-gradient(0deg, transparent 0, #000 5%); mask-composite: intersect; }
.rings { position: absolute; inset: 0; pointer-events: none; }
.ring { position: absolute; width: var(--d); height: var(--d); margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2); background: url("/img/ring-lit-v2.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 176, 0, 0.75)); animation: ring-on 0.36s ease-out both; }
.ring.mine { background-image: url("/img/ring-mine-v2.webp"); filter: drop-shadow(0 0 10px rgba(255, 196, 40, 0.95)); z-index: 2; }
.ring.mine.hash { animation: ring-hash 0.14s ease-out; }
.ring.flip { animation: ring-flip 0.36s ease-out; }
@keyframes ring-on { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes ring-flip { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1) scale(1.15); } 100% { transform: scaleX(1); } }
@keyframes ring-hash { 0% { opacity: 0.72; } 100% { opacity: 1; } }
.pulses { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tag { position: absolute; left: 63.5%; top: -3.5%; width: 34%; transform: translateX(-50%); }
.tag img { width: 100%; filter: drop-shadow(0 8px 10px rgba(60, 30, 10, 0.3)); }
.tag-text { position: absolute; left: 14%; right: 14%; top: 39%; bottom: 10%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.tag-gb { font: 850 clamp(26px, 2.5vw, 48px)/1 var(--display); color: #3B2414; white-space: nowrap; }
.tag-sub { font: 700 clamp(16px, 1vw, 19px)/1.15 var(--display); color: #5A3A22; white-space: nowrap; }
.tag-text.invite .tag-gb { font-size: clamp(20px, 1.7vw, 30px); white-space: normal; }

.console { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s3); row-gap: 12px; align-items: center; margin: 0 0 0 auto;
  width: min(100%, max(600px, calc(min(100%, calc((100svh - 212px) * 1.5)) * 0.76))); padding-right: var(--gutter); }
.spools { display: flex; gap: 12px; border: 0; margin: 0; padding: 0; }
.spool { position: relative; display: grid; justify-items: center; width: 104px; padding: 8px 8px 10px; border-radius: 14px; cursor: pointer; transition: transform 0.15s ease-out, background-color 0.15s; }
.spool input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.spool img { height: 58px; width: auto; transition: transform 0.18s ease-out; }
.spool-mb { font-weight: 800; font-size: 17px; margin-top: 6px; }
.spool-hint { font-size: 16px; color: var(--ink-2); line-height: 1.2; }
.spool:hover { background: rgba(184, 115, 51, 0.1); }
.spool:has(input:checked) { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--copper); }
.spool:has(input:checked) img { transform: translateY(-4px); }
.spool:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.spool.off { opacity: 0.45; cursor: not-allowed; }
.go { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.go .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 800; font-size: 16px; }
.input { width: 100%; min-height: 52px; padding: 0 18px; border-radius: 12px; border: 2px solid rgba(135, 70, 26, 0.45); background: var(--paper-3); font: 500 16px var(--mono); color: var(--ink); }
.input::placeholder { font-family: var(--text); color: #8a7462; }
.input:focus { outline: none; border-color: var(--ink); }
.input.bad { border-color: #A2341B; }
/* the shuttle: the primary action, drawn as a weaving shuttle */
.shuttle { position: relative; min-height: 60px; min-width: 250px; padding: 0 40px; border: 0; border-radius: 999px; cursor: pointer; color: #2A1A08;
  font: 850 19px/1 var(--display); background: var(--amber); box-shadow: inset 0 -4px 0 rgba(140, 80, 0, 0.35), 0 6px 14px rgba(140, 80, 0, 0.25);
  transition: transform 0.12s ease-out, filter 0.15s; }
.shuttle.has-art { background: url("/img/shuttle-v1.webp") center / 100% 100% no-repeat; box-shadow: none; border-radius: 0; aspect-ratio: 2062 / 318; min-width: 340px; min-height: 0; padding: 0 20% 1.2%; filter: drop-shadow(0 6px 8px rgba(140, 80, 0, 0.3)); }
.shuttle:hover { filter: brightness(1.05); }
.shuttle:active { transform: translateY(2px); }
.shuttle.running { background-color: var(--ink); color: var(--amber); }
.shuttle.has-art.running { filter: drop-shadow(0 0 12px rgba(255, 176, 0, 0.8)); color: #2A1A08; }
.status { grid-row: 1; grid-column: 2; margin: 0; min-height: 4.6em; font-size: 16px; color: var(--ink-2); align-self: center; }
.status b { color: var(--ink); }

/* ---------- sections ---------- */
.sec { padding: var(--s7) 0 0; }
.sec:last-child { padding-bottom: var(--s7); }
.sec-head { position: relative; display: grid; gap: var(--s1); margin-bottom: var(--s5); padding-top: var(--s3); }
.sec-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--copper); }
.sec-n { font: 800 16px var(--text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--copper-ink); }
.sec-head h1, .sec-head h2 { margin: 0; font: 800 clamp(34px, 3.4vw, 48px)/1.08 var(--display); letter-spacing: -0.01em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.step img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.step h3 { margin: var(--s2) 0 var(--s1); font: 800 22px/1.2 var(--display); }
.step p { margin: 0; font-size: 17px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); align-items: stretch; }
.card { background: var(--paper-2); border-radius: var(--radius); padding: var(--s4); }
.card h3 { margin: 0 0 var(--s2); font: 800 24px/1.2 var(--display); }
.bar { margin-bottom: var(--s3); }
.bar-fill { display: block; height: 22px; width: var(--w); border-radius: 6px; background: linear-gradient(90deg, var(--copper), var(--amber)); transform-origin: left; }
.in .bar-fill { animation: grow 0.7s ease-out both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.bar p { margin: 8px 0 0; font-size: 18px; }
.note { margin: var(--s2) 0 0; font-size: 16px; color: var(--ink-2); }
.calc-big { margin: 0; font: 850 clamp(40px, 4vw, 60px)/1 var(--display); }
.calc-line { margin: var(--s2) 0 0; }

/* pages */
.page { padding-top: var(--s5); padding-bottom: var(--s7); min-height: calc(100svh - 72px); }
.empty { font-size: 18px; color: var(--ink-2); max-width: 40em; }
.lookup { display: grid; grid-template-columns: minmax(0, 560px) auto; justify-content: start; gap: 12px; align-items: end; margin-bottom: var(--s5); }
.cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.cell { background: var(--paper-2); border-radius: var(--radius); padding: var(--s3); }
.cell-k { margin: 0; font-weight: 800; font-size: 16px; color: var(--copper-ink); text-transform: uppercase; letter-spacing: 0.06em; }
.cell-v { margin: 8px 0 0; font: 850 34px/1.1 var(--display); overflow-wrap: anywhere; }
.cell-s { margin: 6px 0 0; font-size: 16px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; margin: 0 0 var(--s4); border-radius: var(--radius); background: var(--paper-2); padding: var(--s1) var(--s3); }
.t { width: 100%; border-collapse: collapse; font-size: 17px; }
.t th { text-align: left; font-weight: 800; font-size: 16px; color: var(--copper-ink); padding: 14px 12px; border-bottom: 2px solid var(--copper); white-space: nowrap; }
.t td { padding: 14px 12px; border-bottom: 1px solid rgba(184, 115, 51, 0.35); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; white-space: nowrap; }
.t a { font-weight: 700; text-underline-offset: 3px; }
.t code { font-size: 15px; }
.h3 { font: 800 26px/1.2 var(--display); margin: var(--s5) 0 var(--s2); }
.hist { display: flex; align-items: end; gap: 6px; height: 160px; padding: var(--s2) 0; }
.hist i { flex: 1 1 0; max-width: 28px; background: linear-gradient(0deg, var(--copper), var(--amber)); border-radius: 4px 4px 0 0; min-height: 4px; }

/* docs */
.docs-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); align-items: start; }
.toc { position: sticky; top: var(--s3); display: grid; gap: 4px; }
.toc a { text-decoration: none; font-weight: 700; font-size: 16px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); }
.toc a:hover { background: rgba(184, 115, 51, 0.12); color: var(--ink); }
.prose { max-width: 46em; }
.prose h2 { font: 800 30px/1.2 var(--display); margin: var(--s5) 0 var(--s2); scroll-margin-top: var(--s3); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 18px; }
.prose pre { background: var(--paper-2); border-radius: 12px; padding: var(--s2) var(--s3); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.prose ul { padding-left: 1.2em; }
.doc-pic { width: 100%; max-width: 640px; border-radius: var(--radius); margin: var(--s2) 0; }
.risk { margin-top: var(--s5); padding-top: var(--s2); border-top: 1px solid var(--copper); font-size: 16px !important; color: var(--ink-2); }
.noscript { padding: var(--s3); text-align: center; }

/* ---------- widths ---------- */
@media (max-width: 1180px) {
  .first { grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); }
  .console { width: 100%; grid-template-columns: 1fr; padding-left: var(--s3); }
  .status { grid-row: auto; grid-column: 1; min-height: 3.2em; }
}
@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-grid { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .top { height: 64px; }
  .nav { display: none; }
  .menu { display: inline-flex; align-items: center; }
  .drawer { inset: 64px 0 auto 0; }
  /* phone: name, headline, then the plane right under them; the copy, the spools and the plate follow */
  .first { display: flex; flex-direction: column; padding: 0 var(--gutter); margin: 0; min-height: 0; }
  .copy, .rig { display: contents; }
  .kicker { order: 1; margin-top: var(--s2); } .name { order: 2; } .headline { order: 3; }
  .plane { order: 4; margin-top: var(--s3); }
  .lede { order: 5; margin-top: var(--s3); } .potline { order: 6; }
  .console { order: 7; } .plate { order: 8; }
  .name { font-size: clamp(44px, 12.6vw, 60px); white-space: normal; }
  .headline { font-size: 26px; margin-top: var(--s2); }
  .lede, .potline { font-size: 17px; }
  .plane { width: 100%; aspect-ratio: 1024 / 1536; }
  .plane-img { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%); mask-composite: add; }
  .tag { left: 50%; top: -2.5%; width: 66%; }
  .tag-gb { font-size: clamp(28px, 8.4vw, 38px); }
  .tag-sub { font-size: 16px; }
  .console { width: 100%; margin: var(--s3) 0 0; padding: 0; grid-template-columns: 1fr; gap: var(--s2); }
  .spools { justify-content: space-between; }
  .spool { width: calc((100% - 24px) / 3); }
  .go { grid-template-columns: 1fr; padding: 0; }
  .status { grid-row: auto; grid-column: 1; min-height: 4.8em; }
  .shuttle, .shuttle.has-art { position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 25; min-width: 0; }
  .shuttle, .shuttle.has-art { height: 66px; aspect-ratio: auto; padding: 0 22% 2px; line-height: 1.1; }
  .plate { margin: var(--s3) 0 calc(var(--s7) + 8px); border-width: 22px; border-image-width: 22px; padding: 2px 0 0; max-width: none; }
  .ca { grid-template-columns: 1fr; padding: 14px 20px; }
  .ca .ca-copy { justify-self: start; }
  .sec { padding-top: var(--s6); }
  .steps, .split, .cells { grid-template-columns: 1fr; }
  .lookup { grid-template-columns: 1fr; }
  .page { padding-top: var(--s3); }
}
@media (max-width: 420px) {
  .tag { width: 86%; }
  .tag-text { left: 10%; right: 10%; }
}
@media (max-width: 360px) {
  .spool-hint { display: none; }
  .shuttle, .shuttle.has-art { padding: 0 13% 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
