/* ============================================================
   CABINET CHARDOT — Géomètre-Expert · Vosges
   Styles personnalisés (complément Tailwind CDN)
   ============================================================ */

/* --- Variables & base --- */
:root {
  --night: #0E2433;
  --night-light: #1a3a4f;
  --accent: #C97B3C;
  --accent-light: #d9955e;
  --sand: #F7F4EF;
  --sand-dark: #E8E2D9;
  --ink: #1c1c1c;
  --muted: #6b7280;
  --white: #ffffff;
  --radius: 0.75rem;
  --shadow: 0 4px 24px rgba(14, 36, 51, 0.08);
  --shadow-lg: 0 12px 48px rgba(14, 36, 51, 0.12);
  --header-h: 5rem;
  --header-h-scrolled: 4rem;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--sand);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

::selection {
  background: rgba(201, 123, 60, 0.25);
  color: var(--night);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --- Motifs topographiques --- */
.topo-pattern {
  background-image:
    linear-gradient(rgba(14, 36, 51, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 36, 51, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(247, 244, 239, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 244, 239, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

/* --- Header sticky --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  transition: height var(--transition), box-shadow var(--transition), background var(--transition);
}

.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  box-shadow: 0 2px 20px rgba(14, 36, 51, 0.12);
  background: rgba(247, 244, 239, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .header-inner {
  height: 100%;
  transition: padding var(--transition);
}

/* --- Navigation mobile --- */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 36, 51, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
  z-index: 90;
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100vh;
  background: var(--sand);
  transform: translateX(100%);
  transition: transform var(--transition);
  z-index: 95;
  box-shadow: -8px 0 32px rgba(14, 36, 51, 0.15);
}

.mobile-nav.is-open {
  transform: translateX(0);
}

/* Hamburger animé */
.hamburger {
  width: 28px;
  height: 20px;
  position: relative;
  cursor: pointer;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--night);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition), top var(--transition);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

.hamburger.is-active span:nth-child(1) {
  top: 9px;
  transform: rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
  top: 9px;
  transform: rotate(-45deg);
}

/* --- Hero --- */
.hero-section {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--night);
  overflow: hidden;
}

.hero-contours {
  position: absolute;
  inset: 0;
  opacity: 0.4;
}

.hero-contours svg {
  width: 100%;
  height: 100%;
}

.contour-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.5;
  opacity: 0.3;
  animation: drift 20s ease-in-out infinite alternate;
}

.contour-line:nth-child(even) {
  animation-duration: 26s;
  animation-direction: alternate-reverse;
}

@keyframes drift {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-12px) translateX(8px); }
}

.hero-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(500px, 80vw);
  height: min(500px, 80vw);
  opacity: 0.06;
  pointer-events: none;
}

.hero-content > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-content.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.hero-content.is-visible > *:nth-child(1) { transition-delay: 0.1s; }
.hero-content.is-visible > *:nth-child(2) { transition-delay: 0.25s; }
.hero-content.is-visible > *:nth-child(3) { transition-delay: 0.4s; }
.hero-content.is-visible > *:nth-child(4) { transition-delay: 0.55s; }

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 123, 60, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--sand);
  border-color: rgba(247, 244, 239, 0.5);
}

.btn-outline:hover {
  background: rgba(247, 244, 239, 0.1);
  border-color: var(--sand);
}

.btn-outline-dark {
  background: transparent;
  color: var(--night);
  border-color: rgba(14, 36, 51, 0.25);
}

.btn-outline-dark:hover {
  border-color: var(--night);
  background: rgba(14, 36, 51, 0.04);
}

/* --- Bandeau chiffres --- */
.stats-band {
  background: var(--white);
  border-top: 1px solid rgba(14, 36, 51, 0.06);
  border-bottom: 1px solid rgba(14, 36, 51, 0.06);
}

.stat-item {
  position: relative;
  padding: 1.5rem 1rem;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: rgba(14, 36, 51, 0.1);
}

@media (max-width: 767px) {
  .stat-item:not(:last-child)::after {
    display: none;
  }
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

/* --- Cartes activités --- */
.activity-card {
  background: var(--white);
  border: 1px solid rgba(14, 36, 51, 0.08);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.activity-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.activity-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 123, 60, 0.2);
}

.activity-card:hover::before {
  transform: scaleX(1);
}

.activity-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 123, 60, 0.1);
  border-radius: 0.625rem;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

/* --- Frise chronologique --- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.4375rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), rgba(201, 123, 60, 0.2));
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--sand);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-year {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--night);
  margin-bottom: 0.5rem;
}

/* --- Étapes process --- */
.process-step {
  position: relative;
  text-align: center;
  padding: 2rem 1.5rem;
}

.process-number {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--night);
  color: var(--sand);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  position: relative;
  z-index: 1;
}

.process-connector {
  display: none;
}

@media (min-width: 768px) {
  .process-connector {
    display: block;
    position: absolute;
    top: 3.5rem;
    left: calc(50% + 1.5rem);
    width: calc(100% - 3rem);
    height: 2px;
    background: repeating-linear-gradient(
      90deg,
      var(--accent) 0,
      var(--accent) 6px,
      transparent 6px,
      transparent 12px
    );
    z-index: 0;
  }

  .process-step:last-child .process-connector {
    display: none;
  }
}

/* --- Cartes bureaux --- */
.office-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(14, 36, 51, 0.08);
  box-shadow: var(--shadow);
}

.office-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.office-map {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
}

/* --- Formulaire --- */
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--night);
  margin-bottom: 0.375rem;
}

.form-group label .required {
  color: var(--accent);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(14, 36, 51, 0.15);
  border-radius: 0.5rem;
  background: var(--white);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 123, 60, 0.15);
  outline: none;
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: #dc2626;
}

.form-error {
  font-size: 0.8125rem;
  color: #dc2626;
  margin-top: 0.25rem;
  display: none;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  display: none;
  padding: 1.25rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius);
  color: #15803d;
  text-align: center;
}

.form-success.is-visible {
  display: block;
}

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Section titles --- */
.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--night);
  line-height: 1.15;
  margin-bottom: 1rem;
}

/* --- Footer --- */
.site-footer {
  background: var(--night);
  color: rgba(247, 244, 239, 0.85);
}

.site-footer a {
  color: rgba(247, 244, 239, 0.7);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer a:hover {
  color: var(--accent);
}

/* --- Archives highlight --- */
.archives-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(201, 123, 60, 0.1);
  border: 1px solid rgba(201, 123, 60, 0.25);
  border-radius: var(--radius);
  margin-top: 2rem;
}

/* --- Utilitaires --- */
.section-padding {
  padding: clamp(4rem, 8vw, 6rem) 0;
}

.container-narrow {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .hero-content > * {
    opacity: 1;
    transform: none;
  }
}
