:root {
  --bg: #0a1020;
  --bg-elevated: rgba(14, 24, 48, 0.8);
  --border: rgba(144, 163, 255, 0.2);
  --text: #ebf0ff;
  --muted: #a7b3d5;
  --accent: #7c8cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(
      circle at top left,
      rgba(124, 140, 255, 0.22),
      transparent 28%
    ),
    radial-gradient(
      circle at top right,
      rgba(87, 199, 133, 0.16),
      transparent 22%
    ),
    linear-gradient(180deg, #09101f 0%, #050914 100%);
  color: var(--text);
}

body {
  padding: 24px;
}

code {
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(180deg, var(--accent) 0%, #31429b 100%);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease,
    border-color 120ms ease;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
}

button.secondary {
  background: rgba(255, 255, 255, 0.06);
}

.page-shell {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.top-nav {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.top-nav-brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 120ms ease, border-color 120ms ease,
    transform 120ms ease;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  position: relative;
  overflow: hidden;
  gap: 32px;
  align-items: start;
  padding: 34px 32px 32px;
  background: radial-gradient(
      circle at top left,
      rgba(124, 140, 255, 0.2),
      transparent 30%
    ),
    radial-gradient(
      circle at top right,
      rgba(87, 199, 133, 0.12),
      transparent 24%
    ),
    linear-gradient(180deg, rgba(18, 29, 58, 0.96), rgba(13, 20, 40, 0.94));
  border-color: rgba(124, 140, 255, 0.24);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(124, 140, 255, 0.45),
    rgba(87, 199, 133, 0.2),
    transparent 80%
  );
  pointer-events: none;
}

.hero-copy-block {
  display: grid;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}

.hero-scenarios {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: #c5cfff;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  max-width: 11.5ch;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

.hero-title {
  max-width: 13.5ch;
  margin: 0 auto;
  font-size: clamp(3.4rem, 7.6vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  overflow-wrap: anywhere;
}

.hero-title-accent {
  color: #a9bbff;
  text-shadow: 0 0 28px rgba(124, 140, 255, 0.28);
}

h2 {
  font-size: 1.2rem;
}

.hero-copy,
.section-heading p,
.scenario-item span,
dt {
  color: var(--muted);
}

.hero-copy {
  max-width: 66ch;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.72;
}

.compact {
  margin-top: 10px;
}

.child-status-row {
  display: grid;
  gap: 10px;
}

.child-status-row {
  margin-bottom: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.94rem;
  font-weight: 600;
}

.workspace-columns {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(360px, 1.1fr) minmax(
      320px,
      0.95fr
    );
  gap: 20px;
  align-items: start;
}

.column-card {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 100%;
}

.demo-section {
  display: grid;
  gap: 20px;
}

.parent-column,
.events-column {
  display: grid;
  align-content: start;
}

.iframe-column {
  position: relative;
}

.iframe-heading-row {
  display: grid;
  gap: 16px;
}

.iframe-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(124, 140, 255, 0.14);
  border: 1px solid rgba(124, 140, 255, 0.22);
  color: #dbe2ff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.section-heading.tight {
  margin-bottom: 12px;
}

.section-heading p {
  margin: 0;
  line-height: 1.5;
}

.hero-scenarios-lead {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
}

.hero .scenario-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.scenario-list,
.snapshot-grid,
.control-grid {
  display: grid;
  gap: 14px;
}

.scenario-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero .scenario-item {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hero .scenario-item:nth-child(1) {
  background: linear-gradient(
    180deg,
    rgba(124, 140, 255, 0.12),
    rgba(255, 255, 255, 0.035)
  );
  border-color: rgba(124, 140, 255, 0.22);
}

.hero .scenario-item:nth-child(2) {
  background: linear-gradient(
    180deg,
    rgba(83, 174, 255, 0.1),
    rgba(255, 255, 255, 0.035)
  );
  border-color: rgba(83, 174, 255, 0.2);
}

.hero .scenario-item:nth-child(3) {
  background: linear-gradient(
    180deg,
    rgba(87, 199, 133, 0.1),
    rgba(255, 255, 255, 0.035)
  );
  border-color: rgba(87, 199, 133, 0.2);
}

.hero .scenario-item strong {
  margin-bottom: 0;
  font-size: 1.02rem;
}

.hero .scenario-item span {
  line-height: 1.58;
}

.scenario-item strong {
  display: block;
  margin-bottom: 8px;
}

.quickstart-section {
  display: grid;
  gap: 18px;
}

.quickstart-callout {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(124, 140, 255, 0.1);
  border: 1px solid rgba(124, 140, 255, 0.18);
  color: #dbe2ff;
  line-height: 1.5;
}

.quickstart-html-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.quickstart-card {
  display: grid;
  align-content: start;
  align-self: start;
  height: fit-content;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.examples-section {
  display: grid;
  gap: 20px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.example-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.example-header {
  display: grid;
  align-content: start;
  gap: 8px;
}

.example-tag {
  display: inline-block;
  color: #bcc7f4;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.example-card h3 {
  margin: 0;
  font-size: 1.08rem;
}

.example-header h3 code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
}

.example-summary,
.example-explanation p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.example-explanation {
  display: grid;
  gap: 14px;
}

.example-code {
  margin: 0;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(4, 8, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.example-code code {
  display: block;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre;
}

.token-comment {
  color: #7f8cb3;
}

.token-string {
  color: #8ce7b5;
}

.token-keyword {
  color: #ff9cd2;
}

.token-number {
  color: #ffcf76;
}

.token-literal {
  color: #83d7ff;
}

.token-property {
  color: #c5cfff;
}

.token-tag {
  color: #83d7ff;
}

.token-attr-name {
  color: #ffd37b;
}

.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

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

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

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

.snapshot-grid div {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

dt,
dd {
  margin: 0;
}

dd {
  margin-top: 8px;
  font-weight: 700;
}

.iframe-column iframe {
  width: 100%;
  min-height: 720px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: #0a1020;
}

.events-toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-button {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.filter-button.is-active {
  background: linear-gradient(180deg, var(--accent) 0%, #31429b 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.events-summary {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.empty-log {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.log-panel {
  display: grid;
  gap: 10px;
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.log-entry {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.log-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-message {
  line-height: 1.5;
}

.log-source {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.log-source-parent {
  background: rgba(124, 140, 255, 0.14);
  color: #dbe2ff;
}

.log-source-child {
  background: rgba(87, 199, 133, 0.14);
  color: #d9ffe9;
}

.log-entry.ok {
  border-color: rgba(87, 199, 133, 0.24);
  background: rgba(87, 199, 133, 0.08);
}

.log-entry.warn {
  border-color: rgba(255, 180, 84, 0.24);
  background: rgba(255, 180, 84, 0.08);
}

.log-entry.info {
  border-color: rgba(124, 140, 255, 0.24);
  background: rgba(124, 140, 255, 0.08);
}

.log-time {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.child-body {
  padding: 0;
  background: transparent;
}

.child-shell {
  min-height: 100vh;
  padding: 18px;
  background: linear-gradient(
    180deg,
    rgba(5, 9, 20, 0.95),
    rgba(13, 20, 40, 0.98)
  );
}

.child-frame-label {
  display: inline-flex;
  margin-bottom: 16px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.child-header {
  margin-bottom: 16px;
}

.child-snapshot-grid {
  margin-bottom: 16px;
}

.theme-midnight {
  --child-accent: #7c8cff;
}

.theme-sunset {
  --child-accent: #ff8a5b;
}

.theme-forest {
  --child-accent: #57c785;
}

.child-shell .status-pill,
.child-shell .snapshot-grid div,
.child-shell .log-entry,
.child-shell button {
  border-color: rgba(255, 255, 255, 0.12);
}

.child-shell button {
  background: linear-gradient(180deg, var(--child-accent) 0%, #243c62 100%);
}

.child-shell button.secondary {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  body {
    padding: 12px;
  }

  .top-nav {
    top: 8px;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-shell {
    gap: 16px;
  }

  .hero {
    gap: 20px;
    padding: 24px 18px 22px;
  }

  .hero-copy-block {
    max-width: 100%;
    gap: 14px;
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(2.2rem, 11vw, 3.6rem);
    line-height: 0.92;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero-copy {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.62;
  }

  .hero-scenarios {
    gap: 14px;
  }

  .hero-scenarios-lead {
    font-size: 1rem;
  }

  .hero .scenario-list {
    gap: 14px;
  }

  .hero .scenario-item {
    padding: 18px;
  }

  .hero,
  .workspace-columns,
  .quickstart-html-grid,
  .quickstart-grid,
  .examples-grid,
  .hero .scenario-list,
  .control-grid,
  .snapshot-grid,
  .child-controls {
    grid-template-columns: 1fr;
  }

  .iframe-column iframe {
    min-height: 720px;
  }
}
