/* ============================================================
   Moderne Formation (IMFT) — Design System
   Palette: Primary #B71C1C | Secondary #111827 | Accent #C9A227
   Background #FAFAFA | Surface #FFFFFF
   ============================================================ */

:root {
  --primary: #B71C1C;
  --primary-dark: #8E1414;
  --secondary: #111827;
  --accent: #C9A227;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #111827;
  --muted: #6B7280;
  --border: #E5E7EB;
  --success: #2E7D5B;
  --warning: #B7791F;
  --ring: rgba(183, 28, 28, .25);

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow: 0 8px 24px rgba(17, 24, 39, .08);
  --shadow-lg: 0 18px 40px rgba(17, 24, 39, .12);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --container: 1200px;
  --gap: 24px;

  --font-head: "Space Grotesk", "Cairo", system-ui, sans-serif;
  --font-body: "Inter", "Cairo", system-ui, sans-serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.25rem;
  --step-5: 3rem;
  --step-6: 3.75rem;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: clamp(48px, 8vw, 96px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -.02em; color: var(--secondary); font-weight: 700; }
h1 { font-size: clamp(2.25rem, 5vw, var(--step-6)); }
h2 { font-size: clamp(1.75rem, 3.5vw, var(--step-5)); margin-bottom: .5em; }
h3 { font-size: clamp(1.2rem, 2vw, var(--step-3)); margin-bottom: .4em; }
h4 { font-size: var(--step-1); margin-bottom: .35em; }
p { color: var(--text); }
.lead { font-size: var(--step-1); color: var(--muted); }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--primary);
  font-weight: 600; margin-bottom: 12px;
}
.eyebrow::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 10px; }
.text-center { text-align: center; }
.section-head { max-width: 720px; margin-inline: auto; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head p { color: var(--muted); margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  padding: 14px 26px; border-radius: var(--radius-sm); border: 2px solid transparent;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  will-change: transform;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #000; transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--secondary); padding-inline: 12px; }
.btn-ghost:hover { color: var(--primary); }
.btn-sm { padding: 10px 18px; font-size: .875rem; }
.btn-block { width: 100%; }

/* ---------- Trust bar ---------- */
.trustbar { background: var(--secondary); color: #fff; font-size: .85rem; }
.trustbar .container { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: center; padding-block: 9px; }
.trustbar span { display: inline-flex; align-items: center; gap: 8px; }
.trustbar b { color: var(--accent); font-weight: 600; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(250,250,250,.92);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; color: var(--secondary); font-size: 1.15rem; }
.brand .logo {
  height: 44px; width: auto; border-radius: 8px; display: block;
}
.brand small { display: block; font-size: .65rem; letter-spacing: .12em; color: var(--muted); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 14px; border-radius: 8px; color: var(--secondary); font-weight: 500; font-size: .95rem;
  transition: background .15s ease, color .15s ease;
}
.nav-links a:hover { background: #fff; color: var(--primary); }
.nav-links a.active { color: var(--primary); }
.nav-links a.active.btn, .nav-actions a.active.btn { color: #fff; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--secondary); margin: 4px 0; transition: .2s; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero-media {
  position: absolute; inset: 0; background: linear-gradient(120deg, #2a0d0d, #111827 70%);
  z-index: -2;
}
/* Placeholder for hero photo — replace with <img> */
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(800px 400px at 80% 10%, rgba(201,162,39,.22), transparent 60%),
    radial-gradient(700px 500px at 10% 90%, rgba(183,28,28,.35), transparent 60%);
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17,24,39,.55), rgba(17,24,39,.82)); z-index: -1; }
.hero .container { padding-block: clamp(64px, 11vw, 130px); }
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lead { color: rgba(255,255,255,.85); max-width: 52ch; margin-top: 16px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-outline:hover { background: #fff; color: var(--primary); }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; color: rgba(255,255,255,.8); font-size: .9rem; }
.hero-badges b { color: var(--accent); }

/* ---------- Image placeholder (use until real photos added) ---------- */
.img-ph {
  position: relative; background: linear-gradient(135deg, #1f2937, #374151);
  border-radius: var(--radius); overflow: hidden; color: rgba(255,255,255,.75);
  display: grid; place-items: center; text-align: center; min-height: 180px;
  border: 1px solid var(--border);
}
.img-ph::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(500px 300px at 70% 20%, rgba(201,162,39,.18), transparent 60%),
              radial-gradient(400px 300px at 20% 90%, rgba(183,28,28,.30), transparent 60%);
}
.img-ph span { position: relative; font-family: var(--font-head); font-size: .85rem; padding: 12px 16px; letter-spacing: .02em; }
.img-ph.ratio-16x9 { aspect-ratio: 16/9; }
.img-ph.ratio-4x3 { aspect-ratio: 4/3; }
.img-ph.ratio-1x1 { aspect-ratio: 1/1; }
.img-ph.ratio-3x2 { aspect-ratio: 3/2; }

/* Real images replacing placeholders */
.ph-img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); display: block; }
.ph-img.ratio-16x9 { aspect-ratio: 16/9; }
.ph-img.ratio-4x3 { aspect-ratio: 4/3; }
.ph-img.ratio-1x1 { aspect-ratio: 1/1; }
.ph-img.ratio-3x2 { aspect-ratio: 3/2; }
.gitem .ph-img { border-radius: 0; min-height: 0; }
.gitem .ph-img.ratio-1x1 { aspect-ratio: 1/1; }
.gitem .ph-img.ratio-3x2 { aspect-ratio: 3/2; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; }

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d6d3ca; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(183,28,28,.08); color: var(--primary); margin-bottom: 4px;
}
.card .ico svg { width: 24px; height: 24px; }
.card h3 { margin: 0; }
.card p { color: var(--muted); font-size: .95rem; }
.card .tag {
  align-self: flex-start; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(201,162,39,.12); color: #8a6d12; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill);
}

/* ---------- Domain cards (home) ---------- */
.domain { position: relative; overflow: hidden; padding: 0; }
.domain .media { position: relative; }
.domain .body { padding: 20px 22px 24px; }
.domain h3 { font-size: 1.15rem; }
.domain .arrow { color: var(--primary); font-weight: 700; }

/* ---------- Stats ---------- */
.stats { background: var(--secondary); color: #fff; }
.stats .grid { gap: 18px; }
.stat { text-align: center; padding: 18px; }
.stat .num { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; color: var(--accent); line-height: 1; }
.stat .lbl { color: rgba(255,255,255,.75); font-size: .9rem; margin-top: 8px; }

/* ---------- Feature / Why list ---------- */
.feature-list { display: grid; gap: 14px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .tick {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(46,125,91,.12); color: var(--success);
  display: grid; place-items: center; font-weight: 700; margin-top: 2px;
}

/* ---------- CTA band ---------- */
/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--primary), #7c1212);
  color: #fff; border-radius: 22px;
  padding: clamp(44px, 7vw, 84px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
}
.cta-band::before {
  content: ""; position: absolute; width: 320px; height: 320px; right: -80px; top: -120px;
  background: radial-gradient(circle, rgba(201,162,39,.30), transparent 70%); pointer-events: none;
}
.cta-band::after {
  content: ""; position: absolute; width: 260px; height: 260px; left: -90px; bottom: -120px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%); pointer-events: none;
}
.cta-icon {
  position: relative; z-index: 1; width: 66px; height: 66px; border-radius: 18px;
  background: rgba(255,255,255,.15); display: grid; place-items: center; font-size: 1.9rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.cta-text { position: relative; z-index: 1; }
.cta-eyebrow {
  color: var(--accent); font-family: var(--font-head); font-weight: 700;
  letter-spacing: .03em; margin-bottom: 8px; font-size: .95rem; text-transform: uppercase;
}
.cta-band h2 { color: #fff; margin: 0; font-size: clamp(1.55rem, 3vw, 2.3rem); line-height: 1.12; }
.cta-actions { position: relative; z-index: 1; display: flex; gap: 14px; flex-wrap: wrap; }
.cta-band .btn-secondary { background: #fff; color: var(--primary); }
.cta-band .btn-secondary:hover { background: #f1dede; }
.cta-band .btn-outline { color: #fff; border-color: rgba(255,255,255,.6); }
.cta-band .btn-outline:hover { background: #fff; color: var(--primary); }
@media (max-width: 820px) {
  .cta-band { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .cta-icon { margin-bottom: 4px; }
}

/* ---------- Partners ---------- */
.partners { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.partner {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 24px; min-width: 220px; text-align: center; color: var(--muted); font-size: .9rem;
}
.partner b { display: block; color: var(--secondary); font-family: var(--font-head); font-size: 1rem; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 12px; overflow: hidden; }
.faq-q { width: 100%; text-align: left; background: transparent; border: 0; padding: 18px 20px; display: flex; justify-content: space-between; gap: 16px; font-family: var(--font-head); font-weight: 600; color: var(--secondary); font-size: 1.02rem; }
.faq-q .plus { color: var(--primary); font-size: 1.4rem; line-height: 1; transition: transform .2s ease; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 20px 18px; color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field input, .field select, .field textarea {
  font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.field textarea { min-height: 130px; resize: vertical; }
.field .err { color: var(--primary); font-size: .82rem; min-height: 1em; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--primary); }
.form-note { font-size: .82rem; color: var(--muted); }
.form-ok { background: rgba(46,125,91,.1); border: 1px solid var(--success); color: var(--success); padding: 14px 16px; border-radius: var(--radius-sm); font-weight: 600; display: none; }
.form-ok.show { display: block; }

/* ---------- Contact cards / branches ---------- */
.branch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.branch h4 { display: flex; align-items: center; gap: 8px; }
.branch .pin { color: var(--primary); }
.branch p { color: var(--muted); font-size: .92rem; }
.phone-list { display: grid; gap: 10px; }
.phone-list a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; }
.phone-list a:hover { border-color: var(--primary); color: var(--primary); }
.phone-list .ico { width: 38px; height: 38px; border-radius: 10px; background: rgba(183,28,28,.08); color: var(--primary); display: grid; place-items: center; flex: none; }

/* ---------- Gallery ---------- */
.gallery-grid { columns: 3 280px; column-gap: 18px; }
.gallery-grid .gitem { break-inside: avoid; margin-bottom: 18px; border-radius: var(--radius); overflow: hidden; position: relative; cursor: zoom-in; border: 1px solid var(--border); }
.gallery-grid .gitem .img-ph { min-height: 0; }
.gallery-grid .gitem:hover { box-shadow: var(--shadow); }
.lightbox { position: fixed; inset: 0; background: rgba(17,24,39,.9); display: none; place-items: center; z-index: 100; padding: 24px; }
.lightbox.open { display: grid; }
.lightbox .box { max-width: 900px; width: 100%; }
.lightbox .close { position: absolute; top: 20px; right: 24px; background: #fff; color: var(--secondary); border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; }

/* ---------- Testimonials (structural placeholder) ---------- */
.temoignage-note { background: rgba(201,162,39,.1); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 16px 18px; color: #7a6110; font-size: .92rem; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.tcard .stars { color: var(--accent); letter-spacing: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--secondary); color: rgba(255,255,255,.78); margin-top: 0; }
.site-footer .container { padding-block: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,.72); display: inline-block; padding: 4px 0; }
.site-footer a:hover { color: var(--accent); }
.site-footer .brand { color: #fff; }
.site-footer .brand small { color: rgba(255,255,255,.6); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.footer-bottom a { color: rgba(255,255,255,.6); }

/* ---------- Sticky mobile CTA ---------- */
.sticky-cta { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: none; gap: 10px; }
.sticky-cta .btn { flex: 1; box-shadow: var(--shadow-lg); }
.sticky-cta .call { background: var(--secondary); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: .85rem; color: var(--muted); padding-block: 18px; }
.crumb a:hover { color: var(--primary); }

/* ---------- Page hero (inner) ---------- */
.page-hero { background: var(--secondary); color: #fff; }
.page-hero .container { padding-block: clamp(44px, 7vw, 80px); }
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255,255,255,.8); margin-top: 8px; max-width: 60ch; }

/* ---------- Tabs (formations) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.tab { padding: 10px 18px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-pill); font-weight: 600; font-size: .9rem; color: var(--secondary); }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-links, .nav-actions .btn { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    position: absolute; top: 100%; left: 0; right: 0; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 12px 20px 18px; box-shadow: var(--shadow);
  }
  .nav-links.open a { padding: 12px 14px; }
  .nav-links.open .btn { display: inline-flex; margin-top: 6px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .gallery-grid { columns: 2 200px; }
  .sticky-cta { display: flex; }
  .site-footer .container { padding-bottom: 90px; }
}
@media (max-width: 520px) {
  .gallery-grid { columns: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}

/* ============================================================
   Animation & UX enhancements
   ============================================================ */

/* Hero Ken Burns */
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12); } }
.hero-media img { animation: kenburns 20s ease-out infinite alternate; }

/* Nav underline */
.nav-links a { position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px;
  background: var(--primary); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* Button shine */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg); transition: left .6s ease;
}
.btn-primary:hover::after { left: 150%; }

/* Staggered reveal (JS sets --d) */
.reveal { transition-delay: var(--d, 0s); }

/* Card image flush-top + hover zoom */
.card > .ph-img:first-child { margin: -26px -26px 18px; border-radius: 14px 14px 0 0; width: auto; display: block; }
.card .ph-img { transition: transform .35s ease; }
.card:hover .ph-img { transform: scale(1.05); }
.domain .ph-img { transition: transform .35s ease; }
.domain:hover .ph-img { transform: scale(1.05); }

/* Tab panel fade-in */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tab-panel.active { animation: fadeUp .45s ease; }

/* Scroll progress bar */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 80; transition: width .1s linear; }

/* Back to top */
.to-top {
  position: fixed; right: 16px; bottom: 16px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 0; display: grid; place-items: center;
  font-size: 1.3rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transform: translateY(10px); transition: opacity .3s ease, transform .3s ease; z-index: 65;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--primary-dark); }

/* Counter pop */
.stat .num { transition: transform .3s ease; }
.stat.in .num { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Pause animations for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; }
  .btn-primary::after { display: none; }
  .tab-panel.active { animation: none; }
  .stat.in .num { animation: none; }
}

/* On mobile keep scroll progress hidden behind sticky CTA nicely */
@media (max-width: 860px) {
  .to-top { bottom: 76px; }
}

