:root {
  color-scheme: light;
  --page: #f2f6f4;
  --surface: #ffffff;
  --surface-muted: #e8efed;
  --ink: #17252b;
  --muted: #5e6d72;
  --line: #d1ddda;
  --line-strong: #b8c9c5;
  --blue: #2367c9;
  --blue-dark: #174f9f;
  --teal: #087b6e;
  --teal-soft: #dcefea;
  --coral: #cb5b4d;
  --yellow: #f1c65b;
  --code-bg: #17252b;
  --code-ink: #e8f1ef;
  --shadow: 0 16px 42px rgba(24, 51, 55, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-size: 1rem;
  line-height: 1.7;
  letter-spacing: 0;
}

body,
button,
textarea {
  font-family: inherit;
}

button,
textarea {
  font-size: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--blue-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--coral);
}

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

code {
  padding: 0.12em 0.35em;
  color: #8b332a;
  background: #f8e9e5;
  border-radius: 4px;
  font-size: 0.92em;
}

.container {
  width: min(calc(100% - 2rem), 1180px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(209, 221, 218, 0.92);
  background: rgba(242, 246, 244, 0.96);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
}

.top-nav {
  display: flex;
  min-width: 0;
  gap: 0.85rem;
  overflow-x: auto;
  white-space: nowrap;
}

.top-nav a {
  padding-block: 0.25rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--blue-dark);
}

main {
  padding-bottom: 2.5rem;
}

.intro {
  max-width: 850px;
  padding: 3.25rem 0 2.5rem;
}

.eyebrow,
.panel-kicker,
.examples-label {
  margin: 0;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.18;
}

h1 {
  max-width: 820px;
  margin-top: 0.8rem;
  font-size: 2.5rem;
  font-weight: 800;
}

.intro-lead {
  max-width: 700px;
  margin: 1.15rem 0 0;
  color: #2f454b;
  font-size: 1.18rem;
  line-height: 1.55;
}

.intro-copy {
  max-width: 720px;
  margin: 0.9rem 0 0;
  color: var(--muted);
}

.tool-shell {
  margin: 0 0 4rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tool-topline,
.panel-heading,
.console-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-topline {
  align-items: center;
  padding: 0.2rem 0.2rem 1rem;
}

.tool-title {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
  font-weight: 760;
}

.status {
  max-width: 14rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: right;
}

.status.is-error {
  color: var(--coral);
}

.status.is-success {
  color: var(--teal);
}

.tool-actions {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.button,
.editor-tab,
.example-button,
.text-button {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  color: var(--ink);
  background: var(--surface);
  text-align: center;
}

.button:hover,
.editor-tab:hover,
.example-button:hover,
.text-button:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
  background: #f2f7ff;
}

.button:active,
.editor-tab:active,
.example-button:active,
.text-button:active {
  transform: translateY(1px);
}

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

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

.button-quiet {
  color: var(--muted);
  background: var(--surface-muted);
  border-color: transparent;
}

.workbench {
  display: grid;
  gap: 0.8rem;
}

.editor-panel,
.result-panel,
.console-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.panel-heading,
.console-heading {
  min-height: 3.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: #fbfcfc;
}

.panel-heading strong,
.console-heading strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.94rem;
}

.panel-hint {
  color: var(--muted);
  font-size: 0.73rem;
  text-align: right;
}

.text-button {
  flex: 0 0 auto;
  padding: 0.35rem 0.55rem;
  color: var(--blue-dark);
  background: transparent;
  border-color: transparent;
  font-size: 0.78rem;
}

.editor-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.55rem 0.65rem 0;
  background: var(--code-bg);
}

.editor-tab {
  flex: 0 0 auto;
  padding: 0.48rem 0.65rem;
  color: #a7bfbc;
  background: transparent;
  border-color: transparent;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
}

.editor-tab.is-active {
  color: var(--code-bg);
  background: #e8f1ef;
  border-color: #e8f1ef;
}

.editor-stage {
  height: 330px;
  min-height: 300px;
  background: var(--code-bg);
}

.editor-pane {
  height: 100%;
}

.editor-pane[hidden] {
  display: none;
}

.editor-pane textarea {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 1rem;
  color: var(--code-ink);
  background: var(--code-bg);
  border: 0;
  border-radius: 0;
  outline: 0;
  resize: none;
  font-size: 0.82rem;
  line-height: 1.65;
  tab-size: 2;
  white-space: pre;
}

.editor-pane textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(86, 175, 162, 0.65);
}

.preview-stage {
  height: 330px;
  min-height: 300px;
  padding: 0;
  background: #ffffff;
}

.preview-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.console-panel {
  margin-top: 0.8rem;
}

.console-output {
  min-height: 7rem;
  max-height: 12.5rem;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  color: var(--code-ink);
  background: var(--code-bg);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.console-empty,
.console-line {
  margin: 0;
}

.console-empty {
  color: #91aaa5;
}

.console-line {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.22rem 0;
  border-bottom: 1px solid rgba(159, 190, 182, 0.16);
  overflow-wrap: anywhere;
}

.console-label {
  color: #7fd0c1;
  font-weight: 700;
  text-transform: uppercase;
}

.console-line.is-warn .console-label {
  color: var(--yellow);
}

.console-line.is-error .console-label {
  color: #ff927f;
}

.examples-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.95rem 0.2rem 0.2rem;
}

.example-button {
  padding: 0.4rem 0.6rem;
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
  font-size: 0.78rem;
}

.example-button.is-active {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: #9bcfc4;
}

.content-section {
  max-width: 850px;
  padding: 2.8rem 0 0;
  border-top: 1px solid var(--line);
}

.content-section h2 {
  margin-bottom: 1.35rem;
  font-size: 2rem;
  font-weight: 800;
}

.content-section h3 {
  margin-top: 2rem;
  margin-bottom: 0.55rem;
  font-size: 1.32rem;
  font-weight: 780;
}

.content-section h4 {
  margin-top: 1.35rem;
  margin-bottom: 0.4rem;
  color: #31535a;
  font-size: 1.05rem;
  font-weight: 760;
}

.content-section h5 {
  margin-top: 1.1rem;
  margin-bottom: 0.35rem;
  color: #46636a;
  font-size: 0.98rem;
  font-weight: 750;
}

.content-section h6 {
  margin-top: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.content-section p {
  max-width: 78ch;
  margin: 0.65rem 0;
  color: #40545a;
}

.content-section h2 + p {
  margin-top: 0;
}

.faq-section h3 {
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}

.site-footer {
  padding: 2.2rem 0 3.5rem;
  background: #17252b;
  color: #b7c9c5;
}

.footer-inner {
  display: grid;
  gap: 0.55rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.83rem;
}

.footer-inner a {
  color: #d9ebe6;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid rgba(35, 103, 201, 0.35);
  outline-offset: 2px;
}

@media (min-width: 440px) {
  .tool-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 760px) {
  .container {
    width: min(calc(100% - 3rem), 1180px);
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    padding-block: 0;
  }

  .intro {
    padding-top: 4.75rem;
  }

  h1 {
    font-size: 3.5rem;
  }

  .tool-shell {
    padding: 1.25rem;
  }

  .tool-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .button {
    flex: 0 0 auto;
  }

  .workbench {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .editor-stage,
  .preview-stage {
    height: 390px;
  }
}

@media (max-width: 759px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    padding-block: 0.7rem;
  }

  .top-nav {
    width: 100%;
  }
}

@media (min-width: 1080px) {
  .intro {
    padding-bottom: 3.25rem;
  }

  .tool-shell {
    padding: 1.5rem;
  }

  .content-section {
    padding-top: 3.5rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
