/* convertdoks.com: one page, one job.
   White surfaces, near-black text, one vermilion for the action, progress and
   focus. Geist sets the text, Geist Mono the file types (assets/fonts, SIL
   Open Font License). Dark mode follows prefers-color-scheme.
   CSP: this file and the fonts are the only styles (no inline styles). */

@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-v1-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geistmono-v1-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8f8f9;
  --surface-hover: #f1f1f3;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #6b6b74;
  --border: #e6e6ea;
  --border-strong: #d2d2d8;
  --accent: #d63f23;
  --accent-hover: #bd3419;
  --accent-text: #c2381c;
  --accent-soft: #fcebe6;
  --on-accent: #ffffff;
  --success: #15803d;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --overlay: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow: 0 1px 2px rgba(24, 24, 27, 0.04), 0 8px 24px -10px rgba(24, 24, 27, 0.1);
  --radius-sm: 8px;
  --radius: 12px;
  --page: 1040px;
  --gutter: 24px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121214;
    --surface: #19191c;
    --surface-hover: #222226;
    --text: #ededf0;
    --text-2: #b4b4bc;
    --text-3: #93939c;
    --border: #2a2a2f;
    --border-strong: #3c3c43;
    --accent: #d63f23;
    --accent-hover: #e24a2d;
    --accent-text: #ff8b70;
    --accent-soft: #33190f;
    --success: #4ade80;
    --danger: #ff9286;
    --danger-soft: #2c1614;
    --overlay: rgba(18, 18, 20, 0.9);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -12px rgba(0, 0, 0, 0.6);
  }
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

svg {
  flex: none;
}

[hidden] {
  display: none !important;
}

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

.visually-hidden,
.status:not(.is-busy) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

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

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--page);
  height: 64px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  display: block;
  width: 24px;
  height: 24px;
}

.site-nav-list {
  display: flex;
  gap: 2px;
}

.site-nav-link {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.site-nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.site-nav-link[aria-current='page'] {
  background: var(--surface-hover);
  color: var(--text);
}

/* ------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease),
    color 0.15s var(--ease), transform 0.1s var(--ease);
}

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

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  border-color: var(--border-strong);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
  background: var(--surface-hover);
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}

.link-button:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* ------------------------------------------------------------ converter */

.converter {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px var(--gutter) 0;
}

.hero {
  margin-bottom: 36px;
  text-align: center;
}

.hero-title {
  font-size: clamp(32px, 2.2vw + 18px, 48px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-intro {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 18px;
  text-wrap: balance;
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 288px;
  padding: 40px var(--gutter);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.drop-zone:hover {
  border-color: var(--text-3);
}

body.is-dragging .drop-zone {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}

.drop-zone-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.drop-zone-actions {
  margin-top: 4px;
}

.drop-zone .button {
  height: 44px;
  padding: 0 24px;
}

/* the input stays focusable for the keyboard; its label is the button */
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-input:focus-visible + .button {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drop-zone-limits {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
  text-wrap: balance;
}

.status.is-busy {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  text-align: center;
}

/* ---------------------------------------------------------------- files */

.files-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 14px;
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.files-foot {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.sheet {
  padding: 18px 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  animation: sheet-in 0.2s var(--ease);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sheet-thumb {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
}

/* a folded corner while the thumbnail is a file icon */
.sheet-thumb::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid var(--border-strong);
  border-left: 1px solid var(--border-strong);
  border-bottom-left-radius: 4px;
  background: var(--bg);
}

.sheet-thumb:has(.sheet-thumb-img:not([hidden]))::after,
.sheet-thumb-img:not([hidden]) + .sheet-thumb-glyph {
  display: none;
}

.sheet-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  background: #fff;
}

.sheet-thumb-glyph {
  margin-top: 8px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
}

.sheet-meta {
  flex: 1;
  min-width: 0;
}

.sheet-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-details {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-path::before {
  content: ', in ';
}

.sheet-remove {
  display: grid;
  flex: none;
  place-items: center;
  align-self: flex-start;
  width: 32px;
  height: 32px;
  margin: -6px -8px 0 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

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

.sheet-convert {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sheet-convert-label {
  margin-bottom: 10px;
  color: var(--text-3);
  font-size: 13px;
}

.sheet-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease),
    color 0.15s var(--ease), opacity 0.15s var(--ease), transform 0.1s var(--ease);
}

.target:hover:not(:disabled) {
  border-color: var(--text-3);
  background: var(--surface-hover);
}

.target:active:not(:disabled) {
  transform: translateY(1px);
}

.target.is-primary {
  min-width: 128px;
  padding: 0 22px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.target.is-primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.target:disabled {
  cursor: default;
  opacity: 0.5;
}

.target.is-busy {
  opacity: 1;
}

.target.is-done::before {
  content: '';
  width: 5px;
  height: 9px;
  margin: -3px 1px 0 0;
  border: solid var(--success);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.target.is-primary.is-done::before {
  border-color: currentColor;
}

.sheet-progress {
  position: relative;
  height: 3px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--accent-soft);
}

.sheet-progress-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 35%;
  border-radius: inherit;
  background: var(--accent);
  animation: progress 1.1s var(--ease) infinite;
}

@keyframes progress {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(290%);
  }
}

.sheet-note {
  margin-top: 10px;
  color: var(--text-2);
  font-size: 14px;
}

.sheet-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 14px;
  color: var(--text-2);
  font-size: 14px;
}

.sheet-result-icon {
  color: var(--success);
}

.sheet-download {
  color: var(--accent-text);
  font-weight: 500;
  text-underline-offset: 3px;
}

.sheet-error {
  margin-top: 14px;
  color: var(--danger);
  font-size: 14px;
}

.sheet-retry {
  margin-top: 8px;
}

.sheet[data-state='skipped'] {
  background: var(--surface);
  box-shadow: none;
}

.sheet[data-state='skipped'] .sheet-name,
.sheet[data-state='skipped'] .sheet-error {
  color: var(--text-2);
}

/* ------------------------------------------------------- drop overlay */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--overlay);
  pointer-events: none;
  animation: fade-in 0.15s var(--ease);
}

.drop-overlay::before {
  content: '';
  position: absolute;
  inset: 16px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
}

.drop-overlay-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.drop-overlay-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ------------------------------------------------------ below the fold */

.trust,
.popular,
.pair-links {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.trust {
  margin-top: 104px;
}

.trust-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.trust-title {
  font-size: 15px;
  font-weight: 600;
}

.trust-text {
  max-width: 34ch;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 14px;
}

.popular,
.pair-links {
  margin-top: 72px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-link {
  border-radius: 4px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.popular-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 32px;
}

.popular-link {
  display: block;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s var(--ease);
}

.popular-link:hover {
  color: var(--accent-text);
}

.pair-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.pair-links-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pair-links-list,
.formats-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pair-link,
.formats-link {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.pair-link:hover,
.formats-link:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

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

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
}

.site-footer-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
}

.site-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.footer-brand {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-note {
  color: var(--text-3);
  font-size: 13px;
}

.footer-note + .footer-note {
  margin-top: 4px;
}

/* ---------------------------------------------- formats, privacy, 404 */

.site-main-page {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 56px var(--gutter) 0;
}

.page-title {
  font-size: clamp(30px, 1.2vw + 20px, 38px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.page-intro {
  max-width: 60ch;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 18px;
}

.formats-group {
  margin-top: 40px;
}

.formats-group-title {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.formats-table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.formats-table th,
.formats-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.formats-table thead th {
  padding-top: 9px;
  padding-bottom: 9px;
  border-top: 0;
  background: var(--surface);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

.formats-head-from,
.formats-from {
  width: 180px;
}

.formats-from-id {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.formats-from-name {
  display: block;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
}

.formats-empty {
  margin-top: 32px;
  color: var(--text-2);
}

.prose {
  max-width: 680px;
}

.prose-title {
  margin-top: 36px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prose-text {
  margin-top: 8px;
  color: var(--text-2);
  line-height: 1.65;
}

.message .prose-text {
  margin-top: 28px;
}

/* ---------------------------------------------------------------- phone */

@media (max-width: 720px) {
  :root {
    --gutter: 16px;
  }

  .site-header-inner {
    height: 56px;
  }

  .site-nav-link {
    padding: 6px 10px;
  }

  .converter {
    padding-top: 40px;
  }

  .hero {
    margin-bottom: 24px;
  }

  .hero-intro {
    font-size: 16px;
  }

  .drop-zone {
    min-height: 236px;
    padding: 32px 16px;
  }

  .sheet {
    padding: 16px;
  }

  .target.is-primary {
    flex: 1 0 100%;
  }

  .files-foot .button {
    width: 100%;
  }

  .trust {
    margin-top: 72px;
  }

  .trust-list {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .popular,
  .pair-links {
    margin-top: 56px;
  }

  .popular-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
  }

  .pair-links {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-main-page {
    padding-top: 36px;
  }

  .page-intro {
    font-size: 16px;
  }

  .formats-head-from,
  .formats-from {
    width: 92px;
  }

  .formats-table th,
  .formats-table td {
    padding: 10px 12px;
  }

  .site-footer {
    margin-top: 72px;
  }
}

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

  .sheet-progress-bar {
    width: 100%;
    opacity: 0.6;
    animation: none !important;
  }
}
