/* ==========================================================================
   Vellum PDF — design system
   Dark mode, Apple design language: semantic colors, SF Pro type scale,
   vibrancy materials, 4pt spacing grid.
   ========================================================================== */

:root {
  /* Semantic surfaces (dark) */
  --bg: #000000;
  --elevated: #1c1c1e;
  --elevated-2: #2c2c2e;
  --elevated-3: #3a3a3c;

  /* Fills (semi-transparent so they adapt to what's beneath) */
  --fill: rgba(120, 120, 128, 0.24);
  --fill-strong: rgba(120, 120, 128, 0.36);
  --fill-subtle: rgba(120, 120, 128, 0.16);

  /* Labels */
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --label-4: rgba(235, 235, 245, 0.18);

  /* Separators */
  --separator: rgba(84, 84, 88, 0.65);
  --separator-soft: rgba(84, 84, 88, 0.4);

  /* Accents */
  --blue: #0a84ff;
  --blue-pressed: #0071e3;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;

  /* Radii */
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 980px;

  /* Motion */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 200ms;

  /* Layout */
  --gutter: 24px;
  --max: 1120px;
  --read: 720px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -0.41px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding-left: 1.25em;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

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

::selection {
  background: rgba(10, 132, 255, 0.35);
}

/* ----- Type scale (SF Pro metrics) ----- */

.t-large {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.t-title1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

.t-title3 {
  font-size: 20px;
  line-height: 25px;
  font-weight: 600;
  letter-spacing: 0.38px;
}

.t-headline {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.41px;
}

.t-body {
  font-size: 17px;
  line-height: 22px;
  letter-spacing: -0.41px;
}

.t-callout {
  font-size: 16px;
  line-height: 21px;
  letter-spacing: -0.31px;
}

.t-subhead {
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.23px;
}

.t-footnote {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -0.08px;
}

.t-caption {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
}

.t-caption-up {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--label-2);
}

.secondary {
  color: var(--label-2);
}
.tertiary {
  color: var(--label-3);
}

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

/* ----- Layout primitives ----- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page {
  flex: 1;
}

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

/* ----- Header ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 22, 24, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--label);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.41px;
}

.brand:hover {
  text-decoration: none;
}

.brand svg {
  width: 22px;
  height: 22px;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--label-2);
  font-size: 13px;
  letter-spacing: -0.08px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}

.nav a:hover {
  color: var(--label);
  background: var(--fill-subtle);
  text-decoration: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--fill-subtle);
  border: 0.5px solid var(--separator-soft);
  color: var(--label-2);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  white-space: nowrap;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

/* ----- Hero ----- */

.hero {
  padding: 56px 0 8px;
  text-align: center;
}

.hero p {
  margin: 12px auto 0;
  max-width: 56ch;
  color: var(--label-2);
}

/* ----- Tool card ----- */

.tool-card {
  background: var(--elevated);
  border: 0.5px solid var(--separator-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 32px;
}

/* Segmented control (iOS) */

.segmented {
  position: relative;
  display: flex;
  padding: 2px;
  background: var(--fill);
  border-radius: var(--r-sm);
  isolation: isolate;
}

.segmented .thumb {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 0;
  border-radius: 8px;
  background: var(--elevated-3);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.32), 0 1px 1px rgba(0, 0, 0, 0.28);
  transition: transform var(--dur) var(--ease), width var(--dur) var(--ease);
  z-index: 0;
}

.segmented button {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  background: none;
  border: 0;
  padding: 7px 6px;
  border-radius: 8px;
  color: var(--label);
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: -0.08px;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}

.segmented button[aria-selected="false"] {
  color: var(--label-2);
}

.segmented button:hover {
  color: var(--label);
}

.segmented.sm {
  margin-top: 8px;
}

.segmented.sm button {
  font-size: 12px;
  padding: 6px 4px;
}

/* Drop zone */

.dropzone {
  margin-top: 16px;
  border: 1.5px dashed rgba(235, 235, 245, 0.22);
  border-radius: var(--r-md);
  padding: 36px 24px;
  text-align: center;
  background: var(--fill-subtle);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.dropzone:hover {
  border-color: rgba(235, 235, 245, 0.34);
}

.dropzone.is-over {
  border-color: var(--blue);
  background: rgba(10, 132, 255, 0.1);
  transform: scale(1.004);
}

.dropzone .glyph {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  color: var(--label-2);
}

.dropzone .title {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.41px;
}

.dropzone .hint {
  margin-top: 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
}

.dropzone .hint kbd {
  font: inherit;
  font-size: 12px;
  background: var(--fill-strong);
  border-radius: 5px;
  padding: 1px 6px;
}

/* File list */

.filelist {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filelist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--elevated-2);
  border: 0.5px solid var(--separator-soft);
}

.filelist .icon {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--label-2);
}

.filelist .name {
  font-size: 15px;
  letter-spacing: -0.23px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.filelist .meta {
  margin-left: auto;
  color: var(--label-2);
  font-size: 13px;
  letter-spacing: -0.08px;
  white-space: nowrap;
}

.filelist .remove {
  appearance: none;
  border: 0;
  background: var(--fill);
  color: var(--label-2);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.filelist .remove:hover {
  background: rgba(255, 69, 58, 0.22);
  color: var(--red);
}

.filelist .remove svg {
  width: 12px;
  height: 12px;
}

.ord {
  font-size: 12px;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
  width: 18px;
  flex: none;
  text-align: right;
}

/* Options */

.options {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 0.5px solid var(--separator-soft);
  display: none;
}

.options.is-visible {
  display: block;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--label-2);
  margin-bottom: 6px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 9px 34px 9px 12px;
  border-radius: var(--r-sm);
  background-color: var(--fill);
  border: 0.5px solid var(--separator-soft);
  color: var(--label);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.23px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23AEAEB2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  transition: background-color var(--dur) var(--ease);
}

select:hover {
  background-color: var(--fill-strong);
}

/* Buttons */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--r-md);
  padding: 12px 20px;
  min-height: 44px;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.41px;
  cursor: pointer;
  background: var(--fill);
  color: var(--label);
  transition: background-color var(--dur) var(--ease), transform 120ms var(--ease),
    opacity var(--dur) var(--ease);
}

.btn:hover {
  background: var(--fill-strong);
}

.btn:active {
  transform: scale(0.985);
}

.btn[disabled],
.btn-primary[disabled] {
  background: var(--fill);
  color: var(--label-3);
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

.convert-hint {
  margin-top: 8px;
  min-height: 18px;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: #3a9bff;
}

.btn-quiet {
  background: none;
  color: var(--blue);
  padding: 10px 12px;
  min-height: 38px;
  font-size: 15px;
}

.btn-quiet:hover {
  background: var(--fill-subtle);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.actions {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.actions .btn-primary {
  flex: 1 1 240px;
}

/* Progress + status */

.progress {
  margin-top: 20px;
  display: none;
}

.progress.is-visible {
  display: block;
}

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--fill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 2px;
  transition: width 180ms var(--ease);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--label-2);
}

/* Notice / error */

.notice {
  display: none;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.08px;
}

.notice.is-visible {
  display: block;
}

.notice.error {
  background: rgba(255, 69, 58, 0.14);
  border: 0.5px solid rgba(255, 69, 58, 0.35);
  color: #ffb4ae;
}

/* Results */

.results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 0.5px solid var(--separator-soft);
  display: none;
}

.results.is-visible {
  display: block;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-card {
  background: var(--elevated-2);
  border: 0.5px solid var(--separator-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.result-card .thumb {
  aspect-ratio: 3 / 4;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.result-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-card .body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-card .body .name {
  font-size: 13px;
  line-height: 17px;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card .body .meta {
  font-size: 12px;
  color: var(--label-2);
}

.result-card .body .btn {
  padding: 8px 12px;
  min-height: 36px;
  font-size: 15px;
  border-radius: var(--r-sm);
}

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--elevated-2);
  border: 0.5px solid var(--separator-soft);
  border-radius: var(--r-md);
}

.summary .big {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

.summary .before {
  color: var(--label-2);
  text-decoration: line-through;
  font-size: 15px;
}

/* ----- Ad slot ----- */

.ad-slot {
  margin: 40px 0;
  padding: 12px 0 0;
  border-top: 0.5px solid var(--separator-soft);
}

.ad-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--label-3);
  margin-bottom: 8px;
  text-align: center;
}

/* ----- Editorial content ----- */

.prose {
  max-width: var(--read);
  margin: 0 auto;
}

.prose h2 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: 0.35px;
  margin: 0 0 12px;
  scroll-margin-top: 80px;
}

.prose h3 {
  font-size: 20px;
  line-height: 25px;
  font-weight: 600;
  letter-spacing: 0.38px;
  margin: 32px 0 8px;
}

.prose p {
  color: var(--label-2);
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  color: var(--label-2);
  margin: 0 0 16px;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--label-3);
}

.prose strong {
  color: var(--label);
  font-weight: 600;
}

.prose .lead {
  font-size: 20px;
  line-height: 27px;
  color: var(--label);
  letter-spacing: -0.31px;
  margin-bottom: 24px;
}

/* FAQ */

.faq {
  border-top: 0.5px solid var(--separator-soft);
}

.faq details {
  border-bottom: 0.5px solid var(--separator-soft);
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 32px 18px 0;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.41px;
  position: relative;
}

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

.faq summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -7px;
  border-right: 1.5px solid var(--label-2);
  border-bottom: 1.5px solid var(--label-2);
  transform: rotate(45deg);
  transition: transform var(--dur) var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.faq .answer {
  padding: 0 0 20px;
  color: var(--label-2);
}

/* Doc pages (privacy / terms / about) */

.doc {
  max-width: var(--read);
  margin: 0 auto;
  padding: 48px 0 24px;
}

.doc header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 0.5px solid var(--separator-soft);
}

.doc .updated {
  color: var(--label-3);
  font-size: 13px;
  margin-top: 8px;
}

.doc h2 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: 0.35px;
  margin: 36px 0 10px;
}

.doc h3 {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  letter-spacing: -0.41px;
  margin: 24px 0 8px;
}

.doc p {
  color: var(--label-2);
  margin: 0 0 14px;
}

.doc ul,
.doc ol {
  color: var(--label-2);
  margin: 0 0 14px;
}

.doc li {
  margin-bottom: 8px;
}

.doc li::marker {
  color: var(--label-3);
}

.doc strong {
  color: var(--label);
  font-weight: 600;
}

.doc .callout {
  background: var(--elevated);
  border: 0.5px solid var(--separator-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 0 0 20px;
  color: var(--label-2);
}

.doc .callout p:last-child {
  margin-bottom: 0;
}

.toc {
  background: var(--elevated);
  border: 0.5px solid var(--separator-soft);
  border-radius: var(--r-md);
  padding: 18px 20px;
  margin-bottom: 32px;
}

.toc p {
  color: var(--label-2);
  margin-bottom: 8px;
  font-size: 13px;
}

.toc ol {
  margin: 0;
  font-size: 15px;
}

/* Contact block */

.contact-card {
  background: var(--elevated);
  border: 0.5px solid var(--separator-soft);
  border-radius: var(--r-md);
  padding: 20px;
  margin: 0 0 24px;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

/* ----- Footer ----- */

.site-footer {
  margin-top: 64px;
  border-top: 0.5px solid var(--separator);
  padding: 28px 0 40px;
  background: #0a0a0b;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.site-footer nav a {
  color: var(--label-2);
  font-size: 13px;
}

.site-footer nav a:hover {
  color: var(--label);
}

.site-footer .legal {
  margin-left: auto;
  color: var(--label-3);
  font-size: 13px;
}

/* ----- Responsive ----- */

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

  .hero {
    padding: 36px 0 0;
  }

  .t-large {
    font-size: 28px;
    line-height: 34px;
  }

  .tool-card {
    padding: 16px;
  }

  .dropzone {
    padding: 28px 16px;
  }

  .nav .hide-sm {
    display: none;
  }

  .site-footer .legal {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
