/* ==================================================================
   The Gate for Training Services - MOTION LAYER
   ================================================================== */
:root { --tg-ease: cubic-bezier(.2, .7, .2, 1); }

/* ---------- Scroll reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--tg-ease), transform .8s var(--tg-ease); transition-delay: var(--d, 0s); will-change: opacity, transform; }
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="zoom"] { transform: scale(.92); }
[data-reveal="fade"] { transform: none; }
[data-reveal].is-in { opacity: 1; transform: none; }
.tg-section-title .tg-eyebrow::before, .tg-section-title .tg-eyebrow::after { width: 0; transition: width .6s var(--tg-ease) .2s; }
.tg-section-title.is-in .tg-eyebrow::before, .tg-section-title.is-in .tg-eyebrow::after { width: 28px; }

/* ---------- Page transition ---------- */
@keyframes tgPageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tg-page { animation: tgPageIn .55s var(--tg-ease) both; }

/* ---------- Header ---------- */
.tg-header { transition: box-shadow .3s ease, background .3s ease; }
.tg-header .mud-container { transition: padding .3s ease; }
.tg-brand img { transition: height .3s ease, transform .4s var(--tg-ease); }
.tg-brand:hover img { transform: rotate(-6deg) scale(1.06); }
.tg-scrolled .tg-header { box-shadow: 0 10px 30px rgba(30, 42, 58, .10); background: rgba(255,255,255,.86); }
.tg-scrolled .tg-header .mud-container { padding-top: 4px !important; padding-bottom: 4px !important; }
.tg-scrolled .tg-brand img { height: 50px; }
.tg-nav-link.mud-button { position: relative; overflow: visible; }
.tg-nav-link.mud-button::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--tg-orange); border-radius: 2px; transform: scaleX(0); transform-origin: center; transition: transform .3s var(--tg-ease); }
.tg-nav-link.mud-button:hover::after, .tg-nav-active.mud-button::after { transform: scaleX(1); }
.tg-nav-active.mud-button { background: transparent; }

/* ---------- Buttons ---------- */
.mud-button-filled { transition: transform .25s var(--tg-ease), box-shadow .25s var(--tg-ease), background-color .25s ease !important; position: relative; overflow: hidden; }
.mud-button-filled.mud-button-filled-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(238,122,28,.38); }
.mud-button-filled.mud-button-filled-primary::before { content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); transition: left .6s var(--tg-ease); pointer-events: none; }
.mud-button-filled.mud-button-filled-primary:hover::before { left: 125%; }
.mud-button-outlined { transition: transform .25s var(--tg-ease), background-color .25s ease, color .25s ease !important; }
.mud-button-outlined:hover { transform: translateY(-2px); }

/* ---------- Hero ---------- */
@keyframes tgKenBurns { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes tgUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes tgFloat { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(14px, -22px); } }
@keyframes tgFloat2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18px, 16px) scale(1.08); } }
.tg-hero-slide { overflow: hidden; }
.tg-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; animation: tgKenBurns 16s ease-out both; }
.tg-hero-slide::before { z-index: 1; }
.tg-hero-content { z-index: 2; }
.tg-hero-content .tg-anim { animation: tgUp .9s var(--tg-ease) both; animation-delay: calc(var(--i, 0) * .14s + .15s); }
.tg-hero-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; z-index: 1; }
.tg-hero-blob-1 { width: 420px; height: 420px; background: radial-gradient(circle, rgba(238,122,28,.9), transparent 70%); top: -120px; inset-inline-end: 8%; animation: tgFloat 11s ease-in-out infinite; }
.tg-hero-blob-2 { width: 340px; height: 340px; background: radial-gradient(circle, rgba(15,138,126,.8), transparent 70%); bottom: -120px; inset-inline-start: 12%; animation: tgFloat2 14s ease-in-out infinite; }
.tg-hero-scroll { position: absolute; bottom: 70px; left: 50%; margin-left: -13px; z-index: 2; width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.55); border-radius: 14px; }
.tg-hero-scroll::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: #fff; border-radius: 2px; animation: tgScrollDot 1.8s ease-in-out infinite; }
@keyframes tgScrollDot { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }
.tg-gradient-text { background: linear-gradient(90deg, #FFD3AC, #EE7A1C 45%, #FFB873); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: tgShimmer 5s linear infinite; }
@keyframes tgShimmer { to { background-position: 200% 0; } }
.tg-hero .mud-carousel-bullets .mud-icon-button { transition: transform .3s var(--tg-ease); }
.tg-hero .mud-carousel-bullets .mud-icon-button:hover { transform: scale(1.3); }

/* ---------- Glow cards (pointer-follow) ---------- */
.tg-glow { position: relative; overflow: hidden; }
.tg-glow::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(238,122,28,.14), transparent 60%); opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.tg-glow:hover::before { opacity: 1; }
.tg-cat-card { transition: transform .35s var(--tg-ease), box-shadow .35s var(--tg-ease), border-color .35s ease; }
.tg-cat-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--tg-orange), #FFB873); transform: scaleX(0); transition: transform .4s var(--tg-ease); }
.tg-cat-card:hover::after { transform: scaleX(1); }
.tg-cat-card:hover { border-color: #FFD3AC; }
.tg-cat-icon { transition: transform .45s var(--tg-ease), box-shadow .45s var(--tg-ease); }
.tg-cat-card:hover .tg-cat-icon { transform: translateY(-6px) rotate(-8deg) scale(1.08); box-shadow: 0 12px 24px rgba(30,42,58,.12); }

/* ---------- Course cards ---------- */
.tg-course-media { overflow: hidden; display: block; }
.tg-course-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s var(--tg-ease); }
.tg-course-card:hover .tg-course-media img { transform: scale(1.08); }
.tg-course-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(30,42,58,.45)); opacity: 0; transition: opacity .4s ease; }
.tg-course-card:hover .tg-course-media::after { opacity: 1; }
.tg-course-card { transition: transform .35s var(--tg-ease), box-shadow .35s var(--tg-ease); }
.tg-price-tag { transition: transform .35s var(--tg-ease); z-index: 1; }
.tg-course-card:hover .tg-price-tag { transform: translateY(-4px) scale(1.05); }
.tg-cat-chip { z-index: 1; }

/* ---------- Stats ---------- */
.tg-stat { transition: transform .35s var(--tg-ease), box-shadow .35s var(--tg-ease); position: relative; overflow: hidden; }
.tg-stat::before { content: ""; position: absolute; right: -30px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: rgba(238,122,28,.08); transition: transform .5s var(--tg-ease); }
.tg-stat:hover { transform: translateY(-4px); box-shadow: var(--tg-shadow); }
.tg-stat:hover::before { transform: scale(2.2); }

/* ---------- Feature image ---------- */
.tg-feature-img img { transition: transform .9s var(--tg-ease); }
.tg-feature-img:hover img { transform: scale(1.04); }
.tg-feature-float { animation: tgBob 4s ease-in-out infinite; }
@keyframes tgBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Testimonials ---------- */
.tg-testimonial { transition: transform .35s var(--tg-ease), box-shadow .35s var(--tg-ease); }
.tg-testimonial:hover { transform: translateY(-6px); box-shadow: var(--tg-shadow-lg); }
.tg-testimonial .tg-quote { transition: transform .4s var(--tg-ease), opacity .4s ease; display: inline-block; }
.tg-testimonial:hover .tg-quote { transform: scale(1.2) rotate(-6deg); opacity: .6; }

/* ---------- Partners marquee ---------- */
.tg-marquee { overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); padding: 0; }
.tg-marquee-track { display: flex; gap: 24px; width: max-content; animation: tgMarquee 30s linear infinite; }
.tg-marquee:hover .tg-marquee-track { animation-play-state: paused; }
html[dir="rtl"] .tg-marquee-track { animation-name: tgMarqueeRtl; }
@keyframes tgMarquee { to { transform: translateX(-50%); } }
@keyframes tgMarqueeRtl { to { transform: translateX(50%); } }
.tg-marquee .tg-partner { width: 300px; flex-shrink: 0; transition: transform .35s var(--tg-ease), box-shadow .35s var(--tg-ease); }
.tg-marquee .tg-partner:hover { transform: translateY(-5px); box-shadow: var(--tg-shadow); }
.tg-partner img { transition: transform .4s var(--tg-ease); }
.tg-partner:hover img { transform: scale(1.08); }

/* ---------- CTA + banner ---------- */
.tg-cta { background-size: 200% 200%; animation: tgGradient 9s ease infinite; }
@keyframes tgGradient { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.tg-cta::after { animation: tgFloat2 12s ease-in-out infinite; }
.tg-banner { background-size: 200% 200%; animation: tgGradient 14s ease infinite; }
.tg-banner .tg-hero-blob { opacity: .4; }
.tg-banner h1 { animation: tgUp .8s var(--tg-ease) both .1s; }
.tg-banner .mud-typography, .tg-banner .mud-breadcrumbs { animation: tgUp .8s var(--tg-ease) both .25s; }

/* ---------- Gallery ---------- */
.tg-gallery-item .tg-caption { transform: translateY(100%); transition: transform .4s var(--tg-ease); }
.tg-gallery-item:hover .tg-caption { transform: none; }
.tg-gallery-item::after { content: ""; position: absolute; inset: 0; border: 0 solid rgba(255,255,255,.9); transition: border-width .3s ease; pointer-events: none; border-radius: 16px; }
.tg-gallery-item:hover::after { border-width: 4px; }

/* ---------- Services / contact cards / lists ---------- */
.tg-contact-card, .tg-service-card { transition: transform .35s var(--tg-ease), box-shadow .35s var(--tg-ease); }
.tg-contact-card:hover, .tg-service-card:hover { transform: translateY(-6px); box-shadow: var(--tg-shadow-lg) !important; }
.tg-check-list li { transition: transform .25s var(--tg-ease); }
.tg-check-list li:hover { transform: translateX(6px); }
html[dir="rtl"] .tg-check-list li:hover { transform: translateX(-6px); }

/* ---------- Calendar ---------- */
.tg-cal-day { transition: transform .2s var(--tg-ease), background .2s ease, box-shadow .2s ease; }
.tg-cal-day.tg-has:hover { transform: scale(1.08); box-shadow: 0 8px 18px rgba(238,122,28,.25); }

/* ---------- WhatsApp pulse ---------- */
.tg-whatsapp::before { content: ""; position: absolute; inset: 0; border-radius: 999px; background: #25D366; z-index: -1; animation: tgPulse 2.4s ease-out infinite; }
@keyframes tgPulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.55); opacity: 0; } }
.tg-whatsapp .mud-icon-root { animation: tgWiggle 3s ease-in-out infinite; }
@keyframes tgWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tg-sand); }
::-webkit-scrollbar-thumb { background: #C9CFD8; border-radius: 10px; border: 2px solid var(--tg-sand); }
::-webkit-scrollbar-thumb:hover { background: var(--tg-orange); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
    .tg-hero-bg, .tg-hero-blob, .tg-marquee-track, .tg-cta, .tg-banner, .tg-whatsapp::before, .tg-whatsapp .mud-icon-root, .tg-feature-float, .tg-gradient-text, .tg-page { animation: none !important; }
}

/* ---------- CPR heart beat ---------- */
.tg-heart { animation: tgHeart 1.6s ease-in-out infinite; transform-origin: center; }
@keyframes tgHeart { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.18); } 28% { transform: scale(1); } 42% { transform: scale(1.14); } 70% { transform: scale(1); } }

/* ---------- CPR heartbeat block ---------- */
.tg-cpr { position: relative; overflow: hidden; }
.tg-ecg { position: absolute; left: 0; top: 50%; width: 100%; height: 64px; transform: translateY(-50%); opacity: .3; pointer-events: none; z-index: 0; }
.tg-ecg path { fill: none; stroke: #FFB873; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420 1400; stroke-dashoffset: 1820; animation: tgEcg 5s linear infinite; filter: drop-shadow(0 0 6px rgba(238,122,28,.9)); }
@keyframes tgEcg { to { stroke-dashoffset: 0; } }
.tg-heartbeat { position: relative; width: 92px; height: 92px; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.tg-heart-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(238,122,28,.6); animation: tgRing 2.4s ease-out infinite; }
.tg-heart-ring-2 { animation-delay: .8s; }
.tg-heart-ring-3 { animation-delay: 1.6s; }
@keyframes tgRing { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.15); opacity: 0; } }
.tg-heart-glow { position: absolute; width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle, rgba(238,122,28,.55), transparent 70%); filter: blur(14px); animation: tgHeart 1.6s ease-in-out infinite; }
.tg-cpr .tg-heart { font-size: 2.4rem !important; width: 2.4rem !important; height: 2.4rem !important; color: #EE7A1C; position: relative; filter: drop-shadow(0 0 18px rgba(238,122,28,.8)); animation: tgHeart 1.6s ease-in-out infinite; }
.tg-emergency { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 18px 10px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(238,122,28,.45); color: #FFD3AC; font-weight: 600; backdrop-filter: blur(6px); box-shadow: 0 0 0 0 rgba(238,122,28,.5); animation: tgEmergency 2.4s ease-out infinite; }
html[dir="rtl"] .tg-emergency { padding: 10px 10px 10px 18px; }
@keyframes tgEmergency { 0% { box-shadow: 0 0 0 0 rgba(238,122,28,.45); } 100% { box-shadow: 0 0 0 14px rgba(238,122,28,0); } }
.tg-emergency-num { display: inline-flex; align-items: center; gap: 6px; background: #EE7A1C; color: #fff; font-weight: 800; font-size: 1.25rem; letter-spacing: .06em; padding: 6px 16px; border-radius: 999px; box-shadow: 0 8px 20px rgba(238,122,28,.45); }
@media (prefers-reduced-motion: reduce) { .tg-ecg path, .tg-heart-ring, .tg-heart-glow, .tg-cpr .tg-heart, .tg-emergency { animation: none !important; } }

/* ---------- Site background: drifting colour blobs + dot grid ---------- */
.tg-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.mud-layout { position: relative; z-index: 1; }
.tg-bg-blob { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.tg-bg-blob-1 { width: 56vw; height: 56vw; max-width: 900px; max-height: 900px; background: radial-gradient(circle, rgba(238,122,28,.32), transparent 65%); top: -18vw; right: -14vw; animation: tgDrift1 26s ease-in-out infinite; }
.tg-bg-blob-2 { width: 48vw; height: 48vw; max-width: 760px; max-height: 760px; background: radial-gradient(circle, rgba(15,138,126,.28), transparent 65%); bottom: -16vw; left: -12vw; animation: tgDrift2 30s ease-in-out infinite; }
.tg-bg-blob-3 { width: 40vw; height: 40vw; max-width: 620px; max-height: 620px; background: radial-gradient(circle, rgba(30,136,229,.18), transparent 65%); top: 38%; left: 36%; animation: tgDrift3 34s ease-in-out infinite; }
@keyframes tgDrift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-8vw, 10vh) scale(1.12); } }
@keyframes tgDrift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(10vw, -12vh) scale(1.08); } }
@keyframes tgDrift3 { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(-12vw, -8vh); } 66% { transform: translate(8vw, 10vh); } }
.tg-bg-grid { position: absolute; inset: 0; background-image: radial-gradient(rgba(30,42,58,.10) 1px, transparent 1.2px); background-size: 28px 28px; -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 85%); }
/* glass sections so the background shows through */
.tg-section-sand { background: rgba(255,255,255,.42); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-top: 1px solid rgba(255,255,255,.7); border-bottom: 1px solid rgba(255,255,255,.7); }
.tg-main.mud-main-content { background: transparent; }
/* CPR block: mesh gradient + grid */
.tg-cpr.tg-section-navy { background: radial-gradient(820px 420px at 82% 18%, rgba(238,122,28,.28), transparent 62%), radial-gradient(700px 420px at 12% 92%, rgba(15,138,126,.34), transparent 62%), radial-gradient(500px 300px at 50% 50%, rgba(30,136,229,.16), transparent 70%), linear-gradient(135deg, #1E2A3A 0%, #26354A 100%); }
.tg-cpr::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px); background-size: 26px 26px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tg-bg-blob { animation: none !important; } }

/* ---------- Scroll progress bar ---------- */
.tg-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 2000; pointer-events: none; background: rgba(30,42,58,.06); }
.tg-progress span { display: block; height: 100%; width: var(--tg-progress, 0%); background: linear-gradient(90deg, #EE7A1C, #FFB873 60%, #0F8A7E); box-shadow: 0 0 12px rgba(238,122,28,.7); border-radius: 0 4px 4px 0; transition: width .08s linear; }
html[dir="rtl"] .tg-progress span { margin-inline-start: auto; border-radius: 4px 0 0 4px; background: linear-gradient(270deg, #EE7A1C, #FFB873 60%, #0F8A7E); }

/* ---------- Hero slide indicator (dots + counter) ---------- */
.tg-hero-scroll { display: none !important; }
.tg-hero-nav { position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 999px; background: rgba(20,28,40,.45); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.18); }
.tg-hero-counter { color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .06em; min-width: 44px; text-align: center; }
.tg-hero-dots { display: flex; align-items: center; gap: 8px; }
.tg-hero-dot { position: relative; width: 12px; height: 12px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: rgba(255,255,255,.45); overflow: hidden; transition: width .35s var(--tg-ease), background .3s ease; }
.tg-hero-dot:hover { background: rgba(255,255,255,.8); }
.tg-hero-dot.active { width: 44px; background: rgba(255,255,255,.25); }
.tg-hero-dot-fill { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #EE7A1C, #FFB873); border-radius: 999px; }
.tg-hero-dot.active .tg-hero-dot-fill { animation: tgDotFill 8s linear forwards; }
@keyframes tgDotFill { from { width: 0; } to { width: 100%; } }
@media (max-width: 600px) { .tg-hero-nav { bottom: 64px; padding: 6px 10px; } .tg-hero-counter { display: none; } }
@media (prefers-reduced-motion: reduce) { .tg-hero-dot.active .tg-hero-dot-fill { animation: none; width: 100%; } }

/* emergency pill on phones: stacked card */
@media (max-width: 600px) {
    .tg-emergency, html[dir="rtl"] .tg-emergency { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; border-radius: 18px; padding: 14px 16px; }
    .tg-emergency > span:last-child { line-height: 1.6; }
}

/* ---------- Phones: snappier reveals, lighter effects ---------- */
@media (max-width: 960px) {
    [data-reveal] { transform: translateY(16px); transition-duration: .45s; transition-delay: calc(var(--d, 0s) * .35); }
    [data-reveal="left"], [data-reveal="right"] { transform: translateY(16px); }
    [data-reveal="zoom"] { transform: scale(.97); }
    .tg-section-sand { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255,255,255,.6); }
    .tg-bg-blob { filter: blur(50px); animation: none; }
    .tg-bg-blob-3 { display: none; }
    .tg-header { backdrop-filter: none; background: rgba(255,255,255,.97); }
    .tg-glow::before { display: none; }
    .tg-hero-bg { animation-duration: 24s; }
}
