/* ============================================
   G&M Training Hub — Shared Enhancements
   Animations, transitions, decorative elements
   ============================================ */

/* ---------- SCROLL REVEALS (override + enhanced) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }
.reveal-delay-5 { transition-delay: .40s; }

.reveal-left { opacity: 0; transform: translateX(-32px); transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-left.in { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(32px); transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-right.in { opacity: 1; transform: translateX(0); }

.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1), transform 1.1s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-scale.in { opacity: 1; transform: scale(1); }

.reveal-blur { opacity: 0; filter: blur(8px); transition: opacity 1.1s ease, filter 1.1s ease; }
.reveal-blur.in { opacity: 1; filter: blur(0); }

/* Word-by-word reveal for hero titles.
   padding-bottom gives descenders (g, p, q, y) room inside the overflow:hidden box,
   margin-bottom offsets it so the visible baseline stays where the designer expects. */
.word-reveal .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.22em; margin-bottom: -0.22em; }
.word-reveal .word > span { display: inline-block; transform: translateY(110%); opacity: 0; transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease; }
.word-reveal.in .word > span { transform: translateY(0); opacity: 1; }
.word-reveal .word:nth-child(1) > span { transition-delay: 0.05s; }
.word-reveal .word:nth-child(2) > span { transition-delay: 0.12s; }
.word-reveal .word:nth-child(3) > span { transition-delay: 0.19s; }
.word-reveal .word:nth-child(4) > span { transition-delay: 0.26s; }
.word-reveal .word:nth-child(5) > span { transition-delay: 0.33s; }
.word-reveal .word:nth-child(6) > span { transition-delay: 0.40s; }
.word-reveal .word:nth-child(7) > span { transition-delay: 0.47s; }
.word-reveal .word:nth-child(8) > span { transition-delay: 0.54s; }
.word-reveal .word:nth-child(9) > span { transition-delay: 0.61s; }
.word-reveal .word:nth-child(10) > span { transition-delay: 0.68s; }
.word-reveal .word:nth-child(11) > span { transition-delay: 0.75s; }
.word-reveal .word:nth-child(12) > span { transition-delay: 0.82s; }

/* ---------- DECORATIVE BACKGROUNDS ---------- */
.bg-grid {
  background-image:
    linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.bg-dots {
  background-image: radial-gradient(rgba(15,23,42,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}
.bg-noise {
  position: relative;
}
.bg-noise::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  pointer-events: none; opacity: 0.4; mix-blend-mode: multiply;
}

/* Mesh gradient overlay */
.mesh-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(14,165,233,0.18), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(37,99,235,0.08), transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 80%, rgba(255,226,122,0.12), transparent 60%);
}

/* ---------- ENHANCED CARD INTERACTIONS ---------- */
.tilt-card { transition: transform .5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .5s cubic-bezier(0.16, 1, 0.3, 1), border-color .3s ease; will-change: transform; }

.shine { position: relative; overflow: hidden; }
.shine::after {
  content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left .8s ease;
  pointer-events: none;
}
.shine:hover::after { left: 100%; }

/* ---------- COUNT-UP ANIMATION ---------- */
.count-up { display: inline-block; }
.count-up.counting { animation: count-pulse 0.4s ease; }
@keyframes count-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ---------- MARQUEE / LOGO STRIP ---------- */
.marquee {
  overflow: hidden;
  padding: 32px 0;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 64px;
  animation: marquee-scroll 38s linear infinite;
  width: max-content;
  align-items: center;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: rgba(15,23,42,0.45);
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color .25s;
  display: flex;
  align-items: center;
  gap: 16px;
}
.marquee-item::after {
  content: "●";
  font-size: 6px;
  color: rgba(15,23,42,0.25);
  margin-left: 0;
}
.marquee-item:last-child::after { content: ""; }
.marquee-item:hover { color: rgba(15,23,42,0.85); }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 32px)); }
}

/* ---------- DECORATIVE LINE FLOURISH ---------- */
.flourish {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 600;
}
.flourish::before, .flourish::after {
  content: "";
  height: 1px;
  width: 32px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

/* ---------- ANIMATED LINK UNDERLINE ---------- */
.link-anim {
  position: relative;
  text-decoration: none;
  display: inline-block;
}
.link-anim::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-anim:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- BUTTON SHEEN ON HOVER ---------- */
.btn-primary, .btn-outline, .btn-white {
  position: relative;
  overflow: hidden;
}
.btn-primary::before, .btn-outline::before, .btn-white::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 80%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left .6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.btn-primary:hover::before, .btn-outline:hover::before, .btn-white:hover::before {
  left: 120%;
}

/* ---------- ARROW MOTION ---------- */
.nav-cta .arrow, .btn-primary .arrow {
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-cta:hover .arrow, .btn-primary:hover .arrow {
  transform: translateX(2px) rotate(-8deg);
}

/* ---------- PAGE LOAD FADE ---------- */
body { animation: page-load 0.6s ease-out; }
@keyframes page-load {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, #2563EB, #0EA5E9);
  z-index: 100;
  transition: width 0.1s ease;
  border-radius: 0 2px 2px 0;
}

/* ---------- BRAND LOGO IN NAV ----------
   Logo PNG has a transparent background; it sits directly on the nav surface,
   no chip frame, no padding box. Subtle lift on hover only. */
.logo {
  gap: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  transition: transform .25s ease;
}
.logo:hover {
  transform: translateY(-1px);
}
.logo-img {
  display: block;
  height: 80px;
  width: auto;
  transition: transform .25s ease;
}
.logo:hover .logo-img { transform: scale(1.02); }

/* Give the sticky nav room for the taller logo */
.nav-inner { padding-top: 12px; padding-bottom: 12px; }

@media (max-width: 1100px) { .logo-img { height: 68px; } }
@media (max-width: 820px)  { .logo-img { height: 58px; } .logo { padding: 6px 10px; } }
@media (max-width: 480px)  { .logo-img { height: 50px; } .logo { padding: 5px 8px; border-radius: 12px; } }

/* ---------- TYPOGRAPHY OVERRIDE — CORPORATE CLEAN ----------
   Swaps display serif (Instrument Serif) for Plus Jakarta Sans across all
   headlines, logo, stats, and accents. Loaded after each page's inline
   <head> styles, so wins by source order at equal specificity. Preserves
   the brand color system (blue/yellow accents, cream background) — only
   the typeface and weights change, for legibility at any age. */

.serif,
.logo-mark, .logo-mark .amp,
h1, h2, h3, h4, h5, h6,
h1.hero-title, h1.hero-title .accent, h1.hero-title .yellow-mark,
h1.page-title, h1.page-title .accent,
h2.section-title, h2.section-title .accent,
.stat-num, .stat-num .accent,
.what-num, .what-card h3,
.cat-tile .num, .cat-tile h4, .cat-num,
.approach-card h3, .approach-card h3 .accent,
.testi-mark, .testi-quote, .testi-quote em,
.person h3,
.cta-inner h3, .cta-inner h3 .accent,
.form-card h2, .form-card h2 .accent,
.featured h2, .featured h2 .accent,
.newsletter h2, .newsletter h2 .accent,
.partners h2.section-title .accent,
.approach h2.section-title .accent {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}

/* Drop the editorial italic on accent words — keep the brand color */
.accent,
.testi-quote em,
.logo-mark .amp,
.what-num,
.cat-tile .num,
.cat-num,
.testi-mark,
.italic {
  font-style: normal !important;
}

/* Tighten weights and tracking so the sans headlines feel substantial */
h1, h1.hero-title, h1.page-title { font-weight: 700; letter-spacing: -0.022em; line-height: 1.08; }
h2, h2.section-title { font-weight: 700; letter-spacing: -0.015em; }
h3, h4,
.what-card h3, .approach-card h3, .person h3,
.cta-inner h3, .form-card h2, .featured h2, .newsletter h2 {
  font-weight: 700; letter-spacing: -0.01em;
}
.logo-mark { font-weight: 700; letter-spacing: -0.01em; }
.logo-mark .amp { font-weight: 700; }
.stat-num { font-weight: 700; }
.what-num, .cat-tile .num, .cat-num { font-weight: 700; }
.cat-tile h4 { font-weight: 600; }
.testi-mark { font-weight: 800; line-height: 1; }
.testi-quote { font-weight: 500; }

/* ---------- CATEGORY TILE UPGRADE ----------
   Lifts the 24-disciplines grid out of "plain white box" territory into the
   brand language: gradient surface, dotted texture, yellow corner glow, and
   a numbered chip badge in the top-left that flips to blue on hover. */

.cat-tile {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--white) 0%, var(--cream-soft) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 60px 22px 22px;
  min-height: 168px;
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow .35s ease,
              border-color .35s ease;
}

/* Faint dot-grid texture — barely visible, lifts the surface */
.cat-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(37,99,235,0.07) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity .35s ease;
  z-index: 0;
}

/* Soft yellow glow in the top-right corner — expands on hover */
.cat-tile::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 96px; height: 96px;
  background: radial-gradient(circle at 30% 30%, var(--yellow-soft) 0%, rgba(14,165,233,0) 70%);
  pointer-events: none;
  transition: transform .5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.cat-tile:hover {
  transform: translateY(-6px);
  border-color: var(--ink);
  box-shadow: 0 22px 36px -24px rgba(15,23,42,0.22);
}
.cat-tile:hover::after  { transform: scale(1.55); }
.cat-tile:hover::before { opacity: 0.85; }

/* Number badge — circular chip, top-left */
.cat-tile .num {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream) !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-style: normal !important;
  font-size: 12.5px !important;
  letter-spacing: 0.02em;
  margin-bottom: 0 !important;
  transition: background .3s ease, transform .3s ease;
  z-index: 2;
}
.cat-tile:hover .num {
  background: var(--blue);
  transform: rotate(-6deg);
}

/* Title sits below the badge, more presence */
.cat-tile h4 {
  position: relative;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.28;
  margin-top: 4px;
  margin-bottom: auto !important;
  z-index: 1;
}

/* Arrow — bigger, more confident */
.cat-tile .arrow-mark {
  position: relative;
  font-size: 18px;
  color: var(--muted);
  align-self: flex-end;
  transition: color .25s, transform .25s;
  z-index: 1;
}
.cat-tile:hover .arrow-mark {
  color: var(--blue);
  transform: translateX(6px);
}

/* ---------- COURSE CARD PRICING ----------
   Price chip injected by JS into every .course-card on the courses page.
   Sits between the description and the foot (meta + CTA). */
.course-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.course-price {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.course-price-note {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
}

/* ---------- AMBIENT PASSIVE MOTION ----------
   Low-key, always-on motion in the spirit of the homepage's drifting blobs.
   Nothing demands attention — these are background-life cues. All paused
   automatically by prefers-reduced-motion further down. */

/* Slow breathing pulse on the primary nav CTA — invites the eye, never shouts */
.nav-cta {
  animation: cta-breathe 5.5s ease-in-out infinite;
}
@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.18); }
}

/* Gentle twinkle on the yellow star in section eyebrows / tag lines */
.tag::before {
  display: inline-block;
  animation: star-twinkle 4.2s ease-in-out infinite;
}
@keyframes star-twinkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50%      { opacity: 0.55; transform: scale(0.88) rotate(18deg); }
}

/* Very slow ambient float on .arrow circles inside buttons (idle state) */
.btn-primary .arrow, .nav-cta .arrow, .event-cta .arrow {
  animation: arrow-bob 3.8s ease-in-out infinite;
}
@keyframes arrow-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
/* On hover the existing translateX+rotate takes over — disable bob during hover */
.btn-primary:hover .arrow, .nav-cta:hover .arrow, .event-cta:hover .arrow {
  animation: none;
}

/* ---------- MEDIA / IMAGE TREATMENTS ----------
   Shared image styling so every page gets consistent rounded-corner, cover-fit
   photos without duplicating CSS. Variants:
     .media          base figure — rounded corners, contained cover
     .media-hero     square-ish portrait for hero side image
     .media-story    landscape image embedded next to story narratives
     .media-banner   full-bleed banner between sections (max 1240px)
     .media-frame    subtle yellow corner glow + border, used on conceptual visuals
*/

.media { margin: 0; border-radius: 22px; overflow: hidden; background: #FFFFFF; position: relative; }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; }

.media-hero { aspect-ratio: 4 / 5; max-width: 460px; width: 100%; }
@media (max-width: 900px) { .media-hero { aspect-ratio: 16 / 11; max-width: none; margin-top: 24px; } }

.media-story { aspect-ratio: 4 / 3; width: 100%; margin-top: 24px; }

.media-banner { max-width: 1240px; margin: 0 auto; padding: 0 32px 96px; }
.media-banner .media { aspect-ratio: 21 / 9; border-radius: 24px; }
@media (max-width: 720px) { .media-banner .media { aspect-ratio: 4 / 3; } }

.media-frame {
  border: 1px solid #E2E8F0;
  box-shadow: 0 24px 40px -28px rgba(15,23,42,0.18);
}

/* HERO SPLIT — converts a hero into 2-col text+image without breaking existing pages */
.hero-split, .page-header.has-media {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-split > .hero-text, .page-header.has-media > .hero-text {
  min-width: 0;
}
@media (max-width: 900px) {
  .hero-split, .page-header.has-media { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- RESPECT REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale, .reveal-blur { opacity: 1; transform: none; filter: none; }
  .word-reveal .word > span { transform: none; opacity: 1; }
  .marquee-track { animation: none; }
  body { animation: none; }
}

/* ============================================
   WHATSAPP FLOATING BUTTON
   ============================================ */
.wa-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
}
.wa-fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px -8px rgba(37,211,102,0.55), 0 4px 12px rgba(15,23,42,0.18);
  transition: transform .2s ease, box-shadow .2s ease;
}
.wa-fab-btn:hover { transform: scale(1.07); box-shadow: 0 14px 34px -8px rgba(37,211,102,0.7), 0 4px 12px rgba(15,23,42,0.2); }
.wa-fab-btn svg { width: 30px; height: 30px; }
.wa-fab-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 24px 48px -20px rgba(15,23,42,0.4), 0 2px 8px rgba(15,23,42,0.08);
  border: 1px solid #E2E8F0;
  min-width: 230px;
}
.wa-fab.open .wa-fab-menu { display: flex; animation: waPop .22s ease; }
@keyframes waPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.wa-fab-title {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 600;
  padding: 4px 8px 2px;
}
.wa-fab-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #0F172A;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s ease;
}
.wa-fab-link:hover { background: #F1F5F9; }
.wa-fab-link .wa-line { display: flex; flex-direction: column; line-height: 1.25; }
.wa-fab-link .wa-line small { color: #64748B; font-weight: 400; font-size: 12px; }
.wa-fab-link svg { width: 22px; height: 22px; flex-shrink: 0; }
@media (max-width: 720px) {
  .wa-fab { right: 16px; bottom: 16px; }
  .wa-fab-btn { width: 52px; height: 52px; }
}

/* ---------- CONTACT FORM STATUS MESSAGE ---------- */
.form-status { margin-top: 14px; font-size: 14.5px; line-height: 1.5; min-height: 1px; }
.form-status:empty { display: none; }
.form-status.sending { color: #64748B; }
.form-status.ok { color: #15803D; font-weight: 500; }
.form-status.error { color: #B91C1C; }
.form-status a { color: inherit; text-decoration: underline; }
