/* ==========================================================================
   Home page — motion layer
   Hero entrance runs on pure CSS (no FOUC, works without JS).
   Below-the-fold [data-reveal] elements are revealed by home.js on scroll;
   index.php ships a <noscript> fallback that forces them visible.
   ========================================================================== */

/* ===== Scroll progress bar ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary-light));
    z-index: 300;
    pointer-events: none;
    will-change: transform;
}

/* ===== Hero: drifting aurora orbs ===== */
.hero-aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    will-change: transform;
}

.hero-orb-1 {
    width: 460px;
    height: 460px;
    top: -14%;
    left: -8%;
    background: radial-gradient(circle, rgba(18, 168, 146, 0.75), transparent 68%);
    animation: orbDrift1 22s ease-in-out infinite;
}

.hero-orb-2 {
    width: 380px;
    height: 380px;
    bottom: -16%;
    right: -6%;
    background: radial-gradient(circle, rgba(232, 168, 56, 0.55), transparent 68%);
    animation: orbDrift2 27s ease-in-out infinite;
}

.hero-orb-3 {
    width: 300px;
    height: 300px;
    top: 42%;
    left: 46%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 68%);
    animation: orbDrift3 19s ease-in-out infinite;
}

@keyframes orbDrift1 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(70px, 50px, 0) scale(1.14); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-60px, -46px, 0) scale(1.18); }
}

@keyframes orbDrift3 {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-46px, 40px, 0) scale(0.86); }
}

/* Keep hero text above the orbs */
.hero-grid { z-index: 1; }

/* ===== Hero: staggered entrance ===== */
@keyframes heroRise {
    from { opacity: 0; transform: translate3d(0, 26px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes heroCardIn {
    from { opacity: 0; transform: translate3d(36px, 18px, 0) scale(0.96); }
    to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.hero-badge,
.hero h1,
.hero-desc,
.hero-cta,
.hero-stats {
    opacity: 0;
    animation: heroRise 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-badge  { animation-delay: 0.05s; }
.hero h1     { animation-delay: 0.16s; }
.hero-desc   { animation-delay: 0.28s; }
.hero-cta    { animation-delay: 0.40s; }
.hero-stats  { animation-delay: 0.52s; }

.hero-card {
    opacity: 0;
    animation: heroCardIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.34s forwards;
}

/* Gentle float once the card has landed */
.hero-visual {
    animation: cardFloat 7s ease-in-out 1.4s infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(0, -12px, 0); }
}

/* Shimmer sweep across the glass card */
.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: skewX(-18deg);
    animation: cardShimmer 6.5s ease-in-out 2s infinite;
    pointer-events: none;
}

@keyframes cardShimmer {
    0%        { left: -60%; }
    38%, 100% { left: 130%; }
}

/* Goal list items cascade in behind the card */
.hero-goal-list li {
    opacity: 0;
    animation: heroRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-goal-list li:nth-child(1) { animation-delay: 0.62s; }
.hero-goal-list li:nth-child(2) { animation-delay: 0.72s; }
.hero-goal-list li:nth-child(3) { animation-delay: 0.82s; }
.hero-goal-list li:nth-child(4) { animation-delay: 0.92s; }

.goal-icon {
    transition: transform 0.25s ease, background 0.25s ease;
}

.hero-goal-list li:hover .goal-icon {
    transform: scale(1.12) rotate(-6deg);
    background: rgba(232, 168, 56, 0.45);
}

/* ===== Animated underline on the emphasised word ===== */
.hero h1 em {
    position: relative;
    display: inline-block;
}

.hero h1 em::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0.06em;
    height: 0.1em;
    width: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: 0 50%;
    animation: underlineDraw 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.85s forwards;
}

@keyframes underlineDraw {
    to { transform: scaleX(1); }
}

/* ===== Hero CTA micro-interaction ===== */
.hero-cta .btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

/* Pulsing ring on the primary hero action */
.hero-cta .btn-secondary {
    position: relative;
}

.hero-cta .btn-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--color-accent);
    animation: ctaPulse 2.8s ease-out 1.6s infinite;
    pointer-events: none;
}

@keyframes ctaPulse {
    0%       { opacity: 0.7; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(1.18); }
}

/* ===== Scroll cue ===== */
.hero-scroll-cue {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin: 3rem auto 0;
    width: fit-content;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0;
    animation: heroRise 0.7s ease 1.1s forwards;
}

.hero-scroll-cue:hover { color: #fff; }

.hero-scroll-cue span {
    display: block;
    width: 22px;
    height: 34px;
    border: 2px solid currentColor;
    border-radius: 999px;
    position: relative;
}

.hero-scroll-cue span::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 7px;
    width: 3px;
    height: 7px;
    margin-left: -1.5px;
    background: currentColor;
    border-radius: 2px;
    animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
    0%      { opacity: 0; transform: translateY(0); }
    35%     { opacity: 1; }
    75%     { opacity: 0; transform: translateY(11px); }
    100%    { opacity: 0; transform: translateY(11px); }
}

/* ===== Scroll reveal (below the fold) ===== */
[data-reveal] {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

[data-reveal="left"]  { transform: translate3d(-34px, 0, 0); }
[data-reveal="right"] { transform: translate3d(34px, 0, 0); }
[data-reveal="zoom"]  { transform: scale(0.94); }

[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* ===== Stat cards ===== */
.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(13, 107, 92, 0.16);
    border-color: rgba(18, 168, 146, 0.4);
}

.stat-icon {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: translateY(-3px) scale(1.12) rotate(-8deg);
    background: var(--color-accent);
}

/* Counting state gets a subtle live pulse */
.stat-value.is-counting {
    animation: countPulse 0.9s ease-in-out infinite;
}

@keyframes countPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.72; }
}

/* ===== Pillar cards ===== */
.pillar-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.28s ease, border-color 0.25s, box-shadow 0.25s;
}

.pillar-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--color-primary-light), var(--color-accent));
    transform: scaleY(0);
    transform-origin: 50% 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.pillar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(13, 107, 92, 0.12);
}

.pillar-card:hover::before { transform: scaleY(1); }

.pillar-icon {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pillar-card:hover .pillar-icon {
    transform: translateY(-4px) scale(1.15);
}

/* ===== Achievement cards ===== */
.achievement-card {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.achievement-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(13, 107, 92, 0.14);
}

.achievement-year {
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.achievement-card:hover .achievement-year {
    transform: scale(1.08);
}

/* ===== CTA section ===== */
.cta-box {
    position: relative;
    overflow: hidden;
}

.cta-box::after {
    content: '';
    position: absolute;
    inset: -40%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(232, 168, 56, 0.12) 60deg,
        transparent 140deg,
        transparent 360deg
    );
    animation: ctaSweep 14s linear infinite;
    pointer-events: none;
}

.cta-box > * { position: relative; z-index: 1; }

@keyframes ctaSweep {
    to { transform: rotate(360deg); }
}

.cta-buttons .btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .hero-orb-1 { width: 300px; height: 300px; }
    .hero-orb-2 { width: 250px; height: 250px; }
    .hero-orb-3 { display: none; }
    .hero-visual { animation: none; }
}

@media (max-width: 640px) {
    .hero-scroll-cue { display: none; }
}

/* ==========================================================================
   Reduced motion — show everything, move nothing.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .hero-badge,
    .hero h1,
    .hero-desc,
    .hero-cta,
    .hero-stats,
    .hero-card,
    .hero-goal-list li,
    .hero-scroll-cue {
        opacity: 1;
        animation: none;
    }

    .hero-visual,
    .hero-orb,
    .hero-card::after,
    .hero-cta .btn-secondary::before,
    .cta-box::after,
    .hero-scroll-cue span::after,
    .stat-value.is-counting {
        animation: none;
    }

    .hero h1 em::after {
        animation: none;
        transform: scaleX(1);
    }

    [data-reveal],
    [data-reveal].is-revealed {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .scroll-progress { display: none; }

    .stat-card:hover,
    .pillar-card:hover,
    .achievement-card:hover,
    .hero-cta .btn:hover,
    .cta-buttons .btn:hover {
        transform: none;
    }
}
