:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #efedf7;
  --text: #17141f;
  --muted: #6b6680;
  --border: #e2dfee;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-text: #ffffff;
  --danger: #c2261f;
  --danger-bg: #fdecea;
  --shadow: 0 1px 2px rgb(23 20 31 / 6%), 0 8px 24px rgb(23 20 31 / 6%);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d15;
    --surface: #1a1722;
    --surface-2: #242030;
    --text: #f2f0f7;
    --muted: #a19cb3;
    --border: #2f2a3d;
    --accent: #9b6bff;
    --accent-hover: #ae88ff;
    --accent-text: #110c1d;
    --danger: #ff8a80;
    --danger-bg: #3a1714;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d15;
  --surface: #1a1722;
  --surface-2: #242030;
  --text: #f2f0f7;
  --muted: #a19cb3;
  --border: #2f2a3d;
  --accent: #9b6bff;
  --accent-hover: #ae88ff;
  --accent-text: #110c1d;
  --danger: #ff8a80;
  --danger-bg: #3a1714;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; }

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

/* En-tête */
.site-header {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand-mark { width: 32px; height: 32px; color: var(--accent); flex: none; }

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Bloc principal */
.hero { padding: 56px 0 28px; text-align: center; }
.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}

.search {
  display: flex;
  gap: 10px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}
.field { position: relative; flex: 1; min-width: 0; display: flex; }
.field input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 48px 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  outline: none;
}
.field input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--accent); }

.paste {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.paste:hover { background: var(--surface-2); color: var(--text); }
.paste svg { width: 22px; height: 22px; }

/* Boutons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .paste:focus-visible, summary:focus-visible, .brand:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: var(--radius); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); }
.btn[disabled] { cursor: progress; opacity: .85; }

.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 550;
  text-align: left;
}

/* Résultats */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.results.single { grid-template-columns: minmax(0, 420px); justify-content: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.media {
  position: relative;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.media video {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgb(0 0 0 / 62%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}

/* Publicités */
.ad { margin: 0 auto 32px; text-align: center; min-height: 90px; overflow: hidden; }
.ad-preview {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ad--result .ad-preview, .ad--bottom .ad-preview { min-height: 250px; }

/* FAQ */
.faq { margin: 24px 0 40px; }
.faq h2 { font-size: 22px; letter-spacing: -0.01em; margin: 0 0 12px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer;
  padding: 14px 28px 14px 0;
  font-weight: 620;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* Pied de page */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 24px 16px 32px;
  color: var(--muted);
  font-size: 14px;
}

/* Page texte */
.prose { padding-top: 40px; padding-bottom: 24px; }
.prose h1 { font-size: clamp(26px, 5vw, 34px); letter-spacing: -0.02em; margin: 0 0 20px; }
.prose h2 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }

@media (max-width: 560px) {
  .hero { padding: 36px 0 22px; }
  .hero h1 { margin-bottom: 22px; }
  .search { flex-direction: column; padding: 6px; }
  .btn-lg { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn.is-loading::after { animation-duration: 2s; }
}
