:root {
  --ink: #1a1a1a;
  --nav: #333333;
  --muted: #6b6b72;
  --paper: #ffffff;
  --line: #e2e2e6;
  --grid: #ebebeb;
  --accent: #ff4f55;
  --bull: #3dc574;
  --code: #c8ccd2;
  --code-hot: #8b93a0;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      30deg,
      transparent 0,
      transparent 26px,
      var(--grid) 26px,
      var(--grid) 27px
    ),
    repeating-linear-gradient(
      150deg,
      transparent 0,
      transparent 26px,
      var(--grid) 26px,
      var(--grid) 27px
    );
}

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.code-layer {
  position: absolute;
  inset: -24% -18%;
  overflow: hidden;
  color: var(--code);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.28;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: text;
  pointer-events: auto;
}

.code-track {
  display: block;
  width: 100%;
  will-change: transform;
  animation: code-scroll 110s linear infinite;
}

.code-block {
  width: 100%;
}

.code-line {
  white-space: pre;
  width: max-content;
  min-width: 100%;
}

.code-word {
  display: inline;
}

.code-word.is-hot {
  color: var(--code-hot);
}

@keyframes code-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 48px;
  pointer-events: none;
}

.wordmark {
  pointer-events: auto;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
}

.wordmark span {
  color: var(--bull);
}

.login-avatar {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.login-avatar svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-avatar:hover {
  border-color: var(--ink);
}

.login-avatar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 72px 40px 32px;
  pointer-events: none;
}

.chart-stage {
  position: relative;
  width: 100%;
  height: calc(100vh - 104px);
  perspective: 1200px;
  perspective-origin: 50% 48%;
  pointer-events: none;
}

.chart-plane {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  transform: rotateY(-6deg) rotateX(3deg);
}

.chart-canvas-wrap {
  position: absolute;
  inset: 0;
  background: transparent;
  filter: drop-shadow(0 8px 24px rgba(26, 26, 26, 0.06));
}

body.is-shot .chart-plane {
  transform: none !important;
  will-change: auto;
}

body.is-shot .chart-canvas-wrap {
  filter: none;
}

#market {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

.chart-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ticker {
  position: absolute;
  top: 12px;
  left: 16px;
  right: auto;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.2rem 0.15rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow:
    0 0 8px #ffffff,
    0 0 14px #ffffff,
    1px 1px 0 #ffffff;
}

.ticker-sym {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ticker-px {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.entry-pill {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.2rem 0.15rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: min(18rem, calc(100% - 20px));
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-shadow:
    0 0 8px #ffffff,
    0 0 14px #ffffff,
    1px 1px 0 #ffffff;
  transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.entry-pill.is-wrap {
  white-space: normal;
}

.entry-pill.is-on {
  opacity: 1;
}

.entry-pill.is-long {
  box-shadow: none;
}

.entry-pill .side {
  font-weight: 600;
}

.entry-pill .meta {
  color: var(--muted);
}

@media (max-width: 840px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: 64px;
    padding: 0 18px;
  }

  .hero {
    padding: 64px 12px 24px;
  }

  .chart-stage {
    height: calc(100vh - 88px);
    min-height: 22rem;
  }

  .code-layer {
    font-size: 0.5rem;
    line-height: 1.26;
  }
}

@media (prefers-reduced-motion: reduce) {
  .code-track {
    animation: none;
  }

  .chart-plane {
    transform: none;
    filter: none;
  }
}
