:root {
  color-scheme: dark;
  --bg: #020306;
  --bg-deep: #000000;
  --surface: rgba(9, 11, 16, 0.9);
  --surface-2: rgba(10, 14, 21, 0.94);
  --surface-3: rgba(14, 18, 26, 0.98);
  --text: #f5f7fb;
  --text-soft: #cad3e1;
  --muted: #8e99ad;
  --accent: #8db6ff;
  --accent-strong: #6d9cff;
  --accent-soft: rgba(141, 182, 255, 0.12);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(141, 182, 255, 0.18);
  --shadow: 0 36px 120px rgba(0, 0, 0, 0.52);
  --display: Inter, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --sans: Inter, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 0% 0%, rgba(109, 156, 255, 0.1), transparent 28%),
    radial-gradient(circle at 100% 12%, rgba(79, 125, 214, 0.08), transparent 22%),
    linear-gradient(180deg, #06070a 0%, #020306 55%, #000000 100%);
  color: var(--text);
}

body {
  font-family: var(--sans);
  overflow: hidden;
}

.machine-brief {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  height: 100dvh;
  padding: clamp(1rem, 2vw, 1.5rem);
  gap: clamp(1rem, 2vw, 1.35rem);
}

.panel {
  min-height: 0;
}

.panel-copy,
.panel-code {
  display: flex;
  min-height: 0;
}

.copy-block,
.code-shell {
  position: relative;
  width: 100%;
  min-height: 0;
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.copy-block::after,
.code-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}

.copy-block {
  display: flex;
  align-items: flex-start;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%),
    linear-gradient(160deg, rgba(12, 14, 19, 0.96), rgba(4, 6, 10, 0.98));
  backdrop-filter: blur(18px);
}

.copy-stack {
  display: grid;
  gap: clamp(1.35rem, 3.2vh, 2.3rem);
  width: min(100%, 42rem);
}

.copy-main {
  display: grid;
  gap: 1rem;
}

.eyebrow,
.code-kicker,
.code-caption {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-family: var(--display);
  font-size: clamp(4rem, 8vw, 6.8rem);
  font-weight: 760;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.description {
  max-width: 34rem;
  font-size: clamp(1.08rem, 1.35vw, 1.22rem);
  line-height: 1.55;
  color: var(--text);
}

.subcopy {
  max-width: 36rem;
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--muted);
}

.capability-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  max-width: 42rem;
}

.inline-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.94rem;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.inline-token:hover,
.inline-token:focus-visible,
.inline-token.is-active {
  color: #f7fbff;
  background: linear-gradient(180deg, rgba(141, 182, 255, 0.18), rgba(109, 156, 255, 0.11));
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(141, 182, 255, 0.08), 0 14px 32px rgba(34, 67, 130, 0.18);
  outline: none;
}

.inline-token:active {
  transform: translateY(1px);
}

.footer-zone {
  display: grid;
  gap: 1rem;
}

.actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  padding: 0.96rem 1.16rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.action:hover,
.action:focus-visible {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(141, 182, 255, 0.2);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  outline: none;
}

.action:active {
  transform: translateY(1px);
}

.action-primary {
  background: linear-gradient(180deg, #f8fbff 0%, #dce8ff 100%);
  color: #0c1320;
  border-color: transparent;
}

.action-primary:hover,
.action-primary:focus-visible {
  background: linear-gradient(180deg, #ffffff 0%, #e4eeff 100%);
  border-color: transparent;
}

.code-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(1rem, 2vw, 1.35rem);
  background:
    radial-gradient(circle at top, rgba(141, 182, 255, 0.07), transparent 24%),
    linear-gradient(180deg, rgba(8, 10, 15, 0.98), rgba(1, 2, 4, 1));
}

.code-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.18;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.26), #000 18%, #000 82%, rgba(0, 0, 0, 0.14));
  pointer-events: none;
}

.code-chrome {
  display: flex;
  gap: 0.45rem;
  padding-bottom: 0.95rem;
}

.code-chrome span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.code-chrome span:first-child {
  background: rgba(141, 182, 255, 0.92);
  box-shadow: 0 0 20px rgba(141, 182, 255, 0.32);
}

.code-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
}

.code-header h2 {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: clamp(1.02rem, 1.6vw, 1.26rem);
  font-weight: 520;
  color: #f7fbff;
}

.code-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(141, 182, 255, 0.18);
  background: rgba(141, 182, 255, 0.1);
  color: #dce8ff;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-panel {
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
  margin: 0;
  min-height: 0;
  padding: 0;
  overflow: auto;
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.005)),
    linear-gradient(180deg, rgba(4, 7, 12, 0.98), rgba(0, 0, 0, 1));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  scrollbar-width: thin;
  scrollbar-color: rgba(141, 182, 255, 0.28) rgba(255, 255, 255, 0.02);
}

.code-panel::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.code-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

.code-panel::-webkit-scrollbar-thumb {
  background: rgba(141, 182, 255, 0.26);
  border-radius: 999px;
  border: 2px solid rgba(0, 0, 0, 0);
  background-clip: padding-box;
}

.code-panel code {
  display: grid;
  grid-template-columns: auto 1fr;
  min-height: 100%;
  font-family: var(--mono);
  font-size: clamp(0.83rem, 1.02vw, 0.93rem);
  line-height: 1.74;
  color: #edf3ff;
  white-space: normal;
  transition: opacity 140ms ease, transform 140ms ease;
}

.code-panel.is-swapping code {
  opacity: 0.38;
  transform: translateY(2px);
}

.line-number,
.line-content {
  padding-top: 0.06rem;
  padding-bottom: 0.06rem;
}

.line-number {
  padding-left: 1rem;
  padding-right: 0.85rem;
  text-align: right;
  color: rgba(142, 153, 173, 0.58);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
  user-select: none;
}

.line-content {
  padding-left: 0.25rem;
  padding-right: 1.1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.json-punctuation,
.json-brace,
.json-bracket {
  color: #8190aa;
}

.json-key {
  color: #cfe0ff;
}

.json-string {
  color: #f5f7fb;
}

.json-number {
  color: #98bcff;
}

.json-boolean {
  color: #7eb0ff;
}

.json-null {
  color: #8995a7;
}

@media (max-width: 1100px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .copy-block,
  .code-shell {
    border-radius: 1.35rem;
  }

  .code-panel {
    min-height: 28rem;
    height: 28rem;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .copy-block,
  .code-shell {
    padding: 1.05rem;
  }

  .code-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-meta {
    gap: 0.55rem;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
  }

  .description {
    font-size: 1rem;
  }

  .subcopy {
    font-size: 0.93rem;
  }

  .capability-cluster {
    gap: 0.55rem;
  }

  .inline-token {
    padding: 0.64rem 0.82rem;
    font-size: 0.86rem;
  }

  .actions {
    gap: 0.7rem;
  }

  .action {
    flex: 1 1 10rem;
    min-width: 0;
  }

  .code-panel code {
    font-size: 0.81rem;
  }

  .line-number {
    padding-left: 0.7rem;
    padding-right: 0.65rem;
  }

  .line-content {
    padding-right: 0.8rem;
  }
}
