:root {
  --ink: #101c2c;
  --ink-soft: #536072;
  --paper: #f5f4ef;
  --card: #fffefa;
  --line: #d9dcd4;
  --accent: #c9ff42;
  --accent-dark: #5f7d00;
  --positive: #16865c;
  --negative: #d95547;
  --shadow: 0 16px 44px rgba(24, 34, 48, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 28, 44, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 28, 44, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(16, 28, 44, 0.12);
  background: rgba(245, 244, 239, 0.88);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 3px;
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 7px;
  background: var(--ink);
}

.brand-mark i {
  display: block;
  border-radius: 1px;
  background: var(--accent);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.snapshot-status {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 4px rgba(22, 134, 92, 0.12);
}

main {
  overflow: hidden;
}

.hero,
.workspace,
.movers-section {
  width: min(1440px, 90vw);
  margin: 0 auto;
}

.hero {
  padding: 72px 0 56px;
}

.eyebrow {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 22px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 26px;
  height: 3px;
  background: var(--accent-dark);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.65fr);
  gap: 8vw;
  align-items: end;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 24px;
  font-size: clamp(46px, 6.2vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.07em;
}

h1 em {
  color: var(--accent-dark);
  font-style: normal;
}

.hero-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.universe-card {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: end;
  padding: 25px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  box-shadow: 10px 10px 0 var(--accent);
}

.universe-card > div span {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: -0.07em;
}

.universe-card small {
  display: block;
  margin-top: 8px;
  color: #aeb7c4;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.universe-card dl {
  margin: 0;
}

.universe-card dl div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 11px;
}

.universe-card dl div:last-child {
  border-bottom: 0;
}

.universe-card dt {
  color: #aeb7c4;
}

.universe-card dd {
  margin: 0;
  font-family: "DM Mono", monospace;
}

.workspace {
  padding: 58px 0 70px;
  border-top: 1px solid var(--ink);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading > div:first-child {
  display: flex;
  gap: 15px;
  align-items: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  letter-spacing: -0.05em;
}

.section-heading > p {
  max-width: 380px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.section-index {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.picker-shell {
  position: relative;
  z-index: 10;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box > svg {
  position: absolute;
  left: 15px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.7;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 50px 0 45px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fafaf7;
  color: var(--ink);
  font-size: 13px;
  transition: 160ms ease;
}

.search-box input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(16, 28, 44, 0.08);
}

.search-box kbd {
  position: absolute;
  right: 13px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: 330px;
  overflow-y: auto;
  border: 1px solid var(--ink);
  border-radius: 12px;
  background: white;
  box-shadow: 0 18px 50px rgba(16, 28, 44, 0.2);
}

.search-result {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #eceee8;
  background: white;
  cursor: pointer;
  text-align: left;
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result:hover,
.search-result:focus {
  background: #f3f7e8;
  outline: none;
}

.search-result strong {
  font-family: "DM Mono", monospace;
  font-size: 12px;
}

.search-result .company-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.membership {
  display: flex;
  gap: 4px;
  align-items: center;
}

.index-badge {
  padding: 3px 5px;
  border-radius: 4px;
  background: #edf0eb;
  color: #4f5c6c;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  white-space: nowrap;
}

.index-badge.ndx {
  background: #e9e5ff;
  color: #5949a8;
}

.index-filters,
.metric-toggle,
.period-toggle {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f1f2ed;
}

.index-filters button,
.metric-toggle button,
.period-toggle button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.index-filters button {
  padding: 0 14px;
}

.index-filters button.active,
.metric-toggle button.active,
.period-toggle button.active {
  background: var(--ink);
  color: white;
}

.selected-stocks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  padding-top: 14px;
}

.stock-chip {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 9px 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
  transition: 150ms ease;
}

.stock-chip:hover {
  border-color: var(--negative);
  transform: translateY(-1px);
}

.stock-chip .color-dot,
.legend-item .color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--series-color);
}

.stock-chip strong {
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.stock-chip .remove {
  color: #8a929e;
  font-size: 14px;
  line-height: 1;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.summary-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--series-color);
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.8);
}

.summary-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.summary-card header strong {
  font-family: "DM Mono", monospace;
  font-size: 13px;
}

.summary-card .price {
  display: block;
  font-family: "DM Mono", monospace;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.summary-card .moves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.summary-card .moves div {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.summary-card .moves small {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.change {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.chart-grid {
  display: block;
}

.chart-card {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chart-header h3 {
  margin: 3px 0 0;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.chart-kicker {
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-toggle button,
.period-toggle button {
  padding: 8px 11px;
}

.chart-stage {
  position: relative;
  min-height: 410px;
  border-top: 1px solid var(--line);
}

.price-chart {
  display: block;
  width: 100%;
  height: 410px;
  overflow: visible;
}

.grid-line {
  stroke: #e4e6df;
  stroke-width: 1;
}

.zero-line {
  stroke: #9ca5ae;
  stroke-dasharray: 4 4;
}

.axis-label {
  fill: #7d8794;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.series-path {
  fill: none;
  stroke: var(--series-color);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.series-end {
  fill: var(--series-color);
  stroke: white;
  stroke-width: 2;
}

.hover-line {
  stroke: var(--ink);
  stroke-dasharray: 3 4;
  opacity: 0;
}

.chart-hitbox {
  fill: transparent;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 10px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: rgba(16, 28, 44, 0.96);
  color: white;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(16, 28, 44, 0.2);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.chart-tooltip .tip-date {
  display: block;
  margin-bottom: 7px;
  color: #aeb7c4;
}

.chart-tooltip .tip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 0;
}

.chart-tooltip .tip-row span:first-child::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--series-color);
  content: "";
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-height: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.legend-item {
  display: flex;
  gap: 6px;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.legend-item:hover {
  text-decoration: line-through;
}

.empty-state {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.movers-section {
  padding: 64px 0 90px;
  border-top: 1px solid var(--ink);
}

.movers-heading {
  align-items: center;
}

.movers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mover-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.mover-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 19px;
  border-bottom: 1px solid var(--line);
}

.mover-card > header > div {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mover-card h3 {
  margin: 0;
  font-size: 16px;
}

.direction-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  font-family: "DM Mono", monospace;
}

.direction-icon.up {
  background: rgba(22, 134, 92, 0.12);
  color: var(--positive);
}

.direction-icon.down {
  background: rgba(217, 85, 71, 0.12);
  color: var(--negative);
}

.table-note {
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.mover-row {
  display: grid;
  grid-template-columns: 28px 68px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid #e7e9e3;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

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

.mover-row:hover {
  background: #f5f7ef;
}

.mover-rank {
  color: #9aa2ac;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.mover-ticker {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
}

.mover-name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mover-dollar,
.mover-percent {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-align: right;
}

.mover-percent {
  min-width: 64px;
  padding: 6px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.mover-percent.positive {
  background: rgba(22, 134, 92, 0.1);
}

.mover-percent.negative {
  background: rgba(217, 85, 71, 0.1);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: #fafaf7;
}

.page-numbers {
  display: flex;
  gap: 5px;
}

.pagination button {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--line);
  background: white;
}

.pagination button.active {
  background: var(--ink);
  color: white;
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.3;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 5vw;
  border-top: 1px solid rgba(16, 28, 44, 0.2);
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

footer p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  padding: 12px 16px;
  border-radius: 9px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .universe-card {
    max-width: 480px;
  }

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

}

@media (max-width: 720px) {
  .site-header {
    padding: 0 20px;
  }

  .snapshot-status span:last-child {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero,
  .workspace,
  .movers-section {
    width: calc(100vw - 32px);
  }

  .hero {
    padding: 48px 0 38px;
  }

  h1 {
    font-size: 48px;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p {
    margin-top: 12px;
    text-align: left;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .index-filters {
    height: 42px;
  }

  .index-filters button {
    flex: 1;
  }

  .summary-strip {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .summary-card {
    min-width: 230px;
    scroll-snap-align: start;
  }

  .chart-card {
    padding: 16px;
  }

  .chart-header {
    display: block;
  }

  .chart-controls {
    flex-wrap: wrap;
    margin-top: 12px;
  }

  .metric-toggle,
  .chart-period-toggle {
    width: max-content;
  }

  .movers-heading {
    display: flex;
  }

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

  .mover-row {
    grid-template-columns: 22px 56px minmax(0, 1fr) auto;
    padding: 0 12px;
  }

  .mover-dollar {
    display: none;
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
