:root {
  color-scheme: light;
  --ink: #15181d;
  --muted: #657080;
  --line: #d8dee8;
  --paper: #f6f8fb;
  --panel: #ffffff;
  --coal: #202a33;
  --green: #0f8f6f;
  --green-deep: #07664f;
  --amber: #b9770e;
  --blue: #225fb2;
  --red: #b23a48;
  --shadow: 0 18px 50px rgba(28, 38, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(15, 143, 111, 0.08), transparent 360px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 12px;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px clamp(14px, 2vw, 28px) 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #c9ffe6;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
}

.brand span:not(.brand-mark) {
  color: var(--muted);
  font-size: 0.86rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.topnav a {
  color: var(--coal);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 0.88rem;
}

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

.hero-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  gap: clamp(18px, 3vw, 42px);
  align-items: stretch;
  min-height: 430px;
  padding: clamp(26px, 4vw, 52px);
  border: 1px solid rgba(15, 24, 32, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.68)),
    radial-gradient(circle at 88% 10%, rgba(34, 95, 178, 0.2), transparent 30%),
    linear-gradient(120deg, rgba(15, 143, 111, 0.18), rgba(185, 119, 14, 0.08));
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.4rem, 4.8vw, 5rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
}

.lede {
  max-width: 58ch;
  margin: 20px 0 0;
  color: #3d4651;
  font-size: 1.04rem;
}

.hero-actions,
.command-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.primary-action,
.secondary-action,
.code-card button,
.icon-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 9px 13px;
  font-weight: 800;
}

.primary-action {
  background: var(--green);
  color: white;
  box-shadow: 0 10px 24px rgba(15, 143, 111, 0.22);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--green-deep);
  outline: none;
}

.secondary-action,
.code-card button,
.icon-button {
  background: white;
  color: var(--coal);
  border-color: var(--line);
}

.secondary-action:hover,
.secondary-action:focus-visible,
.code-card button:hover,
.code-card button:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  border-color: #9eabbc;
  outline: none;
}

.terminal-panel,
.code-card,
.sidebar,
.tool-panel,
.curl-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.terminal-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(24, 34, 43, 0.12);
}

.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--coal);
  color: #d6dde6;
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e06767;
}

.terminal-head span:nth-child(2) {
  background: #e5b348;
}

.terminal-head span:nth-child(3) {
  background: #6ccb83;
}

.terminal-head strong {
  min-width: 0;
  margin-left: 6px;
  overflow: hidden;
  color: #eef4f9;
  font-size: 0.77rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#heroCommand {
  flex: 1;
  min-height: 300px;
  padding: 18px;
  background: #11181f;
  color: #d9fbe9;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 18px;
}

.status-strip article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.status-strip article.live {
  border-color: rgba(178, 58, 72, 0.35);
  background: rgba(178, 58, 72, 0.08);
}

.status-strip span,
.panel-title span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-strip strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.sidebar,
.tool-panel {
  min-width: 0;
}

.sidebar {
  align-self: start;
  padding: 16px;
}

.panel-title,
.code-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.step-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.step-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #e9eef5;
  color: var(--coal);
  font-weight: 900;
}

.step-list li.done .step-number {
  background: rgba(15, 143, 111, 0.13);
  color: var(--green-deep);
}

.step-list strong,
.step-list span {
  display: block;
}

.step-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  background: var(--coal);
  color: white;
}

.tabs button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.tab-content {
  padding: 18px;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 143, 111, 0.28);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(15, 143, 111, 0.08);
}

.mode-banner strong,
.mode-banner span {
  display: block;
}

.mode-banner span {
  color: #39515a;
  font-size: 0.9rem;
}

.mode-banner.live {
  border-color: rgba(178, 58, 72, 0.35);
  background: rgba(178, 58, 72, 0.08);
}

.mode-banner.live strong {
  color: var(--red);
}

.live-confirm {
  margin-top: 14px;
}

.hidden {
  display: none;
}

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

label,
.textarea-label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #2f3945;
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d1dc;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: 3px solid rgba(15, 143, 111, 0.16);
}

.hint,
.risk-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.inline-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-options input {
  width: 18px;
  min-height: 18px;
}

.risk-note {
  border-left: 4px solid var(--amber);
  padding: 10px 12px;
  background: rgba(185, 119, 14, 0.08);
  color: #5d4216;
}

.split-section,
.curl-section {
  margin-top: 28px;
}

.section-heading {
  margin-bottom: 14px;
}

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

.code-card {
  min-width: 0;
  overflow: hidden;
}

.code-card-head {
  min-height: 48px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f9fbfd;
}

.code-card pre {
  max-height: 360px;
  min-height: 220px;
  overflow: auto;
  padding: 14px;
  background: #ffffff;
  color: #1f2933;
}

.curl-section {
  padding: 18px;
}

.command-toolbar {
  margin-top: 0;
  margin-bottom: 14px;
}

.command-output {
  max-height: 650px;
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
  background: #121820;
  color: #e9fff4;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  transform: translateY(20px);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

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

  .terminal-panel {
    min-height: 360px;
  }

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

@media (max-width: 620px) {
  .shell {
    padding-inline: 12px;
  }

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

  .topnav {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-section {
    padding: 22px;
  }

  .status-strip,
  .payload-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .mode-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip article {
    padding: 12px;
  }

  h1 {
    font-size: 2.65rem;
  }

  .command-toolbar button,
  .hero-actions button {
    width: 100%;
  }

  .tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .tabs button {
    flex: 1 1 92px;
  }
}

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