/* Zekia — a dark pool reads like an instrument, not a landing page: hairlines, mono numbers, and
   one accent that only ever means "live". The faceted corners echo the mark. */

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  --bg: #000000;
  --panel: rgba(6, 10, 11, 0.9);
  --panel-2: #0A0F10;
  --line: #16211F;
  --line-hot: #27463D;
  /* the mark's own mint, sampled from the logo */
  --mint: #7FF9E0;
  --mint-dim: #49C9B2;
  --mint-deep: #1B6B5C;
  --ghost: rgba(127, 249, 224, 0.07);
  --text: #DEEFEB;
  --muted: #6C8F88;
  --faint: #41605A;
  --sell: #FF8E72;
  --buy: #7FF9E0;
  --ui: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --gutter: clamp(14px, 3.2vw, 30px);
  --maxw: 1380px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* A column that always fills the window: a short page must not leave its footer stranded
   halfway down a tall screen. dvh rather than vh so mobile browser chrome does not lie. */
html { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ── the ground ──────────────────────────────────────────────────────────────────────
   A plane folded into triangles, the same language as the mark, kept almost black and
   faded out under the content: this is a trading surface and nothing may compete with a
   number. Static SVG, so it costs nothing to scroll. */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #000 url("/assets/field.svg?v=2") center / cover no-repeat;
  --fade: radial-gradient(150% 125% at 10% -20%, #000 0%, rgba(0, 0, 0, 0.72) 40%, rgba(0, 0, 0, 0.34) 68%, rgba(0, 0, 0, 0.14) 100%);
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}

/* a single cold light behind the header, where the clock lives */
body::after {
  content: "";
  position: fixed;
  inset: -20% 0 auto 0;
  height: 70vh;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(60% 55% at 22% 24%, rgba(127, 249, 224, 0.085), transparent 70%);
}

/* the mark, once, very large and very quiet, where nothing else lives */
.watermark {
  position: fixed;
  right: -3vw;
  bottom: -4vh;
  width: min(46vw, 620px);
  z-index: -1;
  opacity: 0.035;
  pointer-events: none;
  fill: var(--mint);
}
@media (max-width: 900px) { .watermark { display: none; } }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* ── type ────────────────────────────────────────────────────────────────────────── */

.label {
  font: 500 10px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mint { color: var(--mint); }
.muted { color: var(--muted); }
h1, h2, h3 { font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(23px, 1.3rem + 1.6vw, 38px); }
h2 { font-size: 17px; }

/* ── chrome ──────────────────────────────────────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 40; flex: none;
  display: flex; align-items: center; gap: 24px;
  /* the rule runs edge to edge, the content lines up with main */
  padding-inline: max(var(--gutter), (100% - var(--maxw)) / 2);
  height: 56px;
  background: rgba(2, 5, 6, 0.74);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand svg { width: 26px; height: 26px; }
.brand b { font: 700 15px/1 var(--ui); letter-spacing: 0.22em; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 7px 13px; border-radius: 2px; white-space: nowrap;
  font: 500 12px/1 var(--ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.tabs a:hover { color: var(--text); background: var(--ghost); }
.tabs a[aria-current] { color: var(--mint); background: var(--ghost); box-shadow: inset 0 -1px 0 var(--mint); }

.wallet { flex: none; display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border: 1px solid var(--line-hot); border-radius: 2px;
  font: 500 12px/1 var(--ui); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--mint); background: transparent; transition: background .14s, border-color .14s, color .14s;
}
.btn:hover:not(:disabled) { background: var(--ghost); border-color: var(--mint-dim); }
.btn:disabled { color: var(--faint); border-color: var(--line); cursor: not-allowed; }
.btn-solid { background: var(--mint); color: #04100D; border-color: var(--mint); font-weight: 700; }
.btn-solid:hover:not(:disabled) { background: #9BF0DB; border-color: #9BF0DB; }
.btn-solid:disabled { background: #10211D; color: var(--faint); border-color: transparent; }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); }
.btn-sm { padding: 5px 9px; font-size: 11px; }

/* ── the epoch strip: the product's heartbeat ────────────────────────────────────── */

.strip {
  display: flex; align-items: center; gap: 22px; flex: none;
  padding-block: 12px;
  padding-inline: max(var(--gutter), (100% - var(--maxw)) / 2);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(127, 249, 224, 0.05), rgba(0, 0, 0, 0.3));
  backdrop-filter: blur(10px);
}
.strip .pick { display: flex; align-items: center; gap: 10px; flex: none; }
.strip select {
  appearance: none; font: 500 13px/1 var(--ui); color: var(--text);
  background: rgba(10, 15, 16, .8); border: 1px solid var(--line); border-radius: 2px;
  padding: 7px 26px 7px 10px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mint-dim) 50%), linear-gradient(135deg, var(--mint-dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.strip .mark { font-family: var(--mono); font-size: 18px; letter-spacing: -0.02em; }
.strip .mark small { font-size: 11px; color: var(--muted); margin-left: 5px; }

.phases { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.phase-bar { display: flex; gap: 3px; height: 4px; }
.phase-bar i { flex: var(--w, 1); background: #0F1718; position: relative; overflow: hidden; border-radius: 1px; }
.phase-bar i[data-on] { background: var(--mint-deep); }
.phase-bar i[data-now]::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%);
  background: var(--mint); box-shadow: 0 0 12px rgba(127, 249, 224, .6);
}
.phase-names { display: flex; gap: 3px; }
.phase-names span { flex: var(--w, 1); font: 500 9px/1 var(--ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.phase-names span[data-now] { color: var(--mint); }
.countdown { flex: none; text-align: right; }
.countdown b { font: 500 22px/1 var(--mono); font-variant-numeric: tabular-nums; }

/* ── panels ──────────────────────────────────────────────────────────────────────── */

main {
  /* same inline padding as the header, so a panel's edge lines up with the wordmark */
  padding: 20px max(var(--gutter), (100% - var(--maxw)) / 2) 72px;
  width: 100%; flex: 1 0 auto;
}
.grid { display: grid; gap: 14px; }
.cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 2px; position: relative;
  backdrop-filter: blur(16px);
  /* one clipped corner: the same fold as the mark */
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}
.panel > header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.panel > header h2 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.panel .body { padding: 14px; }
.panel .body.flush { padding: 0; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 13px; }

/* ── tables ──────────────────────────────────────────────────────────────────────── */

.panel .body.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
td .num, td.num { overflow-wrap: anywhere; }

thead th {
  font: 500 10px/1 var(--ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid #0E1414; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(127, 249, 224, 0.025); }
td.r, th.r { text-align: right; }
.empty { padding: 34px 14px; text-align: center; color: var(--faint); font-size: 13px; }

/* ── the dark book ───────────────────────────────────────────────────────────────── */

.redact { display: inline-flex; gap: 2px; align-items: center; }
.redact i { width: 7px; height: 11px; background: var(--mint); opacity: var(--o, .3); border-radius: 1px; }
.resolved { display: inline-flex; align-items: center; gap: 8px; }
.side { font: 700 11px/1 var(--mono); letter-spacing: 0.1em; padding: 4px 7px; border-radius: 2px; }
.side.buy { color: var(--buy); background: rgba(127, 249, 224, .1); }
.side.sell { color: var(--sell); background: rgba(255, 142, 114, .11); }
.pill { font: 500 10px/1 var(--ui); letter-spacing: .12em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line-hot); border-radius: 2px; color: var(--mint-dim); }
.pill.off { color: var(--faint); border-color: var(--line); }
.pill.warn { color: var(--sell); border-color: rgba(255, 142, 114, .35); }

/* ── forms ───────────────────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 13px; }
.field > span { display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 11px; background: rgba(10, 15, 16, .8); color: var(--text);
  border: 1px solid var(--line); border-radius: 2px; font: 400 13px/1.3 var(--mono);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--mint-dim); }
.field select { font-family: var(--ui); }
.hint { font-size: 11px; color: var(--faint); margin-top: 6px; line-height: 1.5; }
.row { display: flex; gap: 9px; }
.row > * { flex: 1; }

.steps { counter-reset: s; display: grid; gap: 1px; background: var(--line); }
.steps > div { background: rgba(6, 10, 11, .78); padding: 16px 16px 16px 52px; position: relative; }
.steps > div::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 16px; top: 16px;
  font: 500 12px/1 var(--mono); color: var(--mint-deep);
}
.steps h3 { font-size: 14px; margin-bottom: 5px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }



/* ── docs ───────────────────────────────────────────────────────────────────────── */

.docs { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }

.doc-rail { position: sticky; top: 118px; display: grid; gap: 1px; }
.doc-rail a {
  padding: 7px 10px; border-left: 1px solid var(--line); color: var(--muted);
  font-size: 12.5px; line-height: 1.3; transition: color .14s, border-color .14s;
}
.doc-rail a:hover { color: var(--text); }
.doc-rail a[aria-current] { color: var(--mint); border-left-color: var(--mint); background: var(--ghost); }

.doc-body { max-width: 78ch; }
.doc-hero { padding: 10px 0 8px; }
.doc-hero h1 { letter-spacing: -0.025em; }
.prose { color: var(--muted); font-size: 15px; line-height: 1.72; margin: 14px 0 0; max-width: 68ch; }
.prose + .prose { margin-top: 12px; }
.doc-body i { color: var(--text); font-style: italic; }

.doc-facts { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 26px 0 4px; }
.doc-facts > div { display: grid; gap: 5px; }
.doc-facts b { font: 500 14px/1 var(--mono); color: var(--text); }

.doc-sec { padding-top: 38px; margin-top: 34px; border-top: 1px solid var(--line); scroll-margin-top: 130px; }
.doc-sec > h2 { font-size: 20px; letter-spacing: -0.015em; color: var(--text); }
.doc-sec > h2::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 11px;
  background: var(--mint); clip-path: polygon(0 0, 100% 50%, 0 100%); vertical-align: 1px; }
.doc-sec .steps { margin-top: 20px; border: 1px solid var(--line); }
.doc-sec .steps h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.doc-sec .steps p { font-size: 13.5px; }

.doc-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 13px; }
.doc-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: 14.5px; line-height: 1.68; }
.doc-list li::before { content: ""; position: absolute; left: 0; top: 9px; width: 7px; height: 7px;
  background: var(--mint-deep); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.doc-list b { color: var(--text); font-weight: 500; }

.doc-table { margin: 20px 0 0; border: 1px solid var(--line); overflow-x: auto; }
.doc-table table { min-width: 100%; }
.doc-table.wide table { min-width: 520px; }
.doc-table td:first-child, .doc-table th:first-child { white-space: nowrap; }
.doc-table tbody td { font-size: 13px; }

.doc-body code {
  font: 400 12.5px/1.4 var(--mono); color: var(--mint-dim);
  background: rgba(127, 249, 224, .05); border: 1px solid var(--line); border-radius: 2px; padding: 1px 5px;
  overflow-wrap: anywhere;
}
.doc-link { color: var(--mint-dim); border-bottom: 1px solid var(--line-hot); }
.doc-link:hover { color: var(--mint); }

/* ── toasts ──────────────────────────────────────────────────────────────────────── */

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: grid; gap: 7px; }
.toast {
  padding: 10px 15px; border: 1px solid var(--line-hot); background: #04100D; border-radius: 2px;
  font: 400 13px/1.3 var(--mono); color: var(--text); transition: opacity .5s, transform .5s;
}
.toast-bad { border-color: rgba(255, 142, 114, .4); color: var(--sell); }
.toast.out { opacity: 0; transform: translateY(7px); }

footer { padding: 24px max(var(--gutter), (100% - var(--maxw)) / 2) 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px;
  margin-top: auto; flex: none;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .7)); }

footer a { color: var(--muted); }
footer a:hover { color: var(--mint); }

/* ── the responsive ladder ──────────────────────────────────────────────────────── */

@media (max-width: 1240px) {
  .cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

@media (max-width: 1040px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* the rail becomes a scroller that rides under the strip */
  .doc-rail {
    position: sticky; top: 0; z-index: 20; display: flex; gap: 2px; overflow-x: auto;
    scrollbar-width: none; margin: -20px calc(var(--gutter) * -1) 10px; padding: 10px var(--gutter);
    background: rgba(2, 5, 6, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
  }
  .doc-rail::-webkit-scrollbar { display: none; }
  .doc-rail a { border-left: 0; border-bottom: 1px solid transparent; white-space: nowrap; padding: 6px 9px; }
  .doc-rail a[aria-current] { border-left: 0; border-bottom-color: var(--mint); }
  .doc-sec { scroll-margin-top: 150px; }
}

@media (max-width: 820px) {
  .top { height: auto; flex-wrap: wrap; padding: 10px var(--gutter); gap: 10px 16px; }
  .strip { padding-inline: var(--gutter); }
  .tabs { order: 3; width: 100%; flex: 1 0 100%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
  .wallet { margin-left: auto; }
  .strip { flex-wrap: wrap; gap: 12px 18px; padding-top: 10px; padding-bottom: 10px; }
  .phases { flex: 1 0 100%; order: 3; }
  .countdown { order: 2; margin-left: auto; text-align: right; }
  .countdown b { font-size: 19px; }
  thead th, tbody td { padding-left: 11px; padding-right: 11px; }
  .panel > header { padding: 11px 12px; }
  .panel .body { padding: 12px; }
  /* comfortable targets once there is no mouse */
  .btn { padding: 11px 15px; }
  .btn-sm { padding: 7px 10px; }
  .field input, .field select, .strip select { min-height: 44px; }
  .doc-body { max-width: none; }
  .prose { font-size: 14.5px; }
}

@media (max-width: 620px) {
  /* the first and last column of a long table carry the least information */
  [data-opt] { display: none; }
  .strip .mark { font-size: 16px; }
  /* one legible label beats four clipped ones */
  .phase-names span:not([data-now]) { display: none; }
  .phase-names span[data-now] { flex: none; letter-spacing: .22em; }
  .doc-facts { gap: 10px 24px; }
  .doc-sec { padding-top: 28px; margin-top: 26px; }
  .doc-sec > h2 { font-size: 18px; }
  .steps > div { padding: 14px 13px 14px 44px; }
  .steps > div::before { left: 13px; top: 15px; }
  .row { flex-wrap: wrap; }
  .row > * { flex: 1 1 140px; }
}

@media (max-width: 400px) {
  .brand b { font-size: 13px; letter-spacing: .18em; }
  .tabs a { padding: 7px 9px; font-size: 11px; }
  thead th, tbody td { padding-left: 9px; padding-right: 9px; font-size: 12.5px; }
  .kv dd { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
