/* =========================================================================
   Étude Notariale — Design System
   Palette "vert émeraude / nature" — moderne, chaleureux, professionnel
   ========================================================================= */

:root {
  color-scheme: light;

  /* --- Couleurs --- */
  --color-primary: #14532d;
  --color-primary-dark: #0d3a1f;
  --color-primary-light: #2d6a4f;
  --color-accent: #b08968;
  --color-accent-light: #d4a878;
  --color-bg: #faf7f0;
  --color-bg-alt: #f1ede1;
  --color-surface: #ffffff;
  --color-text: #1f241f;
  --color-text-muted: #55605a;
  --color-border: #e3ddc9;
  --color-success-bg: #eaf3ec;
  --color-focus: #b08968;

  /* --- Typographie --- */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-900: clamp(2.5rem, 1.9rem + 2.6vw, 4rem);
  --fs-800: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  --fs-700: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --fs-600: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --fs-500: 1.125rem;
  --fs-400: 1rem;
  --fs-300: 0.875rem;

  /* --- Espacement --- */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.25rem;
  --space-2xl: 5rem;
  --space-3xl: 7.5rem;

  --container-max: 1180px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 3px rgba(20, 40, 25, 0.08), 0 1px 2px rgba(20, 40, 25, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 40, 25, 0.10), 0 2px 6px rgba(20, 40, 25, 0.06);
  --shadow-lg: 0 20px 48px rgba(20, 40, 25, 0.16);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-primary: #4c9a72;
    --color-primary-dark: #3a7d5a;
    --color-primary-light: #6fb890;
    --color-accent: #d4a878;
    --color-accent-light: #e6c39a;
    --color-bg: #111a14;
    --color-bg-alt: #16221a;
    --color-surface: #17251c;
    --color-text: #eef0ea;
    --color-text-muted: #a9b3ab;
    --color-border: #2a3a2e;
    --color-success-bg: #1a2f22;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
  }
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-400);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100svh;
}

img, picture, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a {
  color: inherit;
  text-decoration: none;
  text-decoration-color: var(--color-accent);
}
/* Liens en prose (au fil du texte) : on garde un soulignement pour rester
   repérables sans dépendre uniquement de la couleur (accessibilité). Les
   liens "composants" (boutons, cartes, logo, navigation...) restent sans
   soulignement, leur zone cliquable étant déjà visuellement évidente. */
.flow a,
.field--checkbox label a,
.callout a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.15; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.15em; }

h1 { font-size: var(--fs-900); }
h2 { font-size: var(--fs-800); }
h3 { font-size: var(--fs-700); }
h4 { font-size: var(--fs-600); }

.text-muted { color: var(--color-text-muted); }
.lede { font-size: var(--fs-500); color: var(--color-text-muted); }

/* --- Accessibilité --- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.85em 1.4em;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

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

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }
.section--alt { background: var(--color-bg-alt); }
.section--primary {
  background: linear-gradient(160deg, var(--color-primary-dark), var(--color-primary));
  color: #fbfaf6;
}
.section--primary h2, .section--primary h3 { color: #fff; }

.section-head { max-width: 46ch; margin-bottom: var(--space-xl); }
.section-head--center { max-width: 60ch; margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--fs-300);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-light);
  margin-bottom: var(--space-sm);
}
.section--primary .eyebrow { color: var(--color-accent-light); }
.eyebrow::before {
  content: "";
  width: 1.5em;
  height: 2px;
  background: currentColor;
}

.grid {
  display: grid;
  gap: var(--space-lg);
}
@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 860px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-400);
  border: 2px solid transparent;
  transition: transform var(--transition-fast), background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--color-primary-light); box-shadow: var(--shadow-md); }

.btn--accent {
  background: var(--color-accent);
  color: #24160b;
}
.btn--accent:hover { background: var(--color-accent-light); box-shadow: var(--shadow-md); }

.btn--ghost {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}
.btn--ghost:hover { background: rgba(255,255,255,0.1); }

.btn--outline-dark {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--outline-dark:hover { background: var(--color-primary); color: #fff; }

.btn--block { width: 100%; }
.btn--sm { padding: 0.6em 1.1em; font-size: var(--fs-300); }

/* --- Barre de progression de lecture --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 1000;
  transition: width 0.12s linear;
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
}

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-md);
  border-bottom-color: transparent;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 0.9rem;
  transition: padding-block var(--transition-base);
}
.site-header.is-scrolled .header-bar {
  padding-block: 0.45rem;
}
.site-header.is-scrolled .brand__mark {
  width: 34px;
  height: 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-text);
}
.brand:hover { color: var(--color-primary); }
.brand__mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  transition: width var(--transition-base), height var(--transition-base);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__text small {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.main-nav {
  display: none;
}
.main-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  padding: var(--space-md);
}
.main-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.main-nav a {
  display: block;
  padding: 0.85em 0.5em;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-bg-alt);
}
.nav-cta { margin-top: var(--space-sm); }

@media (min-width: 940px) {
  .nav-toggle { display: none; }
  .main-nav {
    display: block;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .main-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 0.2rem;
  }
  .main-nav a { padding: 0.5em 0.9em; }
  .header-bar { flex-wrap: nowrap; }
  .main-nav-inner {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
  }
}

/* --- Hero --- */
.hero {
  position: relative;
  overflow: clip;
  background: linear-gradient(170deg, var(--color-bg-alt), var(--color-bg) 60%);
}
.hero__inner {
  display: grid;
  gap: var(--space-xl);
  padding-block: var(--space-2xl);
  align-items: center;
}
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.1fr 0.9fr; padding-block: var(--space-3xl); }
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--color-success-bg);
  color: var(--color-primary-dark);
  padding: 0.5em 1em;
  border-radius: 999px;
  font-size: var(--fs-300);
  font-weight: 600;
  margin-bottom: var(--space-md);
}
.hero h1 { margin-bottom: var(--space-md); }
.hero .lede { margin-bottom: var(--space-lg); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  font-size: var(--fs-300);
  color: var(--color-text-muted);
}
.hero__trust strong { display: block; color: var(--color-text); font-family: var(--font-serif); font-size: 1.3rem; }
.hero__trust a { color: var(--color-text-muted); text-decoration: none; }
.hero__trust a:hover { color: var(--color-primary); text-decoration: underline; }

/* --- Entrée animée du hero, dès le chargement (aucun scroll requis) --- */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero .hero__badge,
.hero h1,
.hero .lede,
.hero .hero__actions,
.hero .hero__trust {
  animation: heroRise 1.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero .hero__badge { animation-delay: 0.1s; }
.hero h1 { animation-delay: 0.3s; }
.hero .lede { animation-delay: 0.6s; }
.hero .hero__actions { animation-delay: 0.9s; }
.hero .hero__trust { animation-delay: 1.15s; }
@media (prefers-reduced-motion: reduce) {
  .hero .hero__badge, .hero h1, .hero .lede, .hero .hero__actions, .hero .hero__trust {
    animation: none;
  }
}

.hero__art {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
}
.hero__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-primary-light); }
.card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--color-success-bg);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}
.card__icon svg { width: 26px; height: 26px; }
.card h3 { font-size: var(--fs-600); margin-bottom: var(--space-xs); }
.card p { color: var(--color-text-muted); }
.card--link { display: block; }
.card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: var(--space-md);
  font-weight: 600;
  color: var(--color-primary);
  font-size: var(--fs-300);
}

.stat-row {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: repeat(2, 1fr);
  text-align: center;
}
@media (min-width: 700px) { .stat-row { grid-template-columns: repeat(4, 1fr); } }
.stat-row strong {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--fs-800);
  color: var(--color-accent-light);
}
.stat-row span { font-size: var(--fs-300); opacity: 0.85; }

/* --- Étapes / process --- */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: var(--space-lg); }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { position: relative; padding-top: var(--space-lg); }
.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-serif);
  font-size: var(--fs-700);
  color: var(--color-accent);
  display: block;
  border-top: 3px solid var(--color-border);
  padding-top: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* --- Timeline (à propos) --- */
.timeline { list-style: none; padding: 0; display: grid; gap: var(--space-lg); border-left: 2px solid var(--color-border); }
.timeline li { padding-left: var(--space-lg); position: relative; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-bg);
}

/* --- FAQ Accordion --- */
.accordion { border-top: 1px solid var(--color-border); }
.accordion-item { border-bottom: 1px solid var(--color-border); }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  background: transparent;
  border: none;
  text-align: left;
  padding: var(--space-md) var(--space-2xs);
  font-weight: 700;
  font-size: var(--fs-500);
}
.accordion-trigger .chevron {
  flex-shrink: 0;
  width: 20px; height: 20px;
  transition: transform var(--transition-base);
}
.accordion-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.accordion-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-base) ease;
}
.accordion-panel__inner { padding: 0 var(--space-2xs) var(--space-md); color: var(--color-text-muted); }
.accordion-panel__inner > * + * { margin-top: 0.8em; }

/* --- Formulaires --- */
.form-grid { display: grid; gap: var(--space-md); }
@media (min-width: 640px) { .form-grid--2col { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 600; font-size: var(--fs-300); }
.field input, .field select, .field textarea {
  padding: 0.8em 0.9em;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--color-primary);
}
.field--checkbox { flex-direction: row; align-items: flex-start; gap: 0.6rem; }
.field--checkbox input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--color-primary); }
.field--checkbox label { font-weight: 400; }
.form-note { font-size: var(--fs-300); color: var(--color-text-muted); }
.form-status { padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); font-weight: 600; display: none; }
.form-status.is-visible { display: block; }
.form-status--success { background: var(--color-success-bg); color: var(--color-primary-dark); }
.form-status--error { background: #fbeaea; color: #9b2c2c; }

/* --- Contact info list --- */
.info-list { list-style: none; padding: 0; display: grid; gap: var(--space-md); }
.info-list li { display: flex; gap: var(--space-sm); align-items: flex-start; }
.info-list .icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--color-success-bg);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
}
.info-list .icon svg { width: 20px; height: 20px; }
.info-list a { text-decoration: none; font-weight: 600; }
.info-list a:hover { text-decoration: underline; }

/* --- Table honoraires --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { text-align: left; padding: 0.9em 1.1em; border-bottom: 1px solid var(--color-border); }
thead th { background: var(--color-bg-alt); font-family: var(--font-serif); font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }

/* --- Breadcrumb --- */
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4em; padding: 0; font-size: var(--fs-300); color: var(--color-text-muted); }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 0.4em; }
.breadcrumb a:hover { color: var(--color-primary); }

/* --- Page header (pages internes) --- */
.page-header { padding-block: var(--space-xl) var(--space-lg); background: var(--color-bg-alt); }
.page-header h1 { margin-block: var(--space-sm); }

/* --- Callout --- */
.callout {
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-alt);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.callout > * + * { margin-top: 0.6em; }

/* --- Footer --- */
.site-footer {
  background: var(--color-primary-dark);
  color: #dce8de;
  padding-block: var(--space-2xl) var(--space-lg);
}
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.footer-grid h2 { font-size: var(--fs-500); color: #fff; margin-bottom: var(--space-sm); }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 0.6em; font-size: var(--fs-300); }
.footer-brand { display: flex; align-items: center; gap: 0.7rem; color: #fff; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; margin-bottom: var(--space-sm); }
.footer-brand .brand__mark { width: 38px; height: 38px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: space-between;
  font-size: var(--fs-300);
  color: #b7c9ba;
}
.footer-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.2em; padding: 0; }

/* --- Utilitaires --- */
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.center { text-align: center; }
.flow > * + * { margin-top: var(--space-md); }

[data-reveal] {
  opacity: 0;
  transform:
    translateY(var(--reveal-y, 48px))
    translateX(var(--reveal-x, 0px))
    rotate(var(--reveal-r, 0deg))
    scale(var(--reveal-scale, 0.94));
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) rotate(0deg) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition-delay: 0ms; }
}

/* --- Effet de parallaxe léger sur l'image du hero --- */
.hero__art[data-parallax] img {
  transform: scale(1.14) translateY(var(--parallax-y, 0px));
  transition: transform 0.05s linear;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .hero__art[data-parallax] img { transform: none !important; transition: none; }
}
