:root {
  color-scheme: light;
  --bg: #f8faf8;
  --panel: #ffffff;
  --ink: #172126;
  --muted: #65727a;
  --line: #d9e3e0;
  --teal: #0f8b7d;
  --blue: #2e69bf;
  --orange: #d97224;
  --soft-teal: #eaf7f4;
  --soft-blue: #eef5ff;
  --soft-orange: #fff3e8;
  --shadow: 0 18px 60px rgba(23, 33, 38, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

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

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  width: 1px;
  height: 1px;
  padding: 10px 12px;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(248, 250, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #0f2f2c;
  border-radius: var(--radius);
  background: #123d39;
  color: #fff;
}

.main-nav,
.site-footer,
.source-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.main-nav a,
.source-row a,
.site-footer a {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.source-row a:hover,
.site-footer a:hover {
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
}

main {
  overflow: clip;
}

.hero {
  min-height: calc(100svh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: clamp(22px, 4vw, 54px);
  align-items: center;
  padding: clamp(34px, 6vw, 76px) clamp(18px, 5vw, 72px) 18px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 20px;
  font-size: 6.1rem;
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 3.7rem;
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.hero-lead,
.section-lead {
  color: #405058;
  font-size: 1.22rem;
}

.hero-actions,
.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: #fff;
  border-color: var(--line);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.hero-facts div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.hero-facts dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.hero-visual {
  min-width: 0;
}

.hero-visual img {
  width: 100%;
  border: 1px solid #c7d7d3;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
}

.hero-hint {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-hint span {
  min-width: 0;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.section {
  padding: clamp(58px, 9vw, 112px) clamp(18px, 5vw, 72px);
}

.section > * {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.intro-band {
  background: #ffffff;
}

.text-grid,
.split,
.runner-grid,
.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 4vw, 42px);
}

.text-grid p,
.split p {
  color: #405058;
  font-size: 1.04rem;
}

.source-row {
  margin-top: 24px;
}

.split > .source-row {
  grid-column: 1 / -1;
}

.source-row a {
  background: var(--soft-blue);
  color: #1a4a91;
}

.comparison-panel,
.checklist-panel,
.api-notes,
.access-grid,
.template-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 32px rgba(23, 33, 38, 0.06);
}

.comparison-panel {
  display: grid;
}

.comparison-panel article {
  display: grid;
  gap: 5px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.comparison-panel article:last-child {
  border-bottom: 0;
}

.comparison-panel span,
.template-card span,
.access-grid span,
.api-notes p,
.runner-note,
.validation,
.field-note {
  color: var(--muted);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.template-card {
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.template-card[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--soft-teal);
}

.template-card strong {
  font-size: 1rem;
}

.template-detail {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-top: 14px;
  padding: 20px;
}

.role-list,
.boundary-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.role-list li,
.boundary-list li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.builder-section {
  background: #eef5f2;
}

.builder {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  border: 1px solid #bed3cd;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

label,
legend {
  color: #213137;
  font-size: 0.9rem;
  font-weight: 800;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #cbd9d5;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 122px;
  padding: 12px;
  resize: vertical;
}

.stepper {
  display: inline-grid;
  grid-template-columns: 44px 70px 44px;
  width: max-content;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  background: #f3f7f5;
  cursor: pointer;
  font-weight: 900;
}

.stepper output {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-weight: 900;
}

input[type="range"] {
  height: auto;
  padding: 0;
}

.segments,
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segments button,
.checks label,
.checklist-panel label {
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.segments button {
  cursor: pointer;
}

.segments button[aria-checked="true"] {
  border-color: var(--teal);
  background: var(--soft-teal);
  color: #064b43;
  font-weight: 800;
}

.checks input,
.checklist-panel input {
  width: auto;
  height: auto;
  margin-right: 6px;
}

.validation {
  grid-column: 1 / -1;
  min-height: 28px;
  margin: 0;
  font-weight: 700;
}

.validation[data-state="error"] {
  color: #9b2d20;
}

.validation[data-state="ready"] {
  color: #0b766a;
}

.runner-section {
  background: #172126;
  color: #eef6f3;
}

.runner-section .section-kicker,
.runner-section .runner-note {
  color: #9fd9d2;
}

.status-rail {
  display: grid;
  align-content: start;
  gap: 8px;
}

.status-rail span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  color: #a7bab4;
}

.status-rail span.active {
  border-color: #8be2d8;
  background: rgba(139, 226, 216, 0.12);
  color: #fff;
}

.output,
.code-block {
  min-height: 320px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: #0d1417;
  color: #e7f8f4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.runner-console {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.runner-meta span,
.artifact-list,
.share-output {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: #d5e8e3;
  overflow-wrap: anywhere;
}

.artifact-list {
  display: grid;
  gap: 8px;
}

.artifact-list p,
.artifact-list h3 {
  margin: 0;
}

.artifact-list ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.artifact-list li {
  display: grid;
  gap: 4px;
}

.artifact-list a {
  color: #aaf0e8;
  font-weight: 800;
}

.artifact-list span {
  color: #b8cbc6;
}

.code-block {
  min-height: auto;
  border-color: #cdd9d5;
  background: #101719;
}

.runner-note {
  margin-top: 18px;
}

.workspace-section {
  background: #ffffff;
}

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

.workspace-panel,
.prompt-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 32px rgba(23, 33, 38, 0.06);
}

.workspace-panel .builder-actions {
  margin: 4px 0 0;
}

.workspace-panel .validation {
  grid-column: auto;
}

.share-output {
  display: block;
  min-height: 44px;
  border-color: var(--line);
  background: #f7fbfa;
  color: var(--ink);
}

.share-output a {
  color: #1a4a91;
  font-weight: 800;
}

.prompt-section {
  background: #eef5ff;
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-heading h3 {
  margin: 0;
}

.copy-icon {
  width: auto;
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.prompt-card .code-block {
  max-height: 280px;
  overflow: auto;
}

.checklist-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.access-grid {
  display: grid;
  gap: 0;
}

.access-grid article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.access-grid article:last-child {
  border-bottom: 0;
}

.api-notes {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

summary {
  cursor: pointer;
  padding: 16px;
  font-weight: 900;
}

details p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
}

.share-page {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0;
}

.share-page section {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.share-page pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  border-radius: var(--radius);
  background: #101719;
  color: #e7f8f4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.site-footer {
  justify-content: center;
  padding: 32px 18px 46px;
  border-top: 1px solid var(--line);
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .hero,
  .text-grid,
  .split,
  .runner-grid,
  .api-grid,
  .workspace-grid,
  .prompt-grid,
  .template-detail,
  .builder {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }

  h1 {
    max-width: 10ch;
    font-size: 4.4rem;
  }

  h2 {
    font-size: 2.6rem;
  }

  .hero-facts,
  .hero-hint,
  .template-grid {
    grid-template-columns: 1fr;
  }

  .runner-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .hero-actions,
  .builder-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  h1 {
    font-size: 3.15rem;
  }

  h2 {
    font-size: 2.05rem;
  }

  .hero-lead,
  .section-lead {
    font-size: 1.08rem;
  }

  .role-list li,
  .boundary-list li {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
