:root {
  color-scheme: light;
  --brand-accent: #2563eb;
  --ink: #14243b;
  --muted: #637187;
  --soft: #8995a7;
  --paper: #f2f5f9;
  --card: #fbfdff;
  --card-strong: #ffffff;
  --line: #d6dfeb;
  --line-strong: #b7c5d8;
  --blue: #2563eb;
  --blue-dark: #174ea6;
  --blue-soft: #e8f0ff;
  --green: #16805a;
  --green-soft: #e1f3ea;
  --red: #b33d4a;
  --red-soft: #fbeaec;
  --amber: #b56a08;
  --amber-soft: #fff4dc;
  --editor: #0d2038;
  --editor-line: #21374f;
  --editor-ink: #e8eef7;
  --shadow: 0 20px 56px rgba(23, 55, 94, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 5%, rgba(37, 99, 235, 0.13), transparent 31rem),
    radial-gradient(circle at 7% 10%, rgba(22, 128, 90, 0.09), transparent 26rem),
    linear-gradient(180deg, #f9fbfe 0, var(--paper) 54rem);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.032) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 72%);
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  pointer-events: none;
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  color: white;
  background: var(--blue);
  border-radius: 8px;
  transform: translateY(-150%);
}

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

.site-header,
.site-footer,
main {
  width: min(1480px, calc(100% - 56px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(121, 137, 128, 0.24);
}

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

.brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 10px rgba(37, 99, 235, 0.16));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 15px;
  font-weight: 820;
  letter-spacing: -0.035em;
}

.brand-name strong {
  color: var(--brand-accent);
}

.brand-tagline,
.product-lockup span,
.eyebrow,
.step-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
}

.brand-tagline {
  color: var(--muted);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.product-lockup {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.product-lockup span {
  color: var(--blue);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.1em;
}

.product-lockup strong {
  font-size: 11px;
  letter-spacing: -0.01em;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 72px;
  align-items: end;
  padding: 76px 0 62px;
}

.eyebrow,
.step-label {
  display: block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.eyebrow {
  margin: 0;
}

.hero h1 {
  margin: 14px 0 0;
  font-size: clamp(48px, 6.4vw, 92px);
  font-weight: 720;
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.hero h1 em {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.hero-copy {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.68;
}

.tool-shell {
  padding: 30px;
  background: rgba(251, 253, 255, 0.97);
  border: 1px solid var(--line);
  border-top: 2px solid #b9ceff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.tool-heading,
.editor-heading,
.validation-panel {
  display: flex;
  align-items: center;
}

.tool-heading {
  justify-content: space-between;
  gap: 24px;
}

.tool-heading h2 {
  margin: 7px 0 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #bfe2d2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.privacy-badge span {
  font-size: 8px;
}

.settings-bar {
  display: grid;
  grid-template-columns: auto minmax(150px, 0.8fr) minmax(130px, 0.65fr) auto 1fr;
  gap: 14px;
  align-items: end;
  margin: 26px 0 20px;
  padding: 18px;
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.segmented-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented-field legend,
.select-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.segmented-control label {
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: block;
  min-width: 54px;
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.segmented-control input:checked + span {
  color: white;
  background: var(--blue);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.2);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

.select-field {
  min-width: 0;
}

.select-field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 34px 8px 11px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 750;
}

.check-field {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  cursor: pointer;
}

.check-field input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}

.check-field span {
  display: flex;
  flex-direction: column;
}

.check-field strong {
  font-size: 11px;
}

.check-field small {
  color: var(--muted);
  font-size: 9px;
}

.primary-actions {
  display: flex;
  justify-content: flex-end;
}

.primary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 10px 16px;
  color: white;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
  font-size: 12px;
  font-weight: 850;
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.27);
}

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

.editor-card {
  min-width: 0;
  overflow: hidden;
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.editor-card.has-error {
  border-color: #d9959d;
  box-shadow: 0 0 0 3px rgba(179, 61, 74, 0.08);
}

.editor-heading {
  min-height: 56px;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.editor-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.editor-index {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 7px;
  font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.editor-heading h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.format-label {
  padding: 4px 7px;
  color: var(--muted);
  background: #eef2f7;
  border-radius: 999px;
  font: 750 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.editor-actions {
  justify-content: flex-end;
}

.text-button {
  padding: 5px 2px;
  color: var(--blue);
  background: transparent;
  border: 0;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.text-button:hover:not(:disabled) {
  color: var(--blue-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.editor-frame {
  display: grid;
  height: clamp(360px, 46vh, 590px);
  grid-template-columns: 48px minmax(0, 1fr);
  overflow: hidden;
  background: var(--editor);
}

.line-numbers,
.editor-frame textarea {
  height: 100%;
  margin: 0;
  padding-top: 18px;
  padding-bottom: 18px;
  overflow: auto;
  border: 0;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  tab-size: 2;
}

.line-numbers {
  padding-right: 10px;
  padding-left: 6px;
  overflow: hidden;
  color: #708197;
  background: #10263f;
  border-right: 1px solid var(--editor-line);
  text-align: right;
  user-select: none;
}

.editor-frame textarea {
  width: 100%;
  min-width: 0;
  padding-right: 18px;
  padding-left: 18px;
  resize: none;
  color: var(--editor-ink);
  background: transparent;
  caret-color: #7bb0ff;
  outline: 0;
  white-space: pre;
}

.editor-frame textarea::placeholder {
  color: #718298;
}

.editor-frame textarea::selection {
  background: rgba(82, 139, 235, 0.38);
}

.editor-meta {
  display: flex;
  min-height: 37px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  color: var(--muted);
  background: #f7f9fc;
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.validation-panel {
  position: relative;
  gap: 12px;
  min-height: 72px;
  margin-top: 18px;
  padding: 14px 16px;
  background: #f5f8fc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.validation-panel.is-success {
  background: var(--green-soft);
  border-color: #b8decd;
}

.validation-panel.is-error {
  background: var(--red-soft);
  border-color: #e5b9bf;
}

.validation-panel.is-pending {
  background: var(--amber-soft);
  border-color: #ecd6a9;
}

.status-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: white;
  background: var(--soft);
  border-radius: 50%;
}

.status-icon::before {
  content: "•";
  font-size: 22px;
  line-height: 1;
}

.is-success .status-icon {
  background: var(--green);
}

.is-success .status-icon::before {
  content: "✓";
  font-size: 17px;
  font-weight: 900;
}

.is-error .status-icon {
  background: var(--red);
}

.is-error .status-icon::before {
  content: "!";
  font-size: 17px;
  font-weight: 900;
}

.is-pending .status-icon {
  background: var(--amber);
}

.is-pending .status-icon::before {
  content: "…";
  font-size: 17px;
  font-weight: 900;
}

.validation-panel strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.validation-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

kbd {
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(99, 113, 135, 0.3);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(20, 36, 59, 0.12);
  font: 750 9px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.location-button {
  margin-left: auto;
  padding: 7px 10px;
  color: var(--red);
  background: white;
  border: 1px solid #dca5ad;
  border-radius: 8px;
  font: 800 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.location-button:hover {
  background: #fff7f8;
}

.guide {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 70px;
  padding: 96px 0 84px;
}

.guide > div:first-child h2 {
  max-width: 340px;
  margin: 14px 0 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.guide-grid article {
  padding: 22px;
  background: rgba(251, 253, 255, 0.7);
  border-top: 1px solid var(--line-strong);
}

.guide-grid article > span {
  color: var(--blue);
  font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.guide-grid h3 {
  margin: 30px 0 10px;
  font-size: 15px;
}

.guide-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.examples-section,
.troubleshooting {
  padding: 76px 0 84px;
  border-top: 1px solid var(--line);
}

.content-heading {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.65fr);
  gap: 70px;
  align-items: end;
  margin-bottom: 38px;
}

.content-heading h2 {
  max-width: 680px;
  margin: 14px 0 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.content-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.example-grid article {
  min-width: 0;
  overflow: hidden;
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(23, 55, 94, 0.07);
}

.example-heading {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.example-heading > div {
  min-width: 0;
}

.example-heading span,
.troubleshooting-grid article > span {
  color: var(--blue);
  font: 800 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.example-heading h3 {
  margin: 5px 0 0;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.example-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #c6d8ff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 850;
}

.example-button:hover {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.example-grid pre {
  min-height: 260px;
  margin: 0;
  padding: 20px 22px;
  overflow: auto;
  color: var(--editor-ink);
  background: var(--editor);
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  tab-size: 2;
}

.troubleshooting {
  padding-bottom: 96px;
}

.troubleshooting-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.troubleshooting-grid article {
  padding: 22px;
  background: rgba(251, 253, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.troubleshooting-grid h3 {
  margin: 22px 0 9px;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.troubleshooting-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.troubleshooting-grid code {
  padding: 2px 4px;
  color: var(--ink);
  background: #edf2f8;
  border-radius: 4px;
  font: 750 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.site-footer {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-footer a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.author-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.author-credit span {
  color: var(--muted);
  font-weight: 500;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100% - 44px));
  padding: 12px 16px;
  color: white;
  background: var(--ink);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(13, 32, 56, 0.24);
  font-size: 12px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

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

@media (max-width: 1180px) {
  .settings-bar {
    grid-template-columns: auto 1fr 1fr auto;
  }

  .primary-actions {
    grid-column: 1 / -1;
  }

  .primary-button {
    width: 100%;
  }

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

  .editor-frame {
    height: 430px;
  }
}

@media (max-width: 840px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 32px, 1480px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 58px 0 46px;
  }

  .hero h1 {
    font-size: clamp(44px, 12vw, 68px);
  }

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

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

  .segmented-field,
  .primary-actions {
    grid-column: 1 / -1;
  }

  .segmented-control {
    display: flex;
  }

  .segmented-control label {
    flex: 1;
  }

  .segmented-control span {
    min-width: 0;
  }

  .guide {
    grid-template-columns: 1fr;
    gap: 38px;
    padding: 72px 0;
  }

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

  .content-heading,
  .example-grid {
    grid-template-columns: 1fr;
  }

  .content-heading {
    gap: 24px;
  }

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

@media (max-width: 600px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 22px, 1480px);
  }

  .product-lockup {
    display: none;
  }

  .hero {
    padding-top: 46px;
  }

  .tool-shell {
    padding: 18px 12px;
    border-radius: 14px;
  }

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

  .settings-bar {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .segmented-field,
  .primary-actions {
    grid-column: auto;
  }

  .editor-heading {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .editor-frame {
    height: 390px;
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .line-numbers,
  .editor-frame textarea {
    font-size: 12px;
  }

  .editor-frame textarea {
    padding-right: 12px;
    padding-left: 12px;
  }

  .validation-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .location-button {
    width: 100%;
    margin-left: 46px;
  }

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

  .example-button {
    width: 100%;
  }

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

  .site-footer,
  .footer-links {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    padding: 28px 0;
  }

  .footer-links {
    gap: 12px;
  }
}

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

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