/* ══════════════════════════════════════════════════════
   APXTrading — Public site
   robot/assets/css/site.css

   Direction: a trading terminal at rest. Deep ink ground, a single
   signal-green that only ever means "up" and a red that only ever
   means "down", gold reserved strictly for the brand mark and primary
   action. The signature is the tape — a live market band that runs
   through the hero as an architectural element rather than a widget
   parked at the top.
   ══════════════════════════════════════════════════════ */

:root {
  --ink:        #05101A;
  --ink-2:      #0A1826;
  --ink-3:      #102435;
  --hairline:   rgba(148, 180, 208, .14);
  --hairline-2: rgba(148, 180, 208, .28);

  --gold:       #C9A84C;
  --gold-soft:  #E8D9A8;
  --signal:     #24D6A4;
  --alert:      #F0555F;

  --text:       #E9F0F7;
  --text-2:     #9FB6CB;
  --text-3:     #62809A;

  --paper:      #F4F7FA;

  --display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --body:    "Inter", system-ui, -apple-system, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --maxw:   1240px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

img, svg { display: block; max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Type scale ─────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-3);
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.04; letter-spacing: -.03em; }
h1 { font-size: clamp(42px, 7.5vw, 92px); }
h2 { font-size: clamp(30px, 4.4vw, 52px); }
h3 { font-size: clamp(19px, 2vw, 24px); letter-spacing: -.015em; }

p { color: var(--text-2); }
strong { color: var(--text); font-weight: 600; }

.lede { font-size: clamp(16px, 1.6vw, 19px); line-height: 1.7; max-width: 56ch; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s, border-color .18s, color .18s;
}
.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: var(--gold-soft); transform: translateY(-2px); }
.btn-line {
  border-color: var(--hairline-2);
  color: var(--text);
}
.btn-line:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-sm { padding: 10px 18px; font-size: 11px; }

/* ── Header ─────────────────────────────────────────── */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(5,16,26,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
}
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
}
.mark { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.mark-glyph {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  border-radius: 2px;
}
.mark-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.02em;
}
.mark-word em { font-style: normal; color: var(--gold); }

.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a {
  font-size: 13.5px;
  color: var(--text-2);
  transition: color .18s;
}
.nav a:hover { color: var(--text); }

.masthead .btn { flex-shrink: 0; }

.burger {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--hairline-2);
  border-radius: 2px;
  padding: 9px 11px;
  cursor: pointer;
}
.burger span { display: block; width: 17px; height: 1.5px; background: var(--text); }
.burger span + span { margin-top: 4px; }

.drawer {
  position: fixed; inset: 68px 0 auto 0;
  z-index: 55;
  background: var(--ink-2);
  border-bottom: 1px solid var(--hairline);
  padding: 18px var(--gutter) 26px;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.drawer.open { display: flex; }
.drawer a { padding: 13px 0; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.drawer .btn { margin-top: 16px; justify-content: center; }

/* ── The tape: the page's signature ─────────────────── */
.tape {
  position: relative;
  border-block: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  overflow: hidden;
}
.tape::before, .tape::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 90px;
  z-index: 2; pointer-events: none;
}
.tape::before { left: 0;  background: linear-gradient(90deg, var(--ink), transparent); }
.tape::after  { right: 0; background: linear-gradient(270deg, var(--ink), transparent); }
.tape-tv { min-height: 46px; }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(60px, 9vw, 112px) clamp(48px, 7vw, 84px);
  overflow: hidden;
}
/* A faint depth grid — the ghost of an order book, not a decoration */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, var(--hairline) 0 1px, transparent 1px 88px);
  opacity: .5;
  mask-image: radial-gradient(ellipse 78% 62% at 50% 40%, #000 30%, transparent 78%);
  pointer-events: none;
}
.hero-inner { position: relative; }

.hero h1 { margin: 20px 0 24px; max-width: 15ch; }
.hero h1 .rate {
  display: inline-block;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.hero-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(48px, 7vw, 76px);
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.figure { background: var(--ink); padding: 24px 22px; }
.figure dt {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.figure dd {
  font-family: var(--display);
  font-size: clamp(26px, 3.1vw, 38px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
}
.figure .unit { font-size: .5em; color: var(--text-3); margin-left: 4px; }

/* ── Sections ───────────────────────────────────────── */
.band { padding-block: clamp(64px, 9vw, 112px); border-top: 1px solid var(--hairline); }
.band-alt { background: var(--ink-2); }

.band-head { max-width: 62ch; margin-bottom: clamp(36px, 5vw, 56px); }
.band-head h2 { margin: 14px 0 16px; }

/* ── Market grid ────────────────────────────────────── */
.markets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.market { background: var(--ink); padding: 0; min-height: 132px; }
.market .tv-mini { height: 132px; }

.market-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--mono);
}

.chart-shell {
  margin-top: 28px;
  border: 1px solid var(--hairline);
  background: var(--ink);
  height: clamp(380px, 52vw, 520px);
}

/* ── Steps: a real sequence, so numbered ────────────── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.step { background: var(--ink); padding: 30px 26px 34px; }
.step-n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--gold);
  margin-bottom: 18px;
}
.step h3 { margin-bottom: 10px; }
.step p { font-size: 14.5px; }

/* ── Tiers ──────────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.tier { background: var(--ink); padding: 26px 22px 30px; position: relative; }
.tier[data-flag]::after {
  content: attr(data-flag);
  position: absolute; top: 18px; right: 18px;
  font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--hairline-2);
  padding: 3px 8px; border-radius: 2px;
}
.tier-name {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 12px;
}
.tier-entry {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(24px, 2.7vw, 32px);
  letter-spacing: -.03em; margin-bottom: 18px;
}
.tier-row {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-top: 1px solid var(--hairline);
  font-size: 13px;
}
.tier-row span:first-child { color: var(--text-3); }
.tier-row span:last-child { font-family: var(--mono); }
.tier-row .up { color: var(--signal); }

/* ── Referral ladder ────────────────────────────────── */
.ladder { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); }
.rung { background: var(--ink); padding: 22px 16px; text-align: center; }
.rung-lv {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px;
}
.rung-pct {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -.03em;
}
.rung:first-child .rung-pct { color: var(--gold); }

.worked {
  margin-top: 28px;
  border: 1px solid var(--hairline);
  background: var(--ink);
  padding: clamp(22px, 3.5vw, 34px);
  font-family: var(--mono);
  font-size: clamp(12.5px, 1.4vw, 14px);
  line-height: 2.1;
  overflow-x: auto;
}
.worked .k { color: var(--text-3); }
.worked .v { color: var(--text); }
.worked .out { color: var(--gold); }
.worked hr { border: none; border-top: 1px solid var(--hairline); margin: 12px 0; }

/* ── Notice / disclaimer block ──────────────────────── */
.notice {
  border: 1px solid rgba(240,85,95,.32);
  background: rgba(240,85,95,.05);
  padding: clamp(22px, 3.5vw, 32px);
  border-radius: 2px;
}
.notice h3 { color: var(--alert); margin-bottom: 12px; }
.notice p + p { margin-top: 12px; }
.notice p { font-size: 14.5px; }

/* ── CTA ────────────────────────────────────────────── */
.closer { text-align: center; }
.closer h2 { margin-bottom: 18px; }
.closer .lede { margin-inline: auto; }
.closer .hero-actions { justify-content: center; }

/* ── Footer ─────────────────────────────────────────── */
.foot { border-top: 1px solid var(--hairline); padding-block: 52px 40px; background: var(--ink-2); }
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px 28px;
  margin-bottom: 40px;
}
.foot h4 {
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px; font-weight: 500;
}
.foot ul { list-style: none; display: grid; gap: 10px; }
.foot a { font-size: 14px; color: var(--text-2); transition: color .18s; }
.foot a:hover { color: var(--gold-soft); }
.foot-note {
  border-top: 1px solid var(--hairline);
  padding-top: 26px;
  font-size: 12.5px;
  color: var(--text-3);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}

/* ── Document pages ─────────────────────────────────── */
.doc { padding-block: clamp(48px, 7vw, 84px) clamp(60px, 9vw, 104px); }
.doc-head { border-bottom: 1px solid var(--hairline); padding-bottom: 30px; margin-bottom: 42px; }
.doc-head h1 { font-size: clamp(32px, 5vw, 54px); margin: 14px 0 12px; }
.doc-body { max-width: 74ch; }
.doc-body h2 {
  font-size: clamp(20px, 2.3vw, 26px);
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.doc-body h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.doc-body h3 { font-size: 17px; margin: 26px 0 10px; }
.doc-body p { margin-bottom: 15px; font-size: 15.5px; }
.doc-body ul, .doc-body ol { margin: 0 0 16px 22px; }
.doc-body li { color: var(--text-2); margin-bottom: 9px; font-size: 15.5px; }
.doc-body code {
  font-family: var(--mono); font-size: .88em;
  background: var(--ink-3); padding: 2px 6px; border-radius: 2px; color: var(--gold-soft);
}
.doc-toc {
  border: 1px solid var(--hairline);
  padding: 22px 24px;
  margin-bottom: 44px;
  background: var(--ink-2);
}
.doc-toc h4 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; font-weight: 500;
}
.doc-toc ol { margin: 0 0 0 20px; }
.doc-toc li { margin-bottom: 8px; font-size: 14px; }
.doc-toc a { color: var(--text-2); }
.doc-toc a:hover { color: var(--gold-soft); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1080px) {
  .markets, .steps, .tiers { grid-template-columns: repeat(2, 1fr); }
  .ladder { grid-template-columns: repeat(3, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .masthead .btn-gold { display: none; }
  .burger { display: block; }
  .hero-figures { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .markets, .steps, .tiers { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ── Scroll reveal ──────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ══════════════════════════════════════════════════════
   Assistant
   Docked to the corner rather than floating over content, so it
   never covers the tape or a figure someone is reading.
══════════════════════════════════════════════════════ */
.bot-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  background: var(--gold); color: var(--ink);
  border: none; border-radius: 2px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), background .18s;
}
.bot-launch:hover { background: var(--gold-soft); transform: translateY(-2px); }
.bot-launch[hidden] { display: none; }

.bot {
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: min(408px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 44px));
  display: none; flex-direction: column;
  background: var(--ink-2);
  border: 1px solid var(--hairline-2);
  border-radius: 3px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  overflow: hidden;
}
.bot.open { display: flex; }

.bot-head {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--ink);
}
.bot-avatar {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--gold); color: var(--ink);
  border-radius: 2px;
  font-family: var(--display); font-weight: 800; font-size: 14px;
}
.bot-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.bot-sub { font-family: var(--mono); font-size: 10px; color: var(--text-3); letter-spacing: .06em; }
.bot-x {
  margin-left: auto; background: none; border: none;
  color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px;
}
.bot-x:hover { color: var(--text); }

.bot-log { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.bot-log::-webkit-scrollbar { width: 6px; }
.bot-log::-webkit-scrollbar-thumb { background: var(--hairline-2); border-radius: 3px; }

.bot-msg { max-width: 92%; font-size: 14px; line-height: 1.65; }
.bot-msg.them {
  align-self: flex-start;
  background: var(--ink-3);
  border-left: 2px solid var(--gold);
  padding: 12px 14px; border-radius: 2px;
  white-space: pre-wrap;
}
.bot-msg.me {
  align-self: flex-end;
  background: var(--gold); color: var(--ink);
  padding: 10px 14px; border-radius: 2px;
  font-weight: 500;
}
.bot-msg.them strong { color: var(--gold-soft); font-weight: 600; }
.bot-msg code { font-family: var(--mono); font-size: .9em; color: var(--gold-soft); }

.bot-chips { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 100%; }
.bot-chip {
  background: transparent;
  border: 1px solid var(--hairline-2);
  color: var(--text-2);
  padding: 8px 12px; border-radius: 2px;
  font-size: 12.5px; text-align: left; cursor: pointer;
  transition: border-color .16s, color .16s;
}
.bot-chip:hover { border-color: var(--gold); color: var(--gold-soft); }

.bot-rate { display: flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 11.5px; color: var(--text-3); }
.bot-rate button {
  background: none; border: 1px solid var(--hairline); color: var(--text-3);
  border-radius: 2px; padding: 3px 9px; cursor: pointer; font-size: 12px;
}
.bot-rate button:hover { border-color: var(--gold); color: var(--gold-soft); }

.bot-foot { border-top: 1px solid var(--hairline); padding: 12px; background: var(--ink); }
.bot-form { display: flex; gap: 8px; }
.bot-input {
  flex: 1; min-width: 0;
  background: var(--ink-2);
  border: 1px solid var(--hairline-2);
  color: var(--text);
  padding: 11px 13px; border-radius: 2px;
  font-family: var(--body); font-size: 14px;
}
.bot-input:focus { outline: none; border-color: var(--gold); }
.bot-send {
  background: var(--gold); color: var(--ink);
  border: none; border-radius: 2px; padding: 0 16px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  letter-spacing: .06em; cursor: pointer;
}
.bot-send:disabled { opacity: .45; cursor: not-allowed; }
.bot-note { font-size: 10.5px; color: var(--text-3); margin-top: 9px; text-align: center; }

.bot-typing { display: inline-flex; gap: 4px; align-items: center; }
.bot-typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--text-3);
  animation: botDot 1.2s infinite ease-in-out; display: block;
}
.bot-typing i:nth-child(2) { animation-delay: .18s; }
.bot-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes botDot { 0%,60%,100% { opacity:.25; transform:translateY(0);} 30% { opacity:1; transform:translateY(-3px);} }

@media (max-width: 520px) {
  .bot { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 16px); }
  .bot-launch { right: 12px; bottom: 12px; }
}

/* ── Small screens ─────────────────────────────────── */
@media (max-width: 400px) {
  :root { --gutter: 16px; }
  h1 { font-size: clamp(32px, 11vw, 42px); }
  .figure { padding: 18px 16px; }
  .tier, .step { padding: 20px 18px; }
  .worked { font-size: 11.5px; line-height: 1.95; }
  .doc-body p, .doc-body li { font-size: 14.5px; }
  .bot-launch { padding: 11px 16px; font-size: 11px; }
}

/* Touch targets */
@media (pointer: coarse) {
  .btn, .bot-chip, .bot-send, .nav a, .drawer a { min-height: 44px; }
  .bot-input { min-height: 44px; }
}

/* Wide screens: the tape and hero should not stretch indefinitely */
@media (min-width: 1600px) {
  :root { --maxw: 1360px; }
}

/* ── Brand mark ──
   The supplied artwork is gold on a dark ground and needs no plate
   behind it; the previous gold tile would have hidden it. */
.mark-glyph {
  width: 34px; height: 34px;
  background: none;
  border-radius: 0;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.auth-logo img { width: 100%; height: 100%; object-fit: contain; }

/* Voice toggle. Muted is the default state, so the affordance has to
   read as "click to enable" rather than looking broken. */
.bot-speak {
  margin-left: auto;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  padding: 6px 9px;
  cursor: pointer;
  transition: border-color .16s, color .16s;
}
.bot-speak:hover { border-color: var(--gold); color: var(--gold-soft); }
.bot-speak.on { border-color: var(--gold); color: var(--gold); background: rgba(201,168,76,.08); }
.bot-head .bot-x { margin-left: 6px; }
