/* Redline showcase site — dark code-editor theme.
   Single accent (--accent) reserved for the brand redline: gauge needles,
   links, CTAs. No webfonts — system stacks only, on purpose (see the
   Performance Snapshot section: every avoided request is part of the
   pitch). */

:root {
  --bg: #0d1117;
  --bg-elevated: #11161d;
  --bg-panel: #161b22;
  --border: #21262d;
  --border-strong: #30363d;
  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --fg-dim: #7d8590;
  --accent: #ff3b30;
  --accent-strong: #d7263d;
  --accent-dim: rgba(255, 59, 48, 0.14);
  --accent-glow: rgba(255, 59, 48, 0.35);
  --green: #3fb950;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.55;
}

body {
  min-height: 100vh;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.brand,
.site-header nav a,
.btn {
  text-decoration: none;
}

code,
pre,
kbd,
.mono {
  font-family: var(--font-mono);
}

pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #c9d1d9;
}

code {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.5rem;
  margin: 0 0 0.4rem;
}

.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.section-lede {
  color: var(--fg-muted);
  max-width: 62ch;
  margin: 0 0 2rem;
}

/* ---------- Header / footer ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand:hover {
  text-decoration: none;
  color: var(--fg);
}

.brand-mark {
  display: block;
  border-radius: 5px;
}

.brand-sub {
  font-weight: 400;
  color: var(--fg-muted);
}

@media (max-width: 560px) {
  .brand-sub {
    display: none;
  }
}

.site-header nav a {
  margin-left: 1.25rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.site-header nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem 3rem;
  color: var(--fg-dim);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer a {
  color: var(--fg-muted);
}

/* ---------- Hero ---------- */

.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  margin: 0 0 1rem;
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 56ch;
  margin: 0 auto 1.75rem;
}

.hero .lede strong {
  color: var(--fg);
}

/* ---------- Badges / callouts ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.badge-vanilla {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.badge + .badge {
  margin-left: 0.4rem;
}

.badge-ok {
  border-color: rgba(63, 185, 80, 0.35);
  color: var(--green);
}

.badge-down {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin: 0 auto;
  max-width: 62ch;
}

.callout-icon {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
}

.callout p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.callout strong {
  color: var(--fg);
}

/* ---------- Stat tiles / live panel ---------- */

.stats-panel {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 2rem;
  align-items: center;
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.gauge-wrap svg {
  width: 100%;
  max-width: 280px;
  height: auto;
}

.gauge-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-align: center;
}

.gauge-readout {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  fill: var(--fg);
}

.gauge-readout-unit {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  fill: var(--fg-muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
}

.stat-tile {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.stat-tile .stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  margin: 0 0 0.35rem;
}

.stat-tile .stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--fg);
}

.stat-tile .stat-value.is-live {
  color: var(--accent);
}

.stat-tile-wide {
  grid-column: 1 / -1;
}

.sparkline {
  width: 100%;
  height: 46px;
  display: block;
}

.sparkline path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
}

.sparkline-empty {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--fg-dim);
}

.sparkline .fill {
  fill: var(--accent-dim);
  stroke: none;
}

.stats-note {
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-top: 1rem;
}

/* ---------- Widget cards ---------- */

.widget-grid {
  display: grid;
  gap: 1.75rem;
}

.widget-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.widget-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.widget-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

/* Filterable grid widget */

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-search {
  flex: 1 1 200px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.filter-search:focus {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.filter-chip {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  cursor: pointer;
}

.filter-chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}

#generated .widget-card + .widget-card {
  margin-top: 1.25rem;
}

.live-headers-output {
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.76rem;
  margin: 0.6rem 0;
}

.artifact-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: var(--bg-panel);
  transition: border-color 0.15s ease;
}

.artifact-card[hidden] {
  display: none;
}

.artifact-card:hover {
  border-color: var(--border-strong);
}

.artifact-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.artifact-card p {
  margin: 0 0 0.6rem;
  color: var(--fg-muted);
  font-size: 0.82rem;
}

.artifact-card .tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.artifact-empty {
  color: var(--fg-dim);
  font-size: 0.85rem;
  padding: 1rem 0;
}

/* Stepper / tabs widget */

.stepper-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.stepper-tab {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  color: var(--fg-muted);
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.stepper-tab.is-active {
  border-color: var(--accent);
  color: var(--fg);
  background: var(--accent-dim);
}

.stepper-panel[hidden] {
  display: none;
}

.stepper-panel h4 {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
}

.stepper-panel p {
  color: var(--fg-muted);
  margin: 0;
}

/* Meta inspector */

.meta-inspector pre {
  max-height: 260px;
  overflow-y: auto;
}

/* ---------- Perf snapshot ---------- */

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.perf-table th,
.perf-table td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.perf-table th {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.perf-table td.this-site {
  color: var(--green);
  font-family: var(--font-mono);
}

.perf-table td.bloated {
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.perf-source {
  font-size: 0.78rem;
  color: var(--fg-dim);
  margin-top: 0.75rem;
}

/* ---------- CTA ---------- */

.cta {
  text-align: center;
  padding: 4rem 0 4.5rem;
}

.cta h2 {
  font-size: 1.9rem;
}

.btn {
  display: inline-block;
  margin-top: 1.2rem;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.6rem;
  border-radius: 6px;
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .stats-panel {
    grid-template-columns: 1fr;
  }
}
