@font-face { font-family: "Jacquard 12"; src: url("/fonts/jacquard12.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jbmono.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* One system. Colours from the chart: deep, water, shallows, sand, parchment, ochre (the only accent).
   Type 16 / 20 / 24 / 32 / 48 (16 is the floor). Space 4 / 8 / 12 / 16 / 24 / 32 / 48. */
:root {
  --deep: #0B2A3B; --water: #134B5F; --shallow: #2F7F86; --sand: #D9C08A; --paper: #EFE3C2; --paper-2: #E4D5AE;
  --ochre: #C9963A; --ochre-dark: #6E4A14; --ink: #0B2A3B; --ink-soft: #3E5560;
  --display: "Jacquard 12", serif; --text: "Hanken Grotesk", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: 24px; --gap: 16px; --col: 320px; --max: 1600px;
  --shadow: 0 4px 0 rgba(6, 22, 31, 0.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--deep); color: var(--ink); font: 400 16px/1.5 var(--text); }
body { -webkit-font-smoothing: antialiased; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: default; outline: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 16px; }
[hidden] { display: none !important; }
a { color: inherit; }
img { image-rendering: pixelated; }
.crisp { display: block; }

/* ---- one card style: parchment, 2 px ink border, one shadow ---------------------------------------------------- */
.card { background: var(--paper); border: 2px solid var(--ink); padding: var(--pad); box-shadow: var(--shadow); }
.card-head { margin: 0; font-weight: 700; font-size: 16px; }
.small { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--ink); }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* ---- buttons: one height, one border, every state ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper); font: 700 16px/1 var(--text); text-decoration: none;
  cursor: pointer; box-shadow: var(--shadow); transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(6, 22, 31, 0.55); }
.btn.ghost:hover { background: #F7EED6; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(6, 22, 31, 0.55); }
.btn:focus-visible, .nav a:focus-visible, .dig:focus-visible, .close:focus-visible, .cartouche-plate:focus-visible, .back:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.btn[aria-disabled="true"] { background: var(--paper-2); color: var(--ink-soft); border-color: var(--ink-soft); cursor: not-allowed; box-shadow: none; transform: none; }
.btn[aria-disabled="true"] img { opacity: 0.6; }
.btn.small { min-height: 40px; padding: 0 16px; }
.btn img { width: 20px; height: 20px; image-rendering: auto; flex: none; }
.close { position: absolute; top: 12px; right: 12px; min-height: 40px; padding: 0 12px; border: 0; background: none; font: 700 16px var(--text); color: var(--ink); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.close:hover { color: var(--ochre-dark); }
.tag { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px; background: var(--deep); color: var(--paper); font: 700 16px/1 var(--text); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }

/* ---- the container: one max width, one inset; left column | the chart (strip on top, frame below) ------------ */
.ui {
  position: fixed; inset: 0; margin: 0 auto; max-width: var(--max); padding: var(--pad);
  display: grid; grid-template-columns: var(--col) minmax(0, 1fr); gap: var(--pad);
}
.col-left { display: flex; flex-direction: column; gap: 12px; align-self: start; min-width: 0; overflow: visible; }
.col-left > * { flex: none; min-width: 0; max-width: 100%; }
.col-map { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.mapframe { position: relative; flex: 1; min-height: 0; border: 2px solid var(--ink); box-shadow: var(--shadow); overflow: hidden; background: var(--deep); }
.mapframe .rose { position: absolute; right: 8px; bottom: 8px; pointer-events: none; opacity: 0.65; filter: none; }

/* cartouche: the plate is a pixel picture shown at a whole-number scale (js/app.js sets its size and --col) */
.cartouche-plate { position: relative; display: block; width: var(--col); text-decoration: none; }
.cartouche-plate img { aspect-ratio: 160 / 87; }
.cartouche-plate img { width: 100%; height: auto; }
.cartouche h1 { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; text-align: center; font: 400 48px/0.9 var(--display); color: var(--ink); padding-bottom: 4px; }
.nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: var(--col); }
.nav a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; background: var(--paper); border: 2px solid var(--ink); font: 700 16px/1 var(--text); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); transition: transform 80ms steps(2); }
.nav a:hover { transform: translateY(-2px); background: #F7EED6; }
.nav a:active { transform: translateY(4px); box-shadow: none; }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* practice card: the same width and left edge as the cartouche */
.practice { width: var(--col); padding: 16px 20px; }
.practice .btn, .links .lbtn { min-height: 44px; }
.practice .row { margin-top: 12px; }
.hashrow { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 8px 8px 8px 16px; background: var(--paper-2); }
.hashrow .mono { flex: 1; min-width: 0; white-space: nowrap; }

/* the strip: the chart's width, one line: the tag, then label + value pairs spread over the width */
.strip { display: flex; align-items: center; gap: 24px; padding: 12px 20px; background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.strip .tag { min-height: 36px; padding: 11px 16px; }
.strip .cell { flex: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.strip .lbl { font-size: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.strip b { font: 700 24px/1 var(--text); font-variant-numeric: tabular-nums; color: var(--ink); }

/* links: the contract card in the left column. Wide column: the address, then pump.fun / X / Copy CA as three
   equal columns. Narrow column (320): Copy CA beside the address (like Copy beside the hash), pump.fun and X equal. */
.links { width: var(--col); padding: 16px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  grid-template-areas: "head head head" "addr addr addr" "pump x copy" "note note note"; }
.links .card-head { grid-area: head; }
.carow { display: contents; }
.links .address { grid-area: addr; margin: 0; padding: 12px 16px; background: var(--paper-2); font-size: 16px; overflow-wrap: anywhere; }
.links .address.is-ca { font-family: var(--mono); user-select: all; }
.links .l-pump { grid-area: pump; } .links .l-x { grid-area: x; } .links #ca-copy { grid-area: copy; }
.links .small { grid-area: note; margin: 0; }
.lbtn { width: 100%; min-width: 0; padding: 0 20px; gap: 6px; white-space: nowrap; }
.lbtn img { width: 18px; height: 18px; }
@media (max-width: 1279px), (max-height: 799px) {
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "head head" "carow carow" "pump x" "note note"; }
  .carow { grid-area: carow; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; background: var(--paper-2); }
  .carow .address { flex: 1; min-width: 0; padding: 0; background: none; }
  .carow #ca-copy { width: auto; flex: none; padding: 0 16px; min-height: 40px; }
}
.rose { width: 80px; height: 80px; flex: none; }

/* ---- the tile card -------------------------------------------------------------------------------------------------------- */
.tilecard { position: fixed; width: 384px; z-index: 5; padding: 32px; }
.tile-name { margin: 0; font: 400 48px/1 var(--display); padding-right: 64px; }
.tile-kind { margin: 4px 0 0; font-weight: 700; }
.tile-note { margin: 8px 0 0; }
.tile-note:empty, .tile-result:empty { display: none; }
.digrow { display: flex; align-items: center; gap: 24px; margin-top: 16px; }
.dig { position: relative; width: auto; height: auto; flex: none; border: 0; padding: 0; background: none; cursor: pointer; }
.dig img { width: 96px; height: 96px; display: block; filter: drop-shadow(0 0 12px rgba(230, 170, 60, 0.7)); transition: transform 80ms steps(2); }
.dig span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 400 32px/1 var(--display); color: var(--deep); }
.dig:hover img { transform: translateY(-2px); }
.dig:active img, .dig.pressed img { transform: translateY(4px) scale(0.96); }
.dig[aria-disabled="true"] { cursor: not-allowed; }
.dig[aria-disabled="true"] img { filter: grayscale(1) brightness(0.85); }
.digcost { display: flex; flex-direction: column; gap: 4px; }
.digcost b { font: 700 24px/1 var(--text); }
.tile-result { margin: 16px 0 0; padding: 12px 16px; background: var(--paper-2); overflow-wrap: anywhere; }
.tile-result .mono, .tile-result .check { word-break: break-all; }
.tile-result strong { display: block; font-size: 20px; margin-bottom: 4px; }
.tile-result.found { box-shadow: inset 6px 0 0 var(--ochre); padding-left: 24px; }

/* ---- wallet chooser ------------------------------------------------------------------------------------------------- */
.wallets { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 400px; z-index: 9; }
.wlist { display: grid; gap: 12px; margin-top: 12px; }
.wlist .btn { justify-content: flex-start; }
.wlist img { width: 24px; height: 24px; }

/* ---- sheets: Docs, Finds, My digs ------------------------------------------------------------------------------------- */
.sheet { position: fixed; inset: 0; z-index: 8; background: rgba(6, 22, 31, 0.6); display: flex; justify-content: center; overflow-y: auto; padding: 48px 24px; }
.sheet-paper { position: relative; width: 800px; max-width: 100%; align-self: flex-start; background: var(--paper); border: 2px solid var(--ink); padding: 32px 48px 48px; box-shadow: 0 8px 0 rgba(6, 22, 31, 0.6); }
.back { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; }
.back:hover { color: var(--ochre-dark); }
.sheet h2 { margin: 16px 0 8px; font: 400 48px/1 var(--display); }
.sheet h3 { margin: 48px 0 8px; font: 400 32px/1 var(--display); }
.sheet p, .sheet li { max-width: 68ch; }
.sheet .lede { font-size: 20px; margin: 8px 0 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0 0; padding: 0; list-style: none; }
.steps li { background: var(--paper-2); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.steps li img { width: 64px; height: 64px; object-fit: contain; }
.steps li b { font: 400 24px/1 var(--display); }
.memo { display: block; margin: 8px 0; padding: 12px 16px; background: var(--paper-2); font-family: var(--mono); font-size: 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
table.rows { width: 100%; border-collapse: collapse; margin-top: 16px; }
table.rows th { text-align: left; font-weight: 700; padding: 8px 12px 8px 0; border-bottom: 2px solid var(--ink); }
table.rows td { padding: 12px 12px 12px 0; border-bottom: 1px solid rgba(11, 42, 59, 0.3); vertical-align: top; font-variant-numeric: tabular-nums; }
.find { margin-top: 24px; padding: 24px; background: var(--paper-2); }
.find h4 { margin: 0; font: 400 32px/1 var(--display); }
.check { display: block; margin-top: 4px; font-weight: 700; }
.check.ok { color: #1D5C44; }
.check.bad { color: var(--ochre-dark); }
.form { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.form input { flex: 1 1 280px; min-height: 48px; padding: 0 16px; border: 2px solid var(--ink); background: #F7EFD8; font: 500 16px var(--mono); color: var(--ink); }
.form input:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }

.err { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; padding: 12px 24px; background: var(--paper); border: 2px solid var(--ochre-dark); z-index: 10; max-width: calc(100% - 48px); }

/* ---- widths ----------------------------------------------------------------------------------------------------------- */
.cartouche h1 { font-size: 32px; }
@media (min-width: 1280px) and (min-height: 800px) { :root { --col: 480px; } .cartouche h1 { font-size: 48px; } }

@media (max-height: 940px) and (min-width: 1024px) { .practice .p-intro, #p-replay, #links-note { display: none; } }
/* below 1024 the page stacks and scrolls: cartouche, nav, strip, the chart, the practice chest, the contract */
@media (max-width: 1023px) {
  :root { --pad: 16px; --col: 240px; --gap: 12px; }
  html, body { overflow: auto; height: auto; }
  .ui { position: static; display: flex; flex-direction: column; gap: 12px; }
  .col-left { display: contents; }
  .cartouche { order: 1; }
  .nav { order: 2; width: 100%; gap: 8px; }
  .col-map { order: 3; }
  .mapframe { flex: none; height: max(360px, 58vh); }
  .practice { order: 4; width: 100%; }
  .links { order: 5; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "head head head" "addr addr addr" "pump x copy" "note note note"; }
  .carow { display: contents; }
  .carow .address { padding: 12px 16px; background: var(--paper-2); }
  .carow #ca-copy { width: 100%; min-height: 48px; }
  .strip { padding: 12px 16px; gap: 16px; }
  .rose { width: 48px; height: 48px; }
  .mapframe .rose { right: 8px; bottom: 8px; }
  .tilecard { left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; width: auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); border-width: 2px 0 0; z-index: 7; }
  .tile-name { font-size: 32px; }
  .wallets { width: calc(100% - 24px); }
  .sheet { padding: 16px 8px; }
  .sheet-paper { padding: 24px 16px 32px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .nav a { min-height: 44px; padding: 0 12px; }
  .strip { flex-wrap: wrap; gap: 8px 16px; }
  .strip .tag { min-height: 36px; padding: 11px 16px; }
  .strip .cell { flex: 0 1 auto; }
  .strip b { font-size: 20px; }
  .links { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "head head" "carow carow" "pump x" "note note"; }
  .carow { grid-area: carow; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; background: var(--paper-2); }
  .carow .address { flex: 1; min-width: 0; padding: 0; background: none; }
  .carow #ca-copy { width: auto; flex: none; padding: 0 16px; min-height: 40px; }
  .lbtn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* short laptop screens: the left column keeps every block on screen without scrolling */
@media (max-height: 760px) and (min-width: 1024px) { :root { --pad: 16px; } }
@media (max-width: 359px) {
  .links { grid-template-columns: 1fr; grid-template-areas: "head" "carow" "pump" "x" "note"; }
}
