:root {
  --bg: #f4f0e6;
  --bg-alt: #fffbf2;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.74);
  --text: #162320;
  --muted: #5b6a65;
  --accent: #0f766e;
  --accent-strong: #0a5b55;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --accent-soft-strong: rgba(15, 118, 110, 0.2);
  --warm: #c78536;
  --danger: #b44b35;
  --warning: #a26b17;
  --success: #1b8d68;
  --table-issue: rgba(180, 75, 53, 0.08);
  --table-empty: rgba(162, 107, 23, 0.08);
  --table-clean: rgba(15, 118, 110, 0.04);
  --border: rgba(22, 35, 32, 0.1);
  --border-strong: rgba(22, 35, 32, 0.16);
  --shadow: 0 26px 70px rgba(18, 29, 27, 0.1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1180px;
}

:root[data-theme="dark"] {
  --bg: #0f1618;
  --bg-alt: #172124;
  --surface: rgba(24, 33, 37, 0.86);
  --surface-strong: #1c272b;
  --surface-muted: rgba(22, 31, 34, 0.72);
  --text: #edf4ef;
  --muted: #aab9b2;
  --accent: #40b4aa;
  --accent-strong: #77d8cf;
  --accent-soft: rgba(64, 180, 170, 0.14);
  --accent-soft-strong: rgba(64, 180, 170, 0.24);
  --warm: #f0a54a;
  --danger: #f17962;
  --warning: #f0ba54;
  --success: #48d09d;
  --table-issue: rgba(241, 121, 98, 0.12);
  --table-empty: rgba(240, 186, 84, 0.12);
  --table-clean: rgba(64, 180, 170, 0.06);
  --border: rgba(237, 244, 239, 0.08);
  --border-strong: rgba(237, 244, 239, 0.14);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(199, 133, 54, 0.16), transparent 24rem),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 26rem),
    linear-gradient(180deg, var(--bg-alt), var(--bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.5), transparent 82%);
  opacity: 0.25;
}

img {
  max-width: 100%;
}

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

a:hover {
  text-decoration: underline;
}

button,
select {
  font: inherit;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-shell,
.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.2);
}

.site-nav,
.footer-nav,
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav a,
.footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent-soft-strong);
}

.hero,
.article-shell {
  padding: 4.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(280px, 0.72fr);
  gap: 1.5rem;
  align-items: stretch;
}

.eyebrow,
.section-label {
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1 {
  max-width: 11ch;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

h3 {
  font-size: 1.05rem;
}

.hero-text,
.article-lead,
.article-text,
.footer-copy,
.panel-note,
.drop-help,
.progress-text,
.helper-text,
.prose p,
.prose li {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
}

.hero-copy {
  padding: 1rem 0;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-points span,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.68rem 1rem;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
}

.chip-quiet {
  background: var(--accent-soft);
}

.card {
  border: 1px solid color-mix(in srgb, var(--surface-strong) 68%, var(--border));
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel,
.article-hero {
  display: grid;
  gap: 1rem;
  padding: 1.75rem;
}

.hero-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 94%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
}

.hero-metric strong {
  font-size: 1.3rem;
}

.hero-metric span {
  color: var(--muted);
  text-align: right;
}

.tool-shell {
  padding-bottom: 4rem;
}

.tool-grid,
.preview-grid,
.article-grid {
  display: grid;
  gap: 1.5rem;
}

.tool-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.preview-grid,
.article-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  margin-top: 1.5rem;
}

.upload-card,
.report-card,
.preview-card,
.export-card,
.article-card,
.prose {
  padding: 1.5rem;
}

.section-head,
.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.processing-shell {
  position: relative;
  overflow: hidden;
}

.processing-shell.is-processing::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.08) 46%, rgba(255, 255, 255, 0.22) 50%, transparent 54%, transparent 100%);
  transform: translateX(-120%);
  animation: processing-sheen 1.4s linear infinite;
}

@keyframes processing-sheen {
  to {
    transform: translateX(120%);
  }
}

.drop-zone {
  padding: 2rem 1.25rem;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 44%, var(--border));
  border-radius: calc(var(--radius-xl) - 6px);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 90%, transparent), color-mix(in srgb, var(--surface-strong) 78%, transparent)),
    var(--surface-muted);
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-over {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(15, 118, 110, 0.15);
  outline: none;
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1rem;
  border-radius: 1.3rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(199, 133, 54, 0.18));
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.drop-title {
  margin: 0 0 0.45rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.tool-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 28px rgba(15, 118, 110, 0.22);
}

.button.secondary {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  border: 1px solid var(--border);
}

.controls-grid,
.file-meta {
  display: grid;
  gap: 0.9rem;
}

.controls-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 1.2rem;
}

.field,
.file-meta div {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.field-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}

.select-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  color: var(--text);
  background: var(--surface-strong);
}

.static-field strong {
  font-size: 1.8rem;
  letter-spacing: -0.04em;
}

.helper-text {
  display: block;
  font-size: 0.88rem;
}

.file-meta {
  margin-top: 1.3rem;
}

.file-meta div {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.file-meta dt,
.file-meta dd {
  margin: 0;
}

.file-meta dt {
  color: var(--muted);
}

.file-meta dd {
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.progress-block {
  margin-top: 1.2rem;
}

.progress-track {
  width: 100%;
  height: 0.85rem;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--warm), var(--accent)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), transparent);
  background-size: 100% 100%, 40px 100%;
  animation: progress-glimmer 1.1s linear infinite;
  transition: width 180ms ease;
}

@keyframes progress-glimmer {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 0 0, 40px 0;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.stat-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.stat-value {
  font-size: 1.65rem;
}

.panel {
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
}

.issue-list {
  display: grid;
  gap: 0.8rem;
  max-height: 25rem;
  overflow: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}

.issue-item,
.issue-empty {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.issue-item {
  display: grid;
  gap: 0.45rem;
}

.issue-empty {
  color: var(--muted);
}

.issue-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.issue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.issue-badge.error {
  color: #fff;
  background: var(--danger);
}

.issue-badge.warning {
  color: #fff;
  background: var(--warning);
}

.issue-badge.fixed {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.legend-swatch {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.legend-healthy {
  background: var(--table-clean);
}

.legend-issue {
  background: var(--table-issue);
}

.legend-empty {
  background: var(--table-empty);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-xl) - 6px);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.preview-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
}

.preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.9rem 0.85rem;
  text-align: left;
  font-size: 0.86rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-strong) 96%, var(--bg));
  border-bottom: 1px solid var(--border);
}

.preview-table tbody td {
  padding: 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

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

.preview-row {
  background: var(--table-clean);
}

.preview-row.has-issues {
  background: var(--table-issue);
}

.preview-row.is-empty-row {
  background: var(--table-empty);
}

.preview-row code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.preview-empty td {
  color: var(--muted);
}

.status-stack {
  display: grid;
  gap: 0.4rem;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  font-size: 0.75rem;
  white-space: nowrap;
}

.mini-badge.issue {
  color: #fff;
  border-color: transparent;
  background: var(--danger);
}

.mini-badge.empty {
  color: #fff;
  border-color: transparent;
  background: var(--warning);
}

.mini-badge.clean {
  color: var(--accent-strong);
  border-color: var(--accent-soft-strong);
  background: var(--accent-soft);
}

.cell-empty {
  color: var(--muted);
}

.code-block {
  margin: 0;
  min-height: 20rem;
  padding: 1.2rem;
  overflow: auto;
  border-radius: calc(var(--radius-xl) - 6px);
  background: #14211e;
  color: #eff9f2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.7;
}

:root[data-theme="dark"] .code-block {
  background: #0c1417;
}

.resource-links,
.seo-link-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.2rem;
}

.link-stack {
  display: grid;
  gap: 0.85rem;
}

.resource-link,
.link-card {
  display: block;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  border: 1px solid var(--border);
}

.resource-link strong,
.resource-link span,
.link-card strong,
.link-card span {
  display: block;
}

.resource-link span,
.link-card span {
  margin-top: 0.35rem;
  color: var(--muted);
}

.article-shell {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.article-hero .button {
  width: fit-content;
}

.prose h2,
.prose h3 {
  margin-bottom: 0.7rem;
}

.prose h2:not(:first-child),
.prose h3:not(:first-child) {
  margin-top: 1.5rem;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.snippet {
  margin: 0 0 1rem;
  padding: 1rem;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: #14211e;
  color: #eff9f2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.6;
}

:root[data-theme="dark"] .snippet {
  background: #0c1417;
}

.callout {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-strong);
}

.examples-list li::marker {
  color: var(--accent);
}

.site-footer {
  padding: 1rem 0 2rem;
}

.footer-copy {
  max-width: 36rem;
  margin: 0.65rem 0 0;
}

.footer-brand {
  color: var(--text);
}

.noscript-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  color: #fff;
  background: var(--danger);
  box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
  .tool-grid,
  .preview-grid,
  .article-grid,
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .nav-shell,
  .footer-shell,
  .section-head,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav,
  .footer-nav,
  .header-actions,
  .tool-actions {
    width: 100%;
  }

  .site-nav a,
  .footer-nav a,
  .theme-toggle,
  .button {
    width: 100%;
  }

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

  .hero,
  .article-shell {
    padding-top: 3rem;
  }

  .upload-card,
  .report-card,
  .preview-card,
  .export-card,
  .article-card,
  .prose,
  .hero-panel,
  .article-hero {
    padding: 1.15rem;
  }

  .preview-table {
    min-width: 560px;
  }
}
