:root {
  --bg: #030508;
  --title: #f3f6fb;
  --text: rgba(226, 234, 245, 0.92);
  --muted: rgba(161, 179, 201, 0.76);
  --accent: #f7931a;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(247, 147, 26, 0.045), transparent 55%),
    var(--bg);
  overflow-x: hidden;
}

.terminal-page {
  width: 100%;
  max-width: 1460px;
  margin: 0 auto;
  padding: 32px 28px 32px;
}

.hero-shell {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.hero-copy {
  min-width: 0;
  max-width: 820px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

h1 {
  margin: 8px 0 10px;
  color: var(--title);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.15;
}

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

.quick-links a {
  color: #d7e7f9;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 0;
  text-underline-offset: 5px;
}

.quick-links a:hover {
  color: #f3fbff;
  text-decoration: underline;
}

.chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font: 11px/1.5 "IBM Plex Mono", monospace;
}

.chart-meta output {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.chart-stage {
  position: relative;
  min-width: 0;
  width: 100%;
  height: clamp(440px, 70svh, 760px);
}

.chart-stage canvas {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  touch-action: pan-y;
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.text-action {
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.text-action:hover {
  color: var(--accent);
}

.text-action:disabled {
  color: var(--muted);
  cursor: wait;
}

.chart-hint.is-error {
  color: #ffadad;
}

.chart-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

@media (max-width: 980px) {
  .hero-shell {
    align-items: start;
    flex-direction: column;
  }

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

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  .terminal-page {
    padding: 24px 14px 24px;
  }

  .hero-shell {
    gap: 8px;
    margin-bottom: 22px;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  h1 {
    font-size: clamp(26px, 7.6vw, 34px);
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .quick-links {
    gap: 6px 18px;
    width: 100%;
  }

  .quick-links a {
    font-size: 12px;
  }

  .chart-stage {
    height: clamp(430px, 66svh, 600px);
  }
}
