/* Self-hosted Geist (OFL, static/vendor/fonts/LICENSE-Geist.txt). Latin subset only. */
@font-face { font-family: "Geist Sans"; font-weight: 400; font-display: swap; src: url("vendor/fonts/geist-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Sans"; font-weight: 600; font-display: swap; src: url("vendor/fonts/geist-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-weight: 400; font-display: swap; src: url("vendor/fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }

/* Radius rule: surfaces 14px, buttons/inputs 10px, status chips full pill. */
:root {
  --bg: #f4f5f8;
  --surface: #fcfcfd;
  --line: #dfe2e8;
  --text: #15171c;
  --muted: #565c69;
  --accent: #2a4fd6;
  --accent-hover: #2142b8;
  --accent-soft: #e7ecfc;
  --on-accent: #fcfcfd;
  --ok: #1d7047;
  --warn: #8a5300;
  --err: #b42318;
  --shadow: 0 1px 2px rgb(30 40 80 / 0.06), 0 8px 24px rgb(30 40 80 / 0.06);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #161920;
    --line: #2a2e38;
    --text: #e8eaef;
    --muted: #a0a6b2;
    --accent: #8aa3ff;
    --accent-hover: #a5b8ff;
    --accent-soft: #1d2645;
    --on-accent: #0f1115;
    --ok: #5cc58f;
    --warn: #e3a94f;
    --err: #f2897d;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }

.top,
.wrap,
.foot {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 24px;
}

.top {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-links a { font-size: 0.92rem; color: var(--muted); text-decoration: none; }
.top-links a:hover { color: var(--text); }
.top-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wordmark {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

/* Intro: copy left, drop zone right */
.intro {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 56px;
  align-items: center;
  padding-block: 56px 40px;
}

h1 {
  font-size: clamp(2.1rem, 4.2vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 14ch;
}

.lede {
  margin-top: 20px;
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 42ch;
}

.privacy {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.privacy .ph { font-size: 1.1rem; color: var(--accent); flex: none; }

.dropzone {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 56px 32px;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}

.dropzone:hover { border-color: var(--accent); }

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.01);
}

.drop-icon { font-size: 2.5rem; color: var(--accent); }
.drop-title { font-size: 1.15rem; font-weight: 600; }
.drop-hint { font-size: 0.85rem; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible,
.remove:focus-visible,
.output:focus-visible,
.demo video:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }

.btn-ghost { background: none; color: var(--muted); padding-inline: 4px; }
.btn-ghost:hover { color: var(--text); }

.notice {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  font-size: 0.92rem;
  white-space: pre-line;
}

/* Converter status: a quiet line while it loads, a notice if it can't start */
.prep {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.prep .ph { font-size: 1.1rem; color: var(--accent); flex: none; }

.prep[data-state="failed"] {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--err);
  color: var(--text);
}

.prep[data-state="failed"] .ph { color: var(--err); }

/* Batch: file list left, combined result right */
.batch {
  display: grid;
  grid-template-columns: 4fr 7fr;
  gap: 32px;
  align-items: start;
  padding-bottom: 64px;
}

.batch[hidden], .notice[hidden], .prep[hidden] { display: none; }

h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

/* Help: below the tool, so it never sits between the drop zone, files and Copy */
.help {
  max-width: 720px;
  padding-block: 8px 72px;
}

.help-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 22px;
}

.help-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.help-list .ph { font-size: 1.25rem; color: var(--accent); margin-top: 1px; }
.help-list h3 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.help-list p { margin-top: 4px; font-size: 0.92rem; color: var(--muted); max-width: 65ch; }

.files-head,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.progress,
.result-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.file-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.file-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 12px 16px;
}

.file-row + .file-row { border-top: 1px solid var(--line); }

.file-icon { font-size: 1.5rem; color: var(--muted); }
.file-text { min-width: 0; display: grid; }

.file-name {
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub { font-size: 0.8rem; color: var(--muted); }
.file-row[data-status="failed"] .file-sub { color: var(--err); }
.file-row[data-status="empty"] .file-sub { color: var(--warn); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
  background: var(--bg);
}

.file-row[data-status="converting"] .chip { color: var(--accent); background: var(--accent-soft); }
.file-row[data-status="done"] .chip { color: var(--ok); }
.file-row[data-status="empty"] .chip { color: var(--warn); }
.file-row[data-status="failed"] .chip { color: var(--err); }

.remove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.remove:hover { background: var(--bg); color: var(--text); }

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

.usage {
  font-size: 0.88rem;
  color: var(--muted);
}

.usage:not(:empty) { margin-bottom: 12px; }

.output {
  margin: 0;
  min-height: 240px;
  max-height: 62vh;
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: "Geist Mono", ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.output.is-placeholder { color: var(--muted); }

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 24px 40px;
  font-size: 0.82rem;
  color: var(--muted);
}

.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.foot a,
.privacy a,
.prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.foot a:hover,
.privacy a:hover,
.prose a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Trust pages */
.prose {
  max-width: 65ch;
  padding-block: 40px 64px;
}

/* max-width: the hero's 14ch would wrap long guide titles to 5 lines. */
.prose h1 { font-size: clamp(1.9rem, 3.5vw, 2.4rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; max-width: 24ch; }
/* Section heads clearly outrank 16px body text so a guide can be scanned. */
.prose h2 { margin-top: 40px; margin-bottom: 8px; font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.015em; }
.prose p { color: var(--muted); }
.prose p + p { margin-top: 12px; }
.prose h1 + p:not(.prose-meta) { margin-top: 16px; } /* About and 404 have no lede class */
.prose-meta { margin-top: 8px; font-size: 0.85rem; }
.prose-lede { margin-top: 16px; font-size: 1.1rem; }
.prose .prose-cta { margin-top: 36px; }
.prose h3 { margin-top: 24px; margin-bottom: 4px; font-size: 1.05rem; font-weight: 600; }
.prose ul { margin: 12px 0 0; padding-left: 1.25em; color: var(--muted); }
.prose li + li { margin-top: 6px; }
.prose ul + p { margin-top: 12px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.9em; }
.prose .guide-list { list-style: none; padding: 0; }
.prose .prose-sample { margin-top: 12px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 0.85rem/1.6 "Geist Mono", ui-monospace, monospace; color: var(--text); }
/* Demo loop: a poster, swapped for the video by static/demo.js */
.demo { margin: 24px 0; }
.demo img,
.demo video { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.demo figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.demo-section { max-width: 860px; padding-block: 8px 48px; scroll-margin-top: 16px; }
.prep, .notice, .batch { scroll-margin-top: 16px; } /* app.js scrolls these into view on phones */
.demo-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.demo-section .demo { margin-top: 10px; }
.demo-link { margin-top: 16px; font-size: 0.95rem; }
.demo-link a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.demo-link a:hover { color: var(--text); }
.demo-link a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.demo-link .ph { font-size: 1.2rem; }
.prose .guide-list li { margin-top: 24px; }
.prose .guide-list li + li { padding-top: 24px; border-top: 1px solid var(--line); }
.prose .guide-list h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--text); }
.prose .guide-list h2 a { text-decoration-color: transparent; }
.prose .guide-list h2 a:hover { text-decoration-color: currentColor; }
.prose a.btn-primary,
.prose a.btn-primary:hover { color: var(--on-accent); text-decoration: none; }

/* Ads (AdSense): labelled, kept clear of the tool's buttons, and gone when unfilled or blocked.
   Below the help section on the tool page; beside the notes under the file list on wide screens
   only (on phones that spot would sit between the files and the notes); mid- and end-article on
   guides. Never in the hero, the prep wait, between tool parts, or on Privacy/Terms. */
.ad { margin-block: 40px; }
.ad-tool-side { margin-block: 40px 0; }
.ad-tool { max-width: 728px; }
.ad-label { margin-bottom: 6px; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ad ins { display: block; min-height: 90px; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }
@media (max-width: 860px) { .ad-tool-side { display: none; } }

/* Motion: feedback only. Spinner shows a file is still working. */
@media (prefers-reduced-motion: no-preference) {
  .file-row[data-status="converting"] .chip .ph,
  .prep[data-state="loading"] .ph { animation: spin 0.9s linear infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .dropzone, .btn { transition: none; }
  .dropzone.dragover { transform: none; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .intro,
  .batch { grid-template-columns: 1fr; }
  .intro { gap: 28px; padding-block: 24px 28px; }
}

@media (max-width: 520px) {
  .demo-section, .demo-link { display: none; } /* home demo shows desktop drag and drop; too small to read */
  .top, .wrap, .foot { padding-inline: 16px; }
  .dropzone { padding: 36px 20px; }
  .result-head { flex-direction: column; align-items: stretch; }
  .actions .btn { flex: 1; justify-content: center; }
  .file-row { grid-template-columns: auto 1fr auto; }
  .file-row .chip { grid-column: 2; justify-self: start; }
  .file-row .remove { grid-row: 1; grid-column: 3; }
}
