/* FOLD — paper & ink design system.
   Desk-gray background, white "sheet" cards, near-black ink, one blue accent.
   Red is reserved for errors only. */

:root {
  --desk: #e3e6eb;          /* cool neutral desk gray */
  --desk-deep: #d6dae1;
  --sheet: #ffffff;
  --ink: #16181e;
  --ink-soft: #4b5162;
  --ink-faint: #7a8093;
  --line: #c7ccd6;
  --line-soft: #e0e3e9;
  --accent: #2337c6;        /* deep ink blue */
  --accent-down: #1b2ba0;
  --accent-tint: #eef0fc;
  --error: #b3261e;
  --error-bg: #fbeeed;
  --radius: 10px;
  --shadow-sheet: 0 1px 2px rgba(22, 24, 30, 0.10), 0 8px 20px rgba(22, 24, 30, 0.07);
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

.mono { font-family: var(--font-mono); font-size: 0.85em; }

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- header / footer ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
}

.site-header .inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand svg { display: block; }

.site-nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14.5px;
  padding: 4px 2px;
}

.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 26px 20px 34px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.site-footer .badge { margin-bottom: 10px; }

/* ---------- privacy badge (the signature element) ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* Landing hero badge: the human promise leads, the technical proof supports.
   A separate class so the shared .badge (footers, tool pages) is untouched. */
.promise-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  max-width: max-content;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sheet);
}
.promise-badge .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none;
}
.promise-badge .promise-text { display: flex; flex-direction: column; line-height: 1.3; }
.promise-badge .promise-primary { font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.promise-badge .promise-secondary { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }

/* ---------- layout ---------- */

main {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 34px 20px 48px;
}

.page-title { font-size: 30px; letter-spacing: -0.02em; margin: 0 0 6px; }
.page-sub { color: var(--ink-soft); margin: 0 0 24px; max-width: 60ch; }

.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sheet);
  padding: 22px;
}

.stack > * + * { margin-top: 16px; }

/* ---------- landing ---------- */

/* Landing page uses a wider container so the hero breathes across the viewport. */
main.landing {
  max-width: 1160px;
  padding: 0 28px 48px;
}

/* Hero: two-column at desktop — text left, geometric mark right. */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding: 42px 0 36px;
}

.hero-content { max-width: 44ch; }

.hero h1 { font-size: 40px; letter-spacing: -0.025em; line-height: 1.13; margin: 0 0 12px; }
.hero p { font-size: 17px; color: var(--ink-soft); margin: 0 0 18px; }

/* Subtle geometric mark: three layered page shapes with an F letterform. */
.hero-mark {
  flex: none;
  width: 160px;
  height: 160px;
  opacity: 0.85;
}
.hero-mark svg { width: 100%; height: 100%; display: block; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 0 0 32px;
}

/* small screens: stack hero, hide mark, restore single-column feel */
@media (max-width: 680px) {
  main.landing { padding: 0 20px 40px; }
  .hero {
    grid-template-columns: 1fr;
    padding: 28px 0 24px;
    gap: 0;
  }
  .hero-mark { display: none; }
  .hero h1 { font-size: 32px; }
}

.tool-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sheet);
  padding: 18px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

a.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(22, 24, 30, 0.10), 0 12px 26px rgba(22, 24, 30, 0.10);
}

.tool-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-tint);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.tool-card h2 { font-size: 17px; margin: 0 0 4px; }
.tool-card p { font-size: 14px; color: var(--ink-soft); margin: 0; }

.tool-card.soon {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}
.tool-card.soon .icon { background: var(--desk-deep); color: var(--ink-faint); }

.soon-tag {
  float: right;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.trust {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.trust h3 { font-size: 15px; margin: 0 0 4px; }
.trust p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* ---------- dropzone ---------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 38px 20px;
  background: var(--sheet);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--ink);
}

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

.dropzone strong { color: var(--ink); font-size: 17px; }
.dropzone .hint { font-size: 13.5px; }

.dropzone[disabled], .dropzone[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- options row (images tool) ---------- */

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--sheet);
}

.options label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.options select {
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sheet);
  min-width: 150px;
}

/* ---------- file list ---------- */

.list-toolbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 4px 2px;
}

.list-toolbar .totals { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }

.link-btn {
  background: none;
  border: none;
  padding: 4px;
  margin-left: auto;
  font: inherit;
  font-size: 13.5px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:disabled { color: var(--ink-faint); cursor: default; text-decoration: none; }

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

.file-list:empty { display: none; }

.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--sheet);
}
.file-list li:first-child { border-top: none; }

.file-list li.dragging { opacity: 0.4; }
.file-list li.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.file-list li.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }

.file-list .grip {
  color: var(--ink-faint);
  cursor: grab;
  flex: none;
  user-select: none;
  letter-spacing: -1px;
}

.file-list .file-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
}

.file-list .file-meta {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.file-list li.has-error .file-meta { color: var(--error); white-space: normal; }
.file-list li.has-error .file-name { color: var(--error); }
.file-list li.is-done .file-meta { color: var(--accent); }

.row-actions { display: flex; gap: 2px; flex: none; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: var(--desk); color: var(--ink); }
.icon-btn.danger:hover { background: var(--error-bg); color: var(--error); }
.icon-btn:disabled { opacity: 0.4; cursor: default; background: none; }

/* ---------- buttons / action row ---------- */

.action-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.action-row .badge { align-self: center; }

.name-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.text-input {
  font: inherit;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink);
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
  min-width: 240px;
}

.text-input::placeholder { color: var(--ink-faint); }

.text-input:disabled {
  background: var(--desk);
  color: var(--ink-faint);
  cursor: not-allowed;
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { border-color: var(--ink-soft); }

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-down); border-color: var(--accent-down); }
.btn-primary:disabled {
  background: var(--desk-deep);
  border-color: var(--desk-deep);
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* ---------- progress ---------- */

.progress-wrap[hidden] { display: none; }

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--desk-deep);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 160ms ease;
}

.progress-text {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  min-height: 1.4em;
}

/* ---------- notices / errors / result ---------- */

.notice {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-soft);
  border-radius: 8px;
  background: var(--sheet);
  font-size: 14px;
  color: var(--ink-soft);
}
.notice[hidden] { display: none; }

/* ---------- document conversion tools ---------- */

.privacy-notice {
  padding: 16px 18px;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-tint);
}
.privacy-notice h2 { font-size: 16px; margin: 0 0 6px; }
.privacy-notice p { color: var(--ink-soft); font-size: 14px; margin: 0; }
.privacy-notice p + p { margin-top: 8px; }

.fidelity-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sheet);
  color: var(--ink-soft);
  font-size: 14px;
}
.fidelity-note strong { color: var(--ink); }

.file-list .conv-row { flex-wrap: wrap; }
.conv-status {
  flex: none;
  min-width: 82px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  text-align: right;
}
.status-uploading .conv-status, .status-converting .conv-status { color: var(--accent); }
.status-done .conv-status { color: var(--accent); }
.status-failed .conv-status, .status-cancelled .conv-status { color: var(--error); }
.conv-error {
  flex: 1 0 100%;
  margin: -2px 0 0;
  color: var(--error);
  font-size: 12.5px;
}

.server-footer { max-width: 660px; margin: 0 auto 10px; white-space: normal; text-align: left; }

.error-box {
  padding: 12px 16px;
  border: 1px solid var(--error);
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 14px;
}
.error-box[hidden] { display: none; }
.error-box h3 { margin: 0 0 6px; font-size: 14.5px; }
.error-box ul { margin: 0; padding-left: 20px; }
.error-box li { margin: 2px 0; }

.result-box {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-tint);
}
.result-box[hidden] { display: none; }
.result-box .file-info { font-family: var(--font-mono); font-size: 14px; }

.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;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
