:root {
  --bg: #07111f;
  --bg2: #0d1728;
  --fg: #e8f0ff;
  --muted: #9fb0c8;
  --line: rgba(158, 193, 255, 0.16);
  --glow: rgba(68, 146, 255, 0.28);
  --accent: #7ae3ff;
  --accent2: #8d72ff;
  --panel: rgba(8, 15, 28, 0.78);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(122, 227, 255, 0.16), transparent 32%),
    radial-gradient(circle at top right, rgba(141, 114, 255, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--fg);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: linear-gradient(transparent 0, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 100% 3px;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.inner-page {
  padding-top: 1.5rem;
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topnav a {
  color: var(--fg);
  text-decoration: none;
  opacity: 0.88;
}

.topnav div {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.topnav a.active,
.topnav a:hover {
  color: var(--accent);
}

.prose-block h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
}

.prose-block p {
  max-width: 70ch;
}

.experiment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.experiment-card {
  min-height: 220px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.slug {
  color: var(--muted);
  font-size: 0.85rem;
}

.pill, .mini-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
}

.pill.cyan { color: var(--accent); }
.pill.violet { color: #b99dff; }
.pill.amber { color: #ffc772; }

.tag-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.terminal-panel {
  margin-top: 1rem;
  overflow: hidden;
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.terminal-head span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
}

.terminal-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #cde8ff;
  display: grid;
  gap: 0.55rem;
}

.prompt-line {
  color: var(--accent);
}

.prompt-line span {
  color: var(--fg);
}

@media (max-width: 900px) {
  .experiment-grid { grid-template-columns: 1fr; }
  .topnav { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .topnav div { gap: 0.75rem; }
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

.glow {
  box-shadow: 0 0 0 1px rgba(122, 227, 255, 0.14), 0 0 80px var(--glow), 0 10px 40px rgba(0,0,0,0.3);
}

.hero {
  padding: 2rem;
  margin-bottom: 1rem;
}

.eyebrow, .section-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

h1, h2 { margin: 0 0 0.8rem; line-height: 1.05; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); max-width: 12ch; }
h2 { font-size: 1.15rem; }
.lede, p, li, dd, dt, blockquote { line-height: 1.55; }
.lede, p, li, dd { color: var(--muted); }
blockquote { margin: 0; font-size: 1.25rem; color: var(--fg); }

.grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.main-grid { grid-template-columns: 1.4fr 1fr 1fr; align-items: stretch; }
.tall { min-height: 300px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #061019;
  font-weight: 700;
  border: none;
}

.take-box {
  min-height: 110px;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.tool-panel {
  margin-top: 1rem;
}

.tool-head,
.feature-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tool-head h2,
.feature-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.tool-lede {
  max-width: 70ch;
}

.tool-mode-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.mode-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.035);
  color: var(--fg);
  border-radius: 999px;
  padding: 0.6rem 0.95rem;
  cursor: pointer;
}

.mode-chip.active {
  background: rgba(122, 227, 255, 0.12);
  color: var(--accent);
  border-color: rgba(122, 227, 255, 0.35);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 1rem;
}

.tool-inputs,
.tool-output {
  min-width: 0;
}

.inset-panel {
  border-radius: 20px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1rem;
}

.input-label,
.score-label,
.mini-heading,
.compare-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.73rem;
  color: var(--accent);
}

.hidden-block {
  display: none;
}

.compare-wrap {
  margin-top: 1rem;
}

.distiller-input {
  width: 100%;
  margin-top: 0.6rem;
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.88);
  color: var(--fg);
  padding: 1rem;
  font: inherit;
  resize: vertical;
}

.distiller-input:focus {
  outline: 2px solid rgba(122, 227, 255, 0.35);
  outline-offset: 2px;
}

.tool-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.tool-hint {
  margin-top: 0.8rem;
  font-size: 0.92rem;
}

.compare-summary {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.compare-cards,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.compare-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem;
  background: rgba(255,255,255,0.025);
  display: grid;
  gap: 0.35rem;
}

.compare-card strong {
  font-size: 2rem;
  line-height: 1;
}

.compare-card.winner {
  border-color: rgba(122, 227, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(122, 227, 255, 0.18) inset;
}

.compare-copy {
  margin: 0.75rem 0 0;
  color: var(--fg);
}

.score-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.score-value {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1;
  font-weight: 800;
  margin-top: 0.3rem;
}

.score-verdict {
  max-width: 24ch;
  text-align: right;
  color: var(--fg);
}

.meter {
  margin: 1rem 0;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6a7a, #ffc56f);
  transition: width 220ms ease;
}

.meter-fill[data-tier='mixed'] {
  background: linear-gradient(90deg, #ffc56f, #7ae3ff);
}

.meter-fill[data-tier='good'] {
  background: linear-gradient(90deg, #6fffc5, #7ae3ff);
}

.tool-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.tool-metrics div,
.tool-section,
.queue-list li {
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.tool-metrics span {
  display: block;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.tool-metrics strong {
  font-size: 1.2rem;
}

.xray-legend {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.legend-chip {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: 0.85rem;
}

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

.legend-chip.hype,
.xray-mark.hype {
  background: rgba(255, 106, 122, 0.14);
  border-color: rgba(255, 106, 122, 0.24);
}

.legend-chip.vague,
.xray-mark.vague {
  background: rgba(255, 197, 111, 0.14);
  border-color: rgba(255, 197, 111, 0.24);
}

.legend-chip.jargon,
.xray-mark.jargon {
  background: rgba(141, 114, 255, 0.16);
  border-color: rgba(141, 114, 255, 0.24);
}

.legend-chip.urgent,
.xray-mark.urgent {
  background: rgba(122, 227, 255, 0.14);
  border-color: rgba(122, 227, 255, 0.24);
}

.xray-output {
  margin-top: 0.65rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 20, 0.72);
  padding: 1rem;
  color: var(--fg);
  line-height: 1.75;
  min-height: 168px;
  white-space: pre-wrap;
}

.xray-mark {
  display: inline;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  padding: 0.08rem 0.22rem;
}

.issue-list {
  margin: 0.6rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.issue-list li + li {
  margin-top: 0.55rem;
}

.rewrite-output {
  margin-top: 0.6rem;
  color: var(--fg);
}

.tool-section {
  margin-top: 0.85rem;
}

.feature-panel,
.build-grid {
  margin-top: 1rem;
}

.feature-card h3 {
  margin: 0.9rem 0 0.6rem;
  font-size: 1.2rem;
}

.queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.queue-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.queue-list span {
  color: var(--muted);
  text-align: right;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
  padding: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.signal-list, .lanes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}
.signal-list li, .lanes li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}
.lanes span { color: var(--muted); text-align: right; }
.status { margin: 0; display: grid; gap: 0.75rem; }
.status div { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 0.75rem; }
.status dt { color: var(--muted); }
.status dd { margin: 0; color: var(--fg); text-align: right; }

@media (max-width: 900px) {
  .three-up, .two-up, .main-grid, .tool-grid, .feature-grid, .compare-cards { grid-template-columns: 1fr; }
  .lanes li, .signal-list li, .status div, .score-row, .tool-head, .feature-head, .queue-list li { flex-direction: column; }
  .lanes span, .status dd, .score-verdict, .queue-list span { text-align: left; }
  .tool-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .xray-legend { flex-direction: column; align-items: flex-start; }
}
