@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/source-serif-4-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f3efe6;
  --paper: #fffdf8;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #d8d0c3;
  --line-strong: #c3baab;
  --accent: #0f5c4c;
  --accent-hover: #0b4a3d;
  --accent-soft: #e4f0ec;
  --danger: #8b2e1f;
  --danger-soft: #f8ece9;
  --warn: #7a5410;
  --warn-soft: #f6eedd;
  --shadow: 0 1px 2px rgba(28, 25, 21, 0.05), 0 16px 40px rgba(28, 25, 21, 0.07);
  --radius: 20px;
  --sans: "Source Sans 3", "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --header-max: 1120px;
  --content-max: 760px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

html { color-scheme: light; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  background:
    radial-gradient(1200px 480px at 50% -120px, #e4eee8 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn:focus-visible,
.icon-btn:focus-visible {
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transform: translateY(-160%);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  color: #fff;
}

.wrap { width: min(var(--content-max), calc(100% - 32px)); margin: 0 auto; }
.header-inner,
.footer-inner { width: min(var(--header-max), calc(100% - 32px)); margin: 0 auto; }

.site-header {
  padding: 18px 0 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 78%, #fff);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
  border-radius: 8px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
}
.header-nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 6px 2px;
}
.header-nav a:hover,
.header-nav a[aria-current="page"] { color: var(--ink); }

.trust-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.trust-line svg {
  flex: 0 0 16px;
  color: var(--accent);
}

main { flex: 1; padding: 12px 0 80px; }

.hero { padding-top: 16px; }
.hero h1,
.page-hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 20px 0 14px;
  text-wrap: balance;
}
.lede {
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 40rem;
}
.kicker {
  margin: 28px 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.drop-panel { padding: 12px 12px 0; }
.drop-panel.has-files { padding-bottom: 0; }

.dropzone {
  display: block;
  margin: 0;
  padding: 44px 24px 22px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, #fffcf7 0%, var(--paper) 100%);
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  user-select: none;
}
.drop-panel.has-files .dropzone {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.drop-panel.has-files .dropzone h2 { font-size: 0.98rem; margin: 0; font-weight: 600; }
.drop-panel.has-files .drop-lead,
.drop-panel.has-files .drop-icon { display: none; }
.dropzone:hover, .dropzone.is-dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.dropzone:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.drop-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--accent);
}
.dropzone h2 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.drop-lead { margin: 0; color: var(--muted); font-size: 0.98rem; }

.drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px 0 14px;
}
.drop-panel.has-files .drop-actions { display: none; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 8px 20px 14px;
}
.field { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.95rem; }
.field label { white-space: nowrap; }
.field select, .field input[type="range"] { accent-color: var(--accent); }
.field select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 10px;
}
.quality-value { min-width: 2.2em; color: var(--ink); font-variant-numeric: tabular-nums; }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn-soft:hover { background: #d5e8e2; color: var(--accent-hover); }
.icon-btn {
  font: inherit;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

.results { padding: 0 12px 12px; display: grid; gap: 10px; }
.file-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #efeae0;
  background-image:
    linear-gradient(45deg, #e0d9cc 25%, transparent 25%),
    linear-gradient(-45deg, #e0d9cc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e0d9cc 75%),
    linear-gradient(-45deg, transparent 75%, #e0d9cc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.thumb img, .thumb-ph {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}
.thumb-ph { display: grid; place-items: center; color: var(--muted); font-size: 11px; background: #ece7dc; border-radius: 8px; }
.file-meta { min-width: 0; }
.file-meta strong { display: block; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span, .file-meta small { color: var(--muted); font-size: 0.84rem; }
.file-actions { display: flex; align-items: center; gap: 4px; }
.status-ok { color: var(--accent); }
.status-warn { color: var(--warn); }
.status-err { color: var(--danger); }
.size-up { color: var(--muted); }

.steps, .explain, .faq, .more { margin-top: 48px; }
.steps h2, .explain h2, .faq h2, .more h2,
.prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.steps ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
  display: grid;
  gap: 14px;
}
.steps li {
  margin: 0;
  padding: 0 0 0 2.75rem;
  position: relative;
}
.steps li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}
.explain p, .faq p { color: var(--ink); margin: 0 0 12px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: 0 0 8px;
  margin-right: 4px;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); max-width: 40rem; }

.more-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.more-list a {
  display: block;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(28, 25, 21, 0.04);
}
.more-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.page-hero .lede { margin-bottom: 8px; }
.prose {
  margin-top: 28px;
  max-width: 40rem;
}
.prose h2 { margin: 32px 0 12px; }
.prose p, .prose li { margin: 0 0 12px; }
.prose ul { margin: 0 0 16px; padding: 0 0 0 1.2rem; }
.prose li { padding-left: 0.2rem; }

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
}

.site-footer {
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  border-top: 1px solid var(--line);
  margin-top: auto;
  background: color-mix(in srgb, var(--bg) 70%, #fff);
}
.site-footer p { margin: 0 0 10px; max-width: 46rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 16px;
}
.footer-nav a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.footer-nav a:hover,
.footer-nav a[aria-current="page"] { color: var(--accent); }
.copyright { margin-top: 16px !important; }

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero h1, .page-hero h1 { margin-top: 12px; }
  .lede { font-size: 1.05rem; margin-bottom: 24px; }
  .file-row { grid-template-columns: 52px 1fr; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn,
  .toolbar-actions .btn-ghost { flex: 1; }
  .dropzone { padding: 28px 16px 16px; }
  .thumb, .thumb img, .thumb-ph { width: 52px; height: 52px; }
  .more-list { grid-template-columns: 1fr; }
  .wordmark { font-size: 1.1rem; }
  .trust-line { font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
