/* ============================================================
   OLScan — base.css
   Layout cartographique partagé. Les couleurs/textures sont
   définies par feuille dans variants.css via les variables.
   ============================================================ */

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

:root {
  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.22,.61,.36,1);
  --font: 'Archivo', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

a { color: inherit; text-decoration: none; }

/* texture papier / grille — appliquée au body par variante */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--tex-opacity, 1);
  background-image: var(--tex);
  background-size: var(--tex-size, 26px 26px);
  transition: opacity .5s var(--ease);
}

/* ── repères de coupe (crop marks) ── */
.crop {
  position: fixed;
  width: 14px; height: 14px;
  z-index: 60;
  pointer-events: none;
  border-color: var(--ink);
  opacity: .35;
  mix-blend-mode: var(--crop-blend, normal);
}
.crop.tl { top: 46px; left: 14px; border-top: 1.5px solid; border-left: 1.5px solid; }
.crop.tr { top: 46px; right: 14px; border-top: 1.5px solid; border-right: 1.5px solid; }
.crop.bl { bottom: 14px; left: 14px; border-bottom: 1.5px solid; border-left: 1.5px solid; }
.crop.br { bottom: 14px; right: 14px; border-bottom: 1.5px solid; border-right: 1.5px solid; }

/* ════════ SÉLECTEUR DE FEUILLE ════════ */
.sheet-bar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--bar-bg);
  color: var(--bar-ink);
  border-bottom: 1px solid var(--bar-line);
  backdrop-filter: blur(6px);
}
.sheet-bar-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 22px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .5px;
}
.sheet-bar-tag { opacity: .55; white-space: nowrap; }
.sheet-bar-meta { margin-left: auto; opacity: .45; white-space: nowrap; }
.sheet-tabs { display: flex; gap: 4px; }
.sheet-tab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3px;
  color: var(--bar-ink);
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  opacity: .5;
  transition: opacity .2s, background .2s, border-color .2s;
}
.sheet-tab b { color: var(--bar-accent); margin-right: 5px; font-weight: 700; }
.sheet-tab:hover { opacity: .85; }
.sheet-tab.is-active {
  opacity: 1;
  border-color: var(--bar-line);
  background: var(--bar-active);
}

/* ════════ NAV ════════ */
.nav {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--pad);
  max-width: 1340px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -.01em;
}
.nav-logo em {
  font-family: var(--mono);
  font-style: normal;
  font-size: .64rem;
  font-weight: 400;
  letter-spacing: .4px;
  opacity: .55;
  border-left: 1px solid var(--line);
  padding-left: 10px;
  margin-left: 1px;
}
.nav-logo .mark {
  width: 22px; height: 22px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: relative;
  flex: none;
}
.nav-logo .mark::before {
  content: ''; position: absolute; inset: 4px;
  border-radius: 50%;
  border: 1.5px solid var(--ochre);
}
.nav-logo .mark::after {
  content: ''; position: absolute;
  left: 50%; top: -4px; bottom: -4px;
  width: 1px; background: var(--accent);
  transform: translateX(-.5px);
}
.nav-right { display: flex; align-items: center; gap: 26px; }
.nav-link {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .3px;
  opacity: .7;
  transition: opacity .2s;
}
.nav-link:hover { opacity: 1; }
.nav-cta {
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 9px 18px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: transparent; color: var(--ink); }

/* ════════ HERO ════════ */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 104px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.topo-field {
  position: absolute;
  inset: -10% -5% -20% 30%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.topo-svg { width: 100%; height: 100%; display: block; }
.topo-svg path { fill: none; stroke: var(--contour); stroke-width: 1; }
.topo-svg path.major { stroke-width: 1.6; stroke: var(--contour-major); }

.hero-grid {
  position: relative;
  z-index: 2;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}
.hero-inner { max-width: 660px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--ochre-ink, var(--ochre));
  border: 1px solid var(--line);
  padding: 6px 13px;
  margin-bottom: 26px;
  background: var(--badge-bg, transparent);
}
.hero-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.35 } }

.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.025em;
  margin-bottom: 18px;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .q { color: var(--rust); }
.hero-tagline {
  font-family: var(--mono);
  font-size: clamp(.92rem, 1.6vw, 1.06rem);
  color: var(--muted);
  margin-bottom: 22px;
  padding-left: 14px;
  border-left: 2px solid var(--ochre);
}
.hero-body {
  font-size: 1.04rem;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 34px;
}
.hero-cta-group { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn-primary {
  font-weight: 700;
  font-size: .98rem;
  padding: 14px 28px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1px solid var(--accent);
  transition: transform .15s var(--ease), box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 -1px var(--accent-shadow); }
.btn-ghost {
  font-family: var(--mono);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--ink);
  transition: gap .2s;
}
.btn-ghost:hover { opacity: .7; }

/* fiche relevé (readout) */
.hero-readout {
  font-family: var(--mono);
  font-size: .76rem;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 18px;
  min-width: 220px;
  align-self: start;
}
.readout-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
}
.readout-row span { opacity: .5; }
.readout-row b { font-weight: 700; }
.readout-sep { height: 1px; background: var(--line); margin: 9px 0; }
.readout-note { font-size: .68rem; opacity: .5; line-height: 1.4; }

/* ════════ BANDE STATISTIQUES ════════ */
.stat-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--stat-bg);
  color: var(--stat-ink);
  border-bottom: 1px solid var(--line);
}
.stat-item {
  padding: 30px var(--pad);
  border-right: 1px solid var(--stat-line);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: var(--mono);
  font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  font-weight: 700;
  color: var(--stat-accent);
  line-height: 1;
  display: block;
  letter-spacing: -.02em;
}
.stat-num sup { font-size: .5em; }
.stat-label { font-size: .82rem; opacity: .72; margin-top: 9px; max-width: 220px; }

/* ════════ STRUCTURE SECTIONS ════════ */
.band { position: relative; z-index: 1; padding: clamp(56px, 8vw, 104px) 0; }
.section-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.section-head { max-width: 720px; margin-bottom: 14px; }
.section-label {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-label .lbl-rule {
  display: block;
  width: 38px; height: 1.5px;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .7s var(--ease);
}
.reveal.in .section-label .lbl-rule { transform: scaleX(1); }
h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.lead { font-size: 1.04rem; color: var(--muted); max-width: 660px; text-wrap: pretty; }

/* ── PROBLÈME ── */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 0;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.map-card {
  background: var(--card-bg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 30px 26px 32px;
  position: relative;
  transition: background .25s;
}
.map-card:hover { background: var(--card-hover); }
.map-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-top: 12px solid var(--accent);
  border-left: 12px solid transparent;
  opacity: 0;
  transition: opacity .25s;
}
.map-card:hover::after { opacity: 1; }
.card-idx {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .5px;
  display: block;
  margin-bottom: 14px;
}
.map-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 9px; line-height: 1.25; }
.map-card p { font-size: .92rem; color: var(--muted); }

/* ── MÉTHODE ── */
.methode-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
  margin-top: 46px;
}
.step {
  position: relative;
  padding: 34px 26px 30px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.step:hover { transform: translateY(-4px); box-shadow: 0 10px 0 -2px var(--accent-shadow); }
.step-station {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--on-accent);
  background: var(--accent);
  display: inline-block;
  padding: 3px 10px;
  margin-bottom: 16px;
}
.step h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 11px; line-height: 1.2; }
.step h3 .opt { font-family: var(--mono); font-size: .7rem; font-weight: 400; opacity: .5; }
.step p { font-size: .93rem; color: var(--muted); }
.step-detail {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  line-height: 1.5;
}

/* ── PLACEHOLDERS MÉDIA ── */
.media-slot { margin-top: 46px; }
.media-slot .slot-img {
  display: block;
  width: 100%;
  height: var(--slot-h, 440px);
  border: 1.5px dashed var(--line-strong);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, var(--hatch) 11px 12px);
  font-family: var(--mono);
  color: var(--accent);
  cursor: pointer;
}
.media-slot.tall { display: block; }
.slot-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 11px;
}
.slot-ctl {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .4px;
  opacity: .72;
}
.slot-ctl output { min-width: 30px; color: var(--accent); }
.slot-ctl input[type=range] {
  width: 128px;
  height: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── VUE 3D OLS (pleine largeur) ── */
.ols-view {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #0e110a;
}
.ols-figure { position: relative; margin: 0; }
.ols-figure img { display: block; width: 100%; height: auto; }
.ols-cap {
  position: absolute;
  left: var(--pad);
  bottom: 24px;
  max-width: 540px;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.5;
  color: #f3efe2;
  background: rgba(18,21,13,.74);
  border: 1px solid rgba(243,239,226,.18);
  padding: 13px 17px;
  backdrop-filter: blur(5px);
}
.ols-tag { display: block; color: var(--ochre); letter-spacing: .6px; margin-bottom: 5px; }
.media-slot figcaption {
  font-family: var(--mono);
  font-size: .72rem;
  opacity: .6;
  padding-left: 2px;
}

/* ── RÉFÉRENCE ── */
.ref-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  margin-top: 44px;
  align-items: stretch;
}
.ref-block {
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 34px;
}
.ref-header {
  display: flex; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; align-items: flex-start;
  padding-bottom: 22px; margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.ref-title { font-size: 1.16rem; font-weight: 700; line-height: 1.2; }
.ref-sub { font-family: var(--mono); font-size: .78rem; opacity: .6; margin-top: 6px; }
.ref-stamp {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--rust);
  border: 1.5px solid var(--rust);
  padding: 7px 12px;
  transform: rotate(-3deg);
  white-space: nowrap;
}
.ref-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 18px;
}
.ref-stat .n {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -.02em;
}
.ref-stat .l { font-size: .82rem; opacity: .68; margin-top: 6px; }
.ref-livrables { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.ref-livrables p {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .8px;
  text-transform: uppercase;
  opacity: .55;
  margin-bottom: 12px;
}
.ref-livrables ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ref-livrables ul li {
  font-family: var(--mono);
  font-size: .76rem;
  border: 1px solid var(--line);
  padding: 5px 11px;
  color: var(--accent);
}

/* ── OFFRES ── */
.offres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
  gap: 22px;
  margin-top: 46px;
}
.offre {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 30px 26px 32px;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.offre:hover { transform: translateY(-4px); box-shadow: 0 12px 0 -3px var(--accent-shadow); }
.offre.featured { border-color: var(--accent); border-width: 1.5px; background: var(--card-feature); }
.offre-flag {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: translateY(-100%);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-align: center;
  color: var(--on-accent);
  background: var(--accent);
  padding: 5px;
}
.offre-top { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.offre-ref { font-family: var(--mono); font-size: .7rem; letter-spacing: 1px; color: var(--accent); }
.offre h3 { font-size: 1.18rem; font-weight: 800; letter-spacing: -.01em; }
.offre-price {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin: 14px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.offre-price span { font-size: .74rem; font-weight: 400; opacity: .55; letter-spacing: .3px; }
.offre > p { font-size: .9rem; color: var(--muted); margin-bottom: 20px; min-height: 60px; }
.offre ul { list-style: none; }
.offre ul li {
  font-size: .88rem;
  color: var(--muted);
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.offre ul li:last-child { border-bottom: none; }
.offre ul li::before {
  content: '';
  position: absolute;
  left: 0; top: 14px;
  width: 9px; height: 9px;
  border: 1.5px solid var(--accent);
  transform: rotate(45deg);
}

/* ── RÉGLEMENTAIRE ── */
.reglo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 30px 26px;
  margin-top: 44px;
}
.reglo-item { position: relative; padding-left: 16px; border-left: 2px solid var(--accent); }
.reglo-ix { font-family: var(--mono); font-size: .72rem; color: var(--accent); display: block; margin-bottom: 8px; }
.reglo-item h4 { font-size: .98rem; font-weight: 700; margin-bottom: 7px; line-height: 1.25; }
.reglo-item p { font-size: .86rem; color: var(--muted); }

/* ── CONTACT ── */
.contact-inner { max-width: 660px; margin: 0 auto; text-align: center; }
.contact-inner .section-label { justify-content: center; }
.contact-inner h2 { margin-bottom: 12px; }
.contact-intro { color: var(--muted); font-size: 1.04rem; margin-bottom: 36px; }
.contact-box {
  position: relative;
  background: var(--contact-bg);
  color: var(--contact-ink);
  border: 1px solid var(--contact-line);
  padding: 48px 40px;
  text-align: center;
  overflow: hidden;
}
.contact-coord {
  position: absolute;
  top: 14px; right: 16px;
  font-family: var(--mono);
  font-size: .68rem;
  opacity: .4;
}
.contact-box h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.contact-box > p { opacity: .72; margin-bottom: 30px; max-width: 460px; margin-inline: auto; font-size: .95rem; }
.contact-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.contact-link {
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 13px 22px;
  border: 1px solid var(--contact-link-line);
  transition: background .2s, color .2s, transform .15s;
}
.contact-link:hover { transform: translateY(-2px); }
.contact-link.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.contact-link:not(.primary):hover { background: var(--contact-link-hover); }

/* ── FOOTER ── */
.footer {
  position: relative;
  z-index: 1;
  background: var(--footer-bg);
  color: var(--footer-ink);
  border-top: 1px solid var(--line);
}
.footer-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 26px var(--pad);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: .74rem;
  opacity: .8;
}
.footer-left { display: flex; align-items: center; gap: 12px; }
.footer-logo { font-family: var(--font); font-weight: 800; font-size: 1rem; color: var(--accent); }
.footer-right { display: flex; gap: 16px; flex-wrap: wrap; opacity: .8; }
.footer-right a:hover { color: var(--accent); }

/* ════════ ANIMATIONS REVEAL ════════ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.problem-grid .map-card.reveal,
.methode-steps .step.reveal,
.offres-grid .offre.reveal,
.reglo-grid .reglo-item.reveal { transition-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-badge .dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ════════ RESPONSIVE ════════ */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-readout { display: none; }
  .topo-field { inset: -10% -20% -10% 20%; opacity: .6; }
  .stat-bar { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(1), .stat-item:nth-child(2) { border-bottom: 1px solid var(--stat-line); }
  .ref-layout { grid-template-columns: 1fr; }
  .ref-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .sheet-bar-tag, .sheet-bar-meta { display: none; }
  .sheet-bar-inner { justify-content: center; }
  .nav-right .nav-link { display: none; }
  .stat-bar { grid-template-columns: 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--stat-line); }
  .ref-stats { grid-template-columns: 1fr; }
  .ols-cap { position: static; left: auto; bottom: auto; max-width: none; backdrop-filter: none; }
}
