:root {
  color-scheme: light;
  --canvas: #f5f5f3;
  --surface: #ffffff;
  --surface-soft: #ececea;
  --ink: #101010;
  --ink-2: #3f3f3c;
  --muted: #71716c;
  --line: rgba(16, 16, 16, 0.12);
  --line-strong: rgba(16, 16, 16, 0.22);
  --inverse: #0f0f0f;
  --inverse-ink: #f7f7f5;
  --success: #1f6b3b;
  --danger: #9a2b25;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.08);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 30px;
  --shell: min(1180px, calc(100vw - 48px));
  --font:
    'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Helvetica Neue', sans-serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --canvas: #111110;
  --surface: #191918;
  --surface-soft: #242422;
  --ink: #f3f3ef;
  --ink-2: #cacac4;
  --muted: #92928c;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.22);
  --inverse: #f2f2ee;
  --inverse-ink: #111110;
  --success: #65bd81;
  --danger: #ef7d75;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}
html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}
body {
  min-height: 100svh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition:
    background 180ms ease,
    color 180ms ease;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p,
dl,
dd,
pre {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.shell {
  width: var(--shell);
  margin-inline: auto;
}
.skip-link {
  position: fixed;
  left: 18px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--inverse);
  color: var(--inverse-ink);
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  background: color-mix(in srgb, var(--canvas) 94%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar__inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--inverse);
  color: var(--inverse-ink);
  font-size: 12px;
  font-weight: 800;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.nav a {
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition:
    color 120ms ease,
    background 120ms ease;
}
.nav a:hover {
  color: var(--ink);
}
.nav a[aria-current='page'] {
  background: var(--inverse);
  color: var(--inverse-ink);
  font-weight: 700;
}
.theme-toggle {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.theme-toggle > span:first-child {
  width: 16px;
  height: 16px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.hero {
  min-height: calc(100svh - 64px);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
  align-items: center;
  gap: clamp(56px, 8vw, 112px);
  padding-block: 88px;
}
.hero__copy {
  animation: rise 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.eyebrow {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 700px;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 650;
}
.hero__lead {
  max-width: 630px;
  margin-top: 28px;
  color: var(--ink-2);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
  letter-spacing: -0.015em;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 19px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease;
}
.button:hover {
  transform: translateY(-1px);
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}
[aria-busy='true'] .button:disabled {
  cursor: wait;
}
.button--dark {
  border-color: var(--inverse);
  background: var(--inverse);
  color: var(--inverse-ink);
}
.button--light {
  background: var(--surface);
  color: var(--ink);
}
.button--wide {
  width: 100%;
  margin-top: 4px;
}
.signal-panel {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 620ms 100ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.signal-panel__header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
}
.status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 13%, transparent);
}
.topology {
  display: grid;
  grid-template-columns: 1fr 24px 1fr 24px 1fr;
  align-items: center;
}
.topology__node {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas);
}
.topology__node small,
.topology__node span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.topology__node strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}
.topology__line {
  height: 1px;
  background: var(--line-strong);
}
.signal-panel > p {
  color: var(--muted);
  font-size: 13px;
}

.feature-band {
  background: var(--inverse);
  color: var(--inverse-ink);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.feature-grid article {
  min-height: 410px;
  display: flex;
  flex-direction: column;
  padding: 54px 36px;
  border-left: 1px solid color-mix(in srgb, var(--inverse-ink) 16%, transparent);
}
.feature-grid article:last-child {
  border-right: 1px solid
    color-mix(in srgb, var(--inverse-ink) 16%, transparent);
}
.feature-index {
  color: color-mix(in srgb, var(--inverse-ink) 50%, transparent);
  font-size: 12px;
}
.feature-grid h2 {
  margin-top: auto;
  font-size: 30px;
}
.feature-grid p {
  margin-top: 18px;
  color: color-mix(in srgb, var(--inverse-ink) 68%, transparent);
  font-size: 15px;
}
.feature-grid code {
  color: inherit;
}
.feature-grid a {
  margin-top: 28px;
  text-underline-offset: 5px;
  font-size: 14px;
}
.feature-grid a span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 120ms ease;
}
.feature-grid a:hover span {
  transform: translate(3px, -3px);
}

.principles {
  min-height: 82svh;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  align-items: center;
  gap: 96px;
  padding-block: 100px;
}
.principles h2 {
  max-width: 420px;
  font-size: clamp(42px, 5vw, 68px);
}
.principles dl {
  border-top: 1px solid var(--line-strong);
}
.principles dl > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}
.principles dt {
  font-weight: 700;
}
.principles dd {
  color: var(--ink-2);
}
.principles code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-soft);
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 88px 0 44px;
}
.page-heading h1 {
  font-size: clamp(48px, 6vw, 72px);
}
.page-heading p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
}
.phase-badge,
.stream-state {
  flex: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.stream-state.is-ready {
  color: var(--success);
}
.stream-state.is-error {
  color: var(--danger);
}
.workbench {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  gap: 20px;
  min-width: 0;
  padding-bottom: 84px;
}
.control-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 28px;
}
.control-panel__intro span,
.preview-panel__header span,
.request-preview > span,
.log-results header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.control-panel__intro h2,
.preview-panel__header h2,
.log-results h2 {
  margin-top: 5px;
  font-size: 24px;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field-row > * {
  min-width: 0;
}
.field,
.upload-field,
.range-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}
.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
}
.field input[type='color'] {
  padding: 6px;
}
.field select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%2371716c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
:root[data-theme='dark'] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%2392928c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.upload-field {
  position: relative;
  min-width: 0;
  max-width: 100%;
  min-height: 112px;
  justify-content: center;
  overflow: hidden;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--canvas);
  cursor: pointer;
}
.upload-field > * {
  min-width: 0;
  max-width: 100%;
}
.upload-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.upload-field strong {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: var(--ink);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-field small {
  color: var(--muted);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.range-field > span {
  display: flex;
  justify-content: space-between;
}
.range-field input {
  width: 100%;
  accent-color: var(--ink);
}
.effect-control {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.effect-control__fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 2px 2px;
}
.effect-control__fields[hidden] {
  display: none;
}
.effect-control__hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.toggle-field {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.toggle-field input {
  width: 17px;
  height: 17px;
  accent-color: var(--ink);
}
.toggle-field span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.toggle-field strong {
  font-size: 13px;
}
.toggle-field small {
  color: var(--muted);
}
.auto-preview-field {
  margin-top: 3px;
}
.render-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.render-actions .button {
  width: 100%;
  min-width: 0;
}
.preview-panel {
  min-width: 0;
  padding: 18px;
}
.preview-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 6px 6px 18px;
}
.preview-panel__header > * {
  min-width: 0;
}
.media-stage {
  min-height: 490px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: #0b0b0b;
  color: #ededeb;
}
.media-stage img,
.media-stage video {
  display: block;
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
}
.media-empty {
  max-width: 360px;
  padding: 40px;
  text-align: center;
}
.media-empty > span {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.media-empty p {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
}
.media-empty code {
  color: #fff;
}
.request-preview {
  margin-top: 14px;
  padding: 18px;
  border-radius: 12px;
  background: var(--canvas);
}
.request-preview pre {
  max-height: 240px;
  overflow: auto;
  margin-top: 10px;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.55;
}
.implementation-note {
  margin: 14px 6px 2px;
  color: var(--muted);
  font-size: 12px;
}
.result-download {
  width: max-content;
  margin-top: 14px;
}

.log-page {
  min-height: calc(100svh - 64px);
}
.log-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  padding-bottom: 84px;
}
.log-filters,
.log-results {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.log-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
  padding: 22px;
}
.log-results {
  min-width: 0;
  overflow: hidden;
}
.log-results > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}
.log-results > header p {
  color: var(--muted);
  font-size: 12px;
}
.log-list {
  min-height: 420px;
  max-height: 650px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.log-entry {
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
}
.log-entry code {
  display: block;
  width: max-content;
  min-width: 100%;
  color: var(--ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  white-space: pre;
}
.log-entry--error code,
.log-entry--fatal code {
  color: var(--danger);
}
.log-entry--warn code {
  color: #8a650c;
}
.log-placeholder {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}
.log-placeholder strong {
  color: var(--ink);
}
.log-placeholder span {
  margin-top: 7px;
  font-size: 13px;
}
.log-placeholder--error strong {
  color: var(--danger);
}

.footer {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  :root {
    --shell: min(100% - 36px, 720px);
  }
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 80px;
  }
  .signal-panel {
    min-height: 380px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .feature-grid article {
    min-height: 300px;
    border-right: 1px solid
      color-mix(in srgb, var(--inverse-ink) 16%, transparent);
    border-bottom: 1px solid
      color-mix(in srgb, var(--inverse-ink) 16%, transparent);
  }
  .principles {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  .workbench,
  .log-shell {
    grid-template-columns: 1fr;
  }
  .log-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .media-stage {
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  :root {
    --shell: calc(100% - 28px);
  }
  .topbar {
    height: 62px;
  }
  .topbar__inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding-block: 8px;
  }
  .brand > span:last-child {
    display: none;
  }
  .nav {
    grid-column: 2;
    grid-row: 1;
    width: max-content;
    max-width: 100%;
    justify-self: center;
    justify-content: center;
    gap: 0;
    padding: 3px;
  }
  .nav a {
    padding: 5px 9px;
    font-size: 12px;
  }
  .theme-toggle__label {
    display: none;
  }
  .hero h1 {
    font-size: 46px;
  }
  .topology {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .topology__node {
    min-height: 82px;
  }
  .topology__line {
    width: 1px;
    height: 12px;
    margin-left: 24px;
  }
  .signal-panel {
    min-height: 520px;
  }
  .principles dl > div {
    grid-template-columns: 88px 1fr;
  }
  .page-heading {
    align-items: start;
    flex-direction: column;
    padding-top: 64px;
  }
  .page-heading h1 {
    font-size: 50px;
  }
  .field-row,
  .log-filters {
    grid-template-columns: 1fr;
  }
  .control-panel,
  .preview-panel {
    padding: 18px;
  }
  .render-actions {
    grid-template-columns: 1fr;
  }
  .preview-panel__header {
    align-items: flex-start;
  }
  .stream-state {
    max-width: 48%;
    overflow-wrap: anywhere;
    text-align: right;
  }
  .media-stage {
    min-height: 340px;
  }
  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

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