/* ==========================================================================
   Maya Vidya Niketan - site-wide animation layer
   Loaded from templates/base.html, driven by static/js/animations.js.
   Everything here is additive: with JavaScript off, or with the visitor's
   "reduce motion" setting on, the pages look exactly as they did before.
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* Slide-in animations start off to the side; never let them widen the page on phones.
   "clip" (unlike "hidden") keeps the sticky navigation working. */
html,
body {
    overflow-x: clip;
}

/* Keep anchored sections (#gandhi-tribute, #sports-champions) clear of the sticky nav */
[id] {
    scroll-margin-top: 96px;
}

/* Soft cross-fade between pages in browsers that support it */
@view-transition {
    navigation: auto;
}

/* ---------- Scroll progress bar ---------- */

.mvn-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #f26b1d, #f5b42a 60%, #138a3e);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

/* ---------- Navigation ---------- */

.glass-nav {
    transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.glass-nav.mvn-nav-scrolled {
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.28);
}

/* Mobile menu slides open instead of popping in */
#mobile-menu:not(.hidden) {
    animation: mvn-menu-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    transform-origin: top center;
}

#mobile-menu:not(.hidden) a {
    animation: mvn-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#mobile-menu:not(.hidden) a:nth-child(2) { animation-delay: 0.03s; }
#mobile-menu:not(.hidden) a:nth-child(3) { animation-delay: 0.06s; }
#mobile-menu:not(.hidden) a:nth-child(4) { animation-delay: 0.09s; }
#mobile-menu:not(.hidden) a:nth-child(5) { animation-delay: 0.12s; }
#mobile-menu:not(.hidden) a:nth-child(6) { animation-delay: 0.15s; }
#mobile-menu:not(.hidden) a:nth-child(7) { animation-delay: 0.18s; }
#mobile-menu:not(.hidden) a:nth-child(8) { animation-delay: 0.21s; }

/* ---------- Announcement ribbons ---------- */

.mvn-drop {
    animation: mvn-drop 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.mvn-drop-2 {
    animation-delay: 0.12s;
}

/* ---------- Hero ---------- */

/* Slow drift-and-zoom on the campus photo */
.mvn-kenburns {
    animation: mvn-kenburns 26s ease-in-out infinite alternate;
    transform-origin: 60% 55%;
    will-change: transform;
}

/* The wrapper is moved by animations.js for the scroll parallax */
[data-mvn-parallax] {
    will-change: transform;
}

/* Soft lights drifting over the photo */
.mvn-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(70px);
    pointer-events: none;
    z-index: 1;
}

.mvn-orb-a {
    width: 22rem;
    height: 22rem;
    left: -6rem;
    top: 12%;
    background: rgba(59, 130, 246, 0.38);
    animation: mvn-float-a 15s ease-in-out infinite;
}

.mvn-orb-b {
    width: 18rem;
    height: 18rem;
    left: 38%;
    bottom: 4%;
    background: rgba(99, 102, 241, 0.3);
    animation: mvn-float-b 19s ease-in-out infinite;
}

/* "Shaping Futures." - light sweeping through the blue */
.mvn-gradient-text {
    background-image: linear-gradient(100deg, #60a5fa 0%, #60a5fa 35%, #e0f2fe 50%, #60a5fa 65%, #60a5fa 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: mvn-text-sheen 6s ease-in-out infinite;
}

/* ---------- Buttons ---------- */

/* A band of light that crosses the button on hover */
.mvn-shine {
    position: relative;
    overflow: hidden;
}

.mvn-shine::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-160%) skewX(-18deg);
    pointer-events: none;
}

.mvn-shine:hover::after,
.mvn-shine:focus-visible::after {
    animation: mvn-shine 0.85s ease;
}

/* The main call-to-action also shines by itself now and then */
.mvn-shine-auto::after {
    animation: mvn-shine-auto 6s ease-in-out 2s infinite;
}

/* ---------- Scroll reveal (applied by animations.js) ---------- */

.mvn-pre {
    opacity: 0;
}

.mvn-in {
    animation: mvn-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) backwards;
    animation-delay: calc(var(--mvn-i, 0) * 80ms);
}

/* Medal tally: the number pops as it finishes counting */
.mvn-count-done {
    animation: mvn-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Ask Maya AI button ---------- */

.mvn-live-dot {
    animation: mvn-dot-pulse 2s ease-out infinite;
}

.mvn-twinkle {
    display: inline-block;
    animation: mvn-twinkle 3.2s ease-in-out infinite;
}

/* ---------- Keyframes ---------- */

@keyframes mvn-rise {
    from { opacity: 0; transform: translate3d(0, 28px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes mvn-drop {
    from { opacity: 0; transform: translate3d(0, -100%, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes mvn-menu-in {
    from { opacity: 0; transform: translate3d(0, -10px, 0) scaleY(0.96); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scaleY(1); }
}

@keyframes mvn-kenburns {
    from { transform: scale(1.02) translate3d(0, 0, 0); }
    to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); }
}

@keyframes mvn-float-a {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(70px, 50px, 0); }
}

@keyframes mvn-float-b {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-80px, -40px, 0); }
}

@keyframes mvn-text-sheen {
    0%, 30% { background-position: 100% 0; }
    70%, 100% { background-position: 0% 0; }
}

@keyframes mvn-shine {
    from { transform: translateX(-160%) skewX(-18deg); }
    to { transform: translateX(340%) skewX(-18deg); }
}

@keyframes mvn-shine-auto {
    0%, 78% { transform: translateX(-160%) skewX(-18deg); }
    100% { transform: translateX(340%) skewX(-18deg); }
}

@keyframes mvn-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

@keyframes mvn-dot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.75); }
    100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

@keyframes mvn-twinkle {
    0%, 70%, 100% { transform: scale(1) rotate(0deg); }
    80% { transform: scale(1.3) rotate(14deg); }
    90% { transform: scale(0.95) rotate(-8deg); }
}

/* ==========================================================================
   School theme layer: crest colours, serif headings, header/footer parts
   ========================================================================== */

:root {
    --mvn-navy: #0c2148;
    --mvn-navy-deep: #071530;
    --mvn-saffron: #f26b1d;
    --mvn-gold: #f5b42a;
    --mvn-green: #138a3e;
}

/* Saffron / white / green strip, as on the crest */
.mvn-tricolor {
    background: linear-gradient(90deg, #f26b1d 0 33.3%, #ffffff 33.3% 66.6%, #138a3e 66.6% 100%);
}

/* Large headings everywhere use the school's serif display face */
:is(h1, h2, h3, h4):is([class*="text-3xl"], [class*="text-4xl"], [class*="text-5xl"], [class*="text-6xl"], [class*="text-7xl"]) {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.015em;
}

/* Smoother text rendering for a finer look */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: #ffcfa6;
    color: #071530;
}

/* ---------- Opening screen ---------- */

.mvn-loader {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: radial-gradient(circle at 50% 42%, #173d80 0%, #0c2148 45%, #071530 100%);
    color: #fff;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

html.mvn-loading .mvn-loader {
    display: flex;
}

.mvn-loader.is-done {
    opacity: 0;
    visibility: hidden;
}

.mvn-loader-inner {
    position: relative;
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mvn-loader-logo {
    width: 92px;
    height: auto;
    filter: drop-shadow(0 0 24px rgba(253, 138, 58, 0.55));
    animation: mvn-loader-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.mvn-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #fd8a3a;
    border-right-color: #f5b42a;
    animation: mvn-spin 1s linear infinite;
}

.mvn-loader-text {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 800;
    font-size: 1.5rem;
    margin-top: 0.75rem;
    animation: mvn-rise 0.7s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mvn-loader-motto {
    color: #ffae6d;
    font-weight: 700;
    letter-spacing: 0.25em;
    font-size: 0.85rem;
    animation: mvn-rise 0.7s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- Navigation links ---------- */

.mvn-navlink {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #122f63;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.mvn-navlink::after {
    content: "";
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.3rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #f26b1d, #f5b42a);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mvn-navlink:hover {
    color: #d95410;
    background-color: rgba(242, 107, 29, 0.06);
}

.mvn-navlink:hover::after,
.mvn-navlink.is-active::after {
    transform: scaleX(1);
}

.mvn-navlink.is-active {
    color: #d95410;
}

.mvn-navtag {
    color: #b33f0f;
    background: rgba(242, 107, 29, 0.1);
    border: 1px solid rgba(242, 107, 29, 0.25);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 9999px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Hamburger that turns into a cross */
.mvn-burger {
    flex-direction: column;
    gap: 5px;
}

.mvn-burger span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.mvn-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mvn-burger.is-open span:nth-child(2) { opacity: 0; }
.mvn-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Footer ---------- */

.mvn-foot-title {
    position: relative;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: #ffae6d;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
}

.mvn-foot-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 2.25rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #f26b1d, #f5b42a);
}

.mvn-foot-link {
    display: inline-block;
    transition: color 0.2s ease, transform 0.25s ease;
}

.mvn-foot-link:hover {
    color: #fff;
    transform: translateX(4px);
}

.mvn-foot-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(242, 107, 29, 0.15);
    color: #ffae6d;
    margin-top: -0.3rem;
}

.mvn-social {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #b3cdf0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s ease, color 0.25s ease;
}

.mvn-social:hover {
    transform: translateY(-4px);
    background: #f26b1d;
    border-color: #f26b1d;
    color: #fff;
}

/* ---------- Back to top ---------- */

.mvn-totop {
    position: fixed;
    left: 1.5rem;
    bottom: 1.5rem;
    z-index: 45;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c2148;
    color: #fff;
    box-shadow: 0 10px 25px -8px rgba(7, 21, 48, 0.6);
    opacity: 0;
    transform: translateY(16px) scale(0.85);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease;
}

.mvn-totop.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.mvn-totop:hover {
    background: #d95410;
}

.mvn-totop-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mvn-totop-ring circle {
    fill: none;
    stroke-width: 3;
    stroke: rgba(255, 255, 255, 0.15);
}

.mvn-totop-ring .mvn-totop-fill {
    stroke: #fd8a3a;
    stroke-linecap: round;
    stroke-dasharray: 132;
    stroke-dashoffset: 132;
}

/* ==========================================================================
   Home page pieces
   ========================================================================== */

/* ---------- Scrolling news ticker ---------- */

.mvn-ticker {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.mvn-ticker-track {
    display: flex;
    width: max-content;
    animation: mvn-marquee 70s linear infinite;
}

.mvn-ticker:hover .mvn-ticker-track,
.mvn-ticker:focus-within .mvn-ticker-track {
    animation-play-state: paused;
}

/* ---------- Hero ---------- */

.mvn-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.mvn-typed {
    border-right: 3px solid #fd8a3a;
    padding-right: 4px;
    animation: mvn-caret 0.9s steps(1) infinite;
}

.mvn-gold-text {
    background-image: linear-gradient(100deg, #fd8a3a 0%, #f5b42a 35%, #fff1c2 50%, #f5b42a 65%, #fd8a3a 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: mvn-text-sheen 6s ease-in-out infinite;
}

/* Scroll hint mouse */
.mvn-mouse {
    width: 26px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    position: relative;
}

.mvn-mouse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 8px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: #fd8a3a;
    animation: mvn-scroll-dot 1.8s ease-in-out infinite;
}

/* Gently bobbing decorations */
.mvn-bob {
    animation: mvn-bob 5s ease-in-out infinite;
}

.mvn-bob-slow {
    animation: mvn-bob 7s ease-in-out infinite reverse;
}

/* ---------- Section headings ---------- */

.mvn-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #b33f0f;
}

.mvn-eyebrow::before,
.mvn-eyebrow.is-center::after {
    content: "";
    width: 2rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #f26b1d, #f5b42a);
}

/* ---------- Cards: 3D tilt and cursor spotlight ---------- */

[data-mvn-tilt] {
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
    will-change: transform;
}

[data-mvn-tilt].is-tilting {
    transition: transform 0.08s linear, box-shadow 0.35s ease;
}

.mvn-spot {
    position: relative;
    isolation: isolate;
}

.mvn-spot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 107, 29, 0.08), transparent 45%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: -1;
}

.mvn-spot:hover::before {
    opacity: 1;
}

.mvn-spot-dark::before {
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(245, 180, 42, 0.16), transparent 45%);
    z-index: 0;
}

/* Quick-access tiles */
.mvn-tile-icon {
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .mvn-tile-icon {
    transform: translateY(-3px);
}

/* ---------- Motto band: lit diya ---------- */

.mvn-flame {
    transform-origin: 50% 100%;
    animation: mvn-flicker 1.6s ease-in-out infinite;
}

.mvn-flame-glow {
    animation: mvn-glow 2.4s ease-in-out infinite;
}

/* Rotating rays behind the diya */
.mvn-rays {
    animation: mvn-spin 60s linear infinite;
}

/* ---------- Sports tabs ---------- */

.mvn-tab-in {
    animation: mvn-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ---------- Confetti (made by animations.js) ---------- */

.mvn-confetti {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    pointer-events: none;
    width: 9px;
    height: 14px;
    border-radius: 2px;
}

/* ---------- Campus in Light (point-cloud hologram) ---------- */

.holo-caption {
    opacity: 0;
    will-change: opacity, transform;
    text-shadow: 0 2px 24px rgba(4, 10, 24, 0.8);
}

.holo-loading {
    transition: opacity 0.6s ease;
}

.holo-loading.is-done {
    opacity: 0;
}

.holo-fallback-img {
    display: none;
}

#campus-hologram.holo-fallback .holo-fallback-img {
    display: block;
}

/* ---------- Extra keyframes ---------- */

@keyframes mvn-spin {
    to { transform: rotate(360deg); }
}

@keyframes mvn-loader-pop {
    from { opacity: 0; transform: scale(0.6) rotate(-10deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes mvn-marquee {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

@keyframes mvn-caret {
    0%, 50% { border-color: #fd8a3a; }
    51%, 100% { border-color: transparent; }
}

@keyframes mvn-scroll-dot {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(14px); }
}

@keyframes mvn-bob {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(0, -14px, 0) rotate(3deg); }
}

@keyframes mvn-flicker {
    0%, 100% { transform: scale(1, 1) rotate(-1deg); }
    25% { transform: scale(0.94, 1.06) rotate(2deg); }
    50% { transform: scale(1.04, 0.96) rotate(-2deg); }
    75% { transform: scale(0.97, 1.04) rotate(1deg); }
}

@keyframes mvn-glow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.12); }
}

/* ---------- Visitors who ask for less motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    @view-transition {
        navigation: none;
    }

    .mvn-progress,
    .mvn-orb,
    .mvn-particles,
    .mvn-loader {
        display: none !important;
    }

    .mvn-pre {
        opacity: 1;
    }

    .mvn-kenburns,
    .mvn-gradient-text,
    .mvn-drop,
    .mvn-in,
    .mvn-count-done,
    .mvn-live-dot,
    .mvn-twinkle,
    .mvn-shine::after,
    #mobile-menu:not(.hidden),
    #mobile-menu:not(.hidden) a,
    .mvn-ticker-track,
    .mvn-typed,
    .mvn-gold-text,
    .mvn-mouse::after,
    .mvn-bob,
    .mvn-bob-slow,
    .mvn-flame,
    .mvn-flame-glow,
    .mvn-rays,
    .mvn-tab-in {
        animation: none !important;
    }

    .mvn-ticker {
        overflow-x: auto;
    }
}

/* Printed pages (e.g. Mandatory Disclosure) must never hide content */
@media print {
    .mvn-pre {
        opacity: 1 !important;
    }

    .mvn-progress,
    .mvn-loader,
    .mvn-totop {
        display: none !important;
    }
}
