/* ==========================================================================
   Cleverix — global.css
   Palette de marque, header universel, composants glassmorphism,
   pages : accueil (index.html) + scrollytelling SEO (agence-seo-marrakech.html)
   ========================================================================== */

:root {
  /* Marque */
  --c-bg: #112f38;
  --c-bg-2: #1f4854;
  --c-bg-deep: #0b2229;
  --c-cyan: #2ee6d6;
  --c-cyan-soft: rgba(46, 230, 214, 0.14);
  --c-gold: #f2b544;
  --c-gold-soft: rgba(242, 181, 68, 0.16);
  --c-text: #eef6f7;
  --c-muted: #a9c3c9;
  --c-line: rgba(255, 255, 255, 0.10);

  /* Glassmorphism */
  --glass-bg: rgba(24, 54, 63, 0.85);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(10px);
  --glass-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.55);

  --radius: 18px;
  --radius-sm: 10px;
  --header-h: 76px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);

  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(46, 230, 214, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 40%, rgba(242, 181, 68, 0.07), transparent 60%),
    var(--c-bg);
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

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

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-cyan);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }

.accent-gold { color: var(--c-gold); }
.accent-cyan { color: var(--c-cyan); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; line-height: 1;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--c-gold); color: #10262d; box-shadow: 0 10px 30px -10px rgba(242, 181, 68, .6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -10px rgba(242, 181, 68, .75); }
.btn-ghost { border-color: rgba(46, 230, 214, .5); color: var(--c-cyan); background: transparent; }
.btn-ghost:hover { background: var(--c-cyan-soft); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--c-cyan); outline-offset: 3px; }

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

/* ==========================================================================
   Header universel
   ========================================================================== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled {
  background: rgba(17, 47, 56, 0.82);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 0 var(--c-line);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 24px; }

.brand { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.brand small { margin-top: 5px; font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--c-gold); }

.main-nav { margin-left: auto; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a, .main-nav .nav-toggle-sub {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 8px;
  font-size: 14.5px; font-weight: 500; color: var(--c-text);
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.main-nav a:hover, .main-nav .nav-toggle-sub:hover, .main-nav a[aria-current="page"] { color: var(--c-cyan); }
.caret { width: 10px; height: 10px; transition: transform .2s ease; }

.submenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 250px;
  list-style: none; margin: 0; padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.submenu a { padding: 9px 12px; font-size: 14px; }
.submenu a:hover { background: var(--c-cyan-soft); }
.submenu .is-hl a { color: var(--c-gold); }
.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu,
.has-sub.is-open > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.has-sub:hover .caret, .has-sub.is-open .caret { transform: rotate(180deg); }

.socials { display: flex; gap: 8px; }
.socials a {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--c-line); color: var(--c-muted);
  transition: color .2s, border-color .2s, background .2s;
}
.socials a:hover { color: var(--c-cyan); border-color: var(--c-cyan); background: var(--c-cyan-soft); }
.socials svg { width: 16px; height: 16px; }

.burger { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--c-line); background: none; color: var(--c-text); cursor: pointer; }
.burger span, .burger span::before, .burger span::after { display: block; width: 20px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: transform .25s ease, background .25s; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.nav-open .burger span { background: transparent; }
.nav-open .burger span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .burger span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1020px) {
  .burger { display: block; }
  .site-header .socials { display: none; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    padding: 12px var(--gutter) 24px;
    background: rgba(17, 47, 56, 0.97);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--c-line);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
  .nav-open .main-nav { opacity: 1; visibility: visible; transform: none; }
  .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a, .main-nav .nav-toggle-sub { width: 100%; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--c-line); border-radius: 0; font-size: 16px; }
  .submenu { position: static; min-width: 0; opacity: 1; visibility: visible; transform: none; display: none; background: none; border: 0; box-shadow: none; padding: 0 0 0 14px; }
  .has-sub:hover > .submenu { display: none; }
  .has-sub.is-open > .submenu { display: block; }
  .main-nav .socials { display: flex; padding-top: 18px; }
}
@media (min-width: 1021px) { .main-nav .socials-mobile { display: none; } }

/* ==========================================================================
   Accueil (index.html)
   ========================================================================== */
.home-hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 80px;
}
.home-hero .container { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.home-hero h1 { font-size: clamp(34px, 5.2vw, 62px); font-weight: 700; }
.home-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--c-cyan), var(--c-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--c-muted); max-width: 58ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 44px; }
.hero-stats strong { display: block; font-family: var(--font-head); font-size: 28px; color: var(--c-gold); }
.hero-stats span { font-size: 13px; color: var(--c-muted); }

.hero-visual { position: relative; aspect-ratio: 1; max-width: 460px; justify-self: center; width: 100%; }
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(46, 230, 214, .25); animation: spin 40s linear infinite; }
.orbit.o2 { inset: 14%; border-color: rgba(242, 181, 68, .25); animation-duration: 28s; animation-direction: reverse; }
.orbit-core { position: absolute; inset: 30%; border-radius: 50%; display: grid; place-items: center; text-align: center; padding: 16px; }
.orbit-core img { width: 80%; }
.orbit-chip { position: absolute; padding: 10px 16px; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.orbit-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-cyan); }
.orbit-chip.c1 { top: 4%; left: 50%; transform: translateX(-50%); }
.orbit-chip.c2 { bottom: 16%; left: -4%; }
.orbit-chip.c2 i { background: var(--c-gold); }
.orbit-chip.c3 { bottom: 16%; right: -4%; }
@keyframes spin { to { transform: rotate(360deg); } }

.section { padding: clamp(70px, 10vw, 120px) 0; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(28px, 3.6vw, 42px); }

.poles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pole { padding: 32px 28px; display: flex; flex-direction: column; transition: transform .3s ease, border-color .3s ease; }
.pole:hover { transform: translateY(-6px); border-color: rgba(46, 230, 214, .45); }
.pole-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--c-cyan-soft); color: var(--c-cyan); margin-bottom: 22px; }
.pole-icon svg { width: 26px; height: 26px; }
.pole.gold .pole-icon { background: var(--c-gold-soft); color: var(--c-gold); }
.pole h3 { font-size: 22px; }
.pole p { color: var(--c-muted); font-size: 15px; }
.pole ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: 14px; }
.pole li { padding: 6px 0 6px 22px; position: relative; }
.pole li::before { content: ""; position: absolute; left: 0; top: 14px; width: 10px; height: 2px; background: var(--c-cyan); }
.pole .link { margin-top: auto; color: var(--c-gold); font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.pole .link:hover { gap: 12px; }

.cta-band { padding: clamp(36px, 5vw, 60px); display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 8px; }
.cta-band p { margin: 0; color: var(--c-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--c-line); padding: 48px 0 30px; font-size: 14px; color: var(--c-muted); background: var(--c-bg-deep); position: relative; z-index: 5; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: var(--c-text); font-size: 15px; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a:hover { color: var(--c-cyan); }
.site-footer .brand img { height: 30px; width: auto; margin-bottom: 14px; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--c-line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }

@media (max-width: 900px) {
  .home-hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 340px; }
  .poles { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ==========================================================================
   Scrollytelling SEO (agence-seo-marrakech.html)
   ========================================================================== */
#motion-stage { position: relative; }

#motion-bird {
  position: fixed; top: 0; left: 0; z-index: 40;
  width: clamp(70px, 9vw, 130px);
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .35));
  opacity: 0; /* révélé par bird-motion.js */
}
#motion-bird .bird-flip { transform-origin: 50% 50%; }
#motion-bird .wing { transform-origin: 46px 44px; transform-box: view-box; }
#motion-bird .wing-back { transform-origin: 50px 44px; }

.m-section {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 40px) 0 80px;
}
.m-section .container { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
/* Alternance : l'oiseau occupe la colonne vide */
.m-section[data-bird="left"] .m-content { grid-column: 2; }
.m-section[data-bird="right"] .m-content { grid-column: 1; }

.m-index { font-family: var(--font-head); font-size: 13px; color: var(--c-gold); letter-spacing: .2em; margin-bottom: 12px; display: block; }
.m-section h2 { font-size: clamp(30px, 4vw, 48px); }
.m-intro { color: var(--c-muted); font-size: 17px; margin-bottom: 26px; }

.m-cards { display: grid; gap: 14px; }
.m-card { padding: 20px 22px; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.m-card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--c-cyan-soft); color: var(--c-cyan); }
.m-card:nth-child(2) .ico { background: var(--c-gold-soft); color: var(--c-gold); }
.m-card .ico svg { width: 22px; height: 22px; }
.m-card h3 { font-size: 17px; margin: 2px 0 4px; }
.m-card p { margin: 0; font-size: 14.5px; color: var(--c-muted); line-height: 1.55; }

/* Hero SEO + Arbre aux livres */
.m-hero .container { grid-template-columns: 1.05fr .95fr; }
.m-hero h1 { font-size: clamp(38px, 6vw, 72px); font-weight: 700; }
.m-hero h1 span { color: var(--c-gold); }
.book-tree { width: 100%; max-width: 480px; justify-self: center; overflow: visible; }
.book-tree .leaf-book { transform-box: fill-box; transform-origin: 50% 100%; }

/* Conclusion */
.m-final .container { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.m-final .m-content { grid-column: 1 !important; max-width: 760px; padding: clamp(32px, 5vw, 56px); }
.m-final .hero-ctas { justify-content: center; }
.m-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin-top: 28px; font-size: 14.5px; color: var(--c-muted); }
.m-contact a:hover { color: var(--c-cyan); }

/* Progression */
.m-progress { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; gap: 10px; }
.m-progress a { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: background .3s, transform .3s; }
.m-progress a.is-active { background: var(--c-gold); transform: scale(1.5); }

@media (max-width: 900px) {
  .m-section .container, .m-hero .container { grid-template-columns: 1fr; gap: 28px; }
  .m-section[data-bird] .m-content { grid-column: 1; }
  .m-section { padding-top: calc(var(--header-h) + 90px); }
  .m-hero { padding-top: calc(var(--header-h) + 30px); }
  .book-tree { max-width: 300px; order: -1; }
  .m-progress { display: none; }
  #motion-bird { width: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
