:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #53616c;
  --soft: #edf3f1;
  --paper: #f8faf9;
  --panel: #ffffff;
  --line: #d7e0dc;
  --teal: #08746d;
  --teal-strong: #045a55;
  --coral: #c84f35;
  --blue: #2f5f98;
  --gold: #d9a624;
  --ok: #126b3a;
  --bad: #aa2d2d;
  --shadow: 0 18px 60px rgba(16, 24, 32, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px 32px;
  background: rgba(248, 250, 249, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.site-header.compact {
  position: static;
}

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: var(--ink);
  border: 2px solid var(--teal);
  border-radius: 8px;
}

.nav-links,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

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

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

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 28px;
}

.hero-copy {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 230px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 46px;
  line-height: 1.04;
}

h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.25;
}

.hero-lede {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-lede.narrow {
  max-width: 820px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.status-strip span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  color: var(--teal-strong);
  background: #e7f5f2;
  border: 1px solid #b7dbd5;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.visual-rail {
  display: flex;
  align-items: stretch;
  min-height: 230px;
  padding: 14px;
  background: #101820;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.visual-rail img {
  width: 100%;
  min-height: 210px;
  object-fit: cover;
  border-radius: 6px;
}

.workbench-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(340px, 1.1fr) minmax(290px, 0.95fr) minmax(330px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.tool-panel {
  min-width: 0;
  min-height: 420px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(16, 24, 32, 0.06);
}

.panel-heading {
  display: flex;
  flex-direction: column;
  min-height: 66px;
}

.stacked-form,
.generation-form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fbfdfc;
  border: 1px solid #c9d5d1;
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 116, 109, 0.14);
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.primary-button,
.secondary-button,
.icon-button,
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button {
  color: #ffffff;
  background: var(--teal);
}

.primary-button:hover {
  background: var(--teal-strong);
}

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

.secondary-button:hover {
  border-color: var(--teal);
}

.icon-button {
  min-width: 62px;
  color: var(--teal-strong);
  background: #e7f5f2;
  border-color: #b7dbd5;
}

.danger-button {
  color: var(--bad);
  background: #fff1ef;
  border-color: #f1c3bb;
}

.wide {
  width: 100%;
}

.inline-link {
  margin-top: 16px;
  width: fit-content;
}

.notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 8px;
  align-items: start;
  margin-top: 12px;
  padding: 12px;
  background: #fff9e8;
  border: 1px solid #f0dc97;
  border-radius: 8px;
}

.notice-label {
  grid-column: 1 / -1;
  color: #7b5b00;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.notice code {
  min-width: 0;
  overflow: hidden;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #f0dc97;
  border-radius: 6px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.table-wrap {
  width: 100%;
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  background: #f1f6f4;
  font-size: 12px;
  text-transform: uppercase;
}

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

.mini-button {
  width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  white-space: normal;
}

.mini-button:hover {
  border-color: var(--teal);
}

.mini-button[disabled],
button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.result-state {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-state strong {
  color: var(--ink);
}

#result-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 12px 0;
  background: #000000;
  border-radius: 8px;
}

.code-box {
  min-height: 210px;
  max-height: 360px;
  margin: 14px 0 0;
  padding: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  color: #e8fff9;
  background: #101820;
  border: 1px solid #283742;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-sample {
  min-height: 302px;
}

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

.tab-button {
  color: var(--muted);
  background: #ffffff;
  border-color: var(--line);
}

.tab-button.is-active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.content-band {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto 24px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  gap: 6px;
  max-width: 760px;
  margin-bottom: 18px;
}

.section-copy,
.prose p,
.source-cta p {
  color: var(--muted);
  font-size: 16px;
}

.prose {
  max-width: 920px;
}

.prose h2 {
  margin-top: 22px;
  font-size: 22px;
}

.prose p {
  margin: 12px 0;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 32px;
  align-items: start;
}

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

.route-list code {
  display: block;
  min-height: 42px;
  padding: 11px;
  color: #f7fffb;
  background: #101820;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

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

.fit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.facts-grid article,
.fit-grid article,
details {
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.facts-grid p,
.fit-grid p,
details p {
  margin: 0;
  color: var(--muted);
}

details {
  margin: 10px 0;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin-top: 10px;
}

.source-cta {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.page-main {
  min-height: calc(100vh - 150px);
}

.source-list ul {
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

.source-list li {
  color: var(--muted);
}

.source-list a {
  color: var(--blue);
  font-weight: 800;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .hero-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .visual-rail {
    min-height: 210px;
  }

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

@media (max-width: 820px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .hero-shell,
  .content-band {
    width: min(100% - 28px, 1180px);
  }

  .hero-copy {
    min-height: 0;
    padding: 20px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

  .hero-lede {
    font-size: 16px;
  }

  .workbench-grid,
  .split-band,
  .source-cta,
  .facts-grid,
  .fit-grid,
  .route-list {
    grid-template-columns: 1fr;
  }

  .tool-panel {
    min-height: 0;
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 18px;
  }
}

@media (max-width: 460px) {
  .nav-links {
    gap: 12px;
  }

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

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

  .primary-button,
  .secondary-button,
  .icon-button,
  .tab-button {
    white-space: normal;
  }
}
