/* GOVERNOR. Layout type follows the user's reference (sonnarh.com): near-black stage, giant
   tight grotesk headlines with a dim second line, a cut-out subject overlapping the type,
   hairline panels, one accent. Subject = the user's oni samurai render ("the code decides":
   bushido is a code). Accent = the red thread in its robe. */
:root {
  --stage: #060606;
  --panel: #0e0e0e;
  --panel-2: #151515;
  --rule: #1d1d1d;
  --rule-2: #2b2b2b;
  --ink: #f1f1f1;
  --ink-2: #a9a9a9;
  --ink-3: #6a6a6a;
  --sage: #e6e6e6;
  --signal: #ff4433;
  --signal-ink: #140504;
  --up: #6fd59a;
  --down: #ff6a55;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 6px;
  --gut: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; overflow-x: clip; }
body {
  background: var(--stage); color: var(--ink); font: 400 16px/1.55 var(--display);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, canvas, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.035em; line-height: 1; }
p { margin: 0; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--stage); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.muted { color: var(--ink-3); }
.up { color: var(--up); } .down { color: var(--down); }

/* header: logo left, links centred, square X + white CTA right */
header.top { position: sticky; top: 0; z-index: 30; background: linear-gradient(var(--stage) 30%, transparent); }
header.top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; height: 92px; max-width: none; padding: 0 clamp(16px, 4vw, 60px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 26px; letter-spacing: -.04em; }
.brand svg { width: 30px; height: 30px; }
nav.links { display: flex; gap: 46px; font: 400 14px/1 var(--display); }
nav.links a { text-decoration: none; color: var(--ink-2); padding: 10px 0; position: relative; }
nav.links a:hover { color: var(--ink); }
nav.links a[aria-current="page"] { color: var(--ink); font-weight: 500; }
nav.links a[aria-current="page"]::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 0; height: 1px; background: var(--ink); }
.top .right { justify-self: end; display: flex; gap: 10px; align-items: center; }
.sq { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--rule-2); color: var(--ink); }
.sq:hover { border-color: var(--ink-3); }
.btn.white { background: var(--ink); color: #0a0a0a; border-color: var(--ink); border-radius: 0; height: 44px; padding: 0 44px; font-weight: 500; }
.btn.white:hover { background: #fff; }

/* floating token pill (coin-site contract ids: lb-ca lb-copy lb-buy lb-chart) */
.capill {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 99px;
  background: rgba(12, 10, 10, .86); backdrop-filter: blur(12px); border: 1px solid rgba(255, 68, 51, .45);
  box-shadow: 0 0 40px rgba(255, 68, 51, .12); font: 500 13px/1 var(--mono); white-space: nowrap; max-width: calc(100vw - 24px);
}
.capill i { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); }
.capill b { color: var(--signal); font-weight: 600; }
.capill #lb-ca { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.capill button { background: var(--ink); color: #0a0a0a; border: 0; border-radius: 99px; padding: 8px 13px; cursor: pointer; font: 500 13px var(--display); }
.capill .x { display: grid; place-items: center; width: 34px; height: 30px; border-radius: 99px; background: #222; color: var(--ink); }
.sr-link { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; cursor: pointer; text-decoration: none;
  border: 1px solid var(--rule-2); background: var(--panel); color: var(--ink); border-radius: var(--r);
  padding: 11px 16px; font: 600 14px/1 var(--display); transition: background .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}
.btn:hover { border-color: var(--ink-3); background: var(--panel-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.btn.primary:hover { background: #ff7457; }
.btn.small { padding: 8px 11px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule-2); }
.link:hover { text-decoration-color: var(--signal); }

/* panels and data */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; }
.hair { border-top: 1px solid var(--rule); }
.label { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font: 13px/1.4 var(--mono); }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: .06em; padding: 5px 7px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink-2); text-transform: uppercase; }
.chip.buy { color: var(--up); border-color: #2f5a3f; } .chip.sell { color: var(--down); border-color: #6a3326; }
.chip.hi { color: var(--signal); border-color: #6a3326; }
.chip.on { color: var(--stage); background: var(--sage); border-color: var(--sage); }
table.data { width: 100%; border-collapse: collapse; font: 13px/1.35 var(--mono); }
table.data th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* forms */
.field { display: grid; gap: 6px; }
.field label { font: 500 12px/1.2 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input {
  width: 100%; background: #0d1411; border: 1px solid var(--rule-2); border-radius: var(--r); padding: 10px 12px; font: 14px/1.3 var(--mono);
}
.input:focus { outline: none; border-color: var(--sage); }
.input-unit { display: flex; align-items: stretch; }
.input-unit .input { border-radius: var(--r) 0 0 var(--r); }
.input-unit span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--rule-2); border-left: 0; border-radius: 0 var(--r) var(--r) 0; font: 12px var(--mono); color: var(--ink-3); background: var(--panel); }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; }
.seg button { background: none; border: 0; padding: 9px 14px; cursor: pointer; font: 600 12px/1 var(--mono); letter-spacing: .05em; color: var(--ink-2); text-transform: uppercase; }
.seg button + button { border-left: 1px solid var(--rule-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--stage); }
.err { color: var(--down); font: 13px/1.4 var(--mono); }
.note { font-size: 13px; color: var(--ink-3); }

/* footer */
footer.foot { border-top: 1px solid var(--rule); margin-top: 120px; padding: 64px 0 90px; overflow: hidden; }
.foot-top { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; }
.foot-top .kick { font: 500 12px var(--display); letter-spacing: .12em; color: var(--signal); margin-bottom: 26px; }
.foot-top p { color: var(--ink-2); font-size: 14px; }
footer.foot nav { display: flex; gap: 28px; flex-wrap: wrap; font-size: 14px; }
footer.foot a { text-decoration: none; color: var(--ink-2); } footer.foot a:hover { color: var(--ink); }
.giant { font: 500 clamp(6rem, 24vw, 22rem)/.8 var(--display); letter-spacing: -.07em; color: #141414; text-align: center; margin: 70px 0 30px; user-select: none; }
.foot-bot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--stage); padding: 10px 14px; border-radius: var(--r); font: 600 13px/1.3 var(--mono); transition: .25s var(--ease); z-index: 50; max-width: calc(100vw - 32px); pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--signal); color: var(--signal-ink); }

/* page head (app pages) */
.phead { padding: 56px 0 28px; display: grid; gap: 14px; }
.phead h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.045em; }
.phead p { max-width: 62ch; color: var(--ink-2); font-size: 17px; }

.js .rise { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .rise.in { opacity: 1; transform: none; }

@media (max-width: 1100px) { nav.links { gap: 26px; } .btn.white { padding: 0 20px; } }
@media (max-width: 860px) {
  nav.links { display: none; }
  header.top .wrap { gap: 10px; height: 68px; grid-template-columns: 1fr auto; }
  .brand { font-size: 22px; }
  .sq, .btn.white, #wallet { display: none; }
  .capill #lb-ca { max-width: 120px; }
  nav.links.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--stage); border-bottom: 1px solid var(--rule); padding: 8px var(--gut) 16px; }
  nav.links.open a { padding: 12px 0; }
  .menu { display: inline-flex !important; }
}
.menu { display: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* pair logos (G.logo / G.tk) */
.tkl { display: inline-block; border-radius: 50%; flex: none; vertical-align: middle; }
.tk { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tks { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; }

/* admin-set announcement (/v1/site banner) */
.site-banner { position: relative; z-index: 60; background: var(--signal); color: var(--signal-ink); text-align: center; font: 600 13px/1.3 var(--display); padding: 9px 16px; }
body.app .site-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); border-radius: 99px; max-width: calc(100vw - 32px); }
@media (max-width: 900px) { body.app .site-banner { bottom: 84px; } }
