:root {
  color-scheme: dark;
  --bg: #0d1111;
  --bg-soft: #121717;
  --surface: #161c1c;
  --surface-strong: #1b2323;
  --surface-muted: #111616;
  --border: rgba(232, 238, 236, 0.09);
  --border-strong: rgba(232, 238, 236, 0.14);
  --text: #eef2f1;
  --text-soft: #9aa4a1;
  --text-dim: #7f8a87;
  --accent: #eef2f1;
  --accent-ink: #0d1111;
  --success: #74d2a5;
  --danger: #ef8d86;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --content-width: 1120px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f7;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-strong: #fbfbfb;
  --surface-muted: #f2f4f3;
  --border: rgba(12, 18, 17, 0.09);
  --border-strong: rgba(12, 18, 17, 0.14);
  --text: #0f1717;
  --text-soft: #5d6764;
  --text-dim: #7b8481;
  --accent: #10201d;
  --accent-ink: #f7f8f7;
  --success: #2f8f64;
  --danger: #b24d45;
  --shadow: 0 18px 34px rgba(16, 23, 23, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 0 22px;
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-copy {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.brand-copy small {
  color: var(--text-soft);
  font-size: 0.96rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle,
.top-link {
  color: var(--text-soft);
}

.theme-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-toggle:hover,
.brand-lockup:hover {
  color: var(--text);
}

.main-content {
  display: grid;
  gap: 30px;
}

.legal-shell {
  max-width: 980px;
}

.legal-main {
  display: grid;
  gap: 28px;
}

.hero {
  padding: 48px 0 8px;
  text-align: center;
}

.legal-hero {
  padding: 44px 0 0;
  text-align: center;
}

.legal-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  color: var(--text-soft);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 5.3rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.lede {
  width: min(740px, 100%);
  margin: 22px auto 0;
  color: var(--text-soft);
  font-size: 1.14rem;
  line-height: 1.65;
}

.upload-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.scrubber-form {
  display: grid;
  gap: 14px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.dropzone strong {
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.dropzone span:not(.drop-icon):not(.browse-chip) {
  color: var(--text-soft);
  font-size: 1rem;
}

.dropzone.is-dragover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.drop-icon {
  font-size: 2.4rem;
  line-height: 1;
  color: var(--text-soft);
}

.browse-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 138px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  margin-top: 8px;
}

.field-help,
.processing-note,
.backend-note,
.proof-note,
.info-card p,
.footer-line,
.result-notes,
.alert p,
.result-grid dt {
  color: var(--text-soft);
}

.field-help,
.processing-note,
.backend-note,
.proof-note {
  margin: 0;
  text-align: center;
  line-height: 1.6;
}

.action-row {
  display: flex;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.meta-row {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.supported-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  text-align: center;
}

.meta-label {
  color: var(--text-soft);
  font-weight: 600;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.92rem;
}

.format-list {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.inline-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 180ms ease, color 180ms ease;
}

.inline-link:hover {
  color: var(--text);
  border-color: var(--text);
}

.alert {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.alert strong {
  font-size: 1rem;
}

.alert-error {
  border-color: rgba(239, 141, 134, 0.32);
  background: rgba(239, 141, 134, 0.08);
}

.alert-success {
  border-color: rgba(116, 210, 165, 0.28);
  background: rgba(116, 210, 165, 0.08);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.result-grid dd {
  margin: 6px 0 0;
  font-weight: 700;
}

.result-notes {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-card {
  padding: 20px 24px;
  border-right: 1px solid var(--border);
}

.info-card:last-child {
  border-right: 0;
}

.info-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.info-card p {
  margin: 0;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 18px;
}

.footer-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.95rem;
}

.footer-license {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 180ms ease;
}

.footer-license:hover {
  color: var(--text);
}

.dot {
  color: var(--text-dim);
}

.footer-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.footer-note img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.legal-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-card p {
  margin: 0 0 16px;
  color: var(--text-soft);
  line-height: 1.75;
}

.legal-title,
.legal-section h3 {
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.legal-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.legal-section {
  padding-top: 8px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

.legal-section h3 {
  font-size: 1.12rem;
}

.legal-list {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-soft);
  line-height: 1.75;
}

@media (max-width: 900px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .info-card:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(var(--content-width), calc(100% - 20px));
  }

  .legal-card {
    padding: 20px;
  }

  .site-header,
  .site-footer,
  .header-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding-top: 34px;
  }

  .upload-shell {
    padding: 14px;
  }

  .dropzone {
    min-height: 220px;
  }

  .dropzone strong {
    font-size: 1.38rem;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-actions,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .supported-line {
    justify-content: flex-start;
  }
}
