/* ============================================================
   AVEC — Homepage rework (loaded only on index.html)
   Builds on styles.css tokens & components. Tekiyo direction:
   white/blue, mixed-weight display, glass surfaces, the blue
   "current line" signature, generous editorial spacing.
   Token-driven → light + dark themes both correct.
   ============================================================ */

/* Grid/flex children must be allowed to shrink below content size,
   otherwise long words (e.g. "vidéosurveillance") force overflow. */
.rx-hero, .rx-method, .rx-zone, .rx-feature, .rx-bento, .rx-stats { min-width: 0; }
.rx-hero > *, .rx-method > *, .rx-zone > *, .rx-feature > *,
.rx-bento > *, .rx-stat, .rx-tl-step, .rx-tl-body { min-width: 0; }
.rx-h1, .rx-lead, .rx-sub, .rx-feature-body p, .rx-tl-body p, .rx-cardlet p { overflow-wrap: break-word; }

/* Shared surface recipe */
.rx-glass {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

/* ---------- HERO ---------------------------------------- */
.rx-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
  padding: 56px 0 40px;
}

.rx-h1 {
  margin: 18px 0 0;
  max-width: 16ch;
  font-size: clamp(2.9rem, 6.4vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 700;
  overflow-wrap: break-word;
}

.rx-lead {
  max-width: 54ch;
  margin: 24px 0 0;
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--muted);
}

.rx-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 32px 0 24px;
}

.rx-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}
.rx-hero-meta strong { color: var(--text); font-weight: 800; }
.rx-sep {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Hero visual + floating glass badges */
.rx-hero-visual {
  position: relative;
  padding: 18px 14px;
}
.rx-hero-img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  object-position: center;
  border-radius: 30px;
  border: 1px solid var(--white-soft);
  box-shadow: 0 40px 90px rgba(3, 8, 26, 0.38);
}

.rx-glass-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--navbar-bg);
  box-shadow: 0 18px 50px rgba(3, 8, 26, 0.30);
  backdrop-filter: blur(20px);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
}
.rx-badge-rating { top: 34px; left: -10px; flex-direction: column; align-items: flex-start; gap: 2px; }
.rx-badge-rating .rx-stars { color: var(--accent); letter-spacing: 0.1em; font-size: 0.92rem; }
.rx-badge-rating .rx-badge-text { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.rx-badge-rating strong { color: var(--text); font-family: "Space Grotesk", sans-serif; font-size: 1rem; }
.rx-badge-spec { bottom: 34px; right: -8px; color: var(--accent-soft); }
html[data-theme="light"] .rx-badge-spec { color: var(--accent); }
.rx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px var(--accent);
}

/* ---------- HERO STATS BAND ----------------------------- */
.rx-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 8px 0 8px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.rx-stat {
  padding: 26px 24px;
  border-left: 1px solid var(--line);
}
.rx-stat:first-child { border-left: 0; }
.rx-stat strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(118deg, var(--accent-soft), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .rx-stat strong {
  background: linear-gradient(118deg, var(--accent), var(--accent-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rx-stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 0.92rem; }

/* ---------- SECTION HEAD -------------------------------- */
.rx-section-head { max-width: 720px; margin-bottom: 38px; }
.rx-section-head h2 {
  margin: 14px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.rx-sub { margin: 16px 0 0; max-width: 60ch; color: var(--muted); line-height: 1.7; font-size: 1.02rem; }

/* ---------- SERVICES BENTO ------------------------------ */
.rx-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.rx-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.rx-feature:hover { border-color: var(--cta-border); box-shadow: 0 34px 80px rgba(3,8,26,0.30); }
.rx-feature-media img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--white-soft);
}
.rx-feature-body { padding: 8px 22px 8px 4px; }
.rx-feature-body h3 {
  margin: 16px 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}
.rx-feature-body p { color: var(--muted); line-height: 1.7; margin: 0; }

.rx-num {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--accent-soft);
  background: var(--cta-bg);
  border: 1px solid var(--cta-border);
  box-shadow: inset 0 0 22px rgba(46,107,255,0.16);
}
html[data-theme="light"] .rx-num { color: var(--accent); }

.rx-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.rx-tags li {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--trust-bg);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.rx-cardlet {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.rx-cardlet::after {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.rx-cardlet:hover { border-color: var(--cta-border); box-shadow: 0 30px 70px rgba(3,8,26,0.30); }
.rx-cardlet:hover::after { opacity: 1; }
.rx-cardlet-media { margin-bottom: 16px; border-radius: 16px; overflow: hidden; }
.rx-cardlet-media img { width: 100%; height: 160px; object-fit: cover; display: block; }
.rx-cardlet .rx-num { width: 42px; height: 42px; border-radius: 12px; font-size: 0.92rem; }
.rx-cardlet h3 {
  margin: 14px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.rx-cardlet p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 0.95rem; }

/* ---------- METHODE TIMELINE ---------------------------- */
.rx-method {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 56px;
  align-items: start;
}
.rx-method-head { position: sticky; top: 96px; }
.rx-method-head h2 {
  margin: 14px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.rx-method-cta { margin-top: 26px; }

.rx-timeline { position: relative; margin: 0; padding: 0 0 0 8px; list-style: none; }
.rx-timeline::before {
  content: "";
  position: absolute;
  left: 34px; top: 12px; bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--accent), var(--accent-soft), transparent);
  opacity: 0.6;
}
.rx-tl-step {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 22px;
  align-items: start;
  padding: 18px 0;
}
.rx-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-soft);
  background: var(--bg);
  border: 1px solid var(--cta-border);
  box-shadow: 0 0 0 6px var(--bg), 0 0 28px rgba(46,107,255,0.22);
}
html[data-theme="light"] .rx-node { color: var(--accent); }
.rx-tl-body { padding-top: 6px; }
.rx-tl-body h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.rx-tl-body p { margin: 0; color: var(--muted); line-height: 1.7; }

/* ---------- ZONE ---------------------------------------- */
.rx-zone {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 44px;
  align-items: center;
  padding: 8px 0;
}
.rx-zone-copy h2 {
  margin: 14px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.rx-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.rx-chips span {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--trust-bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.rx-chips span:hover { border-color: var(--cta-border); background: var(--cta-bg); }
.rx-zone-map {
  padding: 14px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface-tint));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.rx-zone-map img { width: 100%; border-radius: 20px; display: block; }

/* ---------- RESPONSIVE ---------------------------------- */
@media (max-width: 1024px) {
  .rx-hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .rx-hero-img { height: 380px; }
  .rx-method { grid-template-columns: 1fr; gap: 32px; }
  .rx-method-head { position: static; }
  .rx-zone { grid-template-columns: 1fr; gap: 28px; }
  .rx-feature { grid-template-columns: 1fr; }
  .rx-feature-media img { height: 260px; }
  .rx-bento { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .rx-bento { grid-template-columns: 1fr 1fr; }
  .rx-stats { grid-template-columns: repeat(2, 1fr); }
  .rx-stat:nth-child(3) { border-left: 0; }
  .rx-stat:nth-child(odd) { border-left: 0; }
  .rx-stat:nth-child(even) { border-left: 1px solid var(--line); }
  .rx-stat:nth-child(3), .rx-stat:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .rx-bento { grid-template-columns: 1fr; }
  .rx-h1 { font-size: clamp(2.2rem, 9vw, 2.85rem); max-width: none; letter-spacing: -0.04em; }
  .rx-hero-img { height: 300px; }
  .rx-badge-rating { left: 0; }
  .rx-badge-spec { right: 0; }
  .rx-tl-step { grid-template-columns: 48px 1fr; gap: 16px; }
  .rx-node { width: 48px; height: 48px; font-size: 1.2rem; }
  .rx-timeline::before { left: 30px; }
}

/* Reduced motion: drop hover/line transitions */
@media (prefers-reduced-motion: reduce) {
  .rx-cardlet, .rx-cardlet::after, .rx-feature, .rx-chips span { transition: none; }
}
