:root {
  --cream: #faf6f0;
  --cream-deep: #f3ede4;
  --border: #e8e0d8;
  --burgundy: #7d1f26;
  --burgundy-hover: #6a1a20;
  --burgundy-dark: #5a1520;
  --charcoal: #1c1917;
  --charcoal-light: #44403c;
  --muted: #6b645d;
  --gold: #e8c96a;
  --surface: #ffffff;
  --focus: #1d4ed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 8px 24px rgba(28, 25, 23, 0.06);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #1a1613;
    --cream-deep: #221d19;
    --border: #3a322c;
    --burgundy: #c2565e;
    --burgundy-hover: #d06a71;
    --burgundy-dark: #e08a90;
    --charcoal: #f4eee6;
    --charcoal-light: #d8cfc4;
    --muted: #a39a90;
    --surface: #25201c;
    --focus: #8ab4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1120px, 100% - 32px); margin-inline: auto; }

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

.demo-banner {
  background: var(--burgundy-dark);
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  padding: 6px 16px;
}

/* Header */
.site-header { background: var(--cream); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; color: var(--burgundy); text-decoration: none; }
.main-nav { display: flex; gap: 22px; margin-left: auto; font-size: 0.95rem; }
.main-nav a { text-decoration: none; color: var(--charcoal-light); }
.main-nav a:hover { color: var(--burgundy); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 12px 24px;
  font: 600 0.95rem var(--font-body); cursor: pointer; text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn-primary { background: var(--burgundy); color: #fff; }
.btn-primary:hover { background: var(--burgundy-hover); }
.btn-primary:disabled { opacity: 0.65; cursor: progress; }
.btn-ghost { background: transparent; color: var(--charcoal-light); }
.btn-ghost:hover { color: var(--burgundy); }
.btn-small { padding: 9px 18px; font-size: 0.9rem; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--charcoal); }
.btn-secondary:hover { border-color: var(--burgundy); }

/* Hero */
.hero { padding: 56px 0 40px; background: linear-gradient(180deg, var(--cream-deep), var(--cream)); }
.hero-inner { max-width: 820px; text-align: center; }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--burgundy); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-weight: 700; }
.hero-lead { margin: 16px auto 28px; color: var(--charcoal-light); max-width: 600px; font-size: 1.05rem; }

.ai-search {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 14px; text-align: left;
}
.ai-search:focus-within { border-color: var(--burgundy); }
.ai-search textarea {
  width: 100%; border: 0; resize: none; background: transparent; color: var(--charcoal);
  font: 400 1.05rem/1.5 var(--font-body); padding: 8px 10px;
}
.ai-search textarea:focus { outline: none; }
.ai-search textarea::placeholder { color: var(--muted); }
.ai-search-bar { display: flex; align-items: center; gap: 12px; padding: 4px 4px 0; flex-wrap: wrap; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 500;
  color: var(--burgundy); background: var(--cream-deep); border-radius: 999px; padding: 5px 11px;
}
.char-count { font-size: 0.78rem; color: var(--muted); margin-left: auto; }

.examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 18px; }
.examples-label { font-size: 0.85rem; color: var(--muted); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--charcoal-light); border-radius: 999px;
  padding: 7px 14px; font: 500 0.85rem var(--font-body);
}
.chip-example { cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease; }
.chip-example:hover { border-color: var(--burgundy); color: var(--burgundy); }

/* Results */
.results { padding: 12px 0 56px; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 14px; }
.results-head h2 { font-size: 2rem; }
.results-message { color: var(--charcoal-light); }

.criteria { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 22px; min-height: 8px; }
.criteria-label { font-size: 0.85rem; color: var(--muted); margin-right: 4px; }
.chip-criterion { background: var(--cream-deep); border-color: transparent; color: var(--charcoal); }
.chip-criterion button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0 2px; border-radius: 50%;
}
.chip-criterion button:hover { color: var(--burgundy); }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }

.listing {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); animation: rise 0.35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.listing-photo {
  aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--cream-deep), var(--border));
  display: grid; place-items: center; color: var(--muted); position: relative;
}
.listing-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.listing-bail {
  position: absolute; top: 10px; left: 10px; background: var(--burgundy); color: #fff;
  font-size: 0.75rem; font-weight: 600; border-radius: 999px; padding: 4px 10px;
}
.listing-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.listing-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.listing-place { color: var(--muted); font-size: 0.9rem; }
.listing-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.9rem; color: var(--charcoal-light); }
.listing-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.75rem; background: var(--cream-deep); border-radius: 999px; padding: 3px 10px; color: var(--charcoal-light); }
.tag-match { background: #e7f3ea; color: #1f6b3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-match { background: #1d3a29; color: #9fe0b5; } }
.listing-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }
.listing-price { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--burgundy); }
.listing-price small { font: 400 0.8rem var(--font-body); color: var(--muted); }
.listing-link { font-size: 0.9rem; font-weight: 600; color: var(--burgundy); }

/* Niveau de correspondance, écarts et conseil */
.listing-level { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; }
.level-exact { color: #1f6b3a; }
.level-near { color: #9a5b00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .level-exact { color: #9fe0b5; }
  :root:not([data-theme="light"]) .level-near { color: #f0c46c; }
}
.listing-gaps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.85rem; }
.listing-gaps li { color: var(--charcoal-light); padding-left: 16px; position: relative; }
.listing-gaps li::before { content: "△"; position: absolute; left: 0; color: #9a5b00; font-size: 0.7rem; top: 2px; }
.listing-demo {
  position: absolute; top: 10px; right: 10px; background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); font-size: 0.7rem; font-weight: 500; border-radius: 999px; padding: 3px 9px;
}
.advice {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px;
}
.advice-opinion { margin: 8px 0 0; color: var(--charcoal); line-height: 1.6; }
.advice-pending { color: var(--muted); font-style: italic; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
.advice ul { margin: 8px 0 0; padding-left: 18px; color: var(--charcoal-light); display: grid; gap: 4px; }

/* Skeletons */
.skeleton { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.skeleton div { background: linear-gradient(90deg, var(--cream-deep), var(--border), var(--cream-deep)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skeleton .sk-photo { aspect-ratio: 16 / 10; }
.skeleton .sk-line { height: 14px; margin: 14px 16px 0; border-radius: 6px; }
.skeleton .sk-line.short { width: 45%; margin-bottom: 18px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.results-state { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.results-state h3 { font-size: 1.6rem; margin-bottom: 8px; }
.results-state p { color: var(--charcoal-light); margin-bottom: 16px; }
.results-state .examples { margin-top: 0; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--cream-deep); }
.section-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 28px; text-align: center; }
.cards-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.info-card h3 { font-size: 1.6rem; margin-bottom: 6px; color: var(--burgundy); }
.info-tag { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.steps { max-width: 640px; margin: 0 auto; padding-left: 22px; display: grid; gap: 12px; color: var(--charcoal-light); }

.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 0.85rem; color: var(--muted); }
.footer-inner { display: grid; gap: 6px; }

@media (max-width: 820px) {
  .main-nav { display: none; }
  .header-actions { margin-left: auto; }
  .header-actions .btn-ghost { display: none; }
  .hero { padding: 36px 0 28px; }
  .ai-search-bar .btn { width: 100%; }
  .char-count { margin-left: 0; }
}

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