:root {
  color-scheme: dark;
  --ink: #f6f8fb;
  --muted: #aab5c3;
  --line: rgba(255, 255, 255, 0.13);
  --panel: #0d1118;
  --panel-2: #141a24;
  --black: #030406;
  --blue: #0282cf;
  --blue-bright: #16a9ec;
  --gold: #d7a643;
  --gold-soft: #f2d587;
  --rose: #d24d7a;
  --green: #52d18c;
  --red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--black);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

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

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 76px;
  padding: 8px clamp(20px, 5vw, 72px);
  background: linear-gradient(180deg, rgba(3, 4, 6, 0.92), rgba(3, 4, 6, 0.18));
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: clamp(108px, 11vw, 140px);
  height: clamp(32px, 3.8vw, 42px);
  max-height: 42px;
  overflow: hidden;
  line-height: 0;
  min-width: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.nav-links,
.hero-actions,
.footer {
  display: flex;
  align-items: center;
}

.nav-links {
  gap: clamp(12px, 2vw, 26px);
  color: var(--muted);
  font-size: 0.86rem;
}

.ai-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(215, 166, 67, 0.44);
  padding: 8px 11px;
  color: var(--gold-soft);
  background: rgba(3, 4, 6, 0.48);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-button,
.rail-button,
.small-action,
.text-action,
.terminal-tab,
.score-ring {
  border: 0;
  color: inherit;
  background: transparent;
}

.nav-button {
  padding: 0;
  transition: color 160ms ease;
}

.nav-button:hover,
.nav-button.active {
  color: var(--ink);
}

.app-view {
  display: none;
}

.app-view.active {
  display: grid;
}

.hero {
  position: relative;
  min-height: 94svh;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  align-items: end;
  gap: clamp(30px, 5vw, 72px);
  overflow: hidden;
  padding: 174px clamp(20px, 5vw, 72px) clamp(42px, 8vh, 78px);
  background:
    radial-gradient(circle at 78% 28%, rgba(215, 166, 67, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(2, 130, 207, 0.24), transparent 34%),
    var(--black);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, transparent, black 22%, black 78%, transparent);
}

.market-grid {
  position: absolute;
  inset: 21% clamp(20px, 5vw, 72px) auto auto;
  display: grid;
  width: min(520px, 58vw);
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  opacity: 0.28;
}

.market-grid span {
  min-height: 54px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(22, 169, 236, 0.18), rgba(215, 166, 67, 0.1));
  animation: tilePulse 5s ease-in-out infinite;
}

.market-grid span:nth-child(3n) {
  animation-delay: 700ms;
}

.ticker-tape {
  position: absolute;
  z-index: 2;
  top: 76px;
  left: clamp(20px, 5vw, 72px);
  right: clamp(20px, 5vw, 72px);
  display: flex;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.ticker-tape span {
  flex: 1 0 180px;
  min-height: 42px;
  padding: 11px 14px;
  background: rgba(13, 17, 24, 0.82);
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.ticker-tape b {
  color: var(--ink);
}

.ticker-tape em {
  font-style: normal;
}

.hero-content,
.terminal-panel {
  position: relative;
  z-index: 1;
}

.domain,
.section-label {
  margin: 0 0 16px;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.intro h2,
.positions h2,
.workspace h2,
.footer h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.02;
}

.hero h1 {
  max-width: 980px;
  font-size: clamp(3.1rem, 7.1vw, 6.7rem);
  font-weight: 760;
}

.hero-copy {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.12rem, 2vw, 1.38rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button,
.small-action,
.text-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 0 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  font-weight: 760;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.button:hover,
.small-action:hover,
.text-action:hover,
.terminal-tab:hover,
.position-card:hover,
.quote-card:hover {
  transform: translateY(-2px);
}

.button.primary {
  border-color: rgba(215, 166, 67, 0.9);
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: #171006;
}

.button.secondary {
  border-color: rgba(22, 169, 236, 0.5);
}

.button.dark {
  width: 100%;
}

.terminal-panel {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.terminal-panel > div {
  padding: 22px;
  background: rgba(13, 17, 24, 0.82);
  backdrop-filter: blur(16px);
}

.terminal-panel span,
.metrics span,
.metrics small {
  display: block;
  color: var(--muted);
}

.terminal-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.intro,
.positions,
.workspace,
.footer {
  padding: clamp(64px, 10vw, 116px) clamp(20px, 5vw, 72px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(280px, 1fr);
  gap: clamp(36px, 7vw, 86px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.intro h2,
.positions h2,
.workspace h2,
.footer h2 {
  max-width: 920px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
}

.intro > p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--black);
}

.principles article {
  min-height: 320px;
  padding: clamp(28px, 5vw, 54px);
  border-right: 1px solid var(--line);
}

.principles article:last-child {
  border-right: 0;
}

.principles span,
.workflow-grid span {
  color: var(--blue-bright);
  font-size: 0.82rem;
  font-weight: 800;
}

.principles h3,
.workflow-grid h3 {
  margin: 64px 0 12px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  line-height: 1.14;
}

.principles p,
.workflow-grid p {
  margin: 0;
  color: var(--muted);
}

.positions,
.workspace {
  min-height: 78svh;
  background: var(--panel-2);
}

.positions {
  gap: clamp(28px, 5vw, 54px);
  background:
    linear-gradient(180deg, rgba(22, 169, 236, 0.08), transparent 36%),
    var(--panel-2);
}

.positions-heading,
.section-head,
.model-lab-heading,
.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.model-stamp {
  min-width: min(340px, 100%);
  border: 1px solid var(--line);
  padding: 20px;
  background: rgba(3, 4, 6, 0.34);
}

.model-stamp span,
.model-stamp small,
.target-strip span,
.quote-card small {
  display: block;
  color: var(--muted);
}

.model-stamp strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--gold-soft);
  font-size: 1.35rem;
}

.live-dashboard,
.exposure-panel,
.position-overview,
.research-terminal,
.model-lab {
  border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 34px);
  background: rgba(3, 4, 6, 0.2);
}

.section-head h3,
.exposure-panel h3,
.model-lab h3 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.08;
}

.quote-grid,
.position-grid,
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.quote-card,
.position-card,
.workflow-grid article {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(22, 169, 236, 0.08), transparent 46%),
    var(--panel);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.quote-card {
  min-height: 240px;
  padding: 22px;
}

.quote-card:hover,
.position-card:hover,
.workflow-grid article:hover {
  border-color: rgba(215, 166, 67, 0.35);
}

.quote-card-top,
.position-topline,
.memo-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 18px;
}

.quote-card-top span,
.ticker {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quote-card h4,
.position-card h3,
.memo-heading h3 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.6rem);
  line-height: 1.02;
}

.quote-card-top > strong,
.memo-score {
  display: grid;
  min-width: 48px;
  min-height: 48px;
  place-items: center;
  border: 1px solid currentColor;
  font-size: 0.9rem;
}

.quote-price {
  margin-top: 28px;
  color: var(--ink);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 760;
  line-height: 1;
}

.quote-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.positive,
.strong {
  color: var(--green);
}

.negative,
.caution {
  color: var(--red);
}

.watch {
  color: var(--gold-soft);
}

.target-meter,
.bar {
  overflow: hidden;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
}

.target-meter span,
.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue-bright), var(--gold-soft));
  transition: width 260ms ease;
}

.exposure-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-top: 28px;
}

.exposure-bars,
.risk-stack {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.exposure-bars article,
.risk-stack article {
  padding: 20px;
  background: var(--panel);
}

.exposure-bars article {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) 1fr;
  align-items: center;
  gap: 18px;
}

.exposure-bars strong,
.risk-stack strong {
  display: block;
  color: var(--gold-soft);
  font-size: 1.5rem;
}

.exposure-bars span,
.risk-stack span,
.risk-stack small {
  color: var(--muted);
}

.position-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.position-card {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 620px;
  padding: clamp(22px, 3vw, 32px);
}

.score-ring {
  --score: 270deg;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 54%, transparent 56%),
    conic-gradient(currentColor var(--score), rgba(255, 255, 255, 0.12) 0deg);
  font-weight: 900;
}

.target-strip,
.scenario-row {
  display: grid;
  gap: 1px;
}

.target-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--line);
}

.target-strip > div {
  min-height: 112px;
  padding: 16px;
  background: rgba(3, 4, 6, 0.36);
}

.target-strip strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.05;
}

.scenario-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scenario-row span {
  min-height: 38px;
  border: 1px solid rgba(215, 166, 67, 0.22);
  padding: 9px 10px;
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 760;
  text-align: center;
}

.position-card p {
  margin: 0;
  color: #d8dee8;
  font-size: 1.02rem;
}

.mini-score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.mini-score-grid span {
  display: grid;
  gap: 4px;
  min-height: 68px;
  place-items: center;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: capitalize;
}

.mini-score-grid b {
  color: var(--gold-soft);
  font-size: 1.05rem;
}

.text-action {
  width: fit-content;
  min-height: 40px;
  border-color: rgba(22, 169, 236, 0.34);
}

.research-terminal {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1px;
  padding: 0;
  background: var(--line);
}

.terminal-nav,
.terminal-detail {
  background: var(--panel);
}

.terminal-nav {
  display: grid;
  align-content: start;
}

.terminal-tab {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  color: var(--muted);
  text-align: left;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.terminal-tab.active,
.terminal-tab:hover {
  color: var(--ink);
  background: rgba(22, 169, 236, 0.08);
}

.terminal-tab span {
  color: var(--gold-soft);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.terminal-detail {
  min-height: 640px;
  padding: clamp(22px, 4vw, 34px);
}

.memo-heading {
  margin-bottom: 28px;
}

.memo-heading p {
  max-width: 820px;
  color: var(--muted);
}

.memo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.memo-grid article {
  min-height: 190px;
  padding: 22px;
  background: rgba(3, 4, 6, 0.32);
}

.memo-grid article > span,
.model-output > span {
  display: block;
  margin-bottom: 12px;
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.memo-grid p,
.memo-grid ul {
  margin: 0;
  color: var(--muted);
}

.memo-grid ul {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.score-breakdown {
  display: grid;
  gap: 12px;
}

.score-breakdown > div {
  display: grid;
  grid-template-columns: 94px 1fr 42px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  text-transform: capitalize;
}

.score-breakdown strong {
  color: var(--ink);
  text-align: right;
}

.model-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  margin-top: 28px;
}

.model-lab-heading label {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.model-lab-heading select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
}

.model-controls {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.range-control {
  display: grid;
  grid-template-columns: 1fr 82px;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--panel);
  color: var(--muted);
}

.range-control input {
  grid-column: 1 / -1;
  accent-color: var(--gold);
}

.range-control strong {
  color: var(--gold-soft);
  text-align: right;
}

.model-output {
  border: 1px solid var(--line);
  padding: 26px;
  background: var(--panel);
}

.model-output > strong {
  display: block;
  color: var(--gold-soft);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.model-output small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.scenario-ladder {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.scenario-ladder span {
  border: 1px solid var(--line);
  padding: 12px;
  color: var(--muted);
}

.source-note {
  border-left: 3px solid var(--rose);
  padding: 16px 18px;
  background: rgba(3, 4, 6, 0.34);
  color: var(--muted);
}

.source-note p {
  max-width: 980px;
  margin: 0;
}

.workspace {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
}

.workspace-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  padding-top: 22px;
}

.rail-button {
  min-height: 42px;
  border-left: 3px solid transparent;
  padding: 0 12px;
  color: var(--muted);
  text-align: left;
}

.rail-button.active,
.rail-button:hover {
  border-color: var(--blue-bright);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

.workspace-main {
  min-width: 0;
}

.workspace-heading {
  align-items: flex-start;
  margin-bottom: 32px;
}

.small-action {
  min-height: 40px;
  flex: 0 0 auto;
  border-color: rgba(22, 169, 236, 0.34);
  padding: 0 14px;
}

.workflow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 28px;
}

.workflow-grid article {
  min-height: 280px;
  padding: 24px;
}

.workflow-grid h3 {
  margin-top: 56px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.metrics article {
  min-height: 158px;
  padding: 24px;
  background: var(--panel);
}

.metrics strong {
  display: block;
  margin: 16px 0 4px;
  color: var(--gold-soft);
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1;
}

.deal-table {
  margin-top: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.table-row {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 0.7fr 0.4fr;
  min-height: 58px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  min-height: 44px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.footer {
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  border-top: 1px solid var(--line);
  background: var(--black);
}

.footer-copy {
  display: grid;
  gap: 18px;
  max-width: 720px;
}

.footer a {
  width: fit-content;
  border-bottom: 1px solid rgba(215, 166, 67, 0.65);
  color: var(--gold-soft);
  font-size: clamp(1rem, 2vw, 1.24rem);
}

.footer p {
  margin: 0;
  color: var(--muted);
}

@keyframes tilePulse {
  0%,
  100% {
    opacity: 0.46;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .quote-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero,
  .intro,
  .principles,
  .position-grid,
  .exposure-grid,
  .research-terminal,
  .model-lab-grid,
  .workspace,
  .metrics,
  .memo-grid {
    grid-template-columns: 1fr;
  }

  .positions-heading,
  .section-head,
  .model-lab-heading,
  .workspace-heading,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .terminal-panel {
    max-width: 620px;
  }

  .terminal-nav,
  .workspace-rail {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding-top: 0;
  }

  .terminal-tab {
    flex: 1 1 150px;
    border-right: 1px solid var(--line);
  }

  .rail-button {
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .table-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px;
  }

  .table-head {
    display: none;
  }

  .principles article {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .principles article:last-child {
    border-bottom: 0;
  }

  .principles h3 {
    margin-top: 40px;
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    min-height: 156px;
    padding-top: 12px;
  }

  .brand {
    width: min(132px, 48vw);
    height: 40px;
  }

  .brand img {
    width: 100%;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.76rem;
  }

  .ai-badge {
    width: 100%;
    text-align: center;
  }

  .hero {
    min-height: 88svh;
    padding-top: 214px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.8rem);
  }

  .ticker-tape {
    top: 156px;
  }

  .market-grid {
    display: none;
  }

  .button,
  .small-action,
  .text-action {
    width: 100%;
  }

  .quote-grid,
  .target-strip,
  .scenario-row,
  .workflow-grid,
  .mini-score-grid,
  .exposure-bars article,
  .range-control,
  .score-breakdown > div {
    grid-template-columns: 1fr;
  }

  .position-card {
    min-height: auto;
  }
}
