/* =========================================================================
   PDF to JPG — design tokens
   Bold/modern palette with one strong electric-indigo accent, distinct
   from success (green) and error (red) so states never get confused.
   Light:
     --ink #0B0E14  --ink-soft #545B66  --paper #FFFFFF  --panel #FFFFFF
     --brand #3D5AFE  --brand-dark #2A3FCC  --brand-tint #EAECFF
   Dark (opt-in via the header toggle, not the default):
     --paper #0A0C11  --panel #12151D  --ink #F4F6FA  --brand #7C90FF
   Type: system font stack (fast, no webfont request); a bigger, tighter
   type scale carries the "bold & modern" direction instead of a second
   display face.
   ========================================================================= */

:root {
  --ink: #0b0e14;
  --ink-soft: #545b66;
  --ink-faint: #868fa0;
  --paper: #ffffff;
  --panel: #ffffff;
  --panel-raised: #ffffff;
  --line: #e4e7ee;
  --line-soft: #eef0f5;
  --brand: #3d5aff;
  --brand-dark: #2740d6;
  --brand-tint: #eaecff;
  --brand-contrast: #ffffff;
  --good: #12805f;
  --good-tint: #e3f6ef;
  --bad: #d6294a;
  --bad-tint: #fdeaee;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  --content-width: 1160px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 20px;
  --shadow-panel: 0 1px 2px rgba(11, 14, 20, 0.05), 0 16px 40px rgba(11, 14, 20, 0.08);
  --shadow-pop: 0 20px 48px rgba(61, 90, 255, 0.18);

  color-scheme: light;
}

[data-theme="dark"] {
  --ink: #f4f6fa;
  --ink-soft: #aab1c0;
  --ink-faint: #6b7383;
  --paper: #0a0c11;
  --panel: #12151d;
  --panel-raised: #171b26;
  --line: #242938;
  --line-soft: #1b1f2a;
  --brand: #7c90ff;
  --brand-dark: #9aabff;
  --brand-tint: #1c2247;
  --brand-contrast: #0a0c11;
  --good: #33b98c;
  --good-tint: #123529;
  --bad: #ff6b85;
  --bad-tint: #3a1520;
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-pop: 0 20px 48px rgba(124, 144, 255, 0.22);
  color-scheme: dark;
}


* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* -------------------------------------------------------------------- */
/* Skip link */
/* -------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus {
  left: 0;
}

/* -------------------------------------------------------------------- */
/* Header */
/* -------------------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-header__bar {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 12px;
}

.site-header__bar .brand {
  margin-right: auto;
}

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

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 16px rgba(61, 90, 255, 0.3);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Dark mode toggle */
.theme-toggle {
  width: 40px;
  height: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
}
.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.theme-toggle__icon {
  width: 19px;
  height: 19px;
  position: absolute;
  transition: opacity 0.15s ease, transform 0.25s ease;
}
.theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(-40deg) scale(0.6);
}
[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(40deg) scale(0.6);
}
[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.nav__link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.nav__link:hover {
  color: var(--ink);
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav__toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 720px) {
  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 0;
    display: none;
  }
  .nav.is-open {
    display: flex;
  }
  .nav__link {
    width: 100%;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line-soft);
  }
  .nav__toggle {
    display: flex;
  }
}

/* -------------------------------------------------------------------- */
/* Hero */
/* -------------------------------------------------------------------- */
.hero {
  padding: 64px 0 32px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0 20px;
    text-align: left;
  }
  .hero__art {
    order: -1;
    max-width: 280px;
    margin: 0 auto 8px;
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  background: var(--brand-tint);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 16px;
  max-width: 16ch;
}

.hero__subtitle {
  color: var(--ink-soft);
  font-size: 18px;
  max-width: 52ch;
  margin: 0 0 4px;
}

.hero__privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-top: 20px;
}
.hero__privacy svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--good);
}

.hero__art {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 48px rgba(61, 90, 255, 0.18));
}

/* -------------------------------------------------------------------- */
/* Converter card */
/* -------------------------------------------------------------------- */
.converter {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-panel);
  padding: 32px;
  margin: 24px 0 40px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media (max-width: 560px) {
  .converter {
    padding: 18px;
    border-radius: var(--radius-m);
  }
}

.dropzone {
  border: 2.5px dashed var(--line);
  border-radius: var(--radius-m);
  padding: 64px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.dropzone:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
}

.dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-tint);
  transform: scale(1.015);
  box-shadow: var(--shadow-pop);
}

.dropzone:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.dropzone__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  color: var(--brand);
  transition: transform 0.25s ease;
}

.dropzone.is-dragover .dropzone__icon {
  transform: translateY(-6px);
}

.dropzone__title {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 6px;
}

.dropzone__hint {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: 0 10px 24px rgba(61, 90, 255, 0.28);
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 14px 30px rgba(61, 90, 255, 0.34);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  background: var(--ink-faint);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 13.5px;
}
.btn-ghost:hover {
  color: var(--brand);
}

.btn-block {
  width: 100%;
}

.dropzone__meta {
  color: var(--ink-faint);
  font-size: 12.5px;
  margin-top: 14px;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Selected file row */
.file-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 14px 16px;
}

.file-summary__icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--radius-s);
  background: var(--brand-tint);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-summary__icon svg {
  width: 18px;
  height: 18px;
}

.file-summary__text {
  flex: 1;
  min-width: 0;
}

.file-summary__name {
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-summary__size {
  color: var(--ink-soft);
  font-size: 13px;
}

.file-summary__remove {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-s);
  flex: none;
}
.file-summary__remove:hover {
  background: var(--line-soft);
  color: var(--ink);
}

/* Settings panel */
.settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

@media (max-width: 520px) {
  .settings {
    grid-template-columns: 1fr;
  }
}

.field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field select {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
}

.converter__actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Progress state */
.progress {
  text-align: center;
  padding: 10px 0 4px;
}

.progress__label {
  font-weight: 600;
  margin: 0 0 14px;
}

.progress__track {
  height: 10px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark), var(--brand));
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
  width: 0%;
  animation: progress-shimmer 1.4s linear infinite;
}

@keyframes progress-shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

.progress__percent {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

/* Results */
.results__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.results__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results__title svg {
  width: 22px;
  height: 22px;
  color: var(--good);
  flex: none;
}

.results__title h2 {
  font-size: 18px;
  margin: 0;
}

.results__subtitle {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 2px 0 0;
}

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

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.select-row__count {
  font-size: 13.5px;
  color: var(--ink-soft);
}

.select-row__actions {
  display: flex;
  gap: 4px;
}

.select-row__hint {
  width: 100%;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.page-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--panel);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease,
    opacity 0.15s ease;
  animation: page-card-in 0.35s ease both;
}

.page-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-panel);
}

.page-card.is-dragging {
  opacity: 0.4;
}

.page-card.is-drop-target {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.page-card.is-excluded {
  opacity: 0.5;
}

@keyframes page-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-card__thumb {
  aspect-ratio: 3 / 4;
  background: var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.page-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-card__order {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-card__drag {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-s);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  border: 1px solid var(--line);
}
[data-theme="dark"] .page-card__drag {
  background: rgba(18, 21, 29, 0.85);
}
.page-card__drag:active {
  cursor: grabbing;
}
.page-card__drag svg {
  width: 16px;
  height: 16px;
}

.page-card__select {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
}
[data-theme="dark"] .page-card__select {
  background: rgba(18, 21, 29, 0.88);
}

.page-card__checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.page-grid .page-card:nth-child(1) { animation-delay: 0.02s; }
.page-grid .page-card:nth-child(2) { animation-delay: 0.06s; }
.page-grid .page-card:nth-child(3) { animation-delay: 0.1s; }
.page-grid .page-card:nth-child(4) { animation-delay: 0.14s; }
.page-grid .page-card:nth-child(5) { animation-delay: 0.18s; }
.page-grid .page-card:nth-child(n + 6) { animation-delay: 0.2s; }

.page-card__body {
  padding: 12px 14px 14px;
}

.page-card__title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
}

.page-card__dims {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.page-card__download {
  display: block;
  text-align: center;
  width: 100%;
  font-size: 13.5px;
  padding: 8px 10px;
  min-height: 38px;
}

.reset-row {
  text-align: center;
  padding-top: 4px;
}

/* Error / status banners */
.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: var(--radius-s);
  padding: 12px 14px;
  font-size: 14px;
  margin-top: 16px;
}
.banner svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}
.banner--error {
  background: var(--bad-tint);
  color: var(--bad);
}
.banner--info {
  background: var(--brand-tint);
  color: var(--brand-dark);
}

[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------------- */
/* Ad placeholder */
/* -------------------------------------------------------------------- */
.ad-slot {
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
  text-align: center;
  padding: 14px;
  margin: 32px 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot__label {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* -------------------------------------------------------------------- */
/* Content sections */
/* -------------------------------------------------------------------- */
.section {
  padding: 40px 0;
  border-top: 1px solid var(--line-soft);
}

.section h2 {
  font-size: 24px;
  margin: 0 0 24px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 760px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  border-left: 2px solid var(--brand);
  padding-left: 16px;
}

.step__index {
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 6px;
}

.step h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.step p {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 28px;
}

@media (max-width: 640px) {
  .benefits {
    grid-template-columns: 1fr;
  }
}

.benefit {
  display: flex;
  gap: 12px;
}

.benefit svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--good);
  margin-top: 2px;
}

.benefit h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.benefit p {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--line-soft);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--brand);
  font-size: 20px;
  font-weight: 400;
  flex: none;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item p {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 18px;
  max-width: 68ch;
}

/* -------------------------------------------------------------------- */
/* Simple content pages (about/contact/privacy/terms) */
/* -------------------------------------------------------------------- */
.page-hero {
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}

.page-hero h1 {
  font-size: 30px;
  margin: 0 0 8px;
}

.page-hero p {
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.prose {
  max-width: 74ch;
  padding-bottom: 56px;
}

.prose h2 {
  font-size: 19px;
  margin: 32px 0 10px;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}

.prose ul {
  padding-left: 20px;
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px 22px;
  margin: 8px 0 40px;
  max-width: 480px;
}

.contact-card dt {
  font-size: 12.5px;
  color: var(--ink-faint);
  font-weight: 600;
  margin-top: 14px;
}
.contact-card dt:first-child {
  margin-top: 0;
}
.contact-card dd {
  margin: 2px 0 0;
  font-size: 15px;
}

/* -------------------------------------------------------------------- */
/* Footer */
/* -------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 24px;
}

.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer__links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
}
.site-footer__links a:hover {
  color: var(--ink);
}

.site-footer__copy {
  color: var(--ink-faint);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
