/* ═══════════════════════════════════════════════════════════════
   SQGS Hero Animation 2026 — v6.0
   Semaine Québécoise de la Garde Scolaire
   "Un tourbillon de créativité"
═══════════════════════════════════════════════════════════════ */

#sqgs-hero *, #sqgs-hero *::before, #sqgs-hero *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}

/* ─── Hero container ────────────────────────────────────────── */
#sqgs-hero {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  height: 100vh;
  max-height: 820px;
  min-height: 480px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #fdf6e3 0%, #f5edd4 55%, #ede5c8 100%);
  font-family: 'Nunito', sans-serif;
}

/* ─── Canvas particules ─────────────────────────────────────── */
#sqgs-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* ─── Bulles flottantes ─────────────────────────────────────── */
.sqgs-bubbles {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none; overflow: hidden;
}

.sqgs-bubble {
  position: absolute; border-radius: 50%; opacity: 0;
  animation: sqgs-bubble-rise var(--dur, 8s) var(--delay, 0s) ease-in infinite;
}

.sqgs-bubble--1  { --dur:9s;  --delay:0s;    width:14px; height:14px; left:8%;   background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(212,98,26,0.3));   border:1px solid rgba(212,98,26,0.25); }
.sqgs-bubble--2  { --dur:12s; --delay:1.5s;  width:22px; height:22px; left:15%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(42,110,110,0.25)); border:1px solid rgba(42,110,110,0.2); }
.sqgs-bubble--3  { --dur:7s;  --delay:3s;    width:10px; height:10px; left:25%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(240,160,48,0.3));  border:1px solid rgba(240,160,48,0.2); }
.sqgs-bubble--4  { --dur:10s; --delay:0.8s;  width:18px; height:18px; left:35%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(212,98,26,0.25)); border:1px solid rgba(212,98,26,0.2); }
.sqgs-bubble--5  { --dur:14s; --delay:2s;    width:28px; height:28px; left:45%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.7), rgba(42,110,110,0.2));  border:1px solid rgba(42,110,110,0.15); }
.sqgs-bubble--6  { --dur:8s;  --delay:4s;    width:12px; height:12px; left:55%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(240,160,48,0.3));  border:1px solid rgba(240,160,48,0.2); }
.sqgs-bubble--7  { --dur:11s; --delay:1s;    width:20px; height:20px; left:65%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(212,98,26,0.3));   border:1px solid rgba(212,98,26,0.2); }
.sqgs-bubble--8  { --dur:9s;  --delay:5s;    width:16px; height:16px; left:72%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(42,110,110,0.25)); border:1px solid rgba(42,110,110,0.2); }
.sqgs-bubble--9  { --dur:13s; --delay:2.5s;  width:24px; height:24px; left:82%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.7), rgba(240,160,48,0.25)); border:1px solid rgba(240,160,48,0.15); }
.sqgs-bubble--10 { --dur:6s;  --delay:0.3s;  width:8px;  height:8px;  left:90%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(212,98,26,0.35));  border:1px solid rgba(212,98,26,0.25); }
.sqgs-bubble--11 { --dur:10s; --delay:3.5s;  width:18px; height:18px; left:5%;   background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(42,110,110,0.3));  border:1px solid rgba(42,110,110,0.2); }
.sqgs-bubble--12 { --dur:15s; --delay:1.2s;  width:32px; height:32px; left:20%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.6), rgba(212,98,26,0.15)); border:1px solid rgba(212,98,26,0.1); }
.sqgs-bubble--13 { --dur:8s;  --delay:6s;    width:11px; height:11px; left:40%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(240,160,48,0.35)); border:1px solid rgba(240,160,48,0.25); }
.sqgs-bubble--14 { --dur:11s; --delay:2.8s;  width:19px; height:19px; left:58%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(42,110,110,0.25)); border:1px solid rgba(42,110,110,0.2); }
.sqgs-bubble--15 { --dur:7s;  --delay:4.5s;  width:13px; height:13px; left:75%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(212,98,26,0.3));   border:1px solid rgba(212,98,26,0.2); }
.sqgs-bubble--16 { --dur:16s; --delay:0.6s;  width:36px; height:36px; left:30%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.5), rgba(42,110,110,0.12)); border:1px solid rgba(42,110,110,0.08); }
.sqgs-bubble--17 { --dur:9s;  --delay:3.2s;  width:15px; height:15px; left:50%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(240,160,48,0.3));  border:1px solid rgba(240,160,48,0.2); }
.sqgs-bubble--18 { --dur:12s; --delay:1.8s;  width:21px; height:21px; left:85%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.7), rgba(212,98,26,0.25)); border:1px solid rgba(212,98,26,0.15); }
.sqgs-bubble--19 { --dur:10s; --delay:5.5s;  width:17px; height:17px; left:12%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.8), rgba(42,110,110,0.3));  border:1px solid rgba(42,110,110,0.2); }
.sqgs-bubble--20 { --dur:8s;  --delay:7s;    width:9px;  height:9px;  left:62%;  background:radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9), rgba(240,160,48,0.35)); border:1px solid rgba(240,160,48,0.25); }

@keyframes sqgs-bubble-rise {
  0%   { bottom: -40px; opacity: 0; transform: translateX(0) scale(0.8); }
  10%  { opacity: 0.7; }
  50%  { transform: translateX(20px) scale(1); }
  80%  { opacity: 0.4; }
  100% { bottom: 110%; opacity: 0; transform: translateX(-15px) scale(0.9); }
}

/* ─── Points décoratifs ─────────────────────────────────────── */
.sqgs-dot {
  position: absolute; border-radius: 50%; z-index: 3;
  pointer-events: none;
  animation: sqgs-dot-float 6s ease-in-out infinite;
}
@keyframes sqgs-dot-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.45; }
  50%       { transform: translateY(-12px) scale(1.15); opacity: 0.65; }
}

/* ─── Scène principale ──────────────────────────────────────── */
.sqgs-sc { position: absolute; inset: 0; z-index: 4; }

/* ─── Tourbillon central (image officielle du thème) ────────── */
#sqgs-tourb {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46%; max-width: 580px; min-width: 260px;
  z-index: 5; opacity: 0;
  transition: opacity 1.4s ease;
  filter: drop-shadow(0 8px 32px rgba(212,98,26,0.18));
}
#sqgs-tourb img { width: 100%; height: auto; display: block; }
#sqgs-tourb.on  { opacity: 1; }
#sqgs-tourb.fl  { animation: sqgs-tourb-float 9s ease-in-out infinite; }

@keyframes sqgs-tourb-float {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  33%       { transform: translate(-50%, -51.5%) scale(1.012) rotate(0.4deg); }
  66%       { transform: translate(-50%, -49%) scale(1.008) rotate(-0.3deg); }
}

/* Halo animé autour du tourbillon */
#sqgs-tourb::before {
  content: '';
  position: absolute; inset: -8%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(212,98,26,0.07) 0deg, rgba(42,110,110,0.05) 90deg,
    rgba(240,160,48,0.07) 180deg, rgba(212,98,26,0.03) 270deg,
    rgba(212,98,26,0.07) 360deg
  );
  animation: sqgs-halo-spin 22s linear infinite;
  pointer-events: none; z-index: -1;
}
@keyframes sqgs-halo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Personnages ───────────────────────────────────────────── */
.sqgs-ch {
  position: absolute; z-index: 6; opacity: 0;
  will-change: transform, opacity;
}
.sqgs-ch img {
  width: 100%; height: auto; display: block;
  filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.15));
}
.sqgs-ch.sr { transform: translateX(-50px); }
.sqgs-ch.sl { transform: translateX(50px); }
.sqgs-ch.su { transform: translateY(40px); }
.sqgs-ch.on {
  opacity: 1; transform: translate(0, 0) !important;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Flottement continu : chaque personnage a sa propre durée et amplitude */
.sqgs-ch.fl {
  animation:
    sqgs-ch-float-y var(--float-dur, 5s) var(--float-delay, 0s) ease-in-out infinite,
    sqgs-ch-float-x calc(var(--float-dur, 5s) * 1.4) var(--float-delay, 0s) ease-in-out infinite,
    sqgs-ch-float-rot calc(var(--float-dur, 5s) * 1.8) var(--float-delay, 0s) ease-in-out infinite;
}

/* Variations individuelles injectées via JS */

@keyframes sqgs-ch-float-y {
  0%, 100% { translate: 0 0; }
  30%       { translate: 0 calc(var(--float-amp, -9px)); }
  70%       { translate: 0 calc(var(--float-amp, -9px) * 0.4); }
}
@keyframes sqgs-ch-float-x {
  0%, 100% { margin-left: 0; }
  40%       { margin-left: calc(var(--float-sway, 4px)); }
  80%       { margin-left: calc(var(--float-sway, 4px) * -0.6); }
}
@keyframes sqgs-ch-float-rot {
  0%, 100% { rotate: 0deg; }
  35%       { rotate: calc(var(--float-tilt, 1.2deg)); }
  70%       { rotate: calc(var(--float-tilt, 1.2deg) * -0.7); }
}

.sqgs-deco-bl, .sqgs-deco-br { display: none !important; }

/* CTA supprimés */
#sqgs-cta-wrap { display: none !important; }
/* ─── (réservé) ──────────────── */
#sqgs-cta-wrap-DISABLED {
  position: absolute;
  bottom: 32px;
  left: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#sqgs-cta-wrap.on { opacity: 1; transform: translateY(0); }

.sqgs-cta {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 28px;
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: clamp(12px, 1.15vw, 15px);
  letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
  white-space: nowrap;
  border-radius: 100px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.25s ease,
              letter-spacing 0.25s ease;
}
.sqgs-cta::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sqgs-cta:hover { transform: translateY(-4px) scale(1.03); letter-spacing: 0.06em; }
.sqgs-cta:hover::after { opacity: 1; }
.sqgs-cta:active { transform: translateY(-1px) scale(0.98); }

/* Bouton principal : dégradé chaud + shimmer */
.sqgs-cta-p {
  background: linear-gradient(135deg, #e8692a 0%, #d4621a 40%, #c05518 100%);
  color: #fff;
  box-shadow:
    0 4px 20px rgba(212,98,26,0.45),
    0 1px 0 rgba(255,255,255,0.15) inset;
  border: none;
}
.sqgs-cta-p::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-20deg);
  animation: sqgs-btn-shimmer 3.5s ease-in-out infinite;
}
.sqgs-cta-p:hover {
  box-shadow:
    0 8px 32px rgba(212,98,26,0.55),
    0 1px 0 rgba(255,255,255,0.2) inset;
}
.sqgs-cta-p::after {
  background: linear-gradient(135deg, #f07830 0%, #e06020 100%);
}

@keyframes sqgs-btn-shimmer {
  0%   { left: -100%; }
  40%  { left: 160%; }
  100% { left: 160%; }
}

/* Bouton secondaire : glassmorphism teal */
.sqgs-cta-s {
  background: rgba(42,110,110,0.08);
  color: #2a6e6e;
  border: 2px solid rgba(42,110,110,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 4px 16px rgba(42,110,110,0.12),
    0 1px 0 rgba(255,255,255,0.6) inset;
}
.sqgs-cta-s:hover {
  background: rgba(42,110,110,0.9);
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 8px 28px rgba(42,110,110,0.4),
    0 1px 0 rgba(255,255,255,0.15) inset;
}
.sqgs-cta-s::after {
  background: rgba(42,110,110,0.15);
}

/* ─── Flèche scroll ─────────────────────────────────────────── */
#sqgs-scroll {
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%); z-index: 20; opacity: 0; transition: opacity 0.6s ease;
}
#sqgs-scroll.on { opacity: 0.55; }
.sqgs-arrow {
  width: 22px; height: 22px;
  border-right: 3px solid #2a6e6e; border-bottom: 3px solid #2a6e6e;
  transform: rotate(45deg); animation: sqgs-arrow-bounce 1.6s ease-in-out infinite;
}
@keyframes sqgs-arrow-bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50%       { transform: rotate(45deg) translateY(5px); }
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  #sqgs-hero { max-height: 700px; }
  
}

@media (max-width: 900px) {
  #sqgs-hero { max-height: 600px; min-height: 420px; }
  #sqgs-tourb { width: 55%; }
  
  #sqgs-cta-wrap { bottom: 18px; left: 16px; gap: 8px; }
  .sqgs-cta { padding: 9px 18px; font-size: 12px; }
}

@media (max-width: 640px) {
  #sqgs-hero { height: 90vw; max-height: 520px; min-height: 360px; }
  #sqgs-tourb { width: 65%; }
  
  #sqgs-cta-wrap { bottom: 12px; left: 10px; gap: 7px; }
  .sqgs-cta { padding: 8px 14px; font-size: 11px; }
  .sqgs-bubble--12, .sqgs-bubble--16, .sqgs-bubble--5, .sqgs-bubble--9 { display: none; }
}

@media (max-width: 400px) {
  #sqgs-hero { height: 100vw; min-height: 300px; }
  #sqgs-tourb { width: 72%; }
  
  #sqgs-cta-wrap { flex-direction: row; flex-wrap: wrap; bottom: 8px; left: 8px; gap: 6px; }
  .sqgs-cta { padding: 7px 12px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .sqgs-bubble, .sqgs-dot, #sqgs-tourb.fl, .sqgs-ch.fl,
 .sqgs-arrow,
  #sqgs-tourb::before { animation: none !important; }
}
