:root {
  color-scheme: dark;
  --bg: #101210;
  --surface: #181b18;
  --surface-2: #20231f;
  --line: #353a34;
  --text: #f4f5ef;
  --muted: #afb4aa;
  --green: #83e36f;
  --cyan: #54d9e8;
  --coral: #ff766d;
  --yellow: #f3c957;
  --black: #0a0c0a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  line-height: 1.5;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

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

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  padding: 0 5vw;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(16, 18, 16, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  width: fit-content;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.topbar nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.topbar nav a,
.text-link {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.topbar nav a:hover,
.text-link:hover {
  color: var(--text);
}

.version {
  justify-self: end;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.hero {
  position: relative;
  min-height: clamp(300px, 42vw, 470px);
  overflow: hidden;
  background: var(--black);
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 9, 7, 0.95) 0%, rgba(7, 9, 7, 0.65) 42%, rgba(7, 9, 7, 0.08) 76%);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(90%, 1320px);
  min-height: inherit;
  margin: 0 auto;
  padding: 38px 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.77rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin: 22px 0 26px;
  color: #dde0d7;
  font-size: clamp(1rem, 1.7vw, 1.3rem);
}

.install-row {
  display: flex;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(5, 6, 5, 0.78);
}

.install-row code {
  padding: 12px 15px;
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-row button,
.quiet-button {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.install-row button {
  padding: 0 16px;
}

.install-row button:hover,
.quiet-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.tool-band,
.content-band {
  padding: 74px max(5vw, calc((100vw - 1320px) / 2));
}

.tool-band {
  background: #f0f1eb;
  color: #151713;
}

.tool-band .eyebrow {
  color: #397c2e;
}

.section-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.mode-control {
  display: flex;
  padding: 3px;
  border: 1px solid #bfc3b9;
  background: #e1e3dc;
}

.mode-button {
  min-width: 94px;
  min-height: 38px;
  padding: 7px 15px;
  border: 0;
  background: transparent;
  color: #62675e;
  cursor: pointer;
  font-weight: 700;
}

.mode-button.active {
  background: #171a16;
  color: #f7f8f2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 540px;
  border: 1px solid #b8bdb3;
  background: #fff;
}

.editor-pane,
.result-pane {
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto minmax(290px, 1fr) auto;
}

.editor-pane {
  border-right: 1px solid #b8bdb3;
}

.result-pane {
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #171a16;
  color: var(--text);
}

.pane-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid #d0d3cb;
  color: #555b52;
  font-size: 0.78rem;
  font-weight: 700;
}

.pane-toolbar select,
.pane-toolbar input[type="number"] {
  min-height: 34px;
  border: 1px solid #b8bdb3;
  border-radius: 0;
  background: #f8f9f4;
  color: #1b1e19;
}

.pane-toolbar select {
  min-width: 150px;
  padding: 4px 28px 4px 8px;
}

.compact-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
  white-space: nowrap;
}

.compact-control + .compact-control {
  margin-left: 0;
}

.compact-control input[type="number"] {
  width: 68px;
  padding: 4px 6px;
}

.compact-control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #327728;
}

.editor-label {
  padding: 13px 16px 0;
  color: #73786f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

#stream-input {
  width: 100%;
  min-height: 290px;
  padding: 10px 16px 20px;
  resize: none;
  border: 0;
  background: #fff;
  color: #1b1e19;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.7;
  tab-size: 2;
}

#stream-input:focus {
  outline-offset: -3px;
}

.editor-actions {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px 14px;
  border-top: 1px solid #d0d3cb;
}

.editor-actions p {
  margin: 0;
  color: #686d64;
  font-size: 0.76rem;
}

.primary-button,
.primary-link {
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid #171a16;
  background: #171a16;
  color: #f7f8f2;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button:hover,
.primary-link:hover {
  border-color: #397c2e;
  background: #397c2e;
}

.result-toolbar {
  justify-content: space-between;
  border-color: var(--line);
  color: var(--text);
}

.result-toolbar .quiet-button {
  align-self: stretch;
  padding: 0 4px 0 14px;
}

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

.metrics > div {
  display: flex;
  min-width: 0;
  padding: 12px;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.metrics > div:last-child {
  border-right: 0;
}

.metrics span {
  color: var(--muted);
  font-size: 0.67rem;
  text-transform: uppercase;
}

.metrics strong {
  overflow: hidden;
  margin-top: 3px;
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-output {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.event-result {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  background: #1d201c;
}

.event-result > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
}

.event-result > div strong {
  font-size: 0.77rem;
}

.event-result > div span {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
}

.event-result pre,
.encoded-output,
.diagnostics,
.error-output {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.event-result pre {
  padding: 12px;
  color: #ecede7;
  font-size: 0.82rem;
}

.event-result p {
  margin: 0;
  padding: 8px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.67rem;
}

.encoded-output,
.diagnostics {
  color: #ecede7;
  font-size: 0.82rem;
  line-height: 1.7;
}

.diagnostics {
  padding: 12px;
  border-left: 3px solid var(--yellow);
  background: #22231d;
}

.empty-result {
  color: var(--muted);
}

.error-output {
  margin: 16px;
  padding: 14px;
  border: 1px solid var(--coral);
  color: #ffc1bc;
  font-size: 0.8rem;
}

.privacy-note {
  margin: 12px 0 0;
  color: #686d64;
  font-size: 0.76rem;
}

.content-band {
  max-width: 1440px;
  margin: 0 auto;
}

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

.capability-grid article {
  min-height: 240px;
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.capability-index {
  color: var(--coral);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.capability-grid h3,
.limits-panel h3 {
  margin: 38px 0 10px;
  font-size: 1.25rem;
}

.capability-grid p,
.limits-panel p,
.final-band p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.capability-grid code {
  color: var(--yellow);
}

.code-example {
  display: grid;
  grid-template-columns: minmax(230px, 0.36fr) minmax(0, 1fr);
  margin-top: 48px;
  border: 1px solid var(--line);
  background: var(--black);
}

.code-caption {
  display: flex;
  min-height: 220px;
  padding: 22px;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
}

.code-caption strong {
  display: block;
  max-width: 220px;
  margin-top: 8px;
  font-size: 1.15rem;
}

.code-kicker {
  color: var(--cyan);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.code-caption .quiet-button {
  width: fit-content;
  min-height: 36px;
  padding: 0;
  border-left: 0;
}

.code-example > pre {
  min-width: 0;
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: #e7e9df;
  font-size: 0.82rem;
  line-height: 1.75;
}

.alternate {
  max-width: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #151815;
}

.zero-deps {
  padding: 7px 10px;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
}

.compatibility-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 54px;
}

.runtime-list {
  border-top: 1px solid var(--line);
}

.runtime-list > div {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr auto;
  gap: 20px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
}

.runtime-list strong {
  font-size: 0.9rem;
}

.runtime-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.runtime-list b {
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 600;
}

.limits-panel {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.limits-panel h3 {
  margin-top: 0;
}

.limits-panel dl {
  margin: 22px 0;
}

.limits-panel dl > div {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}

.limits-panel dt {
  color: var(--muted);
}

.limits-panel dd {
  margin: 0;
  color: var(--yellow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.final-band {
  display: flex;
  gap: 36px;
  align-items: end;
  justify-content: space-between;
}

.final-band h2 {
  margin-bottom: 14px;
}

.final-actions {
  display: flex;
  gap: 10px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-link {
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.secondary-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

footer {
  display: flex;
  gap: 26px;
  align-items: center;
  min-height: 72px;
  padding: 16px 5vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
}

footer a {
  margin-left: auto;
  text-decoration: none;
}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topbar nav {
    display: none;
  }

  .workspace,
  .compatibility-layout {
    grid-template-columns: 1fr;
  }

  .editor-pane {
    border-right: 0;
    border-bottom: 1px solid #b8bdb3;
  }

  .result-pane {
    min-height: 480px;
  }

  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-example {
    grid-template-columns: 1fr;
  }

  .code-caption {
    min-height: 130px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 56px;
    padding: 0 16px;
  }

  .version {
    font-size: 0.7rem;
  }

  .hero {
    min-height: 360px;
  }

  .hero > img {
    object-position: 56% center;
  }

  .hero-shade {
    background: linear-gradient(90deg, rgba(7, 9, 7, 0.93), rgba(7, 9, 7, 0.43));
  }

  .hero-copy {
    width: auto;
    margin: 0 16px;
  }

  h1 {
    overflow-wrap: normal;
    font-size: clamp(2rem, 10.8vw, 3.25rem);
    white-space: nowrap;
  }

  .install-row {
    width: 100%;
  }

  .install-row code {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
  }

  .tool-band,
  .content-band {
    padding: 54px 16px;
  }

  .section-heading,
  .final-band {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-control {
    align-self: flex-start;
  }

  .pane-toolbar {
    flex-wrap: wrap;
  }

  .pane-toolbar select {
    flex: 1;
    min-width: 120px;
  }

  .compact-control {
    margin-left: 0;
  }

  .editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics > div:nth-child(2) {
    border-right: 0;
  }

  .metrics > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .capability-grid article {
    min-height: 190px;
  }

  .runtime-list > div {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 10px 0;
  }

  .runtime-list span {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .runtime-list b {
    grid-column: 2;
    grid-row: 1;
  }

  .final-actions {
    flex-direction: column;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
