:root {
  color-scheme: dark;
  --bg: #0b0c12;
  --panel: #141620;
  --text: #f7f7fb;
  --muted: #a1a4b5;
  --line: #292b38;
  --accent: #d946ef;
  --accent2: #fb7185;
  --green: #6ee7b7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -20%, #352044 0, transparent 48%), var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100vh;
}

.top {
  height: 82px;
  max-width: 1120px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.4px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.7px;
  margin-top: 3px;
}

.logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #f97316, #e879f9 58%, #8b5cf6);
  color: white;
  font-size: 14px;
}

.theme,
.secondary,
.paste {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.theme {
  font-size: 19px;
  width: 43px;
  height: 43px;
}

main {
  max-width: 1040px;
  margin: auto;
  padding: 48px 24px 28px;
}

.hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #e879f9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 12px #6ee7b7;
}

h1 {
  font-size: clamp(38px, 7vw, 68px);
  line-height: 1.06;
  letter-spacing: -3px;
  margin: 22px 0 18px;
  font-weight: 850;
}

h1 span {
  background: linear-gradient(90deg, #f0abfc, #fb7185);
  background-clip: text;
  color: transparent;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 550px;
  margin: 0 auto;
}

.download-form {
  margin: 34px auto 0;
  display: flex;
  gap: 10px;
  padding: 8px;
  background: rgba(20, 22, 32, .86);
  border: 1px solid #363342;
  border-radius: 18px;
  box-shadow: 0 22px 70px #0004;
}

.url-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 0 8px 0 14px;
}

.url-wrap > span {
  font-size: 20px;
  color: #e879f9;
}

.url-wrap input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  width: 100%;
  min-width: 0;
  font-size: 14px;
  padding: 13px 0;
}

.url-wrap input::placeholder {
  color: #777b8e;
}

.paste {
  padding: 8px 11px;
  font-size: 12px;
}

.primary {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(110deg, #d946ef, #fb7185);
  color: white;
  font-weight: 800;
  padding: 0 20px;
  display: flex;
  gap: 24px;
  align-items: center;
  cursor: pointer;
  white-space: nowrap;
}

.primary:disabled {
  opacity: .6;
  cursor: wait;
}

.privacy {
  font-size: 11px;
  color: #85899b;
  margin-top: 15px;
}

.status {
  max-width: 800px;
  margin: 28px auto 0;
  padding: 15px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  color: var(--muted);
}

.status.error {
  border-color: #854d4d;
  color: #fecaca;
}

.status.success {
  border-color: #285d4a;
  color: #a7f3d0;
}

.hidden {
  display: none !important;
}

.results {
  margin: 62px auto 0;
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.results-head .eyebrow {
  justify-content: flex-start;
}

.results h2 {
  font-size: 28px;
  letter-spacing: -.8px;
  margin: 8px 0;
}

.caption {
  font-size: 13px;
  color: var(--muted);
  max-width: 700px;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.media-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 12px 34px #0002;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.media-card:hover {
  border-color: #604064;
  transform: translateY(-3px);
  box-shadow: 0 18px 42px #0004;
}

.preview {
  height: 220px;
  background: #20212d;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview img,
.preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview .no-preview {
  color: var(--muted);
  font-size: 12px;
}

.preview.video-preview {
  position: relative;
  height: auto;
  aspect-ratio: 9 / 16;
  max-height: 440px;
  padding: 10px;
  background: radial-gradient(ellipse at 50% 35%, #292039, #11121a 72%);
}

.preview.video-preview video {
  display: block;
  object-fit: contain;
  border-radius: 11px;
  background: #08090d;
  box-shadow: 0 8px 24px #0005;
}

.video-badge {
  position: absolute;
  top: 19px;
  left: 19px;
  z-index: 1;
  padding: 5px 8px;
  border: 1px solid #ffffff30;
  border-radius: 7px;
  background: #101019c9;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.media-meta {
  padding: 14px;
}

.media-meta strong {
  font-size: 13px;
  text-transform: capitalize;
}

.media-meta small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 11px;
}

.media-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.media-actions a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  padding: 10px 8px;
  color: white;
  background: #a21caf;
  transition: background .2s ease, border-color .2s ease;
}

.media-actions a:hover {
  background: #c026d3;
}

.media-actions a.open {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.media-actions a.open:hover {
  border-color: #77708a;
  background: #ffffff08;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 82px 0 52px;
}

.features article {
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #171722, #101119);
  padding: 22px;
  border-radius: 16px;
}

.features article > span {
  color: #e879f9;
  font-size: 11px;
  font-weight: 800;
}

.features h3 {
  font-size: 15px;
  margin: 17px 0 8px;
}

.features p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

footer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  color: #7f8292;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #777;
  border-top-color: #e879f9;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body.light {
  --bg: #f7f5fb;
  --panel: #fff;
  --text: #181522;
  --muted: #666577;
  --line: #e3dfe9;
  background: radial-gradient(ellipse at 50% -20%, #f5d0fe 0, transparent 50%), var(--bg);
}

body.light .download-form {
  background: #fff;
  box-shadow: 0 22px 70px #6b21f012;
}

body.light .features article {
  background: #fff;
}

body.light .url-wrap input {
  color: #181522;
}

body.light .preview.video-preview {
  background: radial-gradient(ellipse at 50% 35%, #e9ddf2, #d5d1df 72%);
}

body.light .video-badge {
  border-color: #ffffff70;
  background: #181522c9;
}

.secondary {
  font-weight: 750;
}

.secondary:disabled {
  opacity: .5;
}

@media (max-width: 650px) {
  main {
    padding: 34px 16px 24px;
  }

  .top {
    padding: 0 16px;
    height: 70px;
  }

  h1 {
    letter-spacing: -1.8px;
  }

  .sub {
    font-size: 14px;
  }

  .download-form {
    flex-direction: column;
    padding: 8px;
  }

  .url-wrap {
    min-height: 48px;
  }

  .primary {
    height: 48px;
    justify-content: center;
  }

  .features {
    grid-template-columns: 1fr;
    margin: 55px 0 36px;
  }

  .features article {
    padding: 18px;
  }

  .results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview {
    height: 200px;
  }

  .preview.video-preview {
    height: auto;
    max-height: 390px;
    padding: 7px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .media-card {
    border-radius: 12px;
  }

  .media-meta {
    padding: 10px;
  }

  .media-actions {
    flex-direction: column;
  }

  .media-actions a {
    padding: 9px;
  }

  .brand small {
    font-size: 8px;
  }

  .video-badge {
    top: 14px;
    left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
