/* =========================================================
   Mathaël Mancini — site de conseil
   DA : claire et lumineuse (blanc chaud, lumière dorée),
   sobre et technique, un accent unique vert data.
   Aucune dépendance externe (polices système, zéro CDN).
   ========================================================= */

:root {
  --bg: #faf8f5;          /* blanc chaud */
  --bg-alt: #f3efe9;      /* section alternée, sable clair */
  --surface: #ffffff;
  --line: #e5dfd5;
  --fg: #201d18;
  --fg-muted: #625c51;
  --accent: #0e7a5f;      /* vert data profond, lisible sur clair */
  --accent-soft: #d9ede6;
  --gold: rgba(226, 178, 106, 0.22); /* halo lumière dorée */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  color: var(--fg);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 7px;
}

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

.nav-links a {
  color: var(--fg-muted);
  font-size: 15px;
}
.nav-links a:hover { color: var(--fg); text-decoration: none; }

/* ---------- Boutons ---------- */

.btn {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
  background: var(--surface);
  font-family: var(--sans);
}
.btn:hover { text-decoration: none; border-color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.btn-primary:hover { background: #0b6650; border-color: #0b6650; }

.btn-ghost { color: var(--fg-muted); background: transparent; }
.btn-ghost:hover { color: var(--fg); }

.btn-small { padding: 8px 16px; font-size: 14px; }

/* ---------- Hero ---------- */

.hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 560px at 78% 0%, var(--gold), transparent 65%),
    radial-gradient(800px 420px at 100% 55%, rgba(226, 178, 106, 0.14), transparent 60%),
    radial-gradient(700px 380px at -5% 100%, rgba(14, 122, 95, 0.07), transparent 60%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  align-items: center;
}

.hero-portrait {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(120, 90, 40, 0.18);
  aspect-ratio: 3 / 4;
  transform: rotate(1.2deg);
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.15;
  font-weight: 700;
  max-width: 20ch;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  margin-top: 22px;
  max-width: 62ch;
  color: var(--fg-muted);
  font-size: 18px;
}

.hero-ctas {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.metrics {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(60, 50, 30, 0.05);
}

.metrics > div {
  background: var(--surface);
  padding: 20px 22px;
}

.metrics dt {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}

.metrics dd {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

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

.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.section-index {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  margin-right: 10px;
  vertical-align: 2px;
}

.section-intro {
  color: var(--fg-muted);
  max-width: 62ch;
  margin-bottom: 44px;
}

/* ---------- Case studies ---------- */

.case {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 34px 36px;
  margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(60, 50, 30, 0.05);
}

.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.case-head h3 { font-size: 21px; }

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-tags span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
}

.case-shot {
  margin: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}

.case-shot img {
  width: 100%;
  display: block;
}

.case-shot figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.case-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.case-block h4 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}

.case-block p {
  font-size: 15px;
  color: var(--fg-muted);
}

/* ---------- Mini-démos interactives ---------- */

.mini-demo {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-alt);
  padding: 24px 26px;
}

.mini-demo-head h4 {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.mini-demo-head h4::before {
  content: "▶ ";
  font-size: 10px;
}

.mini-demo-head p {
  font-size: 14.5px;
  color: var(--fg-muted);
  max-width: 62ch;
  margin-bottom: 16px;
}

.demo-table-wrap { overflow-x: auto; }

.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.demo-table th, .demo-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.demo-table th {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}

.demo-table tbody tr:last-child td { border-bottom: none; }
.demo-table tr { transition: background 0.3s; }
.demo-table tr.row-ok { background: rgba(14, 122, 95, 0.05); }
.demo-table tr.row-ko { background: rgba(178, 60, 40, 0.07); }

.badge {
  font-family: var(--mono);
  font-size: 11.5px;
  border-radius: 999px;
  padding: 2px 9px;
}
.badge-wait { color: var(--fg-muted); background: var(--bg-alt); }
.badge-ok { color: var(--accent); background: var(--accent-soft); }
.badge-ko { color: #9c2f1d; background: #f7ddd6; }

.mini-demo-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.demo-result {
  font-size: 14px;
  color: var(--fg);
  max-width: 58ch;
  font-weight: 500;
}

.demo-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--mono);
}

.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.role-pill {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
  transition: all 0.15s;
}

.role-pill:hover { border-color: var(--accent); color: var(--fg); }

.role-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  font-size: 13.5px;
  font-weight: 600;
  transition: opacity 0.25s, transform 0.25s, border-color 0.25s;
}

.tile::before {
  content: "●";
  color: var(--accent);
  font-size: 9px;
  margin-right: 8px;
  vertical-align: 2px;
}

.tile.locked {
  opacity: 0.35;
  transform: scale(0.98);
  border-style: dashed;
}

.tile.locked::before { content: "🔒"; font-size: 11px; }

/* ---------- Lightbox ---------- */

.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(32, 29, 24, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 30px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Apparition douce ---------- */

.reveal-init {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-init.revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal-init { opacity: 1; transform: none; transition: none; }
}

.case-next {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--fg-muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
  background: transparent;
}

/* ---------- Offre ---------- */

.offer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.offer-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 26px 28px;
  box-shadow: 0 1px 3px rgba(60, 50, 30, 0.05);
}

.offer-card h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

.offer-card p {
  font-size: 14.5px;
  color: var(--fg-muted);
}

/* ---------- Profil ---------- */

.profile {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

.portrait {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  background: var(--bg-alt);
  position: relative;
  box-shadow: 0 2px 8px rgba(60, 50, 30, 0.08);
}

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

.portrait-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 44px;
  color: var(--accent);
  opacity: 0.4;
}

.portrait.empty .portrait-fallback { display: flex; }

.profile-text p { margin-bottom: 16px; color: var(--fg-muted); max-width: 62ch; }
.profile-text p em { color: var(--fg); font-style: normal; font-weight: 600; }

.profile-links { margin-top: 8px; }

/* ---------- Contact ---------- */

.contact-form {
  max-width: 640px;
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-form label {
  display: grid;
  gap: 7px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form button { justify-self: start; }

.form-note {
  font-size: 13px;
  color: var(--fg-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: var(--fg-muted);
}

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

@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr 260px; gap: 36px; }
}

@media (max-width: 860px) {
  .case-body { grid-template-columns: 1fr; gap: 20px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .profile { grid-template-columns: 1fr; }
  .portrait { max-width: 280px; }
}

@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-portrait { max-width: 260px; transform: none; order: -1; margin: 0 auto; }
}

@media (max-width: 600px) {
  .tile-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 16px; }
  .nav-links a:not(.btn) { display: none; }
  .hero { padding: 64px 0 52px; }
  .section { padding: 60px 0; }
  .case { padding: 24px 22px; }
  .offer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
