:root {
  color-scheme: light;
  --ink: #141917;
  --muted-ink: #56605b;
  --surface: #ffffff;
  --page: #f6f8f6;
  --soft: #edf2ef;
  --border: #cbd4cf;
  --green: #137a53;
  --green-dark: #0d5b3d;
  --coral: #d95d48;
  --yellow: #f2c94c;
  --code: #111815;
  --code-text: #e9f0ec;
  --danger: #b13a2a;
  --shadow: 0 12px 32px rgba(20, 25, 23, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  line-height: 1.55;
}

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

button,
select {
  cursor: pointer;
}

a {
  color: var(--green-dark);
  text-underline-offset: 3px;
}

code,
pre,
textarea {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
}

.site-header nav,
footer nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-header nav a,
footer a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a:hover,
footer a:hover {
  color: var(--green);
}

.hero {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background-color: #fff;
  background-image: url("./assets/deepmerge-structure.jpg");
  background-position: center right;
  background-repeat: no-repeat;
  background-size: cover;
}

.hero-content {
  position: relative;
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
  padding: 48px 0 42px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: 48px;
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.hero-copy {
  max-width: 600px;
  margin: 16px 0 20px;
  color: #303a35;
  font-size: 18px;
}

.install-row {
  display: inline-flex;
  max-width: 100%;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #26332d;
  border-radius: 6px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.install-row code {
  min-width: 0;
  padding: 11px 14px;
  overflow-x: auto;
  color: var(--code-text);
  white-space: nowrap;
}

.compact-button {
  min-width: 62px;
  border: 0;
  border-left: 1px solid #415149;
  background: #203128;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.compact-button:hover {
  background: var(--green-dark);
}

.release-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 650;
}

.section-inner {
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
}

.section-inner.wide {
  width: min(1440px, calc(100% - 64px));
}

.playground-band {
  padding: 34px 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.tool-heading {
  margin-bottom: 18px;
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.secondary-button,
.primary-button,
.text-button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 21px;
}

.secondary-button,
.primary-button {
  padding: 0 16px;
}

.icon-button:hover,
.secondary-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

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

.primary-button:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.control-bar {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(170px, auto) 116px 130px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--soft);
}

.control-bar label,
.segmented-control {
  min-width: 0;
}

.control-bar label > span,
.segmented-control legend {
  display: block;
  margin: 0 0 5px;
  color: var(--muted-ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.control-bar select,
.control-bar input {
  width: 100%;
  height: 40px;
  border: 1px solid #aebbb4;
  border-radius: 5px;
  background: #fff;
  padding: 0 10px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-control legend {
  grid-column: 1 / -1;
}

.segmented-control button {
  height: 40px;
  border: 1px solid #aebbb4;
  background: #fff;
  font-weight: 700;
}

.segmented-control button:first-of-type {
  border-radius: 5px 0 0 5px;
}

.segmented-control button:last-of-type {
  border-left: 0;
  border-radius: 0 5px 5px 0;
}

.segmented-control button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.editor-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code);
}

.editor-panel header {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #314039;
  color: var(--code-text);
}

.editor-panel header > span {
  color: #9caf9f;
  font-size: 11px;
  font-weight: 700;
}

.editor-panel textarea,
.editor-panel pre {
  width: 100%;
  height: 292px;
  margin: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: var(--code);
  color: var(--code-text);
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
}

.editor-panel textarea {
  display: block;
  resize: vertical;
  padding: 14px;
}

.editor-panel textarea:focus,
.editor-panel pre:focus {
  box-shadow: inset 0 0 0 2px var(--yellow);
}

.editor-panel pre {
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.text-button {
  min-height: 28px;
  padding: 0 9px;
  border-color: #46564e;
  background: #1b2721;
  color: #dce7e1;
  font-size: 11px;
}

.text-button:hover {
  border-color: var(--yellow);
  color: #fff;
}

.status-bar {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 7px 2px 0;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 650;
}

.status-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
}

.status-indicator.error {
  background: var(--danger);
}

.status-separator {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.status-spacer {
  flex: 1;
}

.content-band {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.content-band.muted {
  background: var(--soft);
}

.content-grid,
.proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 72px;
  align-items: start;
}

.content-grid p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted-ink);
  font-size: 17px;
}

.code-surface {
  overflow: hidden;
  border-radius: 6px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.code-surface pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px 20px;
  color: var(--code-text);
  font-size: 13px;
}

.code-surface pre + pre {
  border-top: 1px solid #314039;
}

.inline-link {
  font-weight: 750;
}

.api-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted-ink);
  font-size: 11px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.proof-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.proof-list div {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.proof-list dt {
  color: var(--green-dark);
  font-size: 26px;
  font-weight: 800;
}

.proof-list dd {
  margin: 4px 0 0;
  color: var(--muted-ink);
  font-size: 13px;
}

footer {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  background: var(--ink);
  color: #fff;
}

footer > div {
  display: grid;
  gap: 4px;
}

footer span {
  color: #b9c5be;
  font-size: 12px;
}

footer a {
  color: #e5ede8;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

@media (max-width: 1120px) {
  .editor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .output-panel {
    grid-column: 1 / -1;
  }

  .control-bar {
    grid-template-columns: minmax(180px, 1fr) minmax(170px, 1fr) 116px 130px;
  }

  .control-bar .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .site-header {
    padding: 0 16px;
  }

  .site-header nav {
    gap: 14px;
  }

  .site-header nav a:first-child {
    display: none;
  }

  .brand span:last-child {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    min-height: 360px;
    background-position: 67% center;
    background-size: auto 100%;
  }

  .hero::before {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.78);
    content: "";
  }

  .hero-content,
  .section-inner,
  .section-inner.wide {
    width: min(100% - 32px, 680px);
  }

  .hero-content {
    padding: 42px 0 32px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 25px;
  }

  .hero-copy {
    max-width: 500px;
    font-size: 16px;
  }

  .section-heading,
  .content-grid,
  .proof-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .tool-heading,
  .section-heading {
    align-items: flex-start;
  }

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

  .control-bar label:first-child,
  .control-bar .primary-button {
    grid-column: 1 / -1;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .output-panel {
    grid-column: auto;
  }

  .status-bar {
    flex-wrap: wrap;
  }

  .status-spacer {
    display: none;
  }

  #prototype-status {
    flex-basis: 100%;
    padding-left: 18px;
  }

  .content-band {
    padding: 48px 0;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px 16px;
  }
}

@media (max-width: 470px) {
  .site-header nav a:nth-child(2) {
    display: none;
  }

  .brand span:last-child {
    max-width: 210px;
  }

  .install-row {
    width: 100%;
  }

  h1 {
    font-size: 28px;
    overflow-wrap: normal;
  }

  .install-row code {
    font-size: 11px;
  }

  .tool-heading {
    display: grid;
  }

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

  .control-bar label,
  .control-bar .primary-button {
    grid-column: auto;
  }

  .proof-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 24px;
  }
}

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