:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #fff;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.top-nav a {
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

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

/* Intro */

.page-intro {
  padding-top: 54px;
  padding-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.intro-copy {
  max-width: 720px;
  margin: 16px 0 20px;
  color: #4b5563;
  font-size: 16px;
}

.trust-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: #4b5563;
  font-size: 13px;
}

.trust-points span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust-points i {
  color: var(--green);
  font-style: normal;
  font-weight: 700;
}

/* Workspace */

.tool-section {
  padding-bottom: 34px;
}

.workspace {
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 5px 20px rgba(17, 24, 39, 0.035);
}

.workspace-toolbar,
.output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar-heading,
.output-heading > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.workspace h2,
.output-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.character-count {
  color: var(--muted);
  font-size: 12px;
}

.toolbar-actions,
.output-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.indent-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
}

.indent-control select {
  min-height: 38px;
  padding: 0 30px 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button-primary {
  color: #fff;
  background: #111827;
  border-color: #111827;
}

.button-primary:hover:not(:disabled) {
  background: #374151;
  border-color: #374151;
}

.button-secondary {
  color: #1f2937;
  background: #fff;
}

.button-secondary:hover:not(:disabled) {
  background: var(--soft);
  border-color: #9ca3af;
}

.button-quiet {
  color: #4b5563;
  background: transparent;
  border-color: transparent;
}

.button-quiet:hover:not(:disabled) {
  color: var(--ink);
  background: var(--soft);
}

.field-label {
  display: block;
  margin: 22px 0 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.json-editor {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 16px;
  resize: vertical;
  color: #1f2937;
  background: #f9fafb;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}

.json-editor:focus {
  background: #fff;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.json-editor::placeholder {
  color: #9ca3af;
}

.field-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.status-message {
  min-height: 44px;
  display: flex;
  align-items: center;
  margin-top: 18px;
  padding: 10px 13px;
  color: #4b5563;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.status-message.is-success {
  color: var(--green);
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-message.is-error {
  color: var(--red);
  background: #fef2f2;
  border-color: #fecaca;
}

.status-message.is-warning {
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

.output-heading {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.output-editor {
  min-height: 240px;
  background: #f9fafb;
}

.output-editor:focus {
  background: #fff;
}

/* Privacy */

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 17px 19px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.privacy-icon {
  flex-shrink: 0;
  font-size: 17px;
}

.privacy-note p {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
}

.privacy-note strong {
  color: var(--ink);
}

/* Guide and FAQ */

.content-section {
  padding-top: 16px;
  padding-bottom: 48px;
}

.guide-section {
  margin-bottom: 34px;
}

.guide-section h2,
.faq-section h2,
.related-inner h2 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.guide-section p,
.guide-section li {
  color: #4b5563;
  font-size: 14px;
}

.guide-section ol {
  margin: 0;
  padding-left: 22px;
}

.guide-section li {
  padding: 3px 0;
}

.faq-section {
  margin-top: 12px;
}

.faq-section h2 {
  margin-bottom: 16px;
}

.faq-section details {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq-section details:first-of-type {
  border-top: 1px solid var(--line);
}

.faq-section summary {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.faq-section details p {
  margin: 10px 0 0;
  color: #4b5563;
  font-size: 14px;
}

/* Related tools */

.related-section {
  padding: 30px 0;
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.related-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.related-inner .eyebrow {
  margin-bottom: 7px;
}

.related-inner h2 {
  margin-bottom: 5px;
}

.related-inner p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.related-links a {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.related-links a:hover {
  color: var(--blue);
}

/* Footer */

.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-inner a {
  color: #4b5563;
}

.footer-inner a:hover {
  color: var(--blue);
}

/* Responsive */

@media (max-width: 700px) {
  .container,
  .header-inner {
    width: min(100% - 32px, 1120px);
  }

  .header-inner {
    min-height: 64px;
    gap: 12px;
  }

  .brand-logo {
    width: 150px;
  }

  .top-nav {
    gap: 14px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .page-intro {
    padding-top: 38px;
    padding-bottom: 22px;
  }

  .intro-copy {
    font-size: 14px;
  }

  .trust-points {
    gap: 8px 16px;
  }

  .workspace {
    padding: 17px;
  }

  .workspace-toolbar,
  .output-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-actions,
  .output-actions {
    width: 100%;
  }

  .toolbar-actions .button,
  .output-actions .button {
    flex: 1;
  }

  .indent-control {
    width: 100%;
    justify-content: space-between;
  }

  .indent-control select {
    flex: 1;
  }

  .json-editor {
    min-height: 240px;
    padding: 12px;
    font-size: 12px;
  }

  .action-row .button {
    flex: 1;
  }

  .related-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .footer-inner nav {
    gap: 12px 16px;
  }
}

@media (max-width: 380px) {
  .brand-logo {
    width: 125px;
  }

  .top-nav {
    gap: 10px;
  }

  .top-nav a {
    font-size: 11px;
  }

  .trust-points {
    flex-direction: column;
    gap: 6px;
  }
}
