/* ==========================================================================
   Opus Algo — landing page
   Type: Mona Sans (display + UI), IBM Plex Mono (data)
   Themes: light (default), dark, plus an always-dark scope for product UI
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  --font: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #fbfbfa;
  --bg-2: #f3f3f0;
  --card: #ffffff;
  --fg: #0e0e11;
  --fg-2: #4e4c47;
  --fg-3: #73716b;
  --line: rgba(14, 14, 17, 0.08);
  --line-2: rgba(14, 14, 17, 0.13);
  --line-3: rgba(14, 14, 17, 0.22);
  --fill: rgba(14, 14, 17, 0.035);
  --fill-2: rgba(14, 14, 17, 0.065);

  --accent: #a8741f;
  --accent-soft: #f5e8cc;
  --accent-ink: #5c3f0c;
  --accent-line: rgba(168, 116, 31, 0.35);

  --btn: #0e0e11;
  --btn-fg: #ffffff;
  --btn-hover: #2b2b31;

  --sheet: #0c0c0e;
  --up: #0f9d66;
  --down: #d9404e;

  --shadow-sm: 0 1px 2px rgba(14, 14, 17, 0.05), 0 2px 6px -2px rgba(14, 14, 17, 0.05);
  --shadow-lg: 0 60px 120px -50px rgba(14, 14, 17, 0.45), 0 24px 48px -28px rgba(14, 14, 17, 0.25);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --container: 1200px;
  --gutter: 24px;

  color-scheme: light;
}

/* Dark page theme, forced-dark subtrees (.dark) and product UI (.ui) share one palette */
[data-theme="dark"],
.dark,
.ui {
  --bg: #0a0a0b;
  --bg-2: #101012;
  --card: #131315;
  --fg: #f2f1ec;
  --fg-2: #aaa8a1;
  --fg-3: #8a877f;
  --line: rgba(242, 241, 236, 0.08);
  --line-2: rgba(242, 241, 236, 0.13);
  --line-3: rgba(242, 241, 236, 0.22);
  --fill: rgba(242, 241, 236, 0.04);
  --fill-2: rgba(242, 241, 236, 0.075);

  --accent: #e8c27a;
  --accent-soft: rgba(232, 194, 122, 0.13);
  --accent-ink: #f3d9a6;
  --accent-line: rgba(232, 194, 122, 0.38);

  --btn: #f2f1ec;
  --btn-fg: #0e0e11;
  --btn-hover: #ffffff;

  --up: #3fd19a;
  --down: #f0646e;

  --shadow-sm: none;
  --shadow-lg: 0 60px 120px -50px rgba(0, 0, 0, 0.9);

  color-scheme: dark;
}

[data-theme="dark"] { --sheet: #121215; }

.dark,
.ui { color: var(--fg); }

.ui {
  --surface: #08080a;
  --gold: #e8c27a;
  --gold-hi: #f8e2ae;
  --gold-lo: #b9873f;
  --gold-ink: #17110a;
  --blue: #8fb4ff;
  --violet: #c8a8ff;
  --peach: #f5a97f;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a { color: inherit; }

button { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--fg); }

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

.i { width: 18px; height: 18px; flex: none; }

.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: fixed;
  top: 10px; left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--btn);
  color: var(--btn-fg);
  font-weight: 550;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section { position: relative; padding: clamp(88px, 10vw, 140px) 0; }

/* ---------- Type ---------- */

.hero__title,
.h2,
.logo__word,
.stat b,
.plan__price b {
  font-family: var(--font);
  font-weight: 600;
  font-stretch: 104%;
}

.h2 {
  margin: 0;
  font-size: clamp(2.1rem, 1.25rem + 2.7vw, 3.55rem);
  line-height: 1.03;
  letter-spacing: -0.036em;
  text-wrap: balance;
}
.h2--statement {
  max-width: 17ch;
  margin-inline: auto;
  font-size: clamp(2.35rem, 1.1rem + 3.9vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.044em;
}
.h2--xl { font-size: clamp(2.5rem, 1.1rem + 4.4vw, 5rem); line-height: 1; letter-spacing: -0.044em; }

.lead {
  margin: 0;
  max-width: 36em;
  font-size: clamp(1.04rem, 0.98rem + 0.3vw, 1.18rem);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--fg);
  font-weight: 550;
  text-decoration: underline;
  text-decoration-color: var(--line-3);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.link:hover { text-decoration-color: var(--fg); }
.link .i { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.link:hover .i { transform: translateX(3px); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Section heads ---------- */

.section-head { margin-bottom: clamp(44px, 5.5vw, 72px); }
.section-head .lead { margin-top: 20px; }
.section-head--center { text-align: center; }
.section-head--center .h2 { max-width: 20ch; margin-inline: auto; }
.section-head--center .h2--statement { max-width: 17ch; }
.section-head--center .lead { margin-inline: auto; }
.section-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px 64px;
  align-items: end;
}
.section-head--split .h2 { max-width: 17ch; }
.section-head--split .lead { margin-top: 0; padding-bottom: 6px; }

/* ---------- Buttons ---------- */

.btn {
  --h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: 550 15px/1 var(--font);
  letter-spacing: -0.012em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.btn .i { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.btn:hover .i { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }

.btn--primary { background: var(--btn); color: var(--btn-fg); }
.btn--primary:hover { background: var(--btn-hover); }
.btn--outline { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-3); }
.btn--outline:hover { background: var(--fill); box-shadow: inset 0 0 0 1px var(--fg-3); }

.btn--sm { --h: 36px; padding: 0 15px; font-size: 14px; }
.btn--lg { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn--block { width: 100%; }

.round-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-sm);
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}
.round-btn:hover { background: var(--fill-2); }
.round-btn:disabled { opacity: 0.35; cursor: default; }
.round-btn .i { width: 18px; height: 18px; }

/* ==========================================================================
   Announcement + Nav
   ========================================================================== */

.announce {
  position: relative;
  z-index: 61;
  background: #0e0e11;
  color: #f2f1ec;
  font-size: 13.5px;
}
[data-theme="dark"] .announce { background: #17171a; border-bottom: 1px solid var(--line); }
.announce-closed .announce { display: none; }
.announce__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 9px 52px;
}
.announce p { margin: 0; color: rgba(242, 241, 236, 0.72); }
.announce b { color: #fff; font-weight: 600; }
.announce a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #f3d9a6;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}
.announce a .i { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.announce a:hover .i { transform: translateX(3px); }
.announce__dot {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #e8c27a;
  box-shadow: 0 0 0 3px rgba(232, 194, 122, 0.22);
}
.announce__close {
  position: absolute;
  top: 50%; right: 12px;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: rgba(242, 241, 236, 0.6);
  transform: translateY(-50%);
  cursor: pointer;
}
.announce__close:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.announce__close .i { width: 16px; height: 16px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.3s;
}
@supports (backdrop-filter: blur(1px)) {
  .nav {
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
  }
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: calc(var(--container) + var(--gutter) * 2);
  height: 64px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  color: var(--fg);
  text-decoration: none;
}
.logo__mark { width: 26px; height: 26px; color: var(--fg); }
.logo__word { font-size: 18.5px; font-weight: 650; font-stretch: 106%; letter-spacing: -0.035em; line-height: 1; }

.nav__links { display: flex; gap: 2px; }
.nav__links a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.nav__links a:hover { color: var(--fg); background: var(--fill); }
.nav__links a.is-current { color: var(--fg); }

.nav__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.theme {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.theme button {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fg-3);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.theme button:hover { color: var(--fg); }
.theme button[aria-checked="true"] { background: var(--fill-2); color: var(--fg); }
.theme .i { width: 15px; height: 15px; }

.nav__login {
  padding: 8px 10px;
  color: var(--fg-2);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.nav__login:hover { color: var(--fg); }

.nav__burger {
  display: none;
  position: relative;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}
.nav__burger span {
  position: absolute;
  left: 12px; right: 12px;
  height: 1.5px;
  border-radius: 2px;
  background: var(--fg);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav__burger span:first-child { top: 15px; }
.nav__burger span:last-child { top: 23px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

.menu {
  position: fixed;
  inset: 64px 0 0;
  z-index: 59;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 16px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu__links a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-size: 26px;
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: -0.035em;
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  animation: menu-in 0.5s var(--ease) forwards;
}
.menu__links a:nth-child(2) { animation-delay: 0.03s; }
.menu__links a:nth-child(3) { animation-delay: 0.06s; }
.menu__links a:nth-child(4) { animation-delay: 0.09s; }
.menu__links a:nth-child(5) { animation-delay: 0.12s; }
.menu__links a:nth-child(6) { animation-delay: 0.15s; }
.menu__cta { display: grid; gap: 10px; }
.menu__theme { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--fg-2); font-size: 14px; font-weight: 500; }
.menu .theme { display: flex; }
.menu__note { margin: 4px 0 0; text-align: center; color: var(--fg-3); font-size: 13px; }
@keyframes menu-in { to { opacity: 1; transform: none; } }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { position: relative; padding: clamp(44px, 6.5vh, 84px) 0 clamp(72px, 9vw, 120px); overflow: clip; }
.hero::before {
  content: "";
  position: absolute;
  top: -40%; left: 50%;
  width: 1400px; height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  opacity: 0.55;
  pointer-events: none;
}

.hero__inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-sm);
  color: var(--fg-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, box-shadow 0.2s;
}
.pill:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-3), var(--shadow-sm); }
.pill .i { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.pill:hover .i { transform: translateX(3px); }
.pill__tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 600;
}

.hero__title {
  margin: 0 0 24px;
  font-size: clamp(2.8rem, 1.05rem + 5.6vw, 5.6rem);
  font-stretch: 106%;
  line-height: 0.97;
  letter-spacing: -0.046em;
  text-wrap: balance;
}

.hero__sub {
  max-width: 680px;
  margin: 0 auto 32px;
  color: var(--fg-2);
  font-size: clamp(1.06rem, 0.98rem + 0.36vw, 1.22rem);
  line-height: 1.55;
  text-wrap: pretty;
}

/* Composer */
.composer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--line-2),
    0 24px 48px -28px rgba(14, 14, 17, 0.28),
    0 2px 4px rgba(14, 14, 17, 0.04);
  text-align: left;
  transition: box-shadow 0.25s;
}
.composer:focus-within {
  box-shadow:
    0 0 0 1px var(--line-3),
    0 0 0 5px var(--fill-2),
    0 24px 48px -28px rgba(14, 14, 17, 0.28);
}
.dark .composer,
[data-theme="dark"] .composer { box-shadow: 0 0 0 1px var(--line-2), 0 24px 60px -30px rgba(0, 0, 0, 0.9); }
.composer__top { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; }
.composer__icon { width: 18px; height: 18px; flex: none; color: var(--accent); }
.composer__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: 400 17px/1.4 var(--font);
  letter-spacing: -0.012em;
}
.composer__input::placeholder { color: var(--fg-3); opacity: 1; }
.composer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 6px 6px 8px;
  border-top: 1px solid var(--line);
}
.composer__chips {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.composer__chips::-webkit-scrollbar { display: none; }
.composer__hint { margin: 0; padding-left: 6px; color: var(--fg-3); font-size: 13.5px; }
.composer__btn { --h: 40px; flex: none; padding: 0 17px; }
.composer.is-nudge .composer__btn { animation: nudge 0.8s var(--ease); }
@keyframes nudge { 30% { transform: scale(1.05); } 60% { transform: scale(0.98); } }

.chip {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.chip:hover { color: var(--fg); background: var(--fill-2); }
.chip.is-active { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }

.assure {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--fg-3);
  font-size: 13.5px;
}
.assure li { display: inline-flex; align-items: center; gap: 7px; }
.assure .i { width: 15px; height: 15px; color: var(--accent); }

/* Product frame */
.hero__stage {
  position: relative;
  max-width: calc(1240px + var(--gutter) * 2);
  margin: clamp(40px, 4.4vw, 60px) auto 0;
  padding: 0 var(--gutter);
}
.frame {
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg-2) 60%);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lg);
}

/* ==========================================================================
   Product UI (always dark)
   ========================================================================== */

.app {
  position: relative;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(180deg, #111114 0%, #0a0a0c 100%);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.app__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-3);
  font-size: 12.5px;
}
.app__crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.app__mark { width: 18px; height: 18px; margin-right: 4px; color: var(--gold); }
.app__sep { opacity: 0.5; }
.app__file { overflow: hidden; color: var(--fg); font-family: var(--mono); font-size: 12px; text-overflow: ellipsis; }
.app__tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
}
.app__tabs span { padding: 5px 12px; border-radius: 7px; }
.app__tabs .is-active { background: var(--fill-2); color: var(--fg); }
.app__tools { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-2); }
.switch i {
  position: relative;
  width: 26px; height: 15px;
  border-radius: 99px;
  background: var(--line-3);
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
}
.switch.is-on i { background: var(--gold); }
.switch.is-on i::after { transform: translateX(11px); background: var(--gold-ink); }

.app__deploy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg);
}
.app__deploy .i { width: 13px; height: 13px; color: var(--gold); }
.app__deploy b { color: var(--gold); font-family: var(--mono); font-size: 11px; font-weight: 400; }

.app__body {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 350px;
  height: 580px;
}

.app__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 0;
  border-right: 1px solid var(--line);
}

.tool {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: 9px;
  color: var(--fg-3);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.tool .i { width: 16px; height: 16px; }
.tool.is-active { color: var(--fg); background: var(--fill-2); }
.tool--buy { color: var(--up); }
.tool--sell { color: var(--down); }
.tool--buy.is-pressed { background: rgba(63, 209, 154, 0.14); box-shadow: inset 0 0 0 1px rgba(63, 209, 154, 0.45); transform: scale(0.94); }
.tool--sell.is-pressed { background: rgba(240, 100, 110, 0.14); box-shadow: inset 0 0 0 1px rgba(240, 100, 110, 0.45); transform: scale(0.94); }

.app__chart { position: relative; display: flex; flex-direction: column; min-width: 0; }
.chart-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 6px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 11.5px;
}
.chart-head__sym { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-family: var(--font); font-size: 13.5px; }
.chart-head__sym b { font-weight: 600; }
.chart-head__sym i {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #4a6cf7, #c94a5a, #f3eee4, #4a6cf7);
}
.chart-head__tf { padding: 2px 7px; border-radius: 6px; background: var(--fill-2); color: var(--fg-2); }
.chart-head__chg.up { color: var(--up); }
.chart-head__chg.down { color: var(--down); }
.chart-head__legend { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.chart-head__legend i { width: 14px; height: 2px; border-radius: 2px; background: var(--gold); }

.chart-wrap { position: relative; flex: 1; min-height: 0; }
.chart { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* SVG chart primitives (drawn by main.js) */
.chart .grid line { stroke: rgba(242, 241, 236, 0.045); stroke-width: 1; }
.chart .axis text { fill: var(--fg-3); font: 400 10px var(--mono); }
.chart .cdl line { stroke-width: 1; }
.chart .cdl.u rect { fill: var(--up); }
.chart .cdl.u line { stroke: var(--up); }
.chart .cdl.d rect { fill: var(--down); }
.chart .cdl.d line { stroke: var(--down); }
.chart .cdl { transform-box: fill-box; transform-origin: 50% 50%; }
.chart .cdl.is-new { animation: cdl-in 0.5s var(--ease) both; }
@keyframes cdl-in { from { opacity: 0; transform: scaleY(0.2); } }
.chart .ema { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linejoin: round; }
.chart .ema-glow { fill: none; stroke: var(--gold); stroke-width: 6; opacity: 0.1; }
.chart .last-line { stroke-dasharray: 2 3; stroke-width: 1; }
.chart .last-line.u { stroke: var(--up); }
.chart .last-line.d { stroke: var(--down); }
.chart .tag.u rect { fill: var(--up); }
.chart .tag.d rect { fill: var(--down); }
.chart .tag text { fill: #07110c; font: 500 10.5px var(--mono); }
.chart .pos-tp { fill: rgba(63, 209, 154, 0.12); stroke: rgba(63, 209, 154, 0.38); stroke-width: 1; }
.chart .pos-sl { fill: rgba(240, 100, 110, 0.12); stroke: rgba(240, 100, 110, 0.38); stroke-width: 1; }
.chart .pos-entry { stroke: var(--fg-2); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .pos-label { font: 500 10px var(--mono); }
.chart .pos-label.tp { fill: var(--up); }
.chart .pos-label.sl { fill: var(--down); }
.chart .pos { transform-box: fill-box; transform-origin: 0 50%; animation: pos-in 0.7s var(--ease) both; }
@keyframes pos-in { from { opacity: 0; transform: scaleX(0.1); } }
.chart .mk { animation: mk-in 0.6s var(--ease) both; }
.chart .mk circle.ring { fill: none; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 1.2s var(--ease) both; }
.chart .mk.buy circle { fill: var(--up); stroke: var(--up); }
.chart .mk.sell circle { fill: var(--down); stroke: var(--down); }
.chart .mk circle.ring { fill: none; }
.chart .mk rect { fill: rgba(10, 10, 12, 0.94); stroke-width: 1; }
.chart .mk.buy rect { stroke: rgba(63, 209, 154, 0.5); }
.chart .mk.sell rect { stroke: rgba(240, 100, 110, 0.5); }
.chart .mk text { font: 500 10px var(--mono); letter-spacing: 0.04em; }
.chart .mk.buy text { fill: var(--up); }
.chart .mk.sell text { fill: var(--down); }
.chart .flash { fill: var(--up); opacity: 0; animation: flash 1.2s var(--ease) both; }
.chart .playhead { stroke: var(--gold); stroke-width: 1; }
.chart .playband { fill: rgba(232, 194, 122, 0.07); }
@keyframes mk-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ring { from { opacity: 0.9; transform: scale(0.6); } to { opacity: 0; transform: scale(3.2); } }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: 0.22; } 100% { opacity: 0; } }

/* Chat */
.app__chat { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: rgba(242, 241, 236, 0.012); }
.chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.chat__title { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 550; }
.chat__title .i { width: 14px; height: 14px; color: var(--gold); }
.chat__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(232, 194, 122, 0.08);
  box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.25);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10.5px;
}
.chat__badge i,
.stage__live i,
.dep__conn i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.chat__log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
}
.chat__log.is-scrolled {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 60px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 60px);
}
.msg { flex: none; font-size: 13px; line-height: 1.5; }
.msg.is-new { animation: msg-in 0.5s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg p { margin: 0; }
.msg--user {
  align-self: flex-end;
  max-width: 90%;
  padding: 10px 13px;
  border-radius: 14px 14px 4px 14px;
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg);
}
.msg--ai { display: flex; gap: 10px; max-width: 96%; color: var(--fg-2); }
.msg__av {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: rgba(232, 194, 122, 0.08);
  box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.25);
  color: var(--gold);
}
.msg__av svg { width: 14px; height: 14px; }
.msg--typing p { display: flex; align-items: center; gap: 4px; height: 22px; }
.msg--typing p i { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-3); animation: dots 1s ease-in-out infinite; }
.msg--typing p i:nth-child(2) { animation-delay: 0.15s; }
.msg--typing p i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 0%, 100% { opacity: 0.3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.msg--card {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(232, 194, 122, 0.09), rgba(232, 194, 122, 0.02));
  box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.24);
}
.rc__head { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 550; }
.rc__head .i { width: 15px; height: 15px; color: var(--up); }
.rc__head .spin {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--line-3);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rc__file { margin-top: 4px; color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.rc__bar { height: 3px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: var(--line-2); }
.rc__bar span { display: block; width: var(--p, 0%); height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); transition: width 0.25s linear; }
.rc__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--fg);
  color: #0e0e11;
  font-size: 12px;
  font-weight: 600;
}
.rc__btn .i { width: 13px; height: 13px; }

.chat__input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 12px 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg-3);
  font-size: 13px;
}
.chat__send { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--fg); color: #0e0e11; }
.chat__send .i { width: 14px; height: 14px; }

/* ==========================================================================
   Brokers band
   ========================================================================== */

.brokers { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brokers__inner {
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 26px var(--gutter);
}
.brokers__label { flex: none; max-width: 230px; margin: 0; color: var(--fg-3); font-size: 13.5px; line-height: 1.45; }
.marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; gap: 56px; width: max-content; animation: marquee 42s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span {
  color: var(--fg-3);
  font-size: 20px;
  font-weight: 650;
  font-stretch: 104%;
  letter-spacing: -0.035em;
  white-space: nowrap;
  opacity: 0.85;
}
@keyframes marquee { to { transform: translateX(calc(-50% - 28px)); } }

/* ==========================================================================
   Problem (ruled grid)
   ========================================================================== */

.ruled {
  display: grid;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}
.ruled--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ruled--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ruled > * { padding: 36px 32px 34px; border-left: 1px solid var(--line-2); }
.ruled > *:first-child { border-left: 0; }

.detour { display: flex; flex-direction: column; }
.detour__icon {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-bottom: 26px;
  border-radius: 11px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-sm);
  color: var(--fg-2);
}
.detour h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -0.022em; }
.detour p { margin: 0 0 28px; color: var(--fg-2); font-size: 15.5px; }
.detour .detour__cost {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line-3);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.detour__cost span { color: var(--fg-3); }
.detour__cost s { position: relative; color: var(--fg); text-decoration: none; }
.detour__cost s::after {
  content: "";
  position: absolute;
  top: 52%; left: -3px; right: -3px;
  height: 1.5px;
  background: var(--down);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.8s var(--ease) 0.6s;
}
.detour.is-in .detour__cost s::after,
.no-js .detour__cost s::after,
.no-anim .detour__cost s::after { transform: scaleX(1); }

.problem__pivot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 820px;
  margin: 48px auto 0;
  color: var(--fg-2);
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.5;
  text-align: center;
  text-wrap: balance;
}
.problem__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--fg);
  color: var(--bg);
}
.problem__mark svg { width: 22px; height: 22px; }
.problem__pivot strong { color: var(--fg); font-weight: 600; }

/* ==========================================================================
   Dark sheets
   ========================================================================== */

.sheet {
  position: relative;
  margin: 0 clamp(8px, 1.2vw, 18px);
  padding: clamp(88px, 10vw, 140px) 0;
  border-radius: clamp(22px, 2.4vw, 32px);
  background: var(--sheet);
}
[data-theme="dark"] .sheet { box-shadow: inset 0 0 0 1px var(--line); }

/* ==========================================================================
   How it works
   ========================================================================== */

.how__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
}

.how__steps { position: relative; margin: 0; padding: 4vh 0 8vh; list-style: none; }
.how__steps::before,
.how__steps::after { content: ""; position: absolute; top: 0; left: 0; width: 1px; }
.how__steps::before { bottom: 0; background: var(--line-2); }
.how__steps::after {
  height: calc(var(--p, 0) * 100%);
  background: linear-gradient(180deg, transparent, var(--accent) 12%);
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
  padding-left: 40px;
  opacity: 0.3;
  transition: opacity 0.5s var(--ease);
}
.step::before {
  content: "";
  position: absolute;
  top: 50%; left: -4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1.5px var(--line-3);
  transition: background-color 0.4s, box-shadow 0.4s;
}
.step.is-active { opacity: 1; }
.step.is-active::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step__kicker {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.step__kicker span { color: var(--fg-3); }
.step__title {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 1.3rem + 1.4vw, 2.6rem);
  font-weight: 600;
  font-stretch: 104%;
  line-height: 1.04;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
.step__text { max-width: 30em; margin: 0 0 22px; color: var(--fg-2); font-size: 16.5px; }
.step__points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.step__points li { display: flex; align-items: center; gap: 10px; color: var(--fg-2); font-size: 14.5px; }
.step__points .i { width: 16px; height: 16px; color: var(--accent); }

.how__stage-wrap { position: relative; }

.stage {
  position: sticky;
  top: max(84px, calc(50vh - 300px));
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #131316 0%, #0b0b0d 100%);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 50px 100px -40px rgba(0, 0, 0, 0.9);
}
.stage__bar {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.stage__dots { display: flex; gap: 6px; }
.stage__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.stage__tabs { position: relative; justify-self: center; display: flex; gap: 2px; color: var(--fg-3); font-size: 12.5px; }
.stage__tabs span { position: relative; z-index: 1; padding: 6px 12px; transition: color 0.4s; }
.stage__tabs span.is-active { color: var(--fg); }
.stage__ink {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  z-index: 0;
  width: 60px;
  border-radius: 8px;
  background: var(--fill-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.55s var(--ease), width 0.55s var(--ease);
}
.stage__live { justify-self: end; display: flex; align-items: center; gap: 6px; color: var(--up); font-family: var(--mono); font-size: 10.5px; }

.stage__body { position: relative; flex: 1; min-height: 0; }

.scene {
  position: absolute;
  inset: 0;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease), visibility 0s linear 0.6s;
}
.scene.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.5s var(--ease) 0.08s, transform 0.7s var(--ease) 0.08s, visibility 0s;
}

/* Scene: Draw */
.draw {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  height: 100%;
}
.draw__tools {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border-radius: 12px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
}
.draw__chart {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.draw__chart .chart { top: 38px; height: calc(100% - 38px); }
.draw__head {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 11px;
}
.draw__head b { color: var(--fg); font-family: var(--font); font-size: 13px; font-weight: 600; }
.draw__hint { margin-left: auto; color: var(--gold); }

.note {
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  max-width: 200px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(17, 17, 20, 0.95);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 12px 30px -10px rgba(0, 0, 0, 0.85);
  color: var(--fg);
  font-size: 11.5px;
  line-height: 1.4;
  opacity: 0;
  transform: translate(var(--nx, 0), var(--ny, 0)) translateY(6px) scale(0.96);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.note b { display: block; margin-bottom: 3px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.note--buy b { color: var(--up); }
.note--sell b { color: var(--down); }
.note.is-on { opacity: 1; transform: translate(var(--nx, 0), var(--ny, 0)); }

.cursor {
  position: absolute;
  top: 0; left: 0;
  z-index: 4;
  width: 22px; height: 22px;
  transform: translate(var(--cx, 300px), var(--cy, 260px));
  transition: transform 1s var(--ease-io);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}
.cursor svg { width: 22px; height: 22px; }
.cursor::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-hi);
  opacity: 0;
}
.cursor.is-click::after { animation: click 0.6s var(--ease); }
@keyframes click { from { opacity: 1; transform: scale(0.4); } to { opacity: 0; transform: scale(2.2); } }

.draw__send {
  grid-column: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 550;
  transition: background-color 0.4s, color 0.4s, box-shadow 0.4s;
}
.draw__send .i { width: 14px; height: 14px; }
.draw__send.is-ready { background: var(--fg); color: #0e0e11; box-shadow: 0 0 0 5px var(--fill-2); }

/* Scene: Define */
.define {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 14px;
  height: 100%;
}
.define__chat { display: flex; flex-direction: column; gap: 16px; padding: 4px 2px; min-height: 0; }
.q { transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.q.is-hidden { opacity: 0; transform: translateY(10px); }
.q p { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 9px; color: var(--fg); font-size: 13px; line-height: 1.45; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 32px; }
.opts span {
  padding: 5px 10px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg-2);
  font-size: 12px;
  transition: background-color 0.35s, color 0.35s, box-shadow 0.35s, transform 0.35s var(--ease);
}
.opts span.is-picked { background: var(--gold); color: var(--gold-ink); box-shadow: none; }
.opts span.is-press { transform: scale(0.94); }

.rules {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(63, 209, 154, 0.06);
  box-shadow: inset 0 0 0 1px rgba(63, 209, 154, 0.22);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.rules.is-hidden { opacity: 0; transform: translateY(10px); }
.rules__title { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; color: var(--up); font-size: 12px; font-weight: 600; }
.rules__title .i { width: 14px; height: 14px; }
.rules ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; color: var(--fg); font-size: 12px; }
.rules li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.rules li span { color: var(--fg-3); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.7; }

.define__code {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11px;
}
.code__head span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.code__head .i { width: 13px; height: 13px; color: var(--blue); }
.code__status { color: var(--gold); }
.code__status.is-done { color: var(--up); }

.code {
  margin: 0;
  padding: 14px 12px;
  overflow: hidden;
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  white-space: normal;
  counter-reset: ln;
}
.code code { font: inherit; }
.code .ln { position: relative; display: block; padding-left: 28px; white-space: pre; }
.code .ln::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute;
  left: 0;
  width: 16px;
  color: rgba(242, 241, 236, 0.2);
  text-align: right;
}
.code .ln.is-pending { clip-path: inset(0 100% 0 0); }
.code .ln.is-typing { clip-path: inset(0 0 0 0); transition: clip-path var(--t, 0.5s) steps(var(--steps, 24), end); }

.c-k, .c-t, .c-f, .c-n, .c-s, .c-c { font-style: normal; }
.c-k { color: var(--violet); }
.c-t { color: var(--gold-hi); }
.c-f { color: var(--blue); }
.c-n { color: var(--peach); }
.c-s { color: var(--up); }
.c-c { color: var(--fg-3); font-style: italic; }

/* Scene: Backtest */
.bt { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.bt__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--fg-3); font-size: 12.5px; white-space: nowrap; }
.bt__head b { color: var(--fg); font-weight: 600; }
.tag {
  padding: 3px 8px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bt__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 10px 12px; border-radius: 10px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.kpi span { display: block; margin-bottom: 4px; color: var(--fg-3); font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.kpi b { font-family: var(--mono); font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.bt__chart { position: relative; flex: 1; min-height: 0; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bt__chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.eq-line { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.eq-area { stroke: none; }
.eq-dd { fill: rgba(240, 100, 110, 0.1); }
.eq-dd-line { stroke: rgba(240, 100, 110, 0.5); stroke-dasharray: 3 3; }
.eq-dd-label { fill: var(--down); font: 500 10px var(--mono); }
.eq-base { stroke: rgba(242, 241, 236, 0.1); stroke-dasharray: 3 4; }
.eq-dot { fill: var(--gold-hi); }
.eq-dot-ring { fill: none; stroke: var(--gold-hi); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 1.8s var(--ease) infinite; }
.eq-label { fill: var(--fg-3); font: 400 10px var(--mono); }
.bt__trades { font-family: var(--mono); font-size: 11px; }
.tr {
  display: grid;
  grid-template-columns: 1.3fr 0.6fr 1fr 1fr 0.8fr;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  white-space: nowrap;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.tr:last-child { border-bottom: 0; }
.tr--head { color: var(--fg-3); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.tr.is-hidden { opacity: 0; transform: translateX(-8px); }

/* Scene: Optimise */
.opt { display: grid; grid-template-columns: 186px minmax(0, 1fr); gap: 14px; height: 100%; }
.opt__side { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.opt__label { margin: 0 0 2px; color: var(--fg-3); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.param { padding: 9px 12px; border-radius: 10px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; }
.param span { display: block; color: var(--fg-2); }
.param b { display: block; margin: 2px 0 8px; font-family: var(--mono); font-size: 12px; font-weight: 500; }
.param i { position: relative; display: block; height: 4px; border-radius: 4px; background: var(--line-2); }
.param i s { position: absolute; top: 0; bottom: 0; left: 10%; right: 16%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.param i s::before,
.param i s::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 3px rgba(232, 194, 122, 0.25);
}
.param i s::before { left: -5px; }
.param i s::after { right: -5px; }
.opt__best {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(232, 194, 122, 0.07);
  box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.3);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.opt__best.is-hidden { opacity: 0; transform: translateY(8px); }
.opt__best span { display: block; color: var(--gold); font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.opt__best b { display: block; margin: 3px 0 2px; color: var(--fg); font-family: var(--mono); font-size: 11.5px; font-weight: 500; }
.opt__best em { color: var(--fg-3); font-size: 11px; font-style: normal; }
.opt__count { margin-top: auto; padding: 11px 12px; border-radius: 10px; background: var(--fill); box-shadow: inset 0 0 0 1px var(--line); }
.opt__count b { display: block; color: var(--fg); font-family: var(--mono); font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.2; }
.opt__count span { color: var(--fg-3); font-size: 11.5px; }

.opt__map { position: relative; padding: 14px 14px 32px 34px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.heat {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: 3px;
  height: 100%;
}
.heat i { border-radius: 3px; background: rgba(242, 241, 236, 0.04); transition: background-color 0.45s ease, transform 0.45s var(--ease); }
.heat i.is-on { background: var(--c); }
.heat i.is-pop { transform: scale(1.25); }
.heat__zone,
.heat__spike { position: absolute; opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease), transform 0.7s var(--ease); }
.heat__zone {
  border-radius: 8px;
  border: 1.5px solid var(--gold-hi);
  box-shadow: 0 0 0 4px rgba(232, 194, 122, 0.12), 0 0 30px rgba(232, 194, 122, 0.25);
  transform: scale(1.08);
}
.heat__spike { border-radius: 5px; border: 1.5px dashed var(--down); transform: scale(1.4); }
.heat__zone.is-on,
.heat__spike.is-on { opacity: 1; transform: none; }
.heat__zone span,
.heat__spike span {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  padding: 3px 8px;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
  transform: translateX(-50%);
}
.heat__zone span { background: var(--gold); color: var(--gold-ink); }
.heat__spike span { background: rgba(14, 14, 17, 0.9); color: var(--down); box-shadow: inset 0 0 0 1px rgba(240, 100, 110, 0.45); }
.heat__x,
.heat__y { position: absolute; color: var(--fg-3); font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.heat__x { bottom: 9px; left: 34px; }
.heat__y { left: 20px; bottom: 32px; transform: rotate(-90deg); transform-origin: 0 0; }

/* Scene: Deploy */
.dep { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.dep__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12.5px;
}
.dep__app { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; }
.dep__app svg { width: 18px; height: 18px; color: var(--gold); }
.dep__conn { display: inline-flex; align-items: center; gap: 8px; color: var(--up); font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.dep__table { overflow: hidden; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.row {
  display: grid;
  grid-template-columns: 1.7fr 1fr 0.6fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.row--head { border-top: 0; background: var(--fill); color: var(--fg-3); font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.row span:first-child { overflow: hidden; color: var(--fg); text-overflow: ellipsis; }
.row--head span:first-child { color: var(--fg-3); }
.row em { margin-left: 4px; color: var(--gold); font-family: var(--mono); font-size: 10.5px; font-style: normal; }
.status { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-family: var(--mono); font-size: 10.5px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--run { color: var(--up); background: rgba(63, 209, 154, 0.1); }
.status--run::before { box-shadow: 0 0 8px currentColor; animation: pulse 1.6s ease-in-out infinite; }
.status--pause { color: var(--fg-3); background: var(--fill); }
.dep__feed { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.feed__head { display: flex; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid var(--line); color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.feed__head b { font-weight: 500; font-variant-numeric: tabular-nums; }
.feed__rows { display: flex; flex-direction: column; overflow: hidden; }
.fr {
  display: grid;
  grid-template-columns: 0.95fr 0.9fr 1fr 1fr 1fr;
  gap: 8px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}
.fr span:last-child { text-align: right; }
.fr.is-new { animation: fr-in 0.7s var(--ease) both, fr-glow 2.4s ease-out both; }
@keyframes fr-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes fr-glow { from { background: rgba(63, 209, 154, 0.12); } to { background: transparent; } }

.how__cta { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 56px; text-align: center; }
.how__cta p { margin: 0; color: var(--fg-3); font-size: 14px; }

/* ==========================================================================
   Features (bento)
   ========================================================================== */

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}
.card__copy { padding: 22px 26px 26px; }
.card h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: -0.024em; line-height: 1.25; }
.card p { margin: 0; color: var(--fg-2); font-size: 15px; }
.card__tag {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px !important;
  color: var(--fg-2) !important;
  font-size: 13.5px !important;
  font-weight: 550;
}
.card__tag .i { width: 15px; height: 15px; color: var(--accent); }

.card--agent {
  grid-column: span 4;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
}
.card--agent .card__copy { display: flex; flex-direction: column; justify-content: center; padding: 36px 30px; }
.card--agent h3,
.card--local h3 { margin-bottom: 12px; font-size: clamp(1.7rem, 1.2rem + 1.1vw, 2.2rem); font-stretch: 104%; letter-spacing: -0.038em; line-height: 1.05; }
.card--walk,
.card--code,
.card--costs,
.card--markets { grid-column: span 2; }
.card--local {
  grid-column: span 6;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  align-items: center;
}
.card--local .card__copy { padding: 36px 30px; }

.agent,
.walk,
.mini-code,
.costs,
.mkt,
.local {
  border-radius: 13px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* Agent log */
.agent { display: flex; flex-direction: column; margin: 14px 14px 14px 0; overflow: hidden; }
.agent__head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.agent__head span { display: flex; gap: 5px; }
.agent__head span i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.agent__log { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 12px; list-style: none; font-family: var(--mono); font-size: 12px; }
.agent__log li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--fg-2);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), background-color 0.4s, box-shadow 0.4s, color 0.4s;
}
.agent__log li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent__log em { color: var(--fg-3); font-size: 11px; font-style: normal; white-space: nowrap; }
.agent__log li[data-state="pending"] { opacity: 0; transform: translateY(6px); }
.agent__ic { position: relative; width: 16px; height: 16px; border-radius: 50%; }
.agent__log li[data-state="running"] .agent__ic { border: 1.5px solid var(--line-3); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
.agent__log li[data-state="running"] em { color: var(--gold); }
.agent__log li[data-state="done"] .agent__ic,
.agent__log li[data-state="fail"] .agent__ic,
.agent__log li[data-state="ready"] .agent__ic { background-position: center; background-repeat: no-repeat; background-size: 10px; }
.agent__log li[data-state="done"] .agent__ic {
  background-color: rgba(63, 209, 154, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%233fd19a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.agent__log li[data-state="fail"] .agent__ic {
  background-color: rgba(240, 100, 110, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='%23f0646e' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
.agent__log li[data-state="fail"] em { color: var(--down); }
.agent__log li[data-state="ready"] { margin-top: 4px; background: rgba(232, 194, 122, 0.08); box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.28); color: var(--gold-hi); }
.agent__log li[data-state="ready"] .agent__ic {
  background-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(232, 194, 122, 0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%2317110a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Walkthrough */
.walk { position: relative; height: 210px; margin: 14px 14px 0; overflow: hidden; }
.walk .chart { top: 6px; height: calc(100% - 42px); }
.walk__bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 10.5px;
}
.walk__btns { display: flex; gap: 10px; color: var(--fg-2); }
.walk__btns .i { width: 13px; height: 13px; }
.walk__pos { font-variant-numeric: tabular-nums; }

/* Local execution */
.local {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 210px;
  margin: 14px;
  padding: 0 28px;
  background: radial-gradient(circle at 37% 48%, rgba(232, 194, 122, 0.1), transparent 40%), var(--surface);
}
.local__node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.local__node > .i {
  width: 44px; height: 44px;
  padding: 11px;
  border-radius: 13px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--fg-2);
}
.local__node--pc { color: var(--gold-hi); }
.local__node--pc > .i {
  width: 58px; height: 58px;
  padding: 15px;
  background: rgba(232, 194, 122, 0.07);
  box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.45), 0 0 30px rgba(232, 194, 122, 0.2);
  color: var(--gold-hi);
}
.local__node b {
  position: absolute;
  top: -7px; right: -7px;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--surface);
}
.local__node b .i { width: 12px; height: 12px; color: var(--gold-ink); }
.local__wire {
  position: relative;
  flex: 1;
  height: 1px;
  margin-bottom: 24px;
  background: repeating-linear-gradient(90deg, var(--line-3) 0 4px, transparent 4px 8px);
}
.local__wire em {
  position: absolute;
  bottom: 10px; left: 50%;
  color: var(--fg-3);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  transform: translateX(-50%);
}
.local__wire i {
  position: absolute;
  top: -2px; left: 0;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 10px var(--gold);
  animation: packet 2.4s linear infinite;
}
.local__wire:nth-child(4) i { animation-delay: 0.8s; }
.local__wire:nth-child(6) i { animation-delay: 1.6s; }
@keyframes packet {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: calc(100% - 5px); opacity: 0; }
}

/* Mini code */
.mini-code { height: 210px; margin: 14px 14px 0; padding: 16px; overflow: hidden; color: var(--fg-2); font-family: var(--mono); font-size: 11.5px; line-height: 1.85; }
.mini-code pre { margin: 0; font: inherit; white-space: pre; }
.caret { display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: var(--gold); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Costs waterfall */
.costs { display: grid; align-content: center; gap: 11px; height: 210px; margin: 14px 14px 0; padding: 16px; font-size: 11.5px; }
.costs__row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 58px; align-items: center; gap: 10px; color: var(--fg-2); }
.costs__row i {
  display: block;
  width: var(--w);
  height: 9px;
  margin-left: var(--x, 0);
  border-radius: 3px;
  background: rgba(242, 241, 236, 0.55);
  transform-origin: 0 50%;
  transition: transform 1s var(--ease);
}
.js .costs__row i { transform: scaleX(0); }
.js .is-in .costs__row i { transform: scaleX(1); }
.costs__row:nth-child(2) i { transition-delay: 0.15s; }
.costs__row:nth-child(3) i { transition-delay: 0.3s; }
.costs__row:nth-child(4) i { transition-delay: 0.45s; }
.costs__row:nth-child(5) i { transition-delay: 0.65s; }
.costs__row--neg i { background: var(--down); opacity: 0.9; }
.costs__row--net { margin-top: 2px; padding-top: 11px; border-top: 1px dashed var(--line-2); }
.costs__row--net i { background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.costs__row b { color: var(--fg); font-family: var(--mono); font-size: 11px; font-weight: 500; text-align: right; }
.costs__row--neg b { color: var(--down); }
.costs__row--net b { color: var(--gold-hi); }

/* Markets */
.mkt { display: flex; flex-direction: column; height: 210px; margin: 14px 14px 0; padding: 16px; }
.mkt__head { display: flex; align-items: baseline; justify-content: space-between; }
.mkt__head b { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.mkt__head span { color: var(--fg-3); font-family: var(--mono); font-size: 11px; }
.mkt__spark { flex: 1; width: 100%; min-height: 0; margin: 10px 0 12px; overflow: visible; }
.mkt__spark path { fill: none; stroke: var(--gold); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mkt__chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mkt__chips span { padding: 3px 7px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-3); font-family: var(--mono); font-size: 10px; transition: color 0.3s, background-color 0.3s, box-shadow 0.3s; }
.mkt__chips .is-active { color: var(--gold-hi); background: rgba(232, 194, 122, 0.08); box-shadow: inset 0 0 0 1px rgba(232, 194, 122, 0.4); }

/* ==========================================================================
   Data
   ========================================================================== */

.datacard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
  padding: clamp(32px, 4.4vw, 60px);
  border-radius: clamp(22px, 2.4vw, 30px);
  background: var(--sheet);
}
[data-theme="dark"] .datacard { box-shadow: inset 0 0 0 1px var(--line); }
.datacard .h2 { max-width: 15ch; }
.datacard .lead { margin-top: 20px; font-size: 1.06rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.tags li { padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-3); color: var(--fg-2); font-size: 13px; }
.datacard__viz { display: grid; gap: 12px; }

.panel {
  padding: 22px 24px;
  border-radius: 16px;
  background: rgba(242, 241, 236, 0.03);
  box-shadow: inset 0 0 0 1px var(--line);
}
.panel__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; color: var(--fg-2); font-size: 13.5px; }
.panel__head b { color: var(--gold); font-family: var(--mono); font-size: 11.5px; font-weight: 500; }

.bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 48px; align-items: center; gap: 14px; color: var(--fg-2); font-size: 13px; }
.bars i { position: relative; height: 5px; overflow: hidden; border-radius: 5px; background: var(--line); }
.bars i::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: max(var(--w), 5px);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi));
  transform-origin: 0 50%;
  transition: transform 1.3s var(--ease);
}
.js .bars i::after { transform: scaleX(0); }
.js .is-in .bars i::after { transform: scaleX(1); }
.bars li:nth-child(2) i::after { transition-delay: 0.08s; }
.bars li:nth-child(3) i::after { transition-delay: 0.16s; }
.bars li:nth-child(4) i::after { transition-delay: 0.24s; }
.bars li:nth-child(5) i::after { transition-delay: 0.32s; }
.bars li:nth-child(6) i::after { transition-delay: 0.4s; }
.bars li:nth-child(7) i::after { transition-delay: 0.48s; }
.bars b { color: var(--fg); font-family: var(--mono); font-size: 12px; font-weight: 500; text-align: right; }

.archive { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.archive i {
  flex: 1;
  height: var(--h);
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--gold), rgba(232, 194, 122, 0.12));
  transform-origin: 50% 100%;
  transition: transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.archive i.is-peak { background: linear-gradient(180deg, var(--gold-hi), rgba(248, 226, 174, 0.2)); }
.js .archive i { transform: scaleY(0); }
.js .is-in .archive i { transform: scaleY(1); }
.archive__axis { display: flex; justify-content: space-between; margin-top: 10px; color: var(--fg-3); font-family: var(--mono); font-size: 11px; }

.stats { margin-top: clamp(40px, 5vw, 64px); border-bottom: 0; }
.stat { padding: 30px 28px 6px !important; }
.stat:first-child { padding-left: 0 !important; }
.stat b {
  display: block;
  font-size: clamp(2.6rem, 1.6rem + 2.6vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.stat > span { display: block; margin-top: 12px; color: var(--fg-3); font-size: 14px; }

/* ==========================================================================
   Ideas carousel
   ========================================================================== */

.ideas__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.tabs {
  display: flex;
  gap: 2px;
  min-width: 0;
  padding: 4px;
  overflow-x: auto;
  border-radius: 999px;
  background: var(--fill);
  box-shadow: inset 0 0 0 1px var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__btn {
  flex: none;
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.tabs__btn:hover { color: var(--fg); }
.tabs__btn.is-active { background: var(--card); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 3px rgba(14, 14, 17, 0.08); }
.ideas__nav { display: flex; flex: none; gap: 8px; }

.ideas__viewport {
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent);
}
.ideas__track {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 6px max(var(--gutter), calc((100% - var(--container)) / 2)) 12px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2));
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.ideas__track::-webkit-scrollbar { display: none; }
.idea {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 12px;
  width: min(340px, 82vw);
  padding: 22px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  scroll-snap-align: start;
  transition: box-shadow 0.25s, transform 0.25s var(--ease);
}
.idea:hover { box-shadow: inset 0 0 0 1px var(--line-3), var(--shadow-sm); transform: translateY(-2px); }
.idea[hidden] { display: none; }
.idea__meta { display: flex; align-items: center; justify-content: space-between; color: var(--fg-3); font-family: var(--mono); font-size: 12px; }
.idea__meta .badge { font-family: var(--font); }
.idea h3 { margin: 6px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.024em; }
.idea__prompt { flex: 1; margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.55; }
.idea__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.idea__tags li { padding: 3px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg-2); font-size: 12px; }
.idea__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--fg);
  font-size: 14.5px;
  font-weight: 550;
  text-decoration: none;
}
.idea__cta .i { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.idea__cta:hover .i { transform: translateX(3px); }
.ideas__note { margin: 18px 0 0; color: var(--fg-3); font-size: 12.5px; }

/* ==========================================================================
   Compare
   ========================================================================== */

.compare__wrap {
  overflow-x: auto;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  scrollbar-width: thin;
}
.ctable { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.ctable th,
.ctable td { padding: 17px 22px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ctable thead th { padding-top: 22px; padding-bottom: 18px; color: var(--fg-3); font-size: 13.5px; font-weight: 550; }
.ctable tbody th { color: var(--fg); font-weight: 500; }
.ctable td { color: var(--fg-3); }
.ctable tbody tr:last-child th,
.ctable tbody tr:last-child td { border-bottom: 0; }
.ctable tbody tr { transition: background-color 0.2s; }
.ctable tbody tr:hover { background: var(--fill); }
.ctable .is-us { background: var(--fill); box-shadow: inset 1px 0 0 var(--line-2), inset -1px 0 0 var(--line-2); color: var(--fg); }
.ctable td.is-us b { color: var(--fg); font-weight: 600; }
.ctable__brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg); font-size: 15px; font-weight: 600; }
.ctable__brand svg { width: 20px; height: 20px; color: var(--fg); }
.ctable .i { display: inline-block; width: 18px; height: 18px; vertical-align: middle; }
.yes { color: var(--up); }
.yes--muted { color: var(--fg-3); }
.no { color: var(--line-3); }

/* ==========================================================================
   Pricing
   ========================================================================== */

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.plan {
  display: flex;
  flex-direction: column;
  padding: 26px 22px 24px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}
.plan__head h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.024em; }
.plan__for { margin: 0; color: var(--fg-2); font-size: 14.5px; }
.plan__price { display: flex; align-items: baseline; gap: 6px; margin: 26px 0 20px; }
.plan__price b { font-size: 46px; line-height: 1; letter-spacing: -0.05em; }
.plan__price span { color: var(--fg-3); font-size: 14px; }
.plan__note { margin: 22px 0 14px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 13px; }
.plan__list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.plan__list li { display: flex; align-items: flex-start; gap: 10px; }
.plan__list .i { width: 16px; height: 16px; margin-top: 3px; color: var(--fg); }
.plan__list b { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--fg); font-size: 14.5px; font-weight: 550; letter-spacing: -0.012em; }
.plan__list span { display: block; color: var(--fg-3); font-size: 13px; line-height: 1.45; }
.plan__list li.is-off b,
.plan__list li.is-off .i { color: var(--fg-3); }
.mult {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 600;
}
.plan--featured { box-shadow: inset 0 0 0 1.5px var(--fg), var(--shadow-sm); }

.pricing__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg-2);
  font-size: 14.5px;
}
.pricing__foot p { display: flex; align-items: center; gap: 10px; margin: 0; }
.pricing__foot p .i { width: 16px; height: 16px; color: var(--accent); }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq .section-head { position: sticky; top: 104px; margin: 0; }
.qa { border-bottom: 1px solid var(--line-2); }
.qa:first-child { border-top: 1px solid var(--line-2); }
.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  color: var(--fg);
  font-size: 17.5px;
  font-weight: 550;
  letter-spacing: -0.018em;
  list-style: none;
  cursor: pointer;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary .i { width: 20px; height: 20px; color: var(--fg-3); transition: transform 0.4s var(--ease), color 0.3s; }
.qa summary:hover .i { color: var(--fg); }
.qa[open] summary .i { transform: rotate(45deg); color: var(--fg); }
.qa__a { overflow: hidden; }
.qa__a p { max-width: 40em; margin: 0; padding: 0 44px 24px 0; color: var(--fg-2); font-size: 16px; line-height: 1.65; }

/* ==========================================================================
   Final CTA
   ========================================================================== */

.final { overflow: hidden; padding: clamp(100px, 12vw, 170px) 0; text-align: center; }
.final::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 42% 38% at 50% 42%, var(--sheet) 15%, transparent 100%);
  pointer-events: none;
}
.final__tape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 70%, transparent 100%);
  pointer-events: none;
}
.final__inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.final .h2 { max-width: 16ch; }
.final .lead { margin: 22px auto 40px; }
.composer--final { max-width: 700px; background: rgba(19, 19, 21, 0.86); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ==========================================================================
   Footer
   ========================================================================== */

.footer { padding: 80px 0 0; }
.footer__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: 48px; padding-bottom: 56px; }
.footer__brand .logo { margin-bottom: 18px; }
.footer__desc { max-width: 25em; margin: 0 0 22px; color: var(--fg-2); font-size: 14.5px; }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.footer__cols p { margin: 0 0 14px; color: var(--fg); font-size: 14px; font-weight: 600; }
.footer__cols a { display: block; width: fit-content; padding: 5px 0; color: var(--fg-2); font-size: 14.5px; text-decoration: none; transition: color 0.2s; }
.footer__cols a:hover { color: var(--fg); }
.footer__legal { display: grid; gap: 12px; padding: 28px 0; border-top: 1px solid var(--line-2); }
.footer__legal p { max-width: 118ch; margin: 0; color: var(--fg-3); font-size: 12.5px; line-height: 1.7; }
.footer__legal b { color: var(--fg-2); font-weight: 600; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line-2);
  color: var(--fg-3);
  font-size: 13px;
}
.footer__bottom p { margin: 0; }

/* ==========================================================================
   Sticky mobile CTA
   ========================================================================== */

.sticky-cta {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line-2), 0 20px 40px -16px rgba(14, 14, 17, 0.35);
  transform: translateY(150%);
  transition: transform 0.5s var(--ease);
}
[data-theme="dark"] .sticky-cta { box-shadow: 0 0 0 1px var(--line-2), 0 20px 40px -16px rgba(0, 0, 0, 0.9); }
.sticky-cta.is-on { transform: none; }
.sticky-cta b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.sticky-cta span { color: var(--fg-3); font-size: 12px; }

/* ==========================================================================
   Motion: reveal
   ========================================================================== */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }
.no-anim [data-reveal] { opacity: 1 !important; transform: none !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .app__body { grid-template-columns: 46px minmax(0, 1fr) 310px; height: 540px; }
  .card--agent { grid-column: span 6; }
  .card--walk,
  .card--code,
  .card--costs { grid-column: span 2; }
  .card--markets { grid-column: span 6; }
  .card--markets .mkt { height: 180px; }
  .nav__links a { padding: 8px 9px; }
}

@media (max-width: 1040px) {
  .theme { display: none; }
}

@media (max-width: 960px) {
  :root { --gutter: 20px; }

  .nav__links,
  .nav__login { display: none; }
  .nav__burger { display: block; }

  .section-head--split { grid-template-columns: 1fr; }
  .section-head--split .lead { padding-bottom: 0; }

  .ruled--3 { grid-template-columns: 1fr; }
  .ruled--3 > * { padding: 30px 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .ruled--3 > *:first-child { border-top: 0; }

  .brokers__inner { flex-direction: column; align-items: stretch; gap: 16px; }
  .brokers__label { max-width: none; text-align: center; }

  .app__bar { grid-template-columns: minmax(0, 1fr) auto; }
  .app__tabs { display: none; }
  .app__body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 300px 330px; height: auto; }
  .app__rail { display: none; }
  .app__chat { border-left: 0; border-top: 1px solid var(--line); }

  /* How: sticky stage on top, steps scroll beneath */
  .how__grid { grid-template-columns: 1fr; gap: 0; }
  .how__stage-wrap {
    order: -1;
    position: sticky;
    top: 72px;
    z-index: 3;
    padding-bottom: 14px;
    background: var(--sheet);
  }
  .how__stage-wrap::after {
    content: "";
    position: absolute;
    top: 100%; left: 0; right: 0;
    height: 44px;
    background: linear-gradient(var(--sheet), transparent);
    pointer-events: none;
  }
  .stage { position: relative; top: 0; height: min(400px, 48vh); }
  .how__steps { padding: 24px 0 6vh; }
  .step { justify-content: flex-start; min-height: 62vh; padding: 40px 0 0 30px; }
  .step::before { top: 52px; }

  .card--agent,
  .card--local { grid-template-columns: 1fr; }
  .card--agent .card__copy,
  .card--local .card__copy { padding: 28px 24px 8px; }
  .agent { margin: 14px; }
  .card--walk,
  .card--code,
  .card--costs { grid-column: span 3; }
  .card--costs { grid-column: span 6; }

  .datacard { grid-template-columns: 1fr; }
  .ruled--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0 !important; }
  .stat:nth-child(n + 3) { padding-top: 26px !important; }

  .faq__grid { grid-template-columns: 1fr; }
  .faq .section-head { position: static; }

  .footer__top { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .announce__long { display: none; }
  .announce__inner { justify-content: flex-start; padding: 9px 48px 9px var(--gutter); }

  .hero__title { font-size: clamp(2.5rem, 1.2rem + 7vw, 3.4rem); }
  .composer__bar { flex-direction: column; align-items: stretch; }
  .composer__chips { margin: 0 -6px; padding: 0 6px 2px; }
  .composer__btn { width: 100%; }
  .composer__hint { display: none; }

  .hero__stage { padding: 0 12px; }
  .frame { padding: 6px; border-radius: 20px; }
  .app { border-radius: 15px; }
  .app__bar { height: 46px; }
  .app__tools .switch,
  .app__ws,
  .app__sep,
  .chart-head__ohlc,
  .chart-head__legend { display: none; }
  .app__body { grid-template-rows: 250px 320px; }

  .marquee__track span { font-size: 18px; }

  .stage__bar { grid-template-columns: 1fr; padding: 0 8px; }
  .stage__dots,
  .stage__live { display: none; }
  .stage__tabs { font-size: 11.5px; }
  .stage__tabs span { padding: 6px 8px; }
  .scene { padding: 12px; }

  .br-lg { display: none; }
  .draw { grid-template-columns: 36px minmax(0, 1fr); gap: 8px; }
  .draw__tools .tool { width: 28px; height: 28px; }
  .note { display: none; }

  .define { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .define__chat { gap: 8px; padding: 0; }
  .q p { margin-bottom: 5px; font-size: 12px; }
  .q p .msg__av { display: none; }
  .opts { padding-left: 0; }
  .opts span { padding: 3px 8px; font-size: 11px; }
  .q:nth-child(3),
  .rules { display: none; }
  .code { padding: 10px; font-size: 10.5px; line-height: 1.65; }
  .code .ln { padding-left: 22px; }

  .bt__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .kpi { padding: 7px 10px; }
  .kpi b { font-size: 15px; }
  .bt__head .tag,
  .bt__trades { display: none; }

  .opt { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; }
  .opt__side { flex-direction: row; align-items: stretch; }
  .opt__label,
  .param:nth-of-type(n + 2),
  .opt__best { display: none; }
  .param { flex: 1; }
  .opt__count { flex: 1; margin-top: 0; padding: 8px 10px; }
  .opt__count b { font-size: 18px; }
  .opt__map { padding: 12px 10px 28px 28px; }
  .heat { gap: 2px; }

  .row { grid-template-columns: 1.6fr 1fr 1fr; }
  .row span:nth-child(3) { display: none; }
  .fr { grid-template-columns: 1fr 1fr 1fr; }
  .fr span:nth-child(1),
  .fr span:nth-child(4) { display: none; }
  .dep__conn { font-size: 10px; }

  .bento { gap: 12px; }
  .card--walk,
  .card--code,
  .card--costs,
  .card--markets { grid-column: span 6; }
  .agent__log { padding: 10px; font-size: 11px; }
  .agent__log li { gap: 10px; padding: 8px; }
  .card__copy { padding: 20px 22px 24px; }
  .local { padding: 0 14px; }
  .local__wire em { display: none; }
  .local__node > .i { width: 38px; height: 38px; padding: 9px; }
  .local__node--pc > .i { width: 48px; height: 48px; padding: 12px; }

  .datacard { padding: 28px 20px; }
  .panel { padding: 18px; }
  .bars li { grid-template-columns: 84px minmax(0, 1fr) 42px; gap: 10px; }

  .ideas__bar { flex-direction: column; align-items: stretch; }
  .ideas__nav { display: none; }

  .plans { grid-template-columns: 1fr; }
  .pricing__foot { flex-direction: column; align-items: flex-start; }

  .qa summary { padding: 20px 0; font-size: 16.5px; }
  .qa__a p { padding-right: 0; font-size: 15.5px; }

  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .footer { padding-bottom: 84px; }

  .sticky-cta { display: flex; }
}

@media (max-width: 400px) {
  .logo__word { font-size: 17px; }
  .nav__actions .btn--sm { padding: 0 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
}
