:root {
  color-scheme: dark;
  --bg: #05070b;
  --panel: #0b111c;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #39ff88;
  --accent-dim: #22c55e;
  --accent-soft: rgba(57, 255, 136, 0.14);
  --danger: #fb7185;
  --good: #39ff88;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.freeride-theme {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(57, 255, 136, 0.16), transparent 32rem),
    radial-gradient(circle at 82% 8%, rgba(34, 197, 94, 0.1), transparent 28rem),
    linear-gradient(145deg, #05070b 0%, #08110d 48%, #060a08 100%);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.88);
  backdrop-filter: blur(16px);
}

.nav-inner,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  color: var(--text);
  font-weight: 950;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-right: 0.5rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(57, 255, 136, 0.45);
  background: rgba(57, 255, 136, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: rgba(57, 255, 136, 0.35);
  background: var(--accent-soft);
  color: var(--text);
}

main {
  padding: 48px 0 80px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, #fff 10%, var(--accent) 55%, #bbf7d0 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2,
h3 {
  color: var(--text);
}

p,
li {
  color: var(--muted);
}

.sub {
  max-width: 780px;
  font-size: 1.15rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(57, 255, 136, 0.28);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #d1fae5;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)), rgba(11, 17, 28, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.metric strong {
  display: block;
  color: var(--accent);
  font-size: 32px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 14px;
}

.page-links {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.page-links a,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(57, 255, 136, 0.35);
  border-radius: 999px;
  background: rgba(57, 255, 136, 0.08);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.page-links a:hover,
.btn:hover {
  background: rgba(57, 255, 136, 0.16);
  border-color: rgba(57, 255, 136, 0.55);
}

.btn-primary {
  background: var(--accent);
  color: #041007;
  border-color: var(--accent);
}

.replay-panel {
  margin: 24px 0;
}

.replay-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.replay-meta {
  font-size: 0.9rem;
  color: var(--muted);
}

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

.replay-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.replay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.replay-toggle input {
  accent-color: #39ff88;
}

.replay-toggle.is-off,
.replay-indicator-legend .ind.is-off {
  opacity: 0.4;
}

.replay-controls button,
.replay-controls select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-weight: 700;
}

.replay-controls button:hover {
  border-color: rgba(57, 255, 136, 0.45);
}

#tsla-replay-chart {
  width: 100%;
  height: min(56vh, 520px);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.72);
}

.replay-subchart {
  width: 100%;
  height: 120px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.72);
}

.replay-indicator-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.replay-indicator-legend .ind {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.replay-indicator-legend .ema8 { color: #38bdf8; }
.replay-indicator-legend .ema21 { color: #a78bfa; }
.replay-indicator-legend .sma20 { color: #f97316; }
.replay-indicator-legend .bollinger { color: rgba(244, 114, 182, 0.9); }
.replay-indicator-legend .vwap { color: #fbbf24; }
.replay-indicator-legend .poc { color: rgba(251, 191, 36, 0.75); }

.replay-disclaimer {
  color: var(--muted);
  font-size: 0.88rem;
}

.replay-scrub {
  width: 100%;
  margin-top: 12px;
}

.mi-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.mi-report {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #d1fae5;
  margin: 0;
}

.posts {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.post-card {
  display: block;
  text-decoration: none;
}

.post-card:hover {
  border-color: rgba(57, 255, 136, 0.45);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--good);
  background: rgba(57, 255, 136, 0.08);
}

.warning {
  color: var(--danger);
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 22px;
  align-items: start;
}

.fri-form {
  display: grid;
  gap: 12px;
}

.fri-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.fri-form input,
.fri-form textarea,
.fri-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
  font: inherit;
}

.fri-form textarea {
  min-height: 110px;
  resize: vertical;
}

.fri-form button[type="submit"] {
  border: 0;
  border-radius: 12px;
  min-height: 50px;
  padding: 0 18px;
  background: var(--accent);
  color: #041007;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 860px) {
  .grid,
  .mi-grid,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }
}
