:root {
  --bg: #080b14;
  --panel: #101522;
  --panel-2: #151b2a;
  --panel-3: #1b2335;
  --text: #f7f9fc;
  --muted: #97a1b3;
  --line: rgba(255,255,255,.10);
  --accent: #7c8cff;
  --accent-2: #57d5ff;
  --ok: #4ed29b;
  --danger: #ff6f7d;
  --shadow: 0 24px 80px rgba(0,0,0,.34);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 5%, rgba(124,140,255,.16), transparent 30%),
    radial-gradient(circle at 90% 20%, rgba(87,213,255,.10), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

button:focus-visible, a:focus-visible, label:focus-within {
  outline: 3px solid rgba(124,140,255,.38);
  outline-offset: 3px;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #0b1020;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
}

.privacy-pill {
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(255,255,255,.035);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(420px, 1.12fr);
  gap: clamp(36px, 7vw, 92px);
  align-items: center;
  padding: 54px 0 72px;
}

.hero-copy h1 {
  margin: 10px 0 18px;
  max-width: 650px;
  font-size: clamp(46px, 6.4vw, 82px);
  line-height: .97;
  letter-spacing: -.055em;
}

.hero-copy h1 span {
  color: transparent;
  background: linear-gradient(135deg, #c4caff, #68ddff);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 20px);
}

.eyebrow {
  display: inline-block;
  color: #aab5ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
}

.converter-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -.02em;
}

.card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(78,210,155,.12);
}

.drop-zone {
  min-height: 260px;
  padding: 28px 20px;
  border: 1.5px dashed rgba(170,181,255,.4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  cursor: pointer;
  background: rgba(124,140,255,.045);
  transition: .2s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(124,140,255,.09);
  transform: translateY(-1px);
}

.upload-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,140,255,.2), rgba(87,213,255,.13));
  margin-bottom: 16px;
}

.upload-icon svg {
  width: 28px;
  fill: none;
  stroke: #d9ddff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-zone strong {
  font-size: 18px;
}

.drop-zone > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.secondary-button {
  margin-top: 18px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-3);
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
}

.file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.file-type {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(124,140,255,.14);
  color: #c8ceff;
  font-size: 11px;
  font-weight: 900;
}

.file-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.file-info strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-info span {
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.settings {
  margin: 18px 0;
}

.setting-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.setting-heading label {
  font-size: 13px;
  font-weight: 800;
}

.setting-heading span {
  color: var(--muted);
  font-size: 11px;
}

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

.quality-option {
  min-height: 76px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.quality-option span {
  display: block;
  font-weight: 800;
  font-size: 13px;
}

.quality-option small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.quality-option.active {
  border-color: rgba(124,140,255,.72);
  background: rgba(124,140,255,.12);
}

#quality { display: none; }

.primary-button, .download-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #08101b;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(87,213,255,.12);
}

.primary-button:disabled {
  opacity: .38;
  cursor: not-allowed;
  box-shadow: none;
}

.job-panel, .success-panel, .error-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.job-panel {
  padding: 16px;
  background: var(--panel-2);
}

.job-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.job-top > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.job-top span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.progress-track {
  height: 9px;
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

.job-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 9px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 0 0 10px;
  font-size: 12px;
}

.success-panel {
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  gap: 12px;
  background: rgba(78,210,155,.08);
  border-color: rgba(78,210,155,.18);
}

.success-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(78,210,155,.16);
  color: #7cf0bd;
  font-weight: 900;
}

.success-panel > div:nth-child(2) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.success-panel span {
  color: var(--muted);
  font-size: 12px;
}

.download-button {
  grid-column: 1 / -1;
  min-height: 46px;
  margin-top: 2px;
}

.error-panel {
  padding: 13px 14px;
  color: #ffc5cb;
  background: rgba(255,111,125,.08);
  border-color: rgba(255,111,125,.18);
  font-size: 13px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 0 88px;
}

.trust-grid article {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.025);
}

.mini-icon { font-size: 20px; }

.trust-grid h3 {
  margin: 12px 0 5px;
  font-size: 16px;
}

.trust-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.how-it-works {
  border-top: 1px solid var(--line);
  padding: 72px 0 86px;
}

.how-it-works h2 {
  margin: 7px 0 32px;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -.04em;
}

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

.steps > div {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.steps span {
  color: #9ea9ff;
  font-size: 12px;
  font-weight: 900;
}

.steps strong {
  display: block;
  margin-top: 18px;
  font-size: 17px;
}

.steps p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

footer {
  min-height: 76px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
    gap: 36px;
  }
  .hero-copy {
    max-width: 720px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    min-height: 64px;
  }

  .privacy-pill {
    font-size: 11px;
    padding: 7px 9px;
  }

  .hero {
    padding: 28px 0 54px;
    gap: 28px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .hero-copy p {
    font-size: 16px;
  }

  .converter-card {
    border-radius: 22px;
    padding: 14px;
  }

  .drop-zone {
    min-height: 210px;
    padding: 24px 14px;
  }

  .quality-grid {
    grid-template-columns: 1fr;
  }

  .quality-option {
    min-height: 58px;
  }

  .quality-option small {
    display: inline;
    margin-left: 5px;
  }

  .trust-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    padding-bottom: 60px;
  }

  .how-it-works {
    padding: 54px 0 60px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }
}

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