/* landing.css — Page d'accueil RM.
   Styles isolés, chargés uniquement par index.html. */

:root {
  --bg: #F8F4EC;
  --surface: #FFFDF8;
  --ink: #211D18;
  --muted: #6F675C;
  --line: #E9E1D3;
  --gold: #C79A30;
  --gold-soft: #D8AD55;
  --tint: #F1EADB;
  --radius: 10px;
  --measure: 760px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

a { color: inherit; }

::selection { background: var(--gold); color: #FFFDF8; }

/* ---------- Header ---------- */

.rm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: #263544;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rm-brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gold);
  text-decoration: none;
  line-height: 1;
}

.rm-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.rm-nav a {
  color: #e6ecf2;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.rm-nav a:hover { color: var(--gold); }

.rm-nav a.rm-login { color: #aebccb; }

.rm-nav .rm-logout {
  border: 1px solid #aebccb;
  background: transparent;
  color: #aebccb;
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.rm-nav .rm-logout:hover { color: #fff; border-color: #fff; }

.rm-beta-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--gold-soft);
  border-radius: 4px;
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.rm-menu-btn {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #e6ecf2;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
}

/* ---------- Héros (écran 1) ---------- */

.rm-hero {
  min-height: calc(100svh - 70px);
  display: flex;
  flex-direction: column;
}

.rm-hero-row {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 640px) minmax(240px, 1fr);
  grid-template-areas: "houses center ranking";
  align-items: center;
  column-gap: clamp(28px, 4vw, 64px);
  row-gap: 44px;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 56px) 24px;
}

.rm-hero-inner {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 640px;
  min-width: 0;
  margin: 0 auto;
}

.rm-hero-side {
  min-width: 0;
}

.rm-hero-side--houses { grid-area: houses; }
.rm-hero-side--ranking { grid-area: ranking; }

.rm-hero-side-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--muted);
}

.rm-hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.rm-hero-subtitle {
  margin: 20px 0 0;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 500;
}

.rm-hero-note {
  margin: 10px 0 0;
  color: var(--muted);
}

.rm-search {
  width: min(640px, 100%);
  margin-top: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 6px 6px 16px;
  box-shadow: 0 1px 2px rgba(24, 40, 58, 0.04);
}

.rm-search:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(199, 154, 48, 0.14);
}

.rm-search-icon {
  flex: 0 0 auto;
  color: var(--muted);
}

.rm-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 13px 0;
}

.rm-search input::placeholder { color: #A79E91; }

.rm-search-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--gold);
  color: #fff;
  border-radius: 7px;
  padding: 11px 16px;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rm-search-submit:hover { background: var(--gold-soft); }

.rm-status {
  display: block;
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.rm-hero-hint {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.rm-purge-btn {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: transparent;
  color: #B42318;
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.rm-scroll-cue {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin: 0 0 18px;
  transition: color 0.15s ease;
}

.rm-scroll-cue:hover { color: var(--gold); }

.rm-scroll-cue .rm-scroll-arrow { font-size: 1rem; }

/* ---------- Sections ---------- */

.rm-section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

.rm-section--tint {
  max-width: none;
  background: var(--tint);
  padding-left: 0;
  padding-right: 0;
}

.rm-section-body {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: clamp(20px, 4vw, 56px);
  padding-right: clamp(20px, 4vw, 56px);
}

.rm-section-head { margin-bottom: 44px; }

.rm-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.rm-section-head p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.rm-section .rm-lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 620px;
}

.rm-section .rm-lede + .rm-lede { margin-top: 16px; }

/* Étapes « Comment ça marche » */

.rm-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.rm-steps li { display: flex; flex-direction: column; gap: 10px; }

.rm-step-num {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.rm-steps h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.3; }

.rm-steps p { margin: 0; color: var(--muted); }

/* Communauté — schéma sobre */

.rm-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 44px;
}

.rm-flow span { color: var(--ink); }

.rm-flow .rm-flow-arrow { color: var(--gold); }

/* Bêta / gratuit */

.rm-free-lead {
  margin: 40px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
}

.rm-free-title {
  margin: 32px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
}

.rm-free-points {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.rm-free-points li { padding-left: 18px; position: relative; }

.rm-free-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* Leaderboard */

.rm-ranking {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.rm-ranking li {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.rm-ranking li:first-child { border-top: 0; }

.rm-ranking-rank {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rm-ranking strong {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rm-ranking em {
  font-style: normal;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rm-more-link {
  display: inline-block;
  margin-top: 28px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.rm-more-link:hover { border-color: var(--gold); }

/* Maisons validées (bandeau latéral du héros) */

.rm-latest-houses {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.rm-house-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}

.rm-house-card:hover { border-color: var(--gold); }

.rm-house-thumb {
  flex: 0 0 76px;
  width: 76px;
  height: 58px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rm-house-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.rm-house-thumb-empty { font-size: 0.72rem; color: var(--muted); }

.rm-house-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.rm-house-info strong {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-house-info em { font-style: normal; color: var(--muted); font-size: 0.88rem; }

.rm-house-info small { color: var(--gold); font-size: 0.78rem; }

.rm-muted { color: var(--muted); font-size: 0.95rem; }

/* Nouveautés */

.rm-news {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.rm-news li {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 4px 32px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}

.rm-news li:first-child { border-top: 0; }

.rm-news time { color: var(--muted); font-size: 0.9rem; }

.rm-news h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.15rem; line-height: 1.3; }

.rm-news p { margin: 6px 0 0; color: var(--muted); grid-column: 2; }

/* Footer */

.rm-footer {
  border-top: 1px solid var(--line);
  padding: 48px clamp(20px, 4vw, 56px) 40px;
  text-align: center;
  color: var(--muted);
}

.rm-footer .rm-brand { font-size: 1.15rem; }

.rm-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin: 20px 0;
}

.rm-footer nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.rm-footer nav a:hover { color: var(--gold); }

.rm-footer-note { margin: 0; font-size: 0.85rem; }

/* Bouton retour en haut */

.rm-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24, 40, 58, 0.08);
  transition: background 0.15s ease, color 0.15s ease;
}

.rm-to-top:hover { background: var(--ink); color: #fff; }

/* Dialogue de bienvenue */

.rm-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
  max-width: 420px;
  width: calc(100vw - 28px);
  box-shadow: 0 12px 40px rgba(24, 40, 58, 0.12);
}

.rm-dialog::backdrop { background: rgba(24, 40, 58, 0.4); }

.rm-dialog h2 { margin: 0 0 10px; }

.rm-dialog p { color: var(--muted); }

.rm-btn-primary {
  margin-top: 8px;
  border: 0;
  background: var(--gold);
  color: #fff;
  border-radius: 7px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.rm-btn-primary:hover { background: var(--gold-soft); }

/* Apparition douce au scroll */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible { opacity: 1; transform: none; }

/* Ancres sous le header sticky */

section[id] { scroll-margin-top: 78px; }

/* ---------- Overlay de recherche ---------- */

.rm-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}

.rm-search-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  max-width: 520px;
}

.rm-search-scene {
  height: 180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rm-search-figure {
  overflow: visible;
}

.rm-search-person { transform-origin: 110px 48px; animation: rm-search-bob 1.6s ease-in-out infinite; }

.rm-search-arm { transform-origin: 100px 84px; animation: rm-search-sweep 1.6s ease-in-out infinite; }

.rm-search-house { animation: rm-search-house-pulse 1.6s ease-in-out infinite; }

@keyframes rm-search-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes rm-search-sweep {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-16deg); }
  75% { transform: rotate(16deg); }
}

@keyframes rm-search-house-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}

.rm-search-progress {
  position: relative;
  width: 120px;
  height: 120px;
}

.rm-search-ring {
  transform: rotate(-90deg);
  width: 120px;
  height: 120px;
}

.rm-search-ring-track {
  stroke: var(--line);
}

.rm-search-ring-fill {
  stroke: var(--gold);
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.35s ease;
}

.rm-search-progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.rm-search-overlay-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
}

.rm-search-overlay-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 24px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .rm-hero-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "center center"
      "houses ranking";
  }
}

@media (max-width: 820px) {
  .rm-steps { grid-template-columns: 1fr; gap: 32px; }
  .rm-news li { grid-template-columns: 1fr; gap: 4px; }
  .rm-news p { grid-column: 1; }
}

@media (max-width: 640px) {
  .rm-hero-row {
    grid-template-columns: 1fr;
    grid-template-areas: "center";
  }
  .rm-hero-side { display: none; }
}

@media (max-width: 700px) {
  .rm-header { flex-wrap: wrap; }
  .rm-menu-btn { display: inline-flex; }
  .rm-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0 4px;
  }
  .rm-nav.is-open { display: flex; }
  .rm-nav a { padding: 8px 0; }
  .rm-nav .rm-logout { margin-top: 8px; }
  .rm-to-top { right: 16px; bottom: 16px; }
  .rm-ranking li { grid-template-columns: 40px 1fr auto; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .rm-search-submit, .rm-more-link, .rm-to-top { transition: none; }
  .rm-search-person, .rm-search-arm, .rm-search-house { animation: none; }
  .rm-search-ring-fill { transition: none; }
}
