/* ============================================================
   HELIX — system styles
   Precision instrument. Hairlines everywhere; numbers prized.

   tt-web port (Phase 1 Commit 1, 2026-05-24):
   Global element resets (body, img, svg, a) scoped under .h-theme
   so they only fire on pages opted into the Helix design system.
   Box-sizing stays global — matches Bootstrap 4. html scroll-padding
   stays global — harmless. Component classes (.h-*) are unscoped:
   they only render when markup carries Helix classes.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; }

.h-theme {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 220ms ease, color 220ms ease;
}
.h-theme img,
.h-theme svg { display: block; max-width: 100%; }
.h-theme a { color: inherit; text-decoration: none; }

/* ---- layout ---- */
.h-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.h-section { padding-block: var(--section-pad); }
.h-band {
  background: var(--surface);
  border-block: var(--hairline);
}
.h-hairline-top    { border-top: var(--hairline); }
.h-hairline-bottom { border-bottom: var(--hairline); }

/* dot grid backdrop — a graticule, not decoration */
.h-grid-bg {
  background-image:
    radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: var(--dot-size) var(--dot-size);
  background-position: center;
}

/* ---- type ---- */
.h-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--signal);
  display: inline-flex; align-items: center; gap: 8px;
}
.h-eyebrow::before {
  content: "";
  width: 18px; height: 1px; background: var(--signal);
}
.h-eyebrow.ink { color: var(--slate); }
.h-eyebrow.ink::before { background: var(--slate); }

.h-display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  font-weight: 500;
  margin: 0;
  text-wrap: pretty;
}
.h-display .sig {
  position: relative;
  color: var(--signal);
}
/* a tiny corner-bracket flourish — terminal annotation */
.h-display .br {
  position: relative; padding-inline: 0.05em;
}
.h-display .br::before,
.h-display .br::after {
  content: ""; position: absolute;
  width: 0.5em; height: 0.5em;
  border: 1px solid var(--signal);
}
.h-display .br::before { top: 0; left: -0.15em; border-right: 0; border-bottom: 0; }
.h-display .br::after  { bottom: 0; right: -0.15em; border-left: 0; border-top: 0; }

.h-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.h-h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.18;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.015em;
}
.h-h4 {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 500;
  margin: 0;
}
.h-lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0;
  line-height: 1.5;
}
.h-body { color: var(--ink-soft); margin: 0; }
.h-micro { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--slate); letter-spacing: var(--tracking-mono); }
.h-mono  { font-family: var(--font-mono); font-feature-settings: "tnum" 1; letter-spacing: var(--tracking-mono); }
.h-numeric {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "ss01" 1;
  font-size: var(--fs-numeric);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ---- nav ---- */
.h-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: var(--hairline);
}
.h-nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 16px;
}
.h-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.h-brand__mark {
  display: inline-block;
  width: 18px; height: 18px;
  position: relative;
}
/* Tiny crosshair mark — the brand */
.h-brand__mark::before,
.h-brand__mark::after {
  content: ""; position: absolute;
  background: var(--ink);
}
.h-brand__mark::before { left: 50%; top: 0; bottom: 0; width: 1px; transform: translateX(-50%); }
.h-brand__mark__dot {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px;
  background: var(--signal);
  transform: translate(-50%, -50%);
}
.h-brand__mark::after { top: 50%; left: 0; right: 0; height: 1px; transform: translateY(-50%); }
.h-brand__build {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--slate);
  letter-spacing: 0.06em;
  padding-left: 4px;
}

.h-nav__links {
  display: flex;
  gap: 22px;
  margin-left: 14px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.h-nav__links a:hover { color: var(--signal); }
.h-nav__right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---- theme toggle ---- */
.h-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: var(--hairline);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.h-toggle:hover { border-color: var(--rule-strong); color: var(--ink); }
.h-toggle__dot {
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--signal);
}

/* ---- buttons ---- */
.h-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 160ms, color 160ms, border-color 160ms, transform 80ms;
}
.h-btn:active { transform: translateY(1px); }
.h-btn--primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.h-btn--primary:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.h-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.h-btn--ghost:hover { border-color: var(--ink); }
.h-btn--text {
  height: auto; padding: 0; border: 0;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}
.h-btn--text::after { content: " →"; }
.h-btn--text:hover { color: var(--ink); }
.h-btn--sm { height: 32px; padding: 0 12px; font-size: 0.82rem; }

/* ---- chips / status ---- */
.h-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface);
}
.h-chip--live {
  color: var(--signal);
  border-color: color-mix(in oklab, var(--signal) 50%, transparent);
  background: var(--signal-tint);
}
.h-chip--paper { color: var(--slate); }
.h-chip--pos {
  color: var(--positive);
  border-color: color-mix(in oklab, var(--positive) 50%, transparent);
  background: var(--positive-soft);
}
.h-chip--neg {
  color: var(--negative);
  border-color: color-mix(in oklab, var(--negative) 50%, transparent);
  background: var(--negative-soft);
}
.h-chip--dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

.h-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}

/* corner ticks — instrument detail */
.h-tick {
  position: relative;
  padding: 1px;
}
.h-tick::before, .h-tick::after,
.h-tick > .h-tick__br1::before, .h-tick > .h-tick__br1::after {
  content: ""; position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--rule-strong);
}
.h-tick::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.h-tick::after  { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.h-tick > .h-tick__br1 { position: absolute; inset: 0; pointer-events: none; }
.h-tick > .h-tick__br1::before { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.h-tick > .h-tick__br1::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ---- card ---- */
.h-card {
  background: var(--surface);
  border: var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.h-card__head { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.h-card__title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 500; letter-spacing: -0.015em; }
.h-card__sub   { color: var(--slate); font-size: 0.84rem; font-family: var(--font-mono); }
.h-card__stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  padding-top: 12px;
  border-top: var(--hairline);
}
.h-card__stat { display: flex; flex-direction: column; gap: 2px; padding-right: 12px; border-right: var(--hairline); }
.h-card__stat:last-child { border-right: 0; padding-left: 12px; padding-right: 0; }
.h-card__stat:not(:first-child) { padding-left: 12px; }
.h-card__stat__lbl { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.h-card__stat__val { font-family: var(--font-mono); font-feature-settings: "tnum" 1; font-size: 1.05rem; }
.h-card__stat__val--pos { color: var(--positive); }
.h-card__stat__val--sig { color: var(--signal); }

/* ---- hero ---- */
.h-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  padding-top: clamp(56px, 9vw, 120px);
  padding-bottom: clamp(56px, 9vw, 120px);
  align-items: end;
}
.h-hero__lede { max-width: 38ch; color: var(--ink-soft); font-size: var(--fs-lead); }
.h-hero__cta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 28px;
}
.h-hero__trust {
  margin-top: 18px;
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--slate);
}
.h-hero__trust span::before { content: "·"; margin-right: 10px; color: var(--rule-strong); }
.h-hero__trust span:first-child::before { content: ""; margin: 0; }

/* hero coordinate labels (terminal flourish) */
.h-hero__coords {
  position: absolute; top: 8px; left: 0; right: 0;
  display: flex; justify-content: space-between;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--slate-soft);
  letter-spacing: 0.08em;
}

/* ---- stats bar ---- */
.h-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.h-stats__cell {
  display: flex; flex-direction: column; gap: 8px;
  padding: 36px 28px;
  border-right: var(--hairline);
}
.h-stats__cell:last-child { border-right: 0; }
.h-stats__lead {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate);
}
.h-stats__num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 3vw, 2.6rem);
  letter-spacing: -0.025em;
  line-height: 1;
}
.h-stats__lbl { font-size: 0.86rem; color: var(--ink-soft); max-width: 26ch; }

/* ---- method (3-step) ---- */
.h-method { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; }
.h-method__list { display: grid; gap: 0; }
.h-method__step {
  display: grid; grid-template-columns: 60px 1fr; gap: 24px;
  padding: 28px 0;
  border-top: var(--hairline);
}
.h-method__step:first-child { border-top: 0; padding-top: 0; }
.h-method__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--signal);
  padding-top: 4px;
}
.h-method__body { display: flex; flex-direction: column; gap: 10px; }
.h-method__pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.h-method__pills span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 4px 10px;
  border: var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
}

/* ---- pull / quote ---- */
.h-pull {
  background: var(--surface);
  border-block: var(--hairline);
  padding-block: clamp(56px, 8vw, 110px);
}
.h-pull__text {
  max-width: 60rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: pretty;
}
.h-pull__text .sig { color: var(--signal); }
.h-pull__attrib {
  margin-top: 28px;
  display: flex; gap: 12px; align-items: center;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.h-pull__avatar {
  width: 32px; height: 32px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 600;
}

/* ---- brokers ---- */
.h-brokers {
  display: grid; grid-template-columns: 1fr 2fr; gap: 56px;
  align-items: start;
}
.h-brokers__table {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.h-brokers__cell {
  padding: 18px 18px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border-right: var(--hairline);
  border-bottom: var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.h-brokers__cell:nth-child(4n) { border-right: 0; }
.h-brokers__cell:nth-last-child(-n+4) { border-bottom: 0; }
.h-brokers__cell .h-mono { color: var(--slate); font-size: 0.74rem; }

/* ---- cta close ---- */
.h-cta {
  text-align: center;
  padding-block: clamp(64px, 10vw, 140px);
  display: flex; flex-direction: column; gap: 22px; align-items: center;
}
.h-cta .h-display { text-align: center; max-width: 24ch; }
.h-cta__sub { color: var(--ink-soft); max-width: 50ch; margin: 0 auto; }

/* ---- footer ---- */
.h-footer {
  border-top: var(--hairline);
  padding-block: 56px;
  background: var(--paper);
}
.h-footer__grid {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px;
}
.h-footer__legal a { color: var(--ink-soft); text-decoration: none; }
.h-footer__legal a:hover { color: var(--signal); }
.h-footer__brand { display: flex; flex-direction: column; gap: 12px; }
.h-footer__col h5 {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--slate); font-weight: 500;
}
.h-footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.h-footer__col a { color: var(--ink-soft); font-size: 0.92rem; }
.h-footer__col a:hover { color: var(--signal); }
.h-footer__legal {
  margin-top: 40px;
  display: flex; justify-content: space-between; gap: 18px;
  font-family: var(--font-mono);
  font-size: 0.74rem; color: var(--slate);
  border-top: var(--hairline);
  padding-top: 22px;
}

/* ---- sparkline ---- */
.h-spark { width: 130px; height: 38px; color: var(--signal); }
.h-spark path { fill: none; stroke: currentColor; stroke-width: 1.2; }
.h-spark.pos { color: var(--positive); }
.h-spark.neg { color: var(--negative); }

/* ---- placeholder ---- */
.h-placeholder {
  background:
    repeating-linear-gradient(135deg,
      transparent 0 8px,
      color-mix(in oklab, var(--ink) 6%, transparent) 8px 9px);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: grid; place-items: center;
  padding: 24px;
}

@media (max-width: 960px) {
  .h-hero { grid-template-columns: 1fr; gap: 28px; }
  .h-stats { grid-template-columns: repeat(2, 1fr); }
  .h-stats__cell:nth-child(2) { border-right: 0; }
  .h-method { grid-template-columns: 1fr; gap: 28px; }
  .h-brokers { grid-template-columns: 1fr; }
  .h-brokers__table { grid-template-columns: repeat(2, 1fr); }
  .h-brokers__cell:nth-child(4n) { border-right: var(--hairline); }
  .h-brokers__cell:nth-child(2n) { border-right: 0; }
  .h-footer__grid { grid-template-columns: 1fr 1fr; }
  .h-nav__links { display: none; }
}

/* Tradetron real logo wordmark — theme-aware swap */
.tt-logo{height:26px;width:auto;display:block}
.h-footer .tt-logo,.h-footer__brand .tt-logo{height:20px}
.tt-logo--light{display:none}
body.theme-dark .tt-logo,html.dark .tt-logo--dark,[data-theme="dark"] .tt-logo--dark{display:none}
body.theme-dark .tt-logo,html.dark .tt-logo--light,[data-theme="dark"] .tt-logo--light{display:block}

/* --- logo render fix (authoritative) --- */
.tt-logo{height:28px !important;width:auto !important;display:inline-block !important;vertical-align:middle}
.h-footer .tt-logo,.h-footer__brand .tt-logo,[class*="footer"] .tt-logo{height:22px !important}
.tt-logo--light{display:none !important}
body.theme-dark .tt-logo,html.dark .tt-logo--dark,[data-theme="dark"] .tt-logo--dark{display:none !important}
body.theme-dark .tt-logo,html.dark .tt-logo--light,[data-theme="dark"] .tt-logo--light{display:inline-block !important}

/* --- region (India/US) toggle --- */
.h-region{display:inline-flex;align-items:center;border:var(--hairline);border-radius:var(--radius-pill);overflow:hidden;margin-right:12px;height:30px;flex:0 0 auto}
.h-region__opt{display:inline-flex;align-items:center;gap:5px;padding:0 13px;height:100%;font:500 0.74rem/1 var(--font-mono);letter-spacing:.06em;color:var(--slate);text-decoration:none;transition:background .15s,color .15s}
.h-region__opt:hover{color:var(--ink)}
.h-region__opt.is-active{background:var(--signal);color:#fff}

/* --- inline video embed (16:9) --- */
.h-video__frame{position:relative;width:100%;padding-top:56.25%;border:var(--hairline);border-radius:var(--radius-lg);overflow:hidden;background:#000}
.h-video__frame iframe,.h-video__frame video{position:absolute;inset:0;width:100%;height:100%;border:0;object-fit:cover}

/* --- "try it" banner (Pin Range CTA) --- */
.h-try{display:flex;align-items:center;justify-content:space-between;gap:28px;flex-wrap:wrap;border:var(--hairline);border-left:3px solid var(--signal);border-radius:var(--radius-md);padding:24px 28px;background:var(--signal-tint)}
.h-try__txt{max-width:62ch}

/* --- dropdown menu (deployed ellipsis) --- */
.h-menu{position:relative;display:inline-block}
.h-menu__btn{background:none;border:0;cursor:pointer;color:var(--slate);font-size:1.15rem;line-height:1;padding:4px 9px;border-radius:var(--radius-sm)}
.h-menu__btn:hover{background:var(--paper-2);color:var(--ink)}
.h-menu__pop{position:absolute;right:0;top:calc(100% + 6px);min-width:210px;background:var(--surface);border:var(--hairline);border-radius:var(--radius-md);box-shadow:var(--shadow-md);padding:8px 0;z-index:50;display:none}
.h-menu.is-open .h-menu__pop{display:block}
.h-menu__group{padding:8px 16px 4px;font:600 0.64rem/1 var(--font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--slate-soft)}
.h-menu__item{display:block;padding:8px 16px;font-size:0.86rem;color:var(--ink-soft);text-decoration:none;cursor:pointer;background:none;border:0;width:100%;text-align:left;font-family:var(--font-body)}
.h-menu__item:hover{background:var(--paper-2);color:var(--ink)}
.h-menu__item--danger{color:var(--negative)}

/* --- modal overlay --- */
.h-modal{position:fixed;inset:0;background:rgba(11,18,32,.55);display:none;align-items:center;justify-content:center;z-index:200;padding:24px}
.h-modal.is-open{display:flex}
.h-modal__card{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);max-width:540px;width:100%;max-height:88vh;overflow:auto}
.h-modal__head{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:var(--hairline)}
.h-modal__body{padding:24px}
.h-modal__foot{display:flex;gap:12px;justify-content:flex-end;padding:18px 24px;border-top:var(--hairline)}
.h-modal__close{background:none;border:0;font-size:1.4rem;cursor:pointer;color:var(--slate);line-height:1}

/* appended: newer marketing-page component classes (h-mono, h-method) from current static system.css */
.h-mono  { font-family: var(--font-mono); font-feature-settings: "tnum" 1; letter-spacing: var(--tracking-mono); }
.h-method { display: grid; grid-template-columns: 1fr 2fr; gap: 56px; }
.h-method__list { display: grid; gap: 0; }
.h-method__step {
  display: grid; grid-template-columns: 60px 1fr; gap: 24px;
  padding: 28px 0;
  border-top: var(--hairline);
}
.h-method__step:first-child { border-top: 0; padding-top: 0; }
.h-method__num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--signal);
  padding-top: 4px;
}
.h-method__body { display: flex; flex-direction: column; gap: 10px; }
.h-method__pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.h-method__pills span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 4px 10px;
  border: var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface);
}
