:root {
  --ink: #111418;
  --muted: #626d70;
  --green: #062f25;
  --green-2: #0f4a38;
  --gold: #c7a55c;
  --crimson: #8f2635;
  --paper: #f3eadb;
  --ivory: #fffaf2;
  --steel: #6f8da1;
  --line: rgba(17, 20, 24, 0.13);
  --shadow: 0 22px 60px rgba(17, 20, 24, 0.11);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: var(--green);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.86rem;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border: 2px solid var(--gold);
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--green) 0 48%, var(--gold) 48% 55%, var(--crimson) 55%);
}

.rail nav {
  display: grid;
  gap: 8px;
}

.rail-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.74);
  font-weight: 800;
  font-size: 0.9rem;
}

.rail-link.active,
.rail-link:hover {
  color: white;
  background: rgba(255,255,255,0.08);
  border-color: rgba(199,165,92,0.44);
}

.rail-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(199,165,92,0.42);
  background: rgba(255,255,255,0.07);
}

.rail-card span,
.rail-card small {
  display: block;
  color: rgba(255,255,255,0.68);
  font-size: 0.78rem;
}

.rail-card strong {
  display: block;
  margin: 4px 0;
  color: var(--gold);
  font-family: Newsreader, Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

main {
  min-width: 0;
  padding: 26px clamp(18px, 4vw, 44px) 54px;
}

.hero-section {
  min-height: min(680px, calc(100vh - 52px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-terminal,
.section-block,
.study-strip {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-width: 0;
  padding: clamp(28px, 5vw, 54px);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background:
    linear-gradient(90deg, rgba(6,47,37,0.98), rgba(6,47,37,0.72) 50%, rgba(6,47,37,0.2)),
    url("assets/hero.png") center right / cover no-repeat;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--crimson);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
}

.hero-copy .eyebrow,
.asset-visual .eyebrow {
  color: var(--gold);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  max-width: 700px;
  font-size: clamp(3rem, 5vw, 5.4rem);
  font-weight: 750;
}

h2 {
  font-size: clamp(2.3rem, 4vw, 4.5rem);
  font-weight: 750;
}

h3 {
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 700;
}

.hero-copy p:not(.eyebrow) {
  max-width: 700px;
  margin: 20px 0 0;
  color: rgba(255,255,255,0.82);
  font-size: 1.07rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid currentColor;
  font-weight: 800;
}

.primary-action {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green);
}

.secondary-action {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.4);
  color: white;
}

.hero-terminal {
  min-width: 0;
  padding: 20px;
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.terminal-head,
.section-head,
.terminal-strip,
.asset-card-head,
.market-row,
.activity-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.terminal-head span,
.status-pill {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8rem;
}

.terminal-head strong,
.status-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(28,155,99,0.12);
  color: #13724a;
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-grid div,
.portfolio-grid div,
.revenue-list div,
.doc-item,
.liquidity-cell {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(6,47,37,0.045);
}

.metric-grid span,
.portfolio-grid span,
.revenue-list span,
.liquidity-cell span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.metric-grid strong,
.portfolio-grid strong,
.revenue-list strong,
.liquidity-cell strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-family: Newsreader, Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.terminal-strip {
  flex-wrap: wrap;
}

.terminal-strip span,
.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  background: rgba(111,141,161,0.14);
  color: #38576a;
  font-size: 0.72rem;
  font-weight: 800;
}

.study-strip {
  margin-top: 18px;
  padding: 16px;
  background: var(--green);
  color: white;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.study-strip div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.16);
}

.study-strip strong,
.study-strip span {
  display: block;
}

.study-strip span {
  margin-top: 4px;
  color: rgba(255,255,255,0.68);
  font-size: 0.82rem;
}

.section-block {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 28px);
  background: var(--ivory);
}

.section-head {
  align-items: end;
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(6,47,37,0.05);
  border: 1px solid var(--line);
}

.segmented button,
.detail-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
}

.segmented button.active,
.detail-tabs button.active {
  background: var(--green);
  color: white;
}

.market-layout,
.prediction-layout,
.activity-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.asset-list,
.prediction-list {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.asset-card,
.prediction-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: white;
  padding: 14px;
  text-align: left;
  box-shadow: 0 10px 28px rgba(17,20,24,0.055);
}

.asset-card.active,
.prediction-card.active {
  border-color: rgba(199,165,92,0.95);
}

.asset-card h3,
.prediction-card h3 {
  font-size: 1.45rem;
}

.asset-card p,
.market-intel li,
.prediction-detail p,
.tab-copy,
.portfolio-grid small {
  color: var(--muted);
  font-size: 0.9rem;
}

.asset-card p {
  margin: 8px 0 12px;
}

.asset-card-foot,
.prediction-stats,
.tag-row,
.doc-grid,
.liquidity-grid {
  display: grid;
  gap: 8px;
}

.asset-card-foot {
  grid-template-columns: repeat(4, 1fr);
}

.asset-card-foot div {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.asset-card-foot span,
.prediction-stats span,
.doc-item span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.asset-card-foot strong,
.prediction-stats strong,
.doc-item strong {
  display: block;
  margin-top: 2px;
  font-size: 0.94rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
}

.market-intel {
  min-width: 0;
  padding: 18px;
  background: #f6efe4;
  border: 1px solid var(--line);
}

.market-intel ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.market-intel li + li {
  margin-top: 10px;
}

.asset-terminal {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

.asset-visual {
  min-height: 520px;
  padding: 26px;
  color: white;
  display: flex;
  align-items: end;
  background:
    linear-gradient(0deg, rgba(6,47,37,0.96), rgba(6,47,37,0.22)),
    url("assets/hero.png") center / cover no-repeat;
}

.asset-detail {
  min-width: 0;
  padding: 22px;
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(6,47,37,0.05);
}

.tab-panel {
  display: grid;
  gap: 14px;
}

.doc-grid,
.liquidity-grid {
  grid-template-columns: 1fr 1fr;
}

.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-item em {
  font-style: normal;
  color: #13724a;
  font-weight: 800;
  font-size: 0.74rem;
}

.economics-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.economics-card {
  padding: 16px;
  border: 1px solid var(--line);
  background: #f6efe4;
}

.economics-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.market-row {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.market-row span {
  color: var(--muted);
  font-size: 0.8rem;
}

.prediction-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: center;
}

.probability {
  width: 78px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(6,47,37,0.11) 0);
}

.probability strong {
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--green);
}

.prediction-stats {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}

.prediction-detail {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: #f6efe4;
}

.order-box {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.order-box button {
  min-height: 42px;
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
  font-weight: 800;
}

.order-box button:last-child {
  background: white;
  color: var(--green);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.activity-grid {
  margin-top: 16px;
}

.activity-grid article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: #f6efe4;
}

.activity-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.activity-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.revenue-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    padding: 14px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .rail nav {
    display: flex;
    flex: 1 0 auto;
  }

  .rail-card {
    display: none;
  }

  .hero-section,
  .market-layout,
  .prediction-layout,
  .activity-grid,
  .asset-terminal {
    grid-template-columns: 1fr;
  }

  .hero-section {
    min-height: 0;
  }

  .asset-visual {
    min-height: 360px;
  }

  .study-strip,
  .portfolio-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  body,
  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  main {
    padding: 14px 12px 34px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .rail {
    width: 100%;
    max-width: 100vw;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    overflow-x: hidden;
  }

  .brand {
    flex: 0 0 auto;
  }

  .rail-link {
    min-height: 38px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .rail nav {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rail nav::-webkit-scrollbar {
    display: none;
  }

  .hero-section {
    display: block;
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .hero-copy,
  .hero-terminal,
  .section-block,
  .study-strip {
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .hero-copy {
    min-height: 520px;
    padding: 24px;
    overflow: hidden;
    background-position: center;
  }

  .hero-copy > * {
    max-width: min(312px, calc(100vw - 72px));
  }

  h1 {
    font-size: 2.05rem;
    line-height: 1.05;
    max-width: min(312px, calc(100vw - 72px));
    overflow-wrap: break-word;
  }

  h2 {
    font-size: 2.05rem;
  }

  h3,
  .asset-card h3,
  .prediction-card h3 {
    font-size: 1.34rem;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 0.94rem;
    max-width: min(312px, calc(100vw - 72px));
    overflow-wrap: break-word;
  }

  .metric-grid,
  .study-strip,
  .asset-card-foot,
  .doc-grid,
  .liquidity-grid,
  .economics-split,
  .portfolio-grid,
  .revenue-list,
  .prediction-stats {
    grid-template-columns: 1fr;
  }

  .section-head,
  .terminal-head,
  .activity-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .asset-card,
  .prediction-card,
  .prediction-detail,
  .market-intel,
  .activity-grid article {
    max-width: 100%;
  }

  .prediction-card {
    grid-template-columns: 1fr;
  }

  .probability {
    width: 72px;
  }

  .terminal-strip {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
