/* ============================================================
   APDI Bécancour-Nicolet-Yamaska — Design System
   Palette de marque (issue du logo officiel)
   Terre cuite : #B5451B | Bleu       : #5DADE2
   Gris        : #7F8C8D | Encre      : #20241f
   ============================================================ */

:root {
  --rust: #B5451B;
  --rust-dark: #8F3513;
  --rust-soft: #F4E6DF;
  --blue: #5DADE2;
  --blue-dark: #2E86C1;
  --ink: #20241f;
  --ink-soft: #3a3f38;
  --gray: #7F8C8D;
  --gray-light: #e8eae9;
  --cream: #FBF7F2;
  --white: #ffffff;

  --maxw: 1140px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(32, 36, 31, 0.06);
  --shadow-md: 0 12px 30px rgba(32, 36, 31, 0.10);
  --shadow-lg: 0 24px 60px rgba(32, 36, 31, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 13px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--rust); color: #fff; box-shadow: 0 8px 20px rgba(181,69,27,.30); }
.btn-primary:hover { background: var(--rust-dark); box-shadow: 0 12px 26px rgba(181,69,27,.40); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.55); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.26); }
.btn-light { background: #fff; color: var(--rust-dark); box-shadow: var(--shadow-md); }
.btn-light:hover { background: var(--rust-soft); }
.btn-outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.16); }
.btn-block { width: 100%; justify-content: center; margin-top: 18px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(251, 247, 242, 0);
  transition: background .35s var(--ease), box-shadow .35s var(--ease), padding .35s var(--ease);
  padding: 14px 0;
}
.site-header.scrolled {
  background: rgba(251, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 8px 0;
}
.header-inner { display: flex; align-items: center; gap: 20px; }
.brand-logo { height: 52px; width: auto; transition: height .3s var(--ease); }
.site-header.scrolled .brand-logo { height: 44px; }

.primary-nav { margin-left: auto; display: flex; gap: 30px; }
.primary-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  position: relative;
  padding: 6px 0;
}
/* En haut (hero clair à droite) : texte clair + ombre pour contraste */
.site-header:not(.scrolled) .primary-nav a { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.site-header:not(.scrolled) .nav-toggle span { background: #fff; }
.site-header:not(.scrolled) .header-cta { background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px); }
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--rust);
  transition: width .3s var(--ease);
}
.primary-nav a:hover::after { width: 100%; }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--rust);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 18px;
  border-radius: 999px;
  transition: background .25s, transform .25s var(--ease);
}
.header-cta:hover { background: var(--rust-dark); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--ink); border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform: scale(1.02);
}
.hero-bg svg { width: 100%; height: 100%; display: block; }
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(32,36,31,.62) 0%, rgba(32,36,31,.30) 45%, rgba(32,36,31,.08) 100%),
    linear-gradient(0deg, rgba(32,36,31,.45), rgba(143,53,19,.10));
}
.hero-content { position: relative; z-index: 2; padding-top: 90px; max-width: 760px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .82rem;
  font-weight: 700;
  color: #8FCBF0;
  margin-bottom: 18px;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.01em;
  margin-bottom: 22px;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  max-width: 560px;
  color: rgba(255,255,255,.92);
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.scroll-cue {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 14px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute; top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: #fff; border-radius: 2px;
  animation: scrollcue 1.6s var(--ease) infinite;
}
@keyframes scrollcue { 0%{opacity:0;transform:translateY(0)} 40%{opacity:1} 100%{opacity:0;transform:translateY(14px)} }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-kicker {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--rust);
  margin-bottom: 14px;
}
.section-kicker.center, .center { text-align: center; }
.section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--ink);
}
.section h2.center { margin: 0 auto 56px; max-width: 760px; }

/* ---------- Mission ---------- */
.mission { background: var(--cream); }
.mission-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
.mission-statement {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.85rem);
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 22px 0 18px;
}
.mission-note { color: var(--gray); max-width: 560px; }
.mission-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow-lg);
  border-top: 6px solid var(--rust);
}
.mission-card-logo { height: 64px; width: auto; margin-bottom: 22px; }
.mission-facts { list-style: none; margin: 0; }
.mission-facts li {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
}
.mission-facts li:last-child { border-bottom: 0; }
.fact-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gray); font-weight: 700; }
.fact-value { font-size: 1.02rem; font-weight: 600; color: var(--ink); }

/* ---------- Rôles / Cartes ---------- */
.roles { background: linear-gradient(180deg, #fff 0%, var(--cream) 100%); }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--rust-soft); }
.card-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--rust-soft);
  color: var(--rust);
  margin-bottom: 20px;
}
.card h3 { font-size: 1.18rem; font-weight: 700; margin-bottom: 10px; color: var(--ink); }
.card p { color: var(--gray); font-size: .97rem; }

/* ---------- Territoire ---------- */
.territory { background: var(--ink); color: #fff; }
.territory .section-kicker { color: var(--blue); }
.territory h2 { color: #fff; }
.territory-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }
.territory p { color: rgba(255,255,255,.82); margin-top: 18px; max-width: 520px; }
.territory-list { list-style: none; margin-top: 22px; }
.territory-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: rgba(255,255,255,.9); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; box-shadow: 0 0 0 4px rgba(93,173,226,.25); }
.territory-badges { display: flex; flex-direction: column; gap: 20px; }
.badge {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  padding: 26px;
  display: flex; align-items: center; gap: 20px;
  transition: transform .3s var(--ease), background .3s;
}
.badge:hover { transform: translateY(-4px); background: rgba(255,255,255,.10); }
.badge img { height: 64px; width: auto; background: #fff; border-radius: 10px; padding: 6px; }
.badge span { font-weight: 600; font-size: 1.05rem; }

/* ---------- Coordonnées ---------- */
.contact { background: var(--cream); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact-info h2 { margin-bottom: 28px; }
.info-block { margin-bottom: 26px; }
.info-title { font-size: 1.05rem; font-weight: 700; color: var(--rust-dark); margin-bottom: 4px; }
.info-address { font-style: normal; color: var(--ink-soft); font-size: 1.05rem; line-height: 1.7; }
.contact-list { list-style: none; display: grid; gap: 4px; }
.contact-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
  align-items: baseline;
}
.c-label { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gray); font-weight: 700; }
.contact-list a { font-weight: 600; color: var(--rust-dark); }
.contact-list a:hover { color: var(--rust); text-decoration: underline; }

.contact-map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
}
.contact-map a:first-child { display: block; line-height: 0; }
.contact-map-img { width: 100%; height: auto; display: block; }
.map-link {
  display: block;
  text-align: center;
  background: var(--rust);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  padding: 11px;
  transition: background .25s;
}
.map-link:hover { background: var(--rust-dark); }

/* ---------- CTA final ---------- */
.cta-final { background: linear-gradient(120deg, var(--rust) 0%, var(--rust-dark) 100%); color: #fff; text-align: center; }
.cta-inner { max-width: 720px; margin: 0 auto; }
.cta-final h2 { color: #fff; margin-bottom: 14px; }
.cta-final p { color: rgba(255,255,255,.9); font-size: 1.1rem; margin-bottom: 30px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.78); padding: 70px 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
}
.footer-logo { height: 56px; width: auto; margin-bottom: 16px; background: #fff; border-radius: 8px; padding: 6px; }
.footer-brand p { font-size: .92rem; line-height: 1.6; }
.footer-contact p { font-size: .9rem; margin-bottom: 16px; line-height: 1.6; }
.footer-contact a, .footer-links a { color: rgba(255,255,255,.85); }
.footer-contact a:hover, .footer-links a:hover { color: var(--blue); }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-weight: 500; }
.footer-base { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: .85rem; color: rgba(255,255,255,.72); }
.footer-base .container { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mission-grid, .territory-grid, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .primary-nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(80vw, 320px);
    background: var(--cream);
    flex-direction: column;
    justify-content: center;
    gap: 26px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform .35s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav a { font-size: 1.2rem; }
  .nav-toggle { display: flex; margin-left: auto; }
  .header-cta { display: none; }
  .site-header.menu-open { background: var(--cream); }
}
@media (max-width: 560px) {
  .section { padding: 64px 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .contact-list li { grid-template-columns: 100px 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .contact-map iframe { height: 320px; }
}

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