/* ==========================================================================
   $GOMO Holder Crates · base.css
   Tokens, reset, typography, layout primitives, header, footer, dialog.
   Palette is built from the gomo terminal: near-black #090B0E surfaces,
   hairline borders, uppercase mono micro-labels, trading green for "up".
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #090b0e;
  --bg-alt: #0b0e12;
  --panel: #0f1217;
  --panel-2: #13171d;
  --panel-3: #181d25;
  --line: #1c222a;
  --line-2: #262d37;
  --line-3: #343c48;

  /* Text */
  --text: #e9edf2;
  --text-2: #c2c9d3;
  --muted: #8b95a4;
  --dim: #5f6876;

  /* Signal */
  --up: #2fdc84;
  --up-ink: #04150c;
  --up-soft: rgba(47, 220, 132, 0.12);
  --down: #f2595d;
  --warn: #f1b44c;
  --warn-soft: rgba(241, 180, 76, 0.1);

  /* Tier tones (always paired with T1..T5 index + label, never color alone) */
  --t-copper: #d4875b;
  --t-bronze: #b99257;
  --t-silver: #c9d0da;
  --t-gold: #ecc55c;
  --t-platinum: #bdeee6;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --header-h: 60px;
  --ticker-h: 34px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--up);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--up); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
code { font-family: var(--font-mono); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

.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-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--up); color: var(--up-ink); padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 600; text-decoration: none; transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- Primitives ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 860px; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "zero" 1; }
.muted { color: var(--muted); }
.text-up { color: var(--up); }

.label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--up);
  margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  padding: 3px 7px; border-radius: 4px; line-height: 1.3; text-transform: uppercase;
}
.chip--up { background: var(--up-soft); color: var(--up); }
.chip--muted { background: var(--panel-3); color: var(--muted); }
.chip--outline { border: 1px solid var(--line-3); color: var(--text-2); }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line-3); background: var(--panel-2); color: var(--text-2);
}
.status[data-state="resolved"] { border-color: rgba(47,220,132,.4); color: var(--up); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.dot--wait { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.nil { color: var(--dim); letter-spacing: .12em; }

/* ---------- Buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--h); padding: 0 18px;
  border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 15px; letter-spacing: -.005em; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--sm { --h: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn--lg { --h: 52px; padding: 0 22px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--up); color: var(--up-ink); }
.btn--primary:hover { background: #4fe79a; }
.btn--ghost { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn--ghost:hover { border-color: var(--line-3); background: var(--panel-3); }

.chip-btn {
  min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2);
  font-size: 13px; transition: border-color .15s var(--ease), color .15s var(--ease);
}
.chip-btn:hover { border-color: var(--line-3); color: var(--text); }
.chip-btn[aria-pressed="true"] { border-color: var(--up); color: var(--up); }

.link-btn { background: none; border: 0; padding: 2px 0; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); text-decoration-color: var(--up); }

/* ---------- Ticker ---------- */
.ticker {
  height: var(--ticker-h);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
  font-size: 12px;
  color: var(--text-2);
}
.ticker__inner {
  height: 100%;
  display: flex; align-items: center; gap: 22px;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.ticker__inner::-webkit-scrollbar { display: none; }
.ticker__item { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.ticker__item .label { font-size: 10.5px; color: var(--dim); }
.ticker__item--token strong { font-weight: 600; color: var(--text); }
.ticker__logo { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; background: var(--panel-3); }
.ticker__ca {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 2px 4px; color: var(--text-2);
  border-radius: 4px;
}
.ticker__ca:hover { color: var(--text); background: var(--panel-2); }
.ticker__item--note .mono { color: var(--dim); }
.ticker__link { margin-left: auto; color: var(--up); text-decoration: none; font-weight: 500; }
.ticker__link:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(9, 11, 14, .86);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: var(--panel-3); }
.brand__name { font-weight: 700; letter-spacing: .01em; font-size: 15px; }
.brand__divider { color: var(--line-3); font-weight: 300; }
.brand__product { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em; color: var(--up); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.site-nav__list { display: flex; align-items: center; gap: 4px; }
.site-nav__list a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px;
  border-radius: 8px; font-size: 14px; color: var(--muted); text-decoration: none;
  transition: color .15s var(--ease), background-color .15s var(--ease);
}
.site-nav__list a:hover { color: var(--text); background: var(--panel-2); }
.site-nav__list a[aria-current="true"] { color: var(--text); }
.site-nav__ext a { color: var(--text-2); font-family: var(--font-mono); font-size: 12.5px; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--line-2);
  align-items: center; justify-content: center;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 18px; height: 1.6px; background: var(--text); border-radius: 2px;
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; border-top: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head h2, .why__intro h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12; letter-spacing: -.025em; font-weight: 650;
}
.section-head__text { margin-top: 14px; font-size: 17px; color: var(--muted); max-width: 640px; }
.section-head__text strong { color: var(--text); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 36px 0 44px; font-size: 14px; }
.site-footer__inner { display: grid; grid-template-columns: auto 1fr auto; gap: 16px 28px; align-items: center; }
.site-footer__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.site-footer__brand img { border-radius: 6px; background: var(--panel-3); }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer__nav a { color: var(--muted); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.site-footer__nav a:hover { color: var(--text); }
.site-footer__ca { display: inline-flex; align-items: center; gap: 8px; }
.site-footer__legal { grid-column: 1 / -1; color: var(--dim); font-size: 13px; max-width: 820px; padding-top: 16px; border-top: 1px solid var(--line); }
.site-footer__copy { grid-column: 1 / -1; color: var(--dim); font-family: var(--font-mono); font-size: 12px; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  background: var(--panel); color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.dialog::backdrop { background: rgba(4, 5, 7, .72); }
.dialog[open] { animation: dialogIn .22s var(--ease); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog__body { padding: 22px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.dialog__close {
  width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted);
}
.dialog__close:hover { color: var(--text); }
.dialog__title { font-size: 22px; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 10px; font-weight: 650; }
.dialog p { color: var(--muted); }
.dialog__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--panel-3); border: 1px solid var(--line-3); color: var(--text);
  font-family: var(--font-mono); font-size: 13px;
  padding: 10px 14px; border-radius: var(--radius);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Header responsive ---------- */
@media (max-width: 1080px) {
  .site-nav__ext { display: none; }
}
@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 14px;
    padding: 16px var(--gutter) 22px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s linear .18s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav__list a { min-height: 46px; font-size: 16px; padding: 0 12px; }
  .site-nav__ext { display: block; }
  .site-nav__cta { --h: 48px; font-size: 15px; }
  .site-header { position: sticky; }
}
@media (max-width: 520px) {
  .brand__divider, .brand__product { display: none; }
  .ticker__item--note { display: none; }
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
