@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Manrope:wght@400;500;600&display=swap");

@font-face {
  font-family: "Vellum Manrope";
  src: url("./fonts/manrope-latin-400-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f4f3ef;
  --paper-deep: #e9e8e2;
  --ink: #101112;
  --muted: #6f716f;
  --line: rgba(16, 17, 18, 0.14);
  --accent: #2864ff;
  --accent-soft: #e8edff;
  --white: #fff;
  --radius-lg: 30px;
  --radius-md: 20px;
  --shadow: 0 40px 100px rgba(28, 30, 28, 0.14), 0 2px 10px rgba(28, 30, 28, 0.05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Keep the complete desktop workspace visible without browser-level zoom. */
@media (min-width: 821px) {
  body {
    zoom: .75;
  }
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.site-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 84px;
  padding: 0 clamp(24px, 4.5vw, 72px);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}
.brand { display: inline-flex; align-items: center; width: fit-content; }
.brand-logo { display: block; width: 156px; height: auto; }
.nav-action { transition: opacity 180ms ease; }
.nav-action:hover { opacity: .58; }
.nav-action { justify-self: end; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 500; }

.hero {
  position: relative;
  min-height: 100vh;
  padding: 150px clamp(20px, 6vw, 96px) 66px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255,255,255,.96) 0, rgba(255,255,255,.4) 30%, transparent 57%),
    linear-gradient(180deg, #f7f6f2 0%, var(--paper) 78%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}
.hero::before { width: 520px; height: 520px; left: -350px; top: 220px; border: 1px solid rgba(40,100,255,.11); box-shadow: 0 0 120px rgba(40,100,255,.06); }
.hero::after { width: 350px; height: 350px; right: -250px; top: 470px; border: 1px solid rgba(16,17,18,.09); }
.eyebrow { margin: 0 0 25px; color: #767977; font-size: 10px; font-weight: 600; letter-spacing: .21em; }
.hero h1 {
  margin: 0;
  font-family: "Vellum Manrope", "Manrope", sans-serif;
  font-size: clamp(54px, 7.2vw, 108px);
  font-weight: 400;
  line-height: 1.035;
  letter-spacing: -.012em;
}
.hero h1 { text-wrap: balance; }
.hero h1 em { color: #9a9c99; font-style: normal; font-weight: 400; }
.hero-copy { max-width: 600px; margin: 32px auto 48px; color: #666966; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.65; }

.converter-shell { position: relative; z-index: 2; max-width: 960px; margin: 0 auto; border: 1px solid rgba(16,17,18,.11); border-radius: var(--radius-lg); overflow: hidden; background: rgba(255,255,255,.86); box-shadow: var(--shadow); text-align: left; backdrop-filter: blur(24px); }
.converter-topline { min-height: 76px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.mode-tabs { display: flex; align-items: center; gap: 4px; }
.mode-tab { padding: 13px 18px; border: 0; border-radius: 13px; background: transparent; color: #6c6e6d; font-size: 13px; cursor: pointer; transition: 180ms ease; }
.mode-tab span { margin: 0 2px; }
.mode-tab:hover { background: #f1f1ed; color: var(--ink); }
.mode-tab.is-active { background: var(--ink); color: var(--white); box-shadow: 0 8px 24px rgba(16,17,18,.16); }
.local-note { display: flex; align-items: center; gap: 8px; padding-right: 8px; color: #777a77; font-size: 11px; }
.local-note span { width: 6px; height: 6px; border-radius: 50%; background: #19a36c; box-shadow: 0 0 0 4px rgba(25,163,108,.1); }
.workspace { min-height: 380px; padding: 28px; background: rgba(255,255,255,.62); }
.drop-zone { min-height: 322px; padding: 44px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed rgba(16,17,18,.22); border-radius: 22px; background: linear-gradient(145deg, rgba(244,243,239,.7), rgba(255,255,255,.86)); outline: none; cursor: pointer; transition: border 180ms ease, background 180ms ease, transform 180ms ease; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); transform: scale(.997); }
.upload-icon { width: 52px; height: 52px; margin-bottom: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; box-shadow: 0 12px 24px rgba(16,17,18,.16); }
.upload-icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-title { margin: 0; font-size: 19px; font-weight: 500; letter-spacing: -.025em; }
.drop-subtitle { margin: 9px 0 30px; color: #7c7e7c; font-size: 13px; }
.drop-subtitle span { color: var(--accent); }
.file-acceptance { display: flex; align-items: center; gap: 11px; color: #989a98; font-size: 9px; font-weight: 600; letter-spacing: .12em; }
.file-acceptance i, .format-strip i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.selection-view, .progress-view, .result-view, .error-view { min-height: 322px; }
.selection-header { display: flex; align-items: start; justify-content: space-between; padding: 8px 6px 22px; }
.selection-kicker, .progress-kicker { margin: 0 0 7px; color: #969895; font-size: 9px; font-weight: 600; letter-spacing: .17em; }
.selection-header h2, .progress-view h2, .result-view h2, .error-view h2 { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: -.045em; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.icon-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.file-list { max-height: 145px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.file-item { min-height: 63px; padding: 10px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: #f8f8f5; }
.file-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 700; }
.file-meta { min-width: 0; flex: 1; }
.file-meta strong { display: block; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.file-meta span { color: #949694; font-size: 10px; }
.conversion-options { margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; }
.conversion-options legend { margin: 0 0 8px; padding: 0; color: #969895; font-size: 9px; font-weight: 600; letter-spacing: .15em; }
.strategy-option { min-height: 68px; padding: 12px 14px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #f8f8f5; cursor: pointer; transition: border-color 180ms ease, background 180ms ease; }
.strategy-option:hover { border-color: rgba(40,100,255,.42); }
.strategy-option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.strategy-option.is-unavailable { border-color: var(--line); background: #f3f3f0; color: #969895; cursor: not-allowed; }
.strategy-option.is-unavailable:hover { border-color: var(--line); }
.strategy-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.strategy-option span { min-width: 0; }
.strategy-option strong, .strategy-option small { display: block; }
.strategy-option strong { margin-bottom: 4px; font-size: 12px; font-weight: 500; }
.strategy-option small { color: #858885; font-size: 9px; line-height: 1.35; }
.engine-badge { margin-left: 5px; padding: 2px 5px; border-radius: 999px; background: #e6e6e1; color: #777a77; font-size: 7px; font-weight: 600; letter-spacing: .08em; vertical-align: 1px; }
.engine-badge.is-ready { background: #dff5e9; color: #11865a; }
.engine-badge.is-unavailable { background: #eee4e1; color: #a64b39; }
.engine-status { grid-column: 1 / -1; margin: 1px 2px 0; color: #858885; font-size: 9px; line-height: 1.45; }
.convert-button { width: 100%; min-height: 56px; padding: 0 21px; display: flex; align-items: center; justify-content: center; gap: 11px; border: 0; border-radius: 15px; background: var(--accent); color: white; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: 0 12px 28px rgba(40,100,255,.24); transition: transform 180ms ease, background 180ms ease; }
.convert-button:hover { background: #164fe0; transform: translateY(-1px); }
.convert-button:disabled { background: #b9bcc1; cursor: not-allowed; box-shadow: none; transform: none; }
.convert-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.conversion-note { margin: 13px 0 0; color: #999b99; font-size: 9px; text-align: center; }
.progress-view, .result-view, .error-view { padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.orb { width: 88px; height: 88px; margin-bottom: 23px; }
.orb svg { width: 100%; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; animation: rotate 2.4s linear infinite; }
.orb circle { stroke: #e6e8e7; stroke-dasharray: 48 16; }
.orb path { animation: reverseRotate 2.4s linear infinite; transform-origin: center; }
.progress-track { width: min(370px, 90%); height: 3px; margin-top: 30px; overflow: hidden; border-radius: 99px; background: #e4e5e2; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 500ms ease; }
#progress-percent { margin: 10px 0 0; color: #979997; font-size: 10px; font-variant-numeric: tabular-nums; }
.success-mark, .error-mark { width: 66px; height: 66px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 50%; background: #e4f7ee; color: #11945f; }
.success-mark svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-name { max-width: 90%; margin: 10px 0 24px; overflow: hidden; color: #7a7c7a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.result-view .convert-button { max-width: 390px; }
.text-button { margin-top: 17px; border: 0; background: transparent; color: #777a77; font-size: 11px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.error-mark { background: #fff0ec; color: #d5442e; font-weight: 600; }
#error-message { max-width: 530px; margin: 12px 0 25px; color: #777a77; font-size: 12px; line-height: 1.6; }
.error-view .convert-button { max-width: 280px; }

.format-strip { margin: 39px auto 0; display: flex; justify-content: center; align-items: center; gap: 16px; color: #9b9d9a; font-size: 9px; font-weight: 600; letter-spacing: .16em; }
.reveal { animation: reveal .8s cubic-bezier(.2,.75,.3,1) backwards; }
.reveal-delay-1 { animation-delay: .08s; }
.reveal-delay-2 { animation-delay: .16s; }
.reveal-delay-3 { animation-delay: .24s; }
@keyframes reveal { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes reverseRotate { to { transform: rotate(-360deg); } }

@media (max-width: 820px) {
  .site-header { height: 72px; }
  .hero { padding-top: 126px; }
  .hero h1 { font-size: clamp(50px, 13vw, 72px); line-height: 1.045; letter-spacing: -.01em; }
  .hero-copy { margin-top: 25px; }
  .converter-topline { display: block; padding: 12px; }
  .mode-tabs { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .mode-tab { padding: 12px 6px; font-size: 11px; }
  .local-note { display: none; }
}

@media (max-width: 540px) {
  .site-header { padding: 0 20px; }
  .brand-logo { width: 132px; }
  .nav-action { padding: 9px 12px; font-size: 10px; }
  .hero { padding: 120px 12px 50px; }
  .hero h1 { font-size: 14.8vw; line-height: 1.05; letter-spacing: -.008em; }
  .hero-copy { padding: 0 18px; font-size: 14px; }
  .converter-shell { border-radius: 24px; }
  .mode-tab { font-size: 10px; }
  .workspace { min-height: 350px; padding: 12px; }
  .drop-zone { min-height: 326px; padding: 35px 16px; }
  .selection-view, .progress-view, .result-view, .error-view { min-height: 326px; }
  .selection-header { padding: 14px 6px 20px; }
  .selection-header h2, .progress-view h2, .result-view h2, .error-view h2 { font-size: 22px; }
  .conversion-options { grid-template-columns: 1fr; }
  .strategy-option { min-height: 60px; }
  .format-strip { gap: 9px; font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
