@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');
@import url('tokens.css');

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ========================
   TYPOGRAPHY
   ======================== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: clamp(1.75rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ========================
   LAYOUT
   ======================== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 3.5rem 0;
}

/* ========================
   HEADER & NAV
   ======================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-link img {
  height: 40px;
  width: auto;
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.nav-toggle:hover { background: rgba(63,63,70,0.08); }

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Nav */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-secondary);
  padding: 1rem 1.25rem;
}

.site-nav.is-open {
  display: block;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-list a {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--color-primary);
  transition: background 0.2s, color 0.2s;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  background: var(--color-primary);
  color: var(--color-bg);
}

.nav-cta {
  margin-top: 0.75rem;
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
  text-align: center;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}
.btn-primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

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

.btn-outline-light {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.7);
}
.btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
}

/* ========================
   HERO
   ======================== */
.hero {
  background: var(--color-primary);
  color: #fff;
  padding: 3rem 0 2.5rem;
}

.hero h1 {
  color: #fff;
  margin-bottom: 1rem;
}

.hero .hero-lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
  margin-bottom: 1.75rem;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

/* ========================
   VISUAL PLACEHOLDER
   ======================== */
.visual-placeholder {
  display: block;
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-aspect="4:3"]  { aspect-ratio: 4 / 3; }
.visual-placeholder[data-aspect="1:1"]  { aspect-ratio: 1 / 1; }
.visual-placeholder[data-aspect="3:4"]  { aspect-ratio: 3 / 4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21 / 9; }

.visual-placeholder[data-tone="secondary"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="accent"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-accent, var(--color-primary)) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
      color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

/* Hero placeholder on dark background */
.hero .visual-placeholder {
  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,0.06) 0%,
      rgba(217,119,6,0.25) 50%,
      rgba(234,88,12,0.15) 100%
    );
  border-radius: 12px;
  margin-top: 2rem;
}

/* ========================
   BADGE / TRUST STRIP
   ======================== */
.trust-strip {
  background: var(--color-secondary);
  color: #fff;
  padding: 0.75rem 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

/* ========================
   SECTION TITLES
   ======================== */
.section-title {
  margin-bottom: 0.5rem;
}

.section-intro {
  color: #4B5563;
  font-size: 1.0625rem;
  max-width: 640px;
  margin-bottom: 2rem;
}

/* ========================
   SERVICE CARDS
   ======================== */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-card {
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  background: #fff;
}

.service-card:hover {
  box-shadow: 0 6px 24px rgba(63,63,70,0.12);
  transform: translateY(-2px);
}

.service-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
}

.service-card h3 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.service-card p {
  font-size: 0.9375rem;
  color: #4B5563;
}

.service-card .service-icon {
  font-size: 2rem;
  margin-bottom: 0.625rem;
}

/* ========================
   USP / WHY US
   ======================== */
.usp-section {
  background: #F9FAFB;
}

.usp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.usp-item {
  background: #fff;
  border-left: 4px solid var(--color-secondary);
  padding: 1.125rem 1.25rem;
  border-radius: 0 8px 8px 0;
}

.usp-item h3 {
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

.usp-item p {
  font-size: 0.9rem;
  color: #4B5563;
  margin: 0;
}

/* ========================
   STATS / KEY NUMBERS
   ======================== */
.stats-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 0;
}

.stat-item {
  text-align: center;
  padding: 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  margin-top: 0.25rem;
}

/* ========================
   CTA BAND
   ======================== */
.cta-band {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 3rem 0;
}

.cta-band h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}

.cta-band p {
  color: rgba(255,255,255,0.82);
  margin-bottom: 1.5rem;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* ========================
   FAQ
   ======================== */
.faq-section {
  background: #F9FAFB;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
}

details.faq-item {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}

details.faq-item summary {
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9875rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-primary);
}

details.faq-item summary::-webkit-details-marker { display: none; }

details.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--color-secondary);
  flex-shrink: 0;
  transition: transform 0.2s;
}

details.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.25rem 1.125rem;
  font-size: 0.9375rem;
  color: #4B5563;
}

/* ========================
   SERVICE DETAIL (services.html)
   ======================== */
.service-section {
  border-bottom: 1px solid #E5E7EB;
}
.service-section:last-of-type { border-bottom: none; }

.service-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.service-list {
  margin-top: 0.75rem;
}
.service-list li {
  padding: 0.375rem 0;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.9375rem;
  color: #374151;
}
.service-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: 700;
}

.service-note {
  background: color-mix(in srgb, var(--color-secondary) 10%, #fff);
  border-left: 3px solid var(--color-secondary);
  padding: 0.875rem 1rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  color: #374151;
  margin-top: 1rem;
}

/* ========================
   ABOUT PAGE
   ======================== */
.about-intro-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.about-stats {
  background: #F9FAFB;
  border-radius: 10px;
  padding: 1.5rem;
}

.about-stats dt {
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--color-primary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.875rem;
}
.about-stats dt:first-child { margin-top: 0; }
.about-stats dd {
  color: #374151;
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
}

.engagement-box {
  background: var(--color-primary);
  color: #fff;
  border-radius: 10px;
  padding: 2rem;
  margin-top: 2rem;
}
.engagement-box h3 { color: var(--color-secondary); margin-bottom: 0.75rem; }
.engagement-box p { color: rgba(255,255,255,0.88); }

/* ========================
   CONTACT PAGE
   ======================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.contact-info h2 {
  margin-bottom: 1rem;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.contact-detail .icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.contact-detail p, .contact-detail a {
  font-size: 1rem;
  color: #374151;
}

.contact-detail a:hover { color: var(--color-secondary); }

/* Contact form */
.contact-form {
  background: #F9FAFB;
  border-radius: 10px;
  padding: 1.75rem;
}

.form-group {
  margin-bottom: 1.125rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--color-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid #D1D5DB;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 18%, transparent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-note {
  font-size: 0.8125rem;
  color: #6B7280;
  margin-top: 0.5rem;
}

/* Map */
.map-wrapper {
  margin-top: 2rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #E5E7EB;
}

.map-wrapper iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}

/* ========================
   FOOTER
   ======================== */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.82);
  padding: 2.5rem 0 1.25rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand .footer-logo {
  filter: brightness(0) invert(1);
  height: 36px;
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
}

.footer-section h4 {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

.footer-section li {
  margin-bottom: 0.375rem;
}

.footer-section a {
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--color-secondary);
}

.footer-address {
  font-style: normal;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.25rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.45);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
}
.footer-bottom a:hover { color: var(--color-secondary); }

/* ========================
   SKIP LINK (a11y)
   ======================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-secondary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  padding: 0.625rem 1rem;
  border-radius: 0 0 6px 6px;
  z-index: 999;
  transition: top 0.2s;
}

.skip-link:focus { top: 0; }

/* ========================
   TABLET & DESKTOP
   ======================== */
@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .usp-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    flex-direction: row;
    justify-content: center;
  }

  .stat-item {
    flex: 1;
    max-width: 200px;
  }

  .cta-actions {
    flex-direction: row;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }

  .site-nav {
    display: block;
    position: static;
    background: none;
    border: none;
    padding: 0;
  }

  .nav-list {
    flex-direction: row;
    gap: 0.25rem;
    align-items: center;
  }

  .nav-list a {
    padding: 0.375rem 0.875rem;
  }

  .nav-cta { margin: 0; }

  .service-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-intro-grid {
    grid-template-columns: 3fr 2fr;
  }

  .contact-grid {
    grid-template-columns: 5fr 7fr;
  }

  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .usp-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================
   MISC UTILITIES
   ======================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }

.accent-bar {
  display: inline-block;
  width: 40px;
  height: 4px;
  background: var(--color-secondary);
  border-radius: 2px;
  margin: 0.5rem 0 1.25rem;
}

.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;
}

/* ========================
   ANIMATIONS — Auto Glasse+
   Lot 7 — animation pass
   ======================== */

@media (prefers-reduced-motion: no-preference) {

  /* --- Keyframes --- */
  @keyframes ag-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes ag-slide-left {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
  }

  @keyframes ag-scale-in {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  @keyframes ag-shimmer {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
  }

  @keyframes ag-faq-open {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* --- Scroll reveal (classes injectées par main.js) ---
     .reveal : état initial masqué
     .visible : animation au viewport */
  .reveal {
    opacity: 0;
    transform: translateY(16px);
  }

  .reveal.visible {
    animation: ag-fade-up 0.5s ease-out both;
  }

  /* USP items : slide depuis la gauche */
  .usp-item.reveal {
    transform: translateX(-14px);
  }
  .usp-item.visible {
    animation: ag-slide-left 0.5s ease-out both;
  }

  /* Stat items : scale-in */
  .stat-item.reveal {
    transform: scale(0.92) translateY(10px);
  }
  .stat-item.visible {
    animation: ag-scale-in 0.5s ease-out both;
  }

  /* Cascade — service cards */
  .services-grid .service-card.visible:nth-child(2) { animation-delay: 0.08s; }
  .services-grid .service-card.visible:nth-child(3) { animation-delay: 0.16s; }
  .services-grid .service-card.visible:nth-child(4) { animation-delay: 0.24s; }

  /* Cascade — USP items */
  .usp-grid .usp-item.visible:nth-child(2) { animation-delay: 0.07s; }
  .usp-grid .usp-item.visible:nth-child(3) { animation-delay: 0.14s; }
  .usp-grid .usp-item.visible:nth-child(4) { animation-delay: 0.21s; }
  .usp-grid .usp-item.visible:nth-child(5) { animation-delay: 0.28s; }

  /* Cascade — stat items */
  .stats-row .stat-item.visible:nth-child(2) { animation-delay: 0.08s; }
  .stats-row .stat-item.visible:nth-child(3) { animation-delay: 0.16s; }
  .stats-row .stat-item.visible:nth-child(4) { animation-delay: 0.24s; }

  /* Cascade — FAQ items */
  .faq-list .faq-item.visible:nth-child(2) { animation-delay: 0.06s; }
  .faq-list .faq-item.visible:nth-child(3) { animation-delay: 0.12s; }
  .faq-list .faq-item.visible:nth-child(4) { animation-delay: 0.18s; }
  .faq-list .faq-item.visible:nth-child(5) { animation-delay: 0.24s; }

  /* --- Hero : fade-up cascade (above-fold, time-based) --- */
  .hero h1 {
    animation: ag-fade-up 0.5s ease-out both;
    animation-delay: 0.05s;
  }

  .hero .hero-lead {
    animation: ag-fade-up 0.5s ease-out both;
    animation-delay: 0.18s;
  }

  .hero-actions {
    animation: ag-fade-up 0.5s ease-out both;
    animation-delay: 0.30s;
  }

  /* --- Hero placeholder : shimmer doux du dégradé --- */
  .hero .visual-placeholder {
    background-size: 200% 100%;
    animation: ag-shimmer 5s ease-in-out infinite alternate;
  }

  /* --- Placeholders non-hero : hover lift --- */
  .visual-placeholder {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .visual-placeholder:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(63,63,70,0.14);
  }

  /* Pas de lift sur le placeholder hero (fond sombre) */
  .hero .visual-placeholder:hover {
    transform: none;
    box-shadow: none;
  }

  /* --- FAQ : ouverture animée --- */
  details[open] .faq-answer {
    animation: ag-faq-open 0.22s ease-out both;
  }

  /* --- Focus ring élégant --- */
  :focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 3px;
    transition: outline-offset 0.15s ease;
  }
}

/* Réduction de mouvement — toujours actif */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
