/* ============================================================================
   MBATS — unified homepage
   ----------------------------------------------------------------------------
   DESIGN NOTES (why these choices)

   · Skin: obsidian black (#050505) with electric cyan (#31d6ff) as the primary
     glow, white for ink, soft blue (#6ea8ff) as the secondary accent — chosen
     by the operator: "an advanced AI operating system" where the holograms,
     charts, and the robot stand out against darkness.
   · Market color stays semantic and separate from the brand glow: candle
     green #2ee6a6 = profit/up, red #ff4d6d = loss/down. Cyan is the machine;
     green/red is the market. The two never trade jobs.
   · Type: Space Grotesk (display + body) and JetBrains Mono (data, labels,
     tape). A grotesque with monospace DNA plus a true terminal mono — every
     number on the page reads as instrumentation.
   · Signature: "The Bot at Work" (assets/bot-scene.js) — a Jarvis-like robot
     on a fixed canvas behind the page. Scroll advances its behavior: asleep →
     eyes open → head turns → holograms bloom → it types and trades → candles
     erupt and money rains → it walks off into the dark at the operator door.
     Content rides a left rail so the machine keeps the right of the stage.
   · Motion: one rAF loop in the scene; DOM reveals are transform/opacity
     only. prefers-reduced-motion gets a single still frame of the awake
     robot and instant-visible content.
   ========================================================================== */

:root {
  --void: #050505;
  --panel: #070b10;
  --panel-2: #0a121a;
  --line: #12202c;
  --line-bright: #1b3242;
  --ink: #f4f7fb;
  --muted: #93a0b4;
  --faint: #45536b;
  --cyan: #31d6ff;
  --blue: #6ea8ff;
  --green: #2ee6a6;
  --red: #ff4d6d;
  --font-display: "Space Grotesk", "Bahnschrift", "Segoe UI Semibold", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
/* Anchor jumps must clear the sticky header, so sections land with their
   eyebrow + top padding fully visible (not cut off behind it). */
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
a { color: var(--cyan); }

/* the scene canvas — fixed, behind everything */
#bot-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}
.site-header, main, .site-footer { position: relative; z-index: 1; }

/* ------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(8px);
  transition: padding 0.25s ease;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.24em;
  color: var(--cyan);
  text-decoration: none;
  text-shadow: 0 0 22px rgba(49, 214, 255, 0.45);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--cyan); }
.auth-slot { display: flex; align-items: center; gap: 12px; }

/* buttons */
.btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.2;
}
.btn-neon {
  background: rgba(49, 214, 255, 0.07);
  border: 1px solid rgba(49, 214, 255, 0.55);
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px rgba(49, 214, 255, 0.08), 0 0 24px rgba(49, 214, 255, 0.12);
}
.btn-neon:hover {
  background: rgba(49, 214, 255, 0.14);
  box-shadow: 0 0 30px rgba(49, 214, 255, 0.25);
}
.btn-ghost {
  background: rgba(7, 11, 16, 0.6);
  border: 1px solid var(--line-bright);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-link:hover { color: var(--cyan); }
.btn:focus-visible, .btn-link:focus-visible, .nav-link:focus-visible, .avatar-wrap:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* signed-in chip: avatar with email tooltip + monogram fallback */
.user-chip { display: flex; align-items: center; gap: 12px; }
.avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(49, 214, 255, 0.65);
  box-shadow: 0 0 14px rgba(49, 214, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  cursor: default;
}
.user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.avatar-wrap.no-photo .user-avatar { display: none; }
.avatar-wrap.no-photo::before {
  content: attr(data-initial);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--cyan);
}
.avatar-wrap::after {
  content: attr(data-email);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel-2);
  border: 1px solid var(--line-bright);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 30;
}
.avatar-wrap:hover::after, .avatar-wrap:focus-visible::after { opacity: 1; }

/* ------------------------------------------------------------- layout */
main { padding: 0 30px; }
.rail { max-width: 620px; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--cyan);
  vertical-align: middle;
  margin-right: 12px;
}

.hero {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vh 0 6vh;
  position: relative;
}
.hero-title {
  margin: 0 0 20px;
  font-weight: 700;
  font-size: clamp(44px, 6.6vw, 84px);
  line-height: 1.03;
  letter-spacing: -0.015em;
  text-shadow: 0 0 30px rgba(0, 0, 0, 0.95);
}
.hero-title em, .section-title em {
  font-style: normal;
  color: var(--cyan);
  text-shadow: 0 0 34px rgba(49, 214, 255, 0.4);
}
.hero-pitch {
  max-width: 46ch;
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 30px;
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.95);
}
.hero-pitch strong { color: var(--ink); font-weight: 600; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.restricted-note {
  margin: 18px 0 0;
  max-width: 46ch;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
  border-left: 2px solid var(--red);
  padding-left: 12px;
}
.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 0;
  font-size: 10.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
  animation: cue-drift 2.6s ease-in-out infinite;
}
@keyframes cue-drift {
  0%, 100% { transform: translateY(0); opacity: 0.65; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* sections — tall on purpose: they are the scroll runway for the scene */
.section { min-height: 88vh; padding: 96px 0 12vh; display: flex; align-items: flex-start; }
.section-title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-shadow: 0 0 26px rgba(0, 0, 0, 0.95);
}
.section-lede {
  color: var(--muted);
  font-size: 16px;
  max-width: 50ch;
  margin: 0 0 24px;
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.95);
}

/* reveal: faint depth settle as sections enter */
.reveal {
  opacity: 0;
  transform: perspective(900px) rotateX(4deg) translateY(24px);
  transform-origin: 50% 100%;
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------- blotter */
.blotter { border-top: 1px solid var(--line-bright); }
.blotter-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: baseline;
  padding: 24px 4px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.6);
  min-width: 0;
}
.blotter-row .tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--cyan);
}
.blotter-row p { margin: 0; font-size: 15.5px; color: var(--ink); min-width: 0; }

/* ------------------------------------------------------------- loop */
.loop {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(7, 11, 16, 0.82);
}
.loop-step {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.loop-step:last-child { border-bottom: none; }
.loop-step .n {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 6px;
}
.loop-step p { margin: 0; font-size: 14.5px; color: var(--muted); }
.loop-return {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--faint);
  text-align: right;
  margin: 10px 0 0;
}
.loop-return span { color: var(--cyan); }

/* ------------------------------------------------------------- proof windows */
.rail.rail-wide { max-width: 840px; }
.proof-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.win {
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(7, 11, 16, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(49, 214, 255, 0.05);
  min-width: 0;
}
.win.span2 { grid-column: 1 / -1; }
.win-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 18, 26, 0.6);
}
.win-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-transform: uppercase;
}
.win-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
  white-space: nowrap;
}
.win-body { padding: 10px; }
.win svg { display: block; width: 100%; max-width: 100%; height: auto; }
.fills {
  list-style: none;
  margin: 0;
  padding: 2px 16px;
}
.fills li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
}
.fills li:last-child { border-bottom: none; }
.fills .ft { color: var(--faint); }
.fills .fd { color: var(--ink); letter-spacing: 0.04em; min-width: 0; }
.fills .fv { font-weight: 600; }
.fills .fv.up { color: var(--green); }
.fills .fv.down { color: var(--red); }

/* ------------------------------------------------------------- heartbeat */
.pulse-panel {
  border: 1px solid var(--line);
  background: rgba(7, 11, 16, 0.85);
  padding: 22px 24px;
}
.pulse-dots { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}
.pulse-dot.up { background: var(--green); box-shadow: 0 0 8px rgba(46, 230, 166, 0.6); }
.pulse-dot.down { background: var(--red); box-shadow: 0 0 8px rgba(255, 77, 109, 0.5); }
.pulse-line { margin: 0; font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }
.pulse-line.offline { color: var(--red); }

/* ------------------------------------------------------------- entry + footer */
.section-entry { min-height: 74vh; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 22px 30px 28px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}
.site-footer .mono { letter-spacing: 0.22em; color: var(--muted); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .rail { max-width: 100%; }
}
@media (max-width: 720px) {
  html { scroll-padding-top: 58px; }
  main { padding: 0 18px; }
  .site-header { padding: 14px 18px; }
  .hero { min-height: 86vh; }
  .section { min-height: 74vh; padding: 72px 0 9vh; }
  .proof-stage { grid-template-columns: 1fr; }
  .blotter-row { grid-template-columns: 1fr; gap: 6px; }
  .hero-pitch, .section-lede { text-shadow: 0 0 14px rgba(0, 0, 0, 1), 0 0 28px rgba(0, 0, 0, 0.9); }
}

/* ------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-cue { animation: none; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================================
   Additions: minimizing header, icon sign-out, guided tour buttons,
   interactive equity chart, TradeVault calendar tiles
   ========================================================================== */

.nav-links { display: flex; gap: 20px; align-items: center; }

/* minimizing trailing header (class toggled by assets/ui.js on scroll).
   Desktop mini: MBATS far left, then story/dashboards/heartbeat + the one
   action, all right-aligned. Mobile mini centers the links instead (below).
   Avatar and sign-out fade + collapse smoothly rather than popping out. */
.site-header { transition: padding 0.35s cubic-bezier(0.2, 0.6, 0.2, 1), background 0.35s ease; }
.site-header.mini { padding: 7px 30px; background: rgba(5, 5, 5, 0.92); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.55); flex-wrap: nowrap; }
.wordmark { transition: font-size 0.35s cubic-bezier(0.2, 0.6, 0.2, 1); }
.site-header.mini .wordmark { font-size: 15px; }
.header-nav { transition: gap 0.35s ease; }
.site-header.mini .header-nav { flex-wrap: nowrap; align-items: center; gap: 16px; min-width: 0; }
.site-header.mini .nav-link { white-space: nowrap; }
.btn { transition: padding 0.35s ease, font-size 0.35s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.site-header.mini .btn { padding: 7px 13px; font-size: 10.5px; }
.avatar-wrap, .btn-icon {
  transition: opacity 0.3s ease, max-width 0.35s ease, margin 0.35s ease, border-width 0.35s ease;
  max-width: 40px;
  overflow: hidden;
}
.user-chip { transition: gap 0.35s ease; }
.site-header.mini .avatar-wrap,
.site-header.mini .btn-icon {
  opacity: 0;
  max-width: 0;
  margin: 0;
  border-width: 0;
  padding: 0;
  pointer-events: none;
}
.site-header.mini .user-chip { gap: 0; }
.site-header.mini .auth-slot { gap: 0 16px; }

/* icon sign-out */
.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  background: rgba(7, 11, 16, 0.6);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-icon:hover { color: var(--cyan); border-color: rgba(49, 214, 255, 0.6); box-shadow: 0 0 12px rgba(49, 214, 255, 0.25); }
.btn-icon:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-icon svg { display: block; }

/* guided tour buttons */
.tour-next { display: inline-block; margin-top: 22px; }
.tour-next:hover { transform: translateY(2px); }

/* interactive equity chart */
.equity-chart svg { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: pan-y; }
.equity-chart svg g[opacity] { transition: opacity 0.15s; }

/* TradeVault calendar */
.cal { display: flex; gap: 14px; align-items: stretch; }
.cal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  min-width: 0;
}
.cal-h {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
  text-align: center;
  align-self: end;
  padding-bottom: 2px;
}
.cal-day {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #0b141c;
  color: var(--faint);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.cal-day.up { background: rgba(46, 230, 166, 0.13); color: var(--green); }
.cal-day.up.d2 { background: rgba(46, 230, 166, 0.2); }
.cal-day.up.d3 { background: rgba(46, 230, 166, 0.3); }
.cal-day.down { background: rgba(255, 77, 109, 0.13); color: var(--red); }
.cal-day.down.d2 { background: rgba(255, 77, 109, 0.2); }
.cal-day.sel { border-color: var(--cyan); }
.cal-day:hover, .cal-day:focus-visible {
  transform: scale(1.08);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(49, 214, 255, 0.35);
  outline: none;
  z-index: 1;
}
.cal-aside {
  width: 92px;
  flex: none;
  border: 1px solid #173044;
  border-radius: 4px;
  background: #0a121a;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-family: var(--font-mono);
}
.ca-day { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; color: var(--cyan); }
.ca-trades { font-size: 10.5px; color: var(--muted); }
.ca-pnl { font-size: 14px; font-weight: 600; color: var(--green); }
.ca-link { font-size: 10px; color: var(--faint); margin-top: auto; }

/* proof cards respond to focus */
.win { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.win:hover {
  border-color: rgba(49, 214, 255, 0.45);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 34px rgba(49, 214, 255, 0.12);
}

/* compact right-aligned mobile header: links row above auth row */
@media (max-width: 720px) {
  .site-header { padding: 20px 16px; align-items: flex-start; }
  .site-header .header-nav {
    margin-left: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .nav-links { gap: 16px; }
  .nav-link { font-size: 12px; }
  .auth-slot { gap: 11px; }
  .auth-slot .btn { padding: 10px 15px; font-size: 11px; }
  .avatar-wrap { width: 34px; height: 34px; max-width: 44px; }
  .btn-icon { width: 34px; height: 34px; max-width: 44px; }
  .btn-icon svg { width: 17px; height: 17px; }
  /* mobile mini: links move to the middle, single action stays right */
  .site-header.mini { padding: 6px 12px; align-items: center; }
  .site-header.mini .wordmark { font-size: 13px; letter-spacing: 0.16em; }
  .site-header.mini .header-nav { flex: 1; flex-direction: row; margin-left: 10px; gap: 8px; }
  .site-header.mini .nav-links { flex: 1; justify-content: center; gap: 10px; }
  .site-header.mini .nav-link { font-size: 9.5px; letter-spacing: 0.06em; }
  .site-header.mini .auth-slot { flex: none; }
  .site-header.mini .btn { padding: 6px 9px; font-size: 9.5px; letter-spacing: 0.06em; white-space: nowrap; }
  .site-header.mini .avatar-wrap,
  .site-header.mini .btn-icon { width: 0; }
  .cal { flex-direction: column; }
  .cal-aside {
    width: auto;
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
    padding: 10px 12px;
  }
  .ca-link { margin-top: 0; margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header, .wordmark, .cal-day, .win, .tour-next { transition: none; }
  .cal-day:hover, .cal-day:focus-visible { transform: none; }
  .tour-next:hover { transform: none; }
}





/* tour/anchor jumps: the section's own padding-top provides the breathing
   room below the sticky bar, so anchors land flush and identical each time */
.section, #story, #cycle, #proof, #heartbeat, #entry { scroll-margin-top: 6px; }
@media (max-width: 720px) {
  .section, #story, #cycle, #proof, #heartbeat, #entry { scroll-margin-top: 4px; }
}


/* keep the proof vignettes short enough that the tour button fits the fold */
.proof-stage .win svg { max-height: 176px; }


/* desktop only: sections center vertically in the viewport (mobile keeps
   its top-aligned fixed-padding layout untouched) */
@media (min-width: 721px) {
  .section { align-items: center; padding: 56px 0; }
  .section, #story, #cycle, #proof, #heartbeat, #entry { scroll-margin-top: 12px; }
}
