:root {
  color-scheme: dark;
  --bg: #0d1110;
  --bg-soft: #111715;
  --surface: #151d1b;
  --surface-strong: #1c2724;
  --line: rgba(231, 246, 239, 0.15);
  --line-strong: rgba(231, 246, 239, 0.26);
  --text: #eff7f2;
  --muted: #9fb2aa;
  --faint: #6f827a;
  --fast: #72e0bf;
  --fast-soft: rgba(114, 224, 191, 0.18);
  --slow: #f0ba63;
  --slow-soft: rgba(240, 186, 99, 0.16);
  --danger: #ef7d6a;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(114, 224, 191, 0.08), transparent 22rem),
    linear-gradient(90deg, rgba(240, 186, 99, 0.05), transparent 42rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-5rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 16, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--text);
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    conic-gradient(from -90deg, var(--fast) 0 80deg, var(--slow) 80deg 132deg, rgba(255, 255, 255, 0.12) 132deg 360deg);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  padding: 0.52rem 0.68rem;
  text-decoration: none;
}

.topnav a:hover,
.topnav a:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  outline: none;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 0.8fr);
  align-items: center;
  gap: 3rem;
  min-height: 34rem;
  padding: 5.5rem 0 4rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--fast);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 11ch;
  margin: 0;
  font-size: 4.9rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 40rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: 1.16rem;
}

.hero-visual {
  min-width: 0;
}

.speed-scale {
  position: relative;
  display: grid;
  gap: 1.15rem;
  padding: 2.5rem 0;
}

.speed-track {
  position: relative;
  height: 5.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent),
    var(--surface);
}

.speed-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 12%);
  background: linear-gradient(90deg, var(--track-color), rgba(255, 255, 255, 0.12));
  transform-origin: left center;
  animation: fillIn 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.speed-track-slow {
  --track-color: var(--slow);
  --fill: 12%;
}

.speed-track-fast {
  --track-color: var(--fast);
  --fill: 100%;
}

.speed-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  padding: 1.15rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
}

.speed-caption {
  color: var(--muted);
  font-size: 0.96rem;
}

.control-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 29, 27, 0.76);
}

.control {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.control label,
.control output {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.control output {
  color: var(--text);
  font-family: var(--font-mono);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--fast);
}

.run-button {
  min-height: 2.9rem;
  border: 1px solid rgba(114, 224, 191, 0.55);
  border-radius: var(--radius);
  background: var(--fast);
  color: #08201a;
  font-weight: 800;
  padding: 0 1rem;
  cursor: pointer;
}

.run-button:hover,
.run-button:focus-visible {
  background: #9df0d7;
  outline: none;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 5rem;
}

.lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.lane-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.lane-kicker {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lane h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.lane-header strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  line-height: 1;
  white-space: nowrap;
}

.progress-shell {
  height: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
}

.progress-shell span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--lane-color);
  transition: width 80ms linear;
}

.lane-fast {
  --lane-color: var(--fast);
}

.lane-slow {
  --lane-color: var(--slow);
}

.lane-stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.lane-stats strong {
  color: var(--text);
  font-family: var(--font-mono);
}

pre {
  min-height: 26rem;
  max-height: 26rem;
  margin: 0;
  overflow: auto;
  padding: 1rem;
  color: #dcebe5;
  background: #0a0f0e;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.agent-section,
.architecture,
.sources {
  margin: 0 0 5rem;
}

.section-heading {
  max-width: 48rem;
  margin: 0 0 1.4rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.section-heading p:last-child {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.loop-bars {
  display: grid;
  gap: 0.75rem;
}

.loop-row {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) 7rem;
  align-items: center;
  gap: 1rem;
  min-height: 3.8rem;
  border-top: 1px solid var(--line);
}

.loop-label {
  color: var(--text);
  font-weight: 750;
}

.loop-meter {
  height: 1rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.loop-meter span {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color);
  transition: width 180ms ease;
}

.loop-time {
  color: var(--text);
  font-family: var(--font-mono);
  text-align: right;
}

.loop-note {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.loop-note strong {
  color: var(--text);
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.architecture-grid article {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.architecture-grid span {
  color: var(--fast);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.architecture-grid h3 {
  margin: 0.55rem 0 0.45rem;
  font-size: 1.05rem;
}

.architecture-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.sources ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sources a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
}

.sources a:hover,
.sources a:focus-visible {
  border-color: rgba(114, 224, 191, 0.55);
  color: var(--fast);
  outline: none;
}

@keyframes fillIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

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

  .hero {
    min-height: auto;
    padding: 4rem 0 2.5rem;
  }

  .hero h1 {
    font-size: 3.4rem;
  }

  .control-band {
    grid-template-columns: 1fr;
  }

  .architecture-grid,
  .sources ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.75rem 1rem;
  }

  main {
    width: min(100% - 1rem, 1180px);
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero-lede {
    font-size: 1rem;
  }

  .lane-header,
  .lane-stats,
  .loop-note {
    flex-direction: column;
  }

  .loop-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.85rem 0;
  }

  .loop-time {
    text-align: left;
  }

  pre {
    min-height: 20rem;
    max-height: 20rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
