/*
 * Stockimus marketing shell (css/site.css).
 *
 * The base block every marketing page shares: tokens, base type, the sticky nav and its mobile sheet, buttons,
 * headings, pills, key/value lists, code cards, column cards, the footer, toasts and the fixed background canvases.
 * Pages add their own page CSS after this file. js/site.js renders the markup this file styles:
 *
 *   <body>
 *   <canvas id="bgfx" data-corner="1" aria-hidden="true"></canvas><canvas id="bgmark" aria-hidden="true"></canvas>
 *   <header data-site="nav"></header>                  optional: data-page="docs" (current page), data-fixed (landing)
 *   ... page ...
 *   <footer data-site="footer"></footer>              optional: data-flush (no top margin)
 *   <script type="module" src="/js/site.js"></script>
 *
 * Colour rules: red (--acc) is the brand, the yToken and the focus ring; small red text uses --acc-hi, which keeps
 * 4.5:1 on --bg. Blue is the pToken. --up/--down only for deltas and synced dots. Do not set a background on <html>:
 * the body background has to propagate to the canvas so the fixed z-index:-1 background stays visible.
 */
@import url('/fonts/fonts.css');

:root {
  --bg: #0A0909; --s1: #121010; --s2: #191515; --s3: #221C1C;
  --hair: rgba(255,255,255,.06); --hair2: rgba(255,255,255,.10);
  --t1: #F4F1F1; --t2: #ADA5A5; --t3: #8A8181;
  --t3-aa: #8A8181; /* t3 lifted to 4.5:1 on --bg and --s1, for small meta text (footer, notes) */
  --acc: #E8141B; --acc-hi: #FF3B3B; --acc-ink: #FFFFFF; --acc-glow: rgba(232,20,27,.45);
  --acc-dim: rgba(232,20,27,.12); --acc-dim2: rgba(232,20,27,.18);
  --blue: #4FB4FF; --blue-hi: #8FD0FF; --blue-dim: rgba(79,180,255,.12);
  --amb: #E3B93C; --up: #3DDC97; --down: #FF6B5A;
  --f-xs: 11px; --f-sm: 12.5px; --f-md: 14px; --f-lg: 18px; --f-xl: 28px;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Archivo", -apple-system, system-ui, sans-serif;
  --pixel: "Silkscreen", "Geist Mono", ui-monospace, monospace;
  --nav-h: 64px;
  --gut: 24px;
  --shadow: none;
  /* alias names used by CSS ported from the original pages */
  --red: var(--down); --green: var(--up); --amber: var(--amb);
  --bg-2: var(--s2); --surface: var(--s1); --surface-2: var(--s1); --line: var(--hair); --line-2: var(--hair2);
  --text: var(--t1); --muted: var(--t2); --dim: var(--t3); --ink: var(--acc-ink);
  color-scheme: dark;
}
@media (max-width: 760px) { :root { --nav-h: 60px; --gut: 16px; } }

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { background: var(--bg); color: var(--t1); font-family: var(--sans); font-size: var(--f-md); line-height: 1.55; font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--acc-hi); text-decoration: none; }
a:hover { color: #FF6A6A; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(232,20,27,.35); color: #FFFFFF; }
code { font-family: var(--mono); font-size: .95em; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--acc-hi); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: 10px; z-index: 120; min-height: 44px; display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 9px; background: var(--acc); color: var(--acc-ink); font-weight: 600; transform: translateY(-160%); transition: transform .15s ease; }
.skip:focus, .skip:focus-visible { transform: none; color: var(--acc-ink); }

#bgfx, #bgmark { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
#bgmark { transition: opacity .25s linear; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); }

/* ------------------------------------------------------------------- nav */
/* The header is the sticky element (a sticky child would be pinned inside a header of its own height). Its
   min-height reserves the bar before js/site.js renders it, so nothing below moves. */
header[data-site="nav"] { display: block; position: sticky; top: 0; z-index: 40; min-height: calc(var(--nav-h) + 1px + env(safe-area-inset-top)); }
header[data-site="nav"][data-fixed] { position: fixed; left: 0; right: 0; }
.nav { background: rgba(10,9,9,.82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair); padding-top: env(safe-area-inset-top); }
header[data-fixed] .nav { background: rgba(10,9,9,.72); }
.nav-in { max-width: 1200px; margin: 0 auto; height: var(--nav-h); padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); display: flex; align-items: center; gap: 28px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--t1); flex: none; min-height: 44px; }
.brand:hover { color: var(--t1); }
.brand-logo { position: relative; display: block; width: 28px; height: 28px; flex: none; }
.brand-logo img { display: block; width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.08); transition: box-shadow .25s ease; }
.brand:hover .brand-logo img, .brand:focus-visible .brand-logo img { box-shadow: 0 0 0 1px rgba(232,20,27,.55), 0 0 14px rgba(232,20,27,.45); }
.brand .word { font-family: var(--pixel); font-weight: 700; font-size: 13px; letter-spacing: .14em; line-height: 1; white-space: nowrap; }
/* the drip: one red pixel falls from under the logo while the brand is hovered (the original's P dripped green) */
.nav-drip { position: absolute; left: 12px; top: 30px; width: 4px; height: 4px; background: var(--acc); box-shadow: 0 0 6px rgba(232,20,27,.8); opacity: 0; pointer-events: none; }
.brand:hover .nav-drip, .brand:focus-visible .nav-drip { animation: navdrip 1.1s ease-in infinite; }
@keyframes navdrip { 0% { opacity: 0; transform: translateY(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 22px; min-width: 0; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 13.5px; color: var(--t2); }
.nav-links a { color: var(--t2); white-space: nowrap; position: relative; padding: 8px 0; }
.nav-links a.on, .nav-links a:hover { color: var(--t1); }
.nav-links a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 1px; background: var(--acc); }
.nav-coin { display: flex; align-items: center; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 8px; background: var(--s2); color: var(--t1); font-size: var(--f-sm); font-weight: 500; white-space: nowrap; transition: background-color .15s ease, box-shadow .2s ease, color .15s ease; }
.btn:hover { background: var(--s3); color: var(--t1); }
.btn.acc, .btn.p { background: var(--acc); color: var(--acc-ink); font-weight: 600; }
.btn.acc:hover, .btn.p:hover { background: var(--acc); color: var(--acc-ink); box-shadow: 0 0 0 1px rgba(255,255,255,.10), 0 6px 22px var(--acc-glow); }
.btn.acc:active, .btn.p:active { background: #C9101A; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 11px; }
.btn[aria-disabled="true"], .btn:disabled { cursor: default; }
.nav .btn { height: 36px; padding: 0 16px; font-size: 13.5px; border-radius: 9px; }
/* $STOCKIMUS controls: quiet outlined pills; disabled "soon" state until js/config.js TOKEN is filled */
.btn.coin { background: none; color: var(--t2); box-shadow: inset 0 0 0 1px var(--hair2); font-weight: 500; }
.btn.coin:hover { background: var(--s2); color: var(--t1); }
.btn.coin[aria-disabled="true"], .btn.coin:disabled { color: var(--t3-aa); background: none; box-shadow: inset 0 0 0 1px var(--hair); }
.btn.coin.coin-buy:not([aria-disabled="true"]) { color: var(--t1); box-shadow: inset 0 0 0 1px rgba(232,20,27,.55); }
.btn.coin.coin-buy:not([aria-disabled="true"]):hover { background: var(--acc-dim); box-shadow: inset 0 0 0 1px var(--acc), 0 0 18px rgba(232,20,27,.25); }
.nav .btn.coin { padding: 0 13px; font-size: 13px; }

.nav-burger { display: none; position: relative; width: 44px; height: 44px; margin-right: -10px; border-radius: 10px; align-items: center; justify-content: center; color: var(--t1); flex: none; }
.nav-burger:hover { background: var(--s2); }
.nav-burger svg { width: 22px; height: 22px; display: block; }

/* mid widths: everything still fits on one line (full size needs about 980px) */
@media (max-width: 1000px) and (min-width: 901px) {
  .nav-in { gap: 20px; }
  .nav-right { gap: 14px; }
  .nav-links { gap: 18px; font-size: 13px; }
  .nav-coin { gap: 6px; }
  .nav .btn { padding: 0 13px; font-size: 13px; }
  .nav .btn.coin { padding: 0 10px; font-size: 12px; height: 32px; }
}
@media (max-width: 940px) and (min-width: 901px) {
  .nav-in { gap: 14px; padding-left: 20px; padding-right: 20px; }
  .nav-right { gap: 12px; }
  .nav-links { gap: 14px; }
  .nav .btn.coin { padding: 0 9px; }
}
/* phones and tablets: logo, Open the app and the menu button; everything else lives in the sheet */
@media (max-width: 900px) {
  .nav-links, .nav-coin { display: none; }
  .nav-right { gap: 12px; }
  .nav-burger { display: inline-flex; }
  .nav .btn.nav-app { height: 44px; border-radius: 10px; }
}
@media (max-width: 374px) {
  .nav .btn.nav-app { padding: 0 12px; font-size: 13px; }
  .brand { gap: 8px; }
  .brand .word { font-size: 12px; letter-spacing: .1em; }
}
@media (max-width: 339px) {
  .nav .btn.nav-app { display: none; }
}

/* ---------------------------------------------------------- mobile sheet */
.menu { position: fixed; inset: 0; z-index: 100; display: none; }
.menu.is-mounted { display: block; }
.menu-scrim { position: absolute; inset: 0; background: rgba(5,4,4,.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; transition: opacity .22s ease; }
.menu-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, calc(100% - 44px)); display: flex; flex-direction: column; background: var(--s1); border-left: 1px solid var(--hair2); box-shadow: -24px 0 60px rgba(0,0,0,.5); transform: translateX(104%); transition: transform .26s cubic-bezier(.2,.8,.2,1); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) 0; }
.menu.is-open .menu-scrim { opacity: 1; }
.menu.is-open .menu-sheet { transform: none; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--nav-h); padding: 0 6px 0 20px; border-bottom: 1px solid var(--hair); flex: none; }
.menu-close { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--t1); flex: none; }
.menu-close:hover { background: var(--s2); }
.menu-close svg { width: 22px; height: 22px; display: block; }
.menu-links { display: flex; flex-direction: column; padding: 10px 10px 6px; }
.menu-links a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: 10px; color: var(--t1); font-size: 16px; font-weight: 500; }
.menu-links a:hover { background: var(--s2); color: var(--t1); }
.menu-links a svg { width: 18px; height: 18px; color: var(--t3-aa); flex: none; }
.menu-links a.on { background: var(--s2); }
.menu-links a.on::before { content: ""; position: absolute; left: 0; top: 15px; bottom: 15px; width: 3px; border-radius: 2px; background: var(--acc); }
.menu-links a small { margin-left: 10px; margin-right: auto; font-size: 13px; font-weight: 400; color: var(--t3-aa); }
.menu-coin { display: grid; gap: 8px; padding: 10px 20px 0; }
.menu-coin .btn { height: 48px; width: 100%; font-size: 14px; border-radius: 11px; }
.menu-app { padding: 12px 20px 0; }
.menu-app .btn { height: 52px; width: 100%; font-size: 15px; border-radius: 12px; }
.menu-foot { margin-top: auto; padding: 24px 20px 20px; font-size: 12px; color: var(--t3-aa); display: flex; flex-direction: column; gap: 2px; }
html.menu-lock { overflow: hidden; }
html.menu-lock body { padding-right: var(--sbw, 0px); }
html.menu-lock header[data-site="nav"][data-fixed] { right: var(--sbw, 0px); }
@media (min-width: 901px) { .menu, .menu.is-mounted { display: none; } }

/* -------------------------------------------------------------- headings */
h1 { font-size: var(--f-xl); font-weight: 500; letter-spacing: -.01em; line-height: 1.2; margin: 56px 0 10px; }
h1 b { color: var(--acc); font-weight: 500; }
.lead, .sub { color: var(--t2); max-width: 680px; margin: 0 0 28px; font-size: 15px; }
.lead b, .sub b { color: var(--t1); font-weight: 500; }
h2 { font-size: var(--f-lg); font-weight: 500; letter-spacing: 0; color: var(--t1); margin: 44px 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h2 .n { font-family: var(--mono); font-size: var(--f-xs); color: var(--acc-hi); }
h2 .asof, h2 #asOf { font-family: var(--mono); font-size: var(--f-xs); color: var(--t3-aa); margin-left: auto; letter-spacing: 0; }
.note { font-size: var(--f-sm); color: var(--t3-aa); margin-top: 12px; line-height: 1.55; }
.note b { color: var(--t2); font-weight: 500; }

/* ----------------------------------------------------------------- pills */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 6px; font-size: 10.5px; letter-spacing: .04em; background: var(--s2); color: var(--t2); vertical-align: middle; white-space: nowrap; }
.pill.ok { color: var(--up); background: rgba(61,220,151,.12); }
.pill.hold { color: var(--amb); background: rgba(227,185,60,.12); }
.pill.soon { color: var(--blue-hi); background: var(--blue-dim); }
.pill.bad { color: var(--down); background: rgba(255,107,90,.12); }
.pill.acc { color: var(--acc-hi); background: var(--acc-dim); }

/* ---------------------------------------------------- key / value lists */
.kvs { background: var(--s1); border-radius: 14px; padding: 6px 20px; }
.kv { display: flex; justify-content: space-between; gap: 16px; min-height: 44px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hair); font-size: var(--f-sm); }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--t2); white-space: nowrap; }
.kv .v { font-family: var(--mono); color: var(--t1); text-align: right; word-break: break-all; }
.kv .v a { color: var(--t1); } .kv .v a:hover { color: var(--acc-hi); }

/* ------------------------------------------------------------ code card */
pre { background: var(--s1); border-radius: 14px; padding: 18px 20px; font-family: var(--mono); font-size: var(--f-sm); line-height: 1.7; color: var(--t2); overflow-x: auto; }
pre b { color: var(--t1); font-weight: 500; } pre .c { color: var(--t3-aa); } pre .g { color: var(--acc-hi); } pre .b { color: var(--blue-hi); }

/* --------------------------------------------------------- column cards */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.col { background: var(--s1); border-radius: 14px; padding: 20px 22px; min-width: 0; }
.col .h { font-family: var(--mono); font-size: var(--f-xs); color: var(--acc-hi); letter-spacing: .04em; }
.col p { color: var(--t2); font-size: var(--f-sm); margin: 8px 0 0; }
.col p b { color: var(--t1); font-weight: 500; }
.col .big { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--t1); margin-top: 8px; }
.col .big small { font-size: var(--f-xs); color: var(--t3-aa); font-family: var(--sans); }
.eq { font-family: var(--mono); font-size: var(--f-xs); color: var(--t3-aa); margin-top: 8px; }
.eq b { color: var(--t2); font-weight: 500; } .eq .g { color: var(--acc-hi); } .eq .b { color: var(--blue-hi); }

/* ---------------------------------------------------------------- footer */
footer[data-site="footer"] { display: block; margin: 72px 0 0; padding: 28px 0 calc(40px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); color: var(--t3-aa); font-size: 12px; line-height: 1.6; }
footer[data-site="footer"][data-flush] { margin-top: 0; }
.wrap footer[data-site="footer"] .wrap { padding: 0; max-width: none; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.foot-brand { min-width: 0; }
.foot-word { font-family: var(--pixel); font-weight: 700; letter-spacing: .14em; color: var(--t1); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a { color: var(--t2); display: inline-flex; align-items: center; min-height: 28px; }
.foot-links a:hover, .foot-links a.on { color: var(--t1); }
.foot-camp { color: var(--t2); font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.foot-camp::before { content: ""; width: 6px; height: 6px; background: var(--acc); box-shadow: 0 0 8px rgba(232,20,27,.7); flex: none; }
footer[data-site="footer"] p { max-width: 820px; margin-top: 6px; }
footer[data-site="footer"] .foot-camp { margin-top: 0; }
@media (max-width: 900px) {
  .foot-links { gap: 0 6px; margin: 0 -10px; }
  .foot-links a { min-height: 44px; min-width: 44px; padding: 0 10px; justify-content: center; }
}
@media (max-width: 760px) {
  .foot-row { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .foot-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; margin: 0; }
  .foot-links a { min-height: 44px; padding: 0; justify-content: flex-start; font-size: 13.5px; }
}

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border-radius: 12px; background: var(--s3); color: var(--t1); font-size: 13.5px; box-shadow: 0 0 0 1px var(--hair2), 0 12px 32px rgba(0,0,0,.5); pointer-events: auto; animation: toastin .2s ease-out; max-width: 100%; }
.toast::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--t2); }
.toast.ok::before { background: var(--acc); box-shadow: 0 0 8px rgba(232,20,27,.75); }
.toast.bad::before { background: var(--down); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- narrow */
@media (max-width: 760px) {
  h1 { font-size: 24px; margin-top: 36px; }
  h2 { margin-top: 36px; }
  .cols { grid-template-columns: 1fr; gap: 10px; }
  .kvs { padding: 4px 16px; }
  .kv { flex-direction: column; align-items: flex-start; gap: 4px; }
  .kv .v { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .brand:hover .nav-drip, .brand:focus-visible .nav-drip { animation: none; }
  #bgmark, .menu-scrim, .menu-sheet, .btn, .brand-logo img, .skip { transition: none; }
  .toast { animation: none; }
  .toast.out { transition: none; }
}

/* Touch widths: every control in page content reaches 44px (buttons, download chips, the token row). */
@media (max-width: 900px) {
  .btn, .dl .btn, .tok-row .btn { min-height: 44px; }
  .bk-dl a { min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; padding-left: 12px; padding-right: 12px; }
  .col p a.ext { display: inline-flex; align-items: center; min-height: 44px; }
}
