:root {
  --bg: #080b16;
  --bg-2: #11172a;
  --purple: #8b5cf6;
  --blue: #06b6d4;
  --text: #ffffff;
  --muted: #9ca3af;
  --success: #22c55e;
  --danger: #fb7185;
  --warning: #fbbf24;
  --card: rgba(17, 23, 42, 0.72);
  --stroke: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --glow: 0 0 32px rgba(139, 92, 246, 0.35);
  --radius: 20px;
  --header: 72px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5fb;
  --bg-2: #ffffff;
  --text: #0b1020;
  --muted: #5b6475;
  --card: rgba(255, 255, 255, 0.82);
  --stroke: rgba(15, 23, 42, 0.1);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --glow: 0 0 24px rgba(139, 92, 246, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(139, 92, 246, 0.28), transparent 60%),
    radial-gradient(700px 380px at -10% 20%, rgba(6, 182, 212, 0.18), transparent 55%),
    var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}
p { margin: 0 0 0.9rem; }
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 999px;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.page { padding: 28px 0 64px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header);
  padding: 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--stroke);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 1.15rem;
}
.brand img { width: 40px; height: 40px; display: block; }
.nav-toggle, .theme-toggle, .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle { margin-left: auto; }
.nav {
  display: none;
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% + 8px);
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}
.site-header.is-open .nav { display: flex; }
.nav a {
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 550;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--purple) 22%, transparent);
  color: var(--text);
}

.hero { padding: 28px 0 8px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--purple) 16%, transparent);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
}
.hero h1, .page-title {
  font-size: clamp(2rem, 8vw, 4.2rem);
  max-width: 14ch;
}
.gradient-text {
  background: linear-gradient(120deg, var(--purple), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }

.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.downloader-card, .panel { padding: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.field span, label { font-weight: 600; }
input[type="url"], input[type="text"], input[type="email"], textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  color: var(--text);
}
textarea { min-height: 140px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
.field-error { color: var(--danger); font-size: 0.92rem; min-height: 1.2em; }

.actions, .share-row, .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn {
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
  line-height: 1;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: var(--glow);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border-color: var(--stroke);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--blue); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}
.btn-success { background: color-mix(in srgb, var(--success) 18%, var(--bg-2)); color: var(--text); border-color: color-mix(in srgb, var(--success) 45%, transparent); }

.trust-grid, .card-grid, .media-grid, .steps, .faq-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}
.trust-grid { list-style: none; padding: 0; }
.trust-item, .info-card, .media-card, .step, .gallery-card {
  padding: 16px;
}
a.info-card { color: inherit; text-decoration: none; display: block; }
a.info-card:hover { border-color: var(--blue); }
.trust-item i, .info-card i { color: var(--blue); font-size: 1.2rem; }
.trust-item strong, .info-card h3, .media-card h3 { display: block; margin-bottom: 4px; }
.muted, .fine { color: var(--muted); }
.fine { font-size: 0.92rem; }

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
}
.banner {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  margin: 12px 0;
}
.banner strong { display: block; }
.banner-error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.banner-warn { border-color: color-mix(in srgb, var(--warning) 55%, transparent); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.banner-ok { border-color: color-mix(in srgb, var(--success) 50%, transparent); background: color-mix(in srgb, var(--success) 12%, transparent); }

.preview {
  display: grid;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
}
.player-frame {
  width: min(100%, 320px);
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--stroke);
}
.player-frame iframe, .thumb {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}
.thumb-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 180px;
  color: var(--muted);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.25), rgba(6, 182, 212, 0.15));
}
.meta-list { list-style: none; padding: 0; margin: 0 0 12px; }
.meta-list li { margin: 4px 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.tag-list button, .chip {
  border: 1px solid var(--stroke);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}
.progress.is-indeterminate .progress-bar { width: 35%; animation: indeterminate 1.1s ease-in-out infinite; }

.site-footer {
  border-top: 1px solid var(--stroke);
  padding: 28px 16px 40px;
  color: var(--muted);
}
.footer-grid { display: grid; gap: 16px; width: min(1120px, 100%); margin: 0 auto 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.footer-links a { color: var(--text); text-decoration: none; }
.disclaimer, .copyright { width: min(1120px, 100%); margin: 8px auto; }
.slogan { color: var(--muted); }

.toast-region {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 70;
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6rem; }
.prose ul { padding-left: 1.2rem; }
details.faq {
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--card);
}
details.faq + details.faq { margin-top: 10px; }
details.faq summary { cursor: pointer; font-weight: 700; }
.guide {
  padding: 12px 14px;
  border-left: 3px solid var(--purple);
  background: color-mix(in srgb, var(--purple) 8%, transparent);
  border-radius: 0 14px 14px 0;
}

.gallery-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.gallery-grid { display: grid; gap: 12px; }
.gallery-card h3 { font-size: 1.05rem; }
.thumb-box {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  background: color-mix(in srgb, var(--purple) 18%, var(--bg));
  display: grid;
  place-items: center;
}
.thumb-box img, .thumb-box video { width: 100%; height: 100%; object-fit: cover; }
dialog {
  width: min(560px, calc(100% - 24px));
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--bg-2);
  color: var(--text);
  padding: 16px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.viewer-media { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }

.spinner {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  display: inline-block;
}
code, .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
