:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #14b8a6;
  --border: rgba(15, 23, 42, 0.12);
  --surface-soft: rgba(15, 23, 42, 0.035);
  --locked-bg: rgba(37, 99, 235, 0.08);
  --locked-ink: #1e40af;
  --added-bg: rgba(20, 184, 166, 0.14);
  --added-ink: #0f766e;
  --removed-bg: rgba(225, 29, 72, 0.10);
  --removed-ink: #9f1239;
  --review-bg: rgba(245, 158, 11, 0.16);
  --review-ink: #92400e;
  --highlight-bg: rgba(250, 204, 21, 0.36);
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius);
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 16px;
}

h1 { font-size: 36px; letter-spacing: -0.02em; }
h2 { font-size: 28px; letter-spacing: -0.015em; }
h3 { font-size: 18px; }

p {
  margin: 0 0 16px;
  max-width: 70ch;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.35);
}


.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 4px;
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.section {
  padding: 48px 0;
}

.hero-section {
  padding: 32px 0 48px;
}

.hero-header {
  max-width: 780px;
  margin: 0 auto 24px;
}

.hero-header.centered {
  text-align: center;
}

.hero-header.centered p {
  margin-left: auto;
  margin-right: auto;
}

.lead {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 0;
}

.cluster-anchor {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.prose {
  max-width: 780px;
  margin: 0 auto;
}

.prose h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.prose h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose p, .prose li {
  font-size: 16px;
  color: var(--text);
}

.prose ul, .prose ol {
  margin: 0 0 24px;
  padding-left: 24px;
  max-width: 70ch;
}

.prose li {
  margin-bottom: 8px;
}

.prose blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--card);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-serif);
}

.prose pre {
  margin: 16px 0 24px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.prose code {
  font-size: 14px;
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.prose pre code {
  background: transparent;
  padding: 0;
}

.prose table, .data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 14px;
}

.prose th, .prose td, .data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.prose th, .data-table th {
  background: var(--surface-soft);
  font-weight: 600;
  color: var(--text);
}

.prose figure {
  margin: 24px 0;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prose figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-outline {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 14px;
}


.card, .tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.tool-card {
  max-width: 960px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.cards-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

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

.cards-grid.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.post-card, .feature-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.post-card h2 {
  font-size: 22px;
  margin: 8px 0 12px;
}

.post-card h2 a {
  color: var(--text);
}

.post-card h2 a:hover {
  color: var(--primary);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background: var(--locked-bg);
  color: var(--locked-ink);
}

.card-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.muted-text {
  color: var(--muted);
}

.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Tool Workspace & Diff Markers */
.hz-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.hz-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hz-tab {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.hz-tab[aria-pressed="true"], .hz-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.hz-textarea, .hz-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
}

.hz-textarea {
  min-height: 160px;
  resize: vertical;
  font-family: var(--font-serif);
}

.hz-input {
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--font-body);
}

.hz-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.hz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hz-meta {
  font-size: 14px;
  color: var(--muted);
}

.hz-notice {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 14px;
  color: var(--text);
}

.hz-notice-warn {
  background: var(--review-bg);
  color: var(--review-ink);
  border-color: rgba(146, 64, 14, 0.25);
}

.hz-output {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hz-serif-box {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}

.mark-lock {
  background: var(--locked-bg);
  color: var(--locked-ink);
  outline: 1px dashed var(--locked-ink);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 16px;
}

.mark-change {
  background: var(--added-bg);
  color: var(--added-ink);
  border-bottom: 2px solid var(--added-ink);
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.mark-change[data-rejected="true"] {
  background: var(--surface-soft);
  color: var(--text);
  border-bottom-style: dotted;
}

.mark-removed {
  background: var(--removed-bg);
  color: var(--removed-ink);
  text-decoration: line-through;
  padding: 2px 4px;
  border-radius: 4px;
}

.mark-cliche {
  background: var(--highlight-bg);
  color: var(--text);
  padding: 2px 4px;
  border-radius: 4px;
}

.showcase-box[data-current-view="before"] .demo-after-only {
  display: none;
}

.showcase-box[data-current-view="after"] .demo-before-only {
  display: none;
}

.showcase-box[data-current-view="before"] . demo-after-only {
  display: none;
}

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

.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 4px 0;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 14px;
  font-weight: 600;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
}

.faq-item summary {
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}

.faq-answer {
  margin-top: 12px;
  color: var(--muted);
}

.faq-answer p {
  color: var(--muted);
  margin-bottom: 0;
}

.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-desc, .footer-contact {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}

.footer-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  font-size: 14px;
  color: var(--muted);
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  h1 {
    font-size: 28px;
  }
  h2 {
    font-size: 22px;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 8px;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open {
    display: flex;
  }
  .cards-grid.two-cols,
  .cards-grid.three-cols,
  .cards-grid.four-cols,
  .stats-row,
  .form-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
  }
  .hz-actions {
    width: 100%;
  }
}
