@import "./tokens.css";

/* ===== 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;
}

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-accent);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.4rem); }
h4 { font-size: 1.1rem; color: var(--color-primary); }

p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.4rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

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

section { padding: 3rem 0; }

/* ===== 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));
}

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img { height: 44px; width: auto; }

.main-nav { display: none; }

.main-nav.open { display: flex; }

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

.nav-list li a:hover,
.nav-list li a[aria-current="page"] {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.nav-cta {
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 4px;
  padding: 0.6rem 1.2rem !important;
}

.nav-toggle {
  background: none;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  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); }

/* Mobile: nav as overlay under header */
@media (max-width: 767px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 0.5rem 1rem 1rem;
  }
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .main-nav { display: flex !important; }
  .nav-list { flex-direction: row; gap: 0.25rem; }
  .nav-list li a { padding: 0.5rem 0.75rem; }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 60%, color-mix(in srgb, var(--color-secondary) 40%, var(--color-primary)) 100%);
  color: #fff;
  padding: 4rem 0 3rem;
}

.hero .container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-text { flex: 1; }

.hero-badge {
  display: inline-block;
  background: var(--color-secondary);
  color: var(--color-accent);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}

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

.hero-subtitle {
  font-size: 1.1rem;
  opacity: 0.92;
  margin-bottom: 1.5rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }

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

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

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

.hero-visual { flex: 1; }

@media (min-width: 768px) {
  .hero .container { flex-direction: row; align-items: center; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
}

/* ===== HORAIRES STRIP ===== */
.horaires-strip {
  background: var(--color-secondary);
  padding: 0.85rem 0;
  text-align: center;
}

.horaires-strip p {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-accent);
}

.horaires-strip a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ===== SECTION STYLES ===== */
.section-title {
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

.section-lead {
  font-size: 1.05rem;
  color: color-mix(in srgb, var(--color-text) 70%, #fff);
  margin-bottom: 2rem;
  max-width: 600px;
}

.section-alt { background: color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)); }

/* ===== UNIVERS CARDS ===== */
.univers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.univers-card {
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid color-mix(in srgb, var(--color-primary) 12%, var(--color-bg));
  transition: box-shadow 0.2s, transform 0.2s;
}

.univers-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.13); transform: translateY(-2px); }

.univers-card-body { padding: 1.25rem 1.25rem 1.5rem; }
.univers-card-body h3 { margin-bottom: 0.6rem; }
.univers-card-body p { margin-bottom: 0; font-size: 0.95rem; }

@media (min-width: 600px) { .univers-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .univers-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== FEATURES ===== */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-item { display: flex; gap: 1rem; align-items: flex-start; }

.feature-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.feature-item h4 { margin-bottom: 0.25rem; }
.feature-item p { margin: 0; font-size: 0.92rem; }

@media (min-width: 768px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

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

.cta-section h2 { color: var(--color-secondary); margin-bottom: 1rem; }
.cta-section p { margin-bottom: 2rem; opacity: 0.9; font-size: 1.05rem; }

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

@media (min-width: 480px) {
  .cta-actions { flex-direction: row; justify-content: center; }
}

/* ===== SERVICES PAGE ===== */
.carte-section {
  padding: 3rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 12%, var(--color-bg));
}

.carte-section:last-of-type { border-bottom: none; }

.carte-section-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.carte-section-text { flex: 1; }
.carte-section-visual { flex: 1; }

.menu-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.menu-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 10%, var(--color-bg));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.97rem;
}

.menu-list li::before {
  content: "•";
  color: var(--color-primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .carte-section-inner { flex-direction: row; align-items: flex-start; }
  .carte-section-inner.reverse { flex-direction: row-reverse; }
}

/* ===== A PROPOS ===== */
.about-intro {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.about-intro-text { flex: 1; }
.about-intro-visual { flex: 1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

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

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

.stat-label { font-size: 0.85rem; opacity: 0.9; }

@media (min-width: 768px) {
  .about-intro { flex-direction: row; align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

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

@media (min-width: 768px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

.contact-info dt {
  font-weight: 700;
  color: var(--color-accent);
  margin-top: 1rem;
  font-family: var(--font-display);
}
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd { margin-left: 0; margin-top: 0.25rem; }

.contact-info .tel-link {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}

.map-wrapper {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--color-primary) 20%, var(--color-bg));
}

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

/* ===== FORM ===== */
.contact-form-section { background: color-mix(in srgb, var(--color-secondary) 15%, var(--color-bg)); }

.contact-form { max-width: 640px; }

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

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--color-accent);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid color-mix(in srgb, var(--color-text) 20%, var(--color-bg));
  border-radius: 6px;
  transition: border-color 0.2s;
}

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

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

.form-note {
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--color-text) 60%, #fff);
  margin-top: 0.75rem;
}

/* ===== PAGE HERO (inner pages) ===== */
.page-hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
  color: #fff;
  padding: 3rem 0 2.5rem;
}

.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero p { opacity: 0.9; margin: 0; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: underline; }

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

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

.footer-brand img { height: 40px; filter: brightness(0) invert(1); margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.9rem; margin: 0; opacity: 0.85; }

.footer-col h4 {
  color: var(--color-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-weight: 700;
}

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: rgba(255,255,255,0.85); font-size: 0.9rem; }
.footer-col ul li a:hover { color: var(--color-secondary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.82rem;
  opacity: 0.7;
}

@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }

/* ===== SKIP NAV ===== */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 999;
  border-radius: 0 0 4px 0;
  font-weight: 700;
}
.skip-nav:focus { top: 0; }

/* ===== SOCIAL PROOF ===== */
.social-proof {
  background: var(--color-bg);
  padding: 2.5rem 0;
  text-align: center;
}

.social-proof blockquote {
  font-style: italic;
  font-size: 1.05rem;
  color: color-mix(in srgb, var(--color-text) 80%, #fff);
  max-width: 600px;
  margin: 0 auto 1rem;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-secondary);
  background: color-mix(in srgb, var(--color-secondary) 12%, var(--color-bg));
  border-radius: 0 8px 8px 0;
  text-align: left;
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {

  /* --- Keyframes --- */
  @keyframes slide-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
  }

  @keyframes badge-pop {
    0%   { opacity: 0; transform: translateY(8px) scale(0.9); }
    65%  { transform: translateY(-3px) scale(1.03); }
    85%  { transform: translateY(1px) scale(0.99); }
    100% { opacity: 1; transform: none; }
  }

  @keyframes cta-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.02); }
  }

  /* --- Hero : animations au chargement --- */
  .hero-badge {
    animation: badge-pop 0.5s ease-out both;
    animation-delay: 0.1s;
  }

  .hero h1 {
    animation: slide-up 0.6s ease-out both;
    animation-delay: 0.2s;
  }

  .hero-subtitle {
    animation: slide-up 0.6s ease-out both;
    animation-delay: 0.35s;
  }

  .hero-actions {
    animation: slide-up 0.6s ease-out both;
    animation-delay: 0.5s;
  }

  .hero-visual {
    animation: slide-up 0.6s ease-out both;
    animation-delay: 0.3s;
  }

  /* --- Stagger scroll-reveal pour cartes univers --- */
  .univers-grid .univers-card:nth-child(1) { transition-delay:   0ms; }
  .univers-grid .univers-card:nth-child(2) { transition-delay: 120ms; }
  .univers-grid .univers-card:nth-child(3) { transition-delay: 240ms; }
  .univers-grid .univers-card:nth-child(4) { transition-delay: 360ms; }

  /* --- Stagger pour feature items --- */
  .features-grid .feature-item:nth-child(1) { transition-delay:   0ms; }
  .features-grid .feature-item:nth-child(2) { transition-delay: 120ms; }
  .features-grid .feature-item:nth-child(3) { transition-delay: 240ms; }

  /* --- Section titres : soulignement warm-orange au scroll --- */
  .section-title {
    position: relative;
    display: inline-block;
  }

  .section-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
  }

  .section-title.is-visible::after {
    transform: scaleX(1);
  }

  /* --- Visual placeholder : dégradé qui glisse au survol de la carte --- */
  .visual-placeholder {
    transition: background-position 0.6s ease;
    background-size: 200% 200%;
    background-position: 0% 0%;
  }

  .univers-card:hover .visual-placeholder {
    background-position: 100% 100%;
  }

  /* --- CTA bouton principal : pulse discret (2 fois) à l'entrée viewport --- */
  .cta-section .btn-primary.is-visible {
    animation: cta-pulse 0.4s ease-in-out 2;
  }

  /* --- Focus visible amélioré sur les boutons --- */
  .btn:focus-visible {
    outline: 3px solid var(--color-secondary);
    outline-offset: 4px;
  }

}

/* --- Garde-fou accessibilité : désactive toutes les animations si demandé --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
