/* QScreener marketing — Glitch Market palette, dark-first, gradient-led.
   Tokens mirror brand/qscreener-design-system/project/colors_and_type.css. */

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2-variations"),
       url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2-variations"),
       url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bull: #3eff15;
  --bear: #ff2d6f;
  --warn: #ffce1b;
  --info: #00e5ff;
  --rrg-leading: #3eff15;
  --rrg-improving: #00e5ff;
  --rrg-weakening: #ffce1b;
  --rrg-lagging: #ff2d6f;

  --bg: #000000;
  --elev-1: #0a0a0a;
  --elev-2: #171717;
  --elev-3: #262626;
  --fg: #ffffff;
  --fg-muted: #d4d4d4;
  --fg-subtle: #a3a3a3;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  --font-display: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 999px;

  --maxw: 1180px;

  /* Reserved marketing gradients (sanctioned for this surface only). */
  --grad-signal: linear-gradient(135deg, #39ff14 0%, #00ffff 100%);
  --grad-risk: linear-gradient(135deg, #ff007a 0%, #ff9500 100%);
  --grad-sheen: linear-gradient(160deg, #262626 0%, #0a0a0a 60%, #000 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--fg); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
em { color: var(--fg); font-style: italic; }
strong { color: var(--fg); font-weight: 700; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--bull); color: #000; padding: 10px 16px; border-radius: var(--r-sm);
}
.skip-link:focus { left: 12px; top: 12px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 14px;
}

.grad-text {
  background: var(--grad-signal);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.grad-text--bear { background: var(--grad-risk); -webkit-background-clip: text; background-clip: text; }
.grad-text--info { background: linear-gradient(135deg, #00ffff, #4f8aff); -webkit-background-clip: text; background-clip: text; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: var(--r-full);
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn--lg { padding: 15px 30px; font-size: 15px; }
.btn--primary {
  color: #000; background: var(--grad-signal);
  box-shadow: 0 8px 30px -10px rgba(57, 255, 20, 0.6);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(0, 255, 255, 0.55); }
.btn--ghost {
  color: var(--fg); background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong); backdrop-filter: blur(6px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-1px); }

/* ───────── Nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); }
.brand__mark { display: block; border-radius: 7px; }
.brand__word { font-size: 18px; letter-spacing: -0.02em; }
.brand__dot { color: var(--bull); }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { font-size: 14px; color: var(--fg-subtle); transition: color .15s ease; }
.nav__links a:hover { color: var(--fg); }
.nav__cta { margin-left: 8px; }
@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
}

/* ───────── Hero ───────── */
.hero { position: relative; overflow: hidden; padding: 120px 24px 110px; }
.hero__glow {
  position: absolute; inset: -40% -10% auto -10%; height: 720px;
  background:
    radial-gradient(60% 60% at 25% 20%, rgba(57, 255, 20, 0.18), transparent 70%),
    radial-gradient(55% 55% at 80% 10%, rgba(0, 255, 255, 0.16), transparent 70%),
    radial-gradient(50% 50% at 60% 80%, rgba(255, 0, 122, 0.1), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.hero__inner { position: relative; max-width: 880px; margin: 0 auto; text-align: center; }
.hero__title { font-size: clamp(44px, 8vw, 92px); letter-spacing: -0.03em; margin-bottom: 26px; }
.hero__lede { font-size: clamp(16px, 2.2vw, 21px); color: var(--fg-muted); max-width: 680px; margin: 0 auto 36px; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero__meta {
  margin-top: 26px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-subtle);
}

/* ───────── Sections ───────── */
.section { max-width: var(--maxw); margin: 0 auto; padding: 96px 24px; }
.section__head { max-width: 720px; margin-bottom: 44px; }
.section h2 { font-size: clamp(28px, 4.4vw, 46px); margin-bottom: 18px; }
.section__sub { font-size: 17px; color: var(--fg-muted); }

.livebar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.livebar__live {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 7px 14px 7px 12px; border-radius: var(--r-full);
  border: 1px solid rgba(57, 255, 20, 0.45); color: var(--bull);
  background: rgba(57, 255, 20, 0.08);
}
.livebar__pulse {
  width: 8px; height: 8px; border-radius: var(--r-full);
  background: var(--bull); box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.7);
  animation: live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.65); }
  70% { box-shadow: 0 0 0 9px rgba(57, 255, 20, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 255, 20, 0); }
}
@media (prefers-reduced-motion: reduce) { .livebar__pulse { animation: none; } }
.livebar__live[data-state="loading"] {
  border-color: var(--border-strong); color: var(--fg-subtle); background: rgba(255, 255, 255, 0.03);
}
.livebar__live[data-state="loading"] .livebar__pulse { background: var(--fg-subtle); animation: none; }
.livebar__live[data-state="down"] {
  border-color: rgba(255, 45, 111, 0.45); color: var(--bear); background: rgba(255, 45, 111, 0.08);
}
.livebar__live[data-state="down"] .livebar__pulse { background: var(--bear); animation: none; }

/* Asset-class tag (real on constituents — group rows span asset classes). */
.atag {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-full); border: 1px solid transparent;
}
.atag--crypto { color: var(--bull); border-color: rgba(57, 255, 20, 0.4); background: rgba(57, 255, 20, 0.08); }
.atag--equity { color: var(--info); border-color: rgba(0, 229, 255, 0.4); background: rgba(0, 229, 255, 0.08); }
.atag--etf { color: var(--warn); border-color: rgba(255, 206, 27, 0.4); background: rgba(255, 206, 27, 0.08); }
.atag--mixed { color: #9b8cff; border-color: rgba(155, 140, 255, 0.42); background: rgba(155, 140, 255, 0.1); }
.atag--fx, .atag--future, .atag--index, .atag--other {
  color: var(--fg-subtle); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.04);
}

/* ───────── Live grid / panels ───────── */
.live-grid, .ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.qscore__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) {
  .live-grid, .ai-grid, .qscore__grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--grad-sheen);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.5), rgba(0, 255, 255, 0.5), transparent);
}
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel__head h3 { font-size: 18px; }
.panel__hint, .tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-subtle); }
.tag { color: var(--info); }
.panel--code p { font-size: 14px; margin-bottom: 14px; }
.panel--code pre {
  background: #000; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; overflow-x: auto;
}
.panel--code code { font-family: var(--font-mono); font-size: 13px; color: var(--bull); white-space: pre; }
.panel__foot { font-size: 13px; color: var(--fg-subtle); margin-top: 12px; }

/* ───────── Matrix ───────── */
/* ~5.5 rows tall so the matrix + RRG fit one phone screen; scrolls inside. */
.matrix { display: flex; flex-direction: column; gap: 4px; max-height: 332px; overflow-y: auto; padding-top: 1px; }
.matrix__loading { color: var(--fg-subtle); font-family: var(--font-mono); font-size: 13px; padding: 30px 0; text-align: center; }
.mhead, .mrow {
  display: grid; grid-template-columns: 22px minmax(132px, 1.2fr) 78px 92px repeat(3, minmax(58px, .6fr)) 56px 62px;
  align-items: center; gap: 10px;
}
.mhead {
  position: sticky; top: 0; z-index: 2;
  padding: 9px 11px 9px;
  margin-bottom: 2px;
  background: var(--elev-1);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 10px -8px rgba(0, 0, 0, 0.9);
  color: var(--fg-subtle);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mhead__cell--ret1w, .mhead__cell--ret1m, .mhead__cell--ret3m, .mhead__cell--rs, .mhead__cell--mom { text-align: right; }
.mrow {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent; cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background .12s ease, border-color .12s ease;
}
.mrow:hover { background: rgba(255, 255, 255, 0.06); }
.mrow:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.mrow--active { border-color: var(--bull); background: rgba(62, 255, 21, 0.08); }
.mrow--locked {
  overflow: hidden;
  text-decoration: none;
  min-height: 48px;
  background:
    linear-gradient(90deg, rgba(57, 255, 20, 0.08), rgba(0, 229, 255, 0.08), rgba(255, 45, 111, 0.07)),
    rgba(255, 255, 255, 0.025);
}
.mrow--locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.18), rgba(0,0,0,0.45) 45%, rgba(0,0,0,0.86));
  backdrop-filter: blur(5px);
  pointer-events: none;
}
.mrow__rank { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); }
.mrow__name { min-width: 0; font-size: 14px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrow__asset { display: flex; align-items: center; min-width: 0; }
.mrow__quad {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mrow__metric { font-family: var(--font-mono); font-size: 12px; font-weight: 400; text-align: right; color: var(--fg-muted); }
.mrow__heat {
  height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: #000;
}
.mrow__blur { filter: blur(3px); opacity: .7; user-select: none; }
.mrow__cta {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: #000;
  background: var(--grad-signal);
  border-radius: var(--r-full);
  padding: 7px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

@media (min-width: 1080px) {
  .live-grid { grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); }
}
/* Two-column layout: the matrix panel stretches to the RRG panel's height
   (grid stretch) and the matrix flex-fills + scrolls so it doesn't leave the
   container half-empty. The ~5.5-row cap stays for the stacked mobile view. */
@media (min-width: 901px) {
  .live-grid > .panel { display: flex; flex-direction: column; }
  .live-grid > .panel .matrix { max-height: none; flex: 1 1 auto; min-height: 0; }
}
@media (max-width: 1120px) {
  .mhead, .mrow { grid-template-columns: 22px minmax(116px, 1fr) 72px 82px 70px 56px; }
  .mhead__cell--ret1w, .mhead__cell--ret1m, .mhead__cell--mom,
  .mrow__metric--1w, .mrow__metric--1m, .mrow__metric--mom { display: none; }
}
@media (max-width: 520px) {
  .section { padding-left: 16px; padding-right: 16px; }
  .panel { padding: 16px; }
  .panel__head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .mhead, .mrow { grid-template-columns: minmax(0, 1fr) 66px 78px 64px; gap: 8px; }
  .mhead__cell--rank, .mhead__cell--rs,
  .mrow__rank, .mrow__metric--rs { display: none; }
  .mrow { padding: 9px; }
  .mrow__quad { font-size: 10px; }
  .mrow__cta { right: 8px; padding: 7px 9px; font-size: 11px; }
}

/* ───────── RRG ───────── */
.rrg { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 460px; }
.rrg svg { width: 100%; height: 100%; display: block; }
.rrg__legend {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-subtle);
}
.dot { width: 9px; height: 9px; border-radius: var(--r-full); display: inline-block; margin-left: 14px; }
.dot:first-child { margin-left: 0; }
.dot--leading { background: var(--rrg-leading); }
.dot--improving { background: var(--rrg-improving); }
.dot--weakening { background: var(--rrg-weakening); }
.dot--lagging { background: var(--rrg-lagging); }
.live-error { margin-top: 22px; color: var(--bear); font-family: var(--font-mono); font-size: 13px; }

/* ───────── Constituents list ───────── */
.panel--constituents { margin-top: 20px; }
.con-parent { color: var(--bull); }
.clist { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; padding-top: 1px; }
.chead, .crow {
  display: grid;
  grid-template-columns: 26px minmax(150px, 1.4fr) 78px 96px 56px 72px;
  align-items: center; gap: 12px;
}
.chead {
  position: sticky; top: 0; z-index: 2;
  padding: 9px 11px; margin-bottom: 2px;
  background: var(--elev-1); border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 10px -8px rgba(0, 0, 0, 0.9);
  color: var(--fg-subtle); font-family: var(--font-mono);
  font-size: 10px; line-height: 1.5; letter-spacing: 0.08em; text-transform: uppercase;
}
.chead__cell--rs, .chead__cell--ret3m { text-align: right; }
.crow {
  position: relative; min-height: 46px;
  padding: 9px 11px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.02); border: 1px solid transparent;
}
.crow--locked {
  overflow: hidden; text-decoration: none; min-height: 48px;
  background:
    linear-gradient(90deg, rgba(57, 255, 20, 0.08), rgba(0, 229, 255, 0.08), rgba(255, 45, 111, 0.07)),
    rgba(255, 255, 255, 0.025);
}
.crow--locked::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.18), rgba(0,0,0,0.45) 45%, rgba(0,0,0,0.86));
  backdrop-filter: blur(5px); pointer-events: none;
}
.crow__rank { font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); }
.crow__name { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.crow__name strong { font-size: 14px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow__sub { font-size: 12px; color: var(--fg-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow__asset { display: flex; }
.crow__quad {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crow__metric { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--fg-muted); }
.crow__heat {
  height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: #000;
}
@media (max-width: 760px) {
  .chead, .crow { grid-template-columns: minmax(0, 1fr) 70px 84px 64px; gap: 8px; }
  .chead__cell--rank, .chead__cell--rs, .crow__rank, .crow__metric--rs { display: none; }
}

/* ───────── Q-Score ───────── */
.section--qscore { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature-list { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.feature-list li { font-size: 16px; color: var(--fg-muted); padding-left: 18px; position: relative; }
.feature-list li::before { content: "›"; position: absolute; left: 0; color: var(--bull); font-weight: 700; }
.qscore__viz { display: flex; justify-content: center; }
.pressure {
  width: 100%; max-width: 320px; aspect-ratio: 1 / 1;
  background: var(--grad-sheen); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 26px;
  display: flex; align-items: flex-end; gap: 22px; position: relative;
}
.pressure__bar { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: var(--r-sm); background: rgba(255,255,255,0.03); }
.pressure__bar span { display: block; width: 100%; border-radius: var(--r-sm); }
.pressure__bar--bull span { background: linear-gradient(180deg, #39ff14, #1aaa00); box-shadow: 0 0 24px rgba(57,255,20,.5); }
.pressure__bar--bear span { background: linear-gradient(180deg, #ff007a, #a60050); box-shadow: 0 0 24px rgba(255,0,122,.4); }
.pressure__net {
  position: absolute; top: 18px; left: 26px;
  font-family: var(--font-mono); font-size: 13px; color: var(--fg-subtle);
}
.pressure__net strong { color: var(--bull); font-size: 20px; display: block; }

/* ───────── Surfaces ───────── */
.surface-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .surface-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .surface-grid { grid-template-columns: 1fr; } }
.surface {
  background: var(--grad-sheen); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px;
}
.surface h3 { font-size: 18px; }
.surface p { font-size: 14px; flex: 1; }
.badge {
  align-self: flex-start; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn);
  border: 1px solid rgba(255, 206, 27, 0.4); border-radius: var(--r-full); padding: 6px 12px;
}

/* ───────── CTA band + footer ───────── */
.cta-band {
  max-width: var(--maxw); margin: 0 auto; padding: 110px 24px; text-align: center;
}
.cta-band h2 { font-size: clamp(30px, 5vw, 56px); margin-bottom: 32px; }
.footer { border-top: 1px solid var(--border); }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.footer__links { display: flex; gap: 22px; margin-left: auto; }
.footer__links a { font-size: 13px; color: var(--fg-subtle); }
.footer__links a:hover { color: var(--fg); }
.footer__fine { width: 100%; font-family: var(--font-mono); font-size: 12px; color: var(--fg-subtle); letter-spacing: 0.06em; }
