/* =========================================================
   gfinzi.com — proposition de refonte (draft)
   Aucune dépendance externe : polices système, icônes SVG inline.
   ========================================================= */

/* ---------- Thème ---------- */
:root {
  --brand: #0369a1;           /* bleu principal, contraste 5,9:1 sur blanc */
  --brand-strong: #075985;
  --brand-bright: #38bdf8;    /* rappel du bleu d'origine, usage décoratif */

  --bg: #ffffff;
  --surface: #f6f8fb;
  --line: #e3e8ef;
  --ink: #0f172a;
  --text: #334155;
  --muted: #5b6b80;

  --hero-bg: #0b1324;
  --hero-ink: #f1f5f9;
  --hero-muted: #b4c2d3;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --header-h: 68px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #38bdf8;
    --brand-strong: #7dd3fc;
    --bg: #0b1120;
    --surface: #111a2e;
    --line: #1f2a44;
    --ink: #f1f5f9;
    --text: #cbd5e1;
    --muted: #94a3b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem); font-weight: 750; }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
p { margin: 0 0 1em; }

a { color: var(--brand); text-underline-offset: .2em; }
a:hover { color: var(--brand-strong); }

:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 3px; border-radius: 4px; }

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

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  padding: .6rem 1rem; border-radius: 8px;
  background: var(--brand); color: #fff; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

.muted { opacity: .7; font-weight: 400; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px;
  padding: .75rem 1.4rem;
  border: 2px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; transform: translateY(-1px); }
@media (prefers-color-scheme: dark) { .btn, .btn:hover { color: #0b1120; } }

.btn-small { min-height: 40px; padding: .45rem 1.1rem; font-size: .95rem; }

.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: var(--hero-ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .6); color: #fff; }

.btn-light { background: #fff; border-color: #fff; color: #0b1324; }
.btn-light:hover { background: #e0f2fe; border-color: #e0f2fe; color: #0b1324; }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-ghost, .btn-ghost:hover, .btn-outline-light, .btn-outline-light:hover { color: #fff; }
  .btn-light, .btn-light:hover { color: #0b1324; }
}

.btn-quiet { background: transparent; color: var(--brand); }
.btn-quiet:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .btn-quiet, .btn-quiet:hover { color: var(--brand); } }

.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-decoration: none; }
.link-arrow .icon { transition: transform .15s ease; }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(15, 23, 42, .05); }

.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  color: #fff; font-size: .95rem; letter-spacing: .02em;
}
.brand-name { font-size: 1.1rem; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .35rem; }
.site-nav a:not(.btn) {
  display: block; padding: .5rem .8rem; border-radius: 8px;
  color: var(--text); font-weight: 550; text-decoration: none;
}
.site-nav a:not(.btn):hover { color: var(--ink); background: var(--surface); }
.site-nav a[aria-current="true"]:not(.btn) { color: var(--brand); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  align-items: center; justify-content: center; cursor: pointer;
}
.nav-toggle .icon { width: 22px; height: 22px; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: .75rem 1.25rem 1.25rem; gap: .25rem; }
  .site-nav a:not(.btn) { padding: .8rem .75rem; }
  .site-nav .btn { margin-top: .5rem; width: 100%; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin-top: calc(-1 * var(--header-h));
  padding: calc(var(--header-h) + clamp(3rem, 6vw, 5rem)) 0 clamp(3.5rem, 7vw, 5.5rem);
  /* le haut de page occupe tout l'écran, contenu centré verticalement */
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  color: var(--hero-muted);
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(56, 189, 248, .28), transparent 60%),
    radial-gradient(40rem 25rem at 0% 110%, rgba(3, 105, 161, .35), transparent 60%),
    var(--hero-bg);
  overflow: hidden;
  isolation: isolate;
}
/* trame discrète */
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 20%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 20%, #000 10%, transparent 70%);
}

/* l'en-tête est transparent au-dessus du hero */
.site-header:not(.is-scrolled) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-header:not(.is-scrolled) .brand,
.site-header:not(.is-scrolled) .site-nav a:not(.btn) { color: var(--hero-ink); }
.site-header:not(.is-scrolled) .site-nav a:not(.btn):hover { background: rgba(255, 255, 255, .1); }
.site-header:not(.is-scrolled) .nav-toggle { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
@media (max-width: 760px) {
  .site-header:not(.is-scrolled) .site-nav a:not(.btn) { color: var(--text); }
}
.site-header:not(.is-scrolled) .btn-small { background: #fff; border-color: #fff; color: #0b1324; }

.hero-inner > * { max-width: 880px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-bottom: 1.5rem; padding: .35rem .85rem;
  border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--hero-ink); font-size: .9rem; font-weight: 550;
}
.eyebrow .icon { color: var(--brand-bright); }

.hero h1 { color: var(--hero-ink); }
.hero h1 .accent {
  background: linear-gradient(90deg, #7dd3fc, #38bdf8 40%, #a5b4fc);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-lead { max-width: 640px; font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--hero-muted); }

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 3rem; }
.hero .btn:not(.btn-ghost) { background: #38bdf8; border-color: #38bdf8; color: #0b1324; }
.hero .btn:not(.btn-ghost):hover { background: #7dd3fc; border-color: #7dd3fc; }

.hero-facts {
  list-style: none; margin: 0; padding: 1.75rem 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.hero-facts strong { display: block; color: var(--hero-ink); font-size: 1.15rem; font-weight: 650; }
.hero-facts span { font-size: .95rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-alt { background: var(--surface); }

.section-head { max-width: 680px; margin-bottom: 3rem; }
.kicker {
  margin-bottom: .6rem;
  color: var(--brand); font-size: .85rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.section-lead { font-size: 1.125rem; color: var(--muted); }

/* cartes services */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.card {
  padding: 2rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px; margin-bottom: 1.25rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}
.card-icon .icon { width: 24px; height: 24px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.checklist li { position: relative; padding-left: 1.9rem; }
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: .3em;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 14%, transparent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230369a1' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 70% no-repeat;
}

@media (prefers-color-scheme: dark) {
  .checklist li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E");
  }
}

/* 5 services : 1 colonne sur mobile ; dès 700px, carte Conseil en pleine largeur + grille 2 × 2 */
.cards-4 { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-4 > .card:first-child { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .cards-4 > .card:first-child .checklist { grid-template-columns: repeat(2, 1fr); column-gap: 2rem; }
}

/* mission en cours */
.mission {
  max-width: 860px;
  padding: 2.25rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (max-width: 760px) { .mission { padding: 1.75rem; } }
.mission-body h3 { margin-bottom: 1.1rem; }

/* environnement technique */
.section-tight { padding: clamp(3.5rem, 7vw, 5rem) 0; }
/* 3 groupes : 1 colonne sur mobile, 3 colonnes dès 700px (jamais 2 + 1) */
.stack { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 700px) { .stack { grid-template-columns: repeat(3, 1fr); } }
.stack-group h3 { font-size: 1rem; margin-bottom: .9rem; }
.stack-subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted); font-size: .85rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.stack + .stack-subtitle { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.tags.tags-past li { border-style: dashed; background: transparent; color: var(--muted); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text); font-size: .92rem; font-weight: 550;
}

/* étapes */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
/* 4 étapes : 1, puis 2 × 2, puis 4 colonnes (jamais 3 + 1) */
@media (min-width: 600px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step {
  position: relative;
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step::before {
  content: "";
  position: absolute; top: -1px; left: 1.5rem; right: 1.5rem; height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-bright));
}
.step-num {
  display: block; margin-bottom: .75rem;
  font-size: 2rem; font-weight: 300; line-height: 1;
  color: var(--brand); font-variant-numeric: tabular-nums;
}
.step p { margin: 0; color: var(--muted); }

/* parcours */
.parcours > * { max-width: 820px; }
.parcours .section-lead { margin-bottom: 2.5rem; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: .6rem; bottom: .6rem;
  width: 2px; background: var(--line);
}
.timeline li { position: relative; padding: 0 0 2rem 2.25rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: .3rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--brand);
}
.timeline li:first-child::before { background: var(--brand); }
.tl-date {
  margin: 0 0 .2rem;
  color: var(--brand); font-size: .8rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.timeline h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.tl-org { color: var(--muted); font-weight: 500; }
.timeline li > p:last-child { margin: 0; color: var(--muted); }
.timeline .link-arrow { margin-left: .25rem; }

.parcours-training {
  margin: 2.5rem 0 0; padding: 1rem 1.25rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); font-size: .95rem;
}
.parcours-training strong { color: var(--ink); }
.parcours-links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.5rem; }

/* contact */
.section-contact {
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(56, 189, 248, .3), transparent 60%),
    var(--hero-bg);
  color: var(--hero-muted);
}
.contact { max-width: 720px; text-align: center; }
.contact h2 { color: var(--hero-ink); }
.contact .section-lead { color: var(--hero-muted); }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 2rem; }
.contact-address { margin: 1.25rem 0 0; color: var(--hero-muted); font-size: .95rem; letter-spacing: .01em; }

/* ---------- Pied de page ---------- */
.site-footer { padding: 2rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; align-items: center; gap: 1.25rem; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--brand); }
.footer-inner .icon { width: 20px; height: 20px; }

/* ---------- Pages simples (mentions, 404) ---------- */
.page-simple .site-header { background: color-mix(in srgb, var(--bg) 82%, transparent); }
.page-simple .site-header .brand,
.page-simple .site-header .site-nav a:not(.btn) { color: var(--ink); }
.page-simple .site-header .btn-small { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .page-simple .site-header .btn-small { color: #0b1120; } }

.page-head { padding: clamp(3rem, 7vw, 5rem) 0 2rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-head h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); margin: 0; }
.page-head p { margin: .75rem 0 0; color: var(--muted); }

.prose { max-width: 760px; padding: 3rem 0 5rem; }
.prose h2 { font-size: 1.35rem; margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }

.notice {
  margin-bottom: 2rem; padding: 1rem 1.25rem;
  border: 1px solid #f59e0b; border-radius: 10px;
  background: color-mix(in srgb, #f59e0b 10%, transparent);
  color: var(--ink); font-size: .95rem;
}

.error-page { min-height: calc(100vh - var(--header-h) - 90px); display: grid; place-items: center; text-align: center; padding: 4rem 0; }
.error-code {
  margin: 0; font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 200; line-height: 1;
  background: linear-gradient(90deg, var(--brand), var(--brand-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page .hero-actions { justify-content: center; margin-bottom: 0; }

/* ---------- Apparition au défilement (activée par JS) ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .link-arrow .icon { transition: none; }
}
