/* ==========================================================================
   Dr. Bhagyashree Yewale-Goykar — Motion
   Entrance and scroll animations. They apply only while scripts run
   (.js-enabled), and are switched off for visitors who prefer reduced motion.
   Reveals move elements with the `translate` property, so they never clash
   with the hover effects, which use `transform`.
   ========================================================================== */

@keyframes rise {
    from {
        opacity: 0;
        translate: 0 28px;
    }

    to {
        opacity: 1;
        translate: none;
    }
}

@keyframes rise-left {
    from {
        opacity: 0;
        translate: -40px 0;
    }

    to {
        opacity: 1;
        translate: none;
    }
}

@keyframes rise-right {
    from {
        opacity: 0;
        translate: 40px 0;
    }

    to {
        opacity: 1;
        translate: none;
    }
}

@keyframes zoom-in {
    from {
        opacity: 0;
        scale: 0.96;
    }

    to {
        opacity: 1;
        scale: none;
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

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

@keyframes ticker {
    to {
        transform: translateX(-50%);
    }
}

/* --------------------------------------------------------------------------
   Preloader: the gold ring draws itself around the logo
   -------------------------------------------------------------------------- */

.preloader__ring circle {
    animation: draw 1.3s var(--ease) 0.1s forwards;
}

.preloader__logo,
.preloader__name,
.preloader__role {
    animation: rise 0.8s var(--ease) both;
}

.preloader__name {
    animation-delay: 0.15s;
}

.preloader__role {
    animation-delay: 0.25s;
}

/* --------------------------------------------------------------------------
   Hero entrance (waits for the preloader to leave)
   -------------------------------------------------------------------------- */

.js-enabled [data-hero] {
    animation: rise 1s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 110ms + 150ms);
}

.js-enabled.is-preloading [data-hero],
.js-enabled.is-preloading .hero__visual *,
.js-enabled.is-preloading .hero__visual::after {
    animation-play-state: paused;
}

/* The life-stages frame arrives in steps as its column rises:
   1. the white disc fades in from a little smaller (0.25s)
   2. the wheel opens out from the centre like an iris, easing back from a
      slight zoom (0.4s)
   3. the tagline fades in, already turning at its usual slow pace (0.9s);
      it is never rotated on entry, so it doesn't whip round after a refresh
   4. the gold rim light fades in and starts to circle (1.8s)
   Each step runs once and keeps nothing afterwards (`backwards`). They use
   `scale`, `opacity` and `clip-path`, never `transform`, so they don't clash
   with the wheel's own sizing or the tagline's turning. The iris opens to
   71% so it ends past the corners of the square image. */
@keyframes hero-visual-in {
    from {
        opacity: 0;
        translate: 0 30px;
        scale: 0.97;
    }

    to {
        opacity: 1;
        translate: none;
        scale: none;
    }
}

@keyframes frame-in {
    from {
        opacity: 0;
        scale: 0.9;
    }

    to {
        opacity: 1;
        scale: none;
    }
}

@keyframes iris-open {
    from {
        clip-path: circle(0% at 50% 50%);
    }

    to {
        clip-path: circle(71% at 50% 50%);
    }
}

@keyframes wheel-settle {
    from {
        scale: 1.12;
    }

    to {
        scale: none;
    }
}

@keyframes orbit-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.js-enabled .hero__visual[data-hero] {
    animation-name: hero-visual-in;
    animation-duration: 1.3s;
}

.js-enabled .hero__disc {
    animation: frame-in 1.2s var(--ease) 0.25s backwards;
}

.js-enabled .hero__photo {
    animation:
        iris-open 1.4s cubic-bezier(0.65, 0, 0.35, 1) 0.4s backwards,
        wheel-settle 2.2s var(--ease) 0.4s backwards;
}

.js-enabled .hero__orbit text {
    animation:
        orbit-in 1.6s var(--ease) 0.9s backwards,
        spin 50s linear infinite;
}

.js-enabled .hero__visual::after {
    animation:
        fade 0.8s ease 1.8s backwards,
        hero-rim 9s linear 1.8s infinite;
}

/* --------------------------------------------------------------------------
   Continuous motion
   -------------------------------------------------------------------------- */

.ticker__track {
    animation: ticker 46s linear infinite;
}

.ticker:hover .ticker__track {
    animation-play-state: paused;
}

/* The text turns inside its SVG (not the SVG itself), so the turning square
   never pokes out past the page edge on phones */
.hero__orbit text {
    transform-box: view-box;
    transform-origin: 50% 50%;
    animation: spin 50s linear infinite;
}

/* Hero frame rim light: a gold streak runs around the frame's white ring.
   It sits on .hero__visual::after, over the white ring, which it matches
   exactly (same inset, 6px wide), and turns with `rotate`, so it never
   clashes with the entrance (`translate`). The ring is cut out of a turning
   conic gradient: transparent for most of the way round, then fading up to a
   bright gold head */
@keyframes hero-rim {
    to {
        rotate: 360deg;
    }
}

.hero__visual::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    inset: 7.5%;
    padding: 6px;
    background: conic-gradient(transparent 0 58%, rgba(235, 203, 131, 0.35) 78%, var(--gold-400) 94%, var(--gold-500) 99.4%, transparent 99.5%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    animation: hero-rim 9s linear infinite;
}

/* --------------------------------------------------------------------------
   Scroll reveals: main.js adds .is-visible as each element comes into view
   -------------------------------------------------------------------------- */

.js-enabled [data-reveal] {
    opacity: 0;
}

.js-enabled [data-reveal].is-visible {
    animation: rise 0.95s var(--ease) both;
    animation-delay: calc(var(--d, 0) * 100ms);
}

.js-enabled [data-reveal="left"].is-visible {
    animation-name: rise-left;
}

.js-enabled [data-reveal="right"].is-visible {
    animation-name: rise-right;
}

.js-enabled [data-reveal="zoom"].is-visible {
    animation-name: zoom-in;
}

/* --------------------------------------------------------------------------
   Image frames
   - Settle: each photo starts a little zoomed in and eases back as its
     section comes into view. The hero's life-stages wheel is left out of
     this and of the hover zoom, so its labels at the edge are never cropped
     once it has arrived (its own entrance is under "Hero entrance").
   - Light sweep: on hover a soft band of light glides across the photo.
   - The frames move a touch on hover: photos zoom in slightly, the About
     arch's back panel and gold outline drift apart, and the stage portraits' arcs
     turn while their badges lift.
   Settling uses the `scale` property and the frame movements `rotate` and
   `translate`, so none of them clash with the hover zooms (`transform`).
   -------------------------------------------------------------------------- */

@keyframes settle {
    from {
        scale: 1.14;
    }

    to {
        scale: none;
    }
}

/* Settle: each photo on reveal */
.js-enabled .about__visual .about__photo,
.js-enabled .stage .stage__photo,
.js-enabled .g-slider .g-item img {
    scale: 1.14;
}

.js-enabled .about__visual.is-visible .about__photo,
.js-enabled .stage.is-visible .stage__photo,
.js-enabled .g-slider.is-visible .g-item img {
    animation: settle 1.8s var(--ease) both;
    animation-delay: calc(var(--d, 0) * 100ms + 0.1s);
}

/* Light sweep: a band of light, parked off the left edge, glides across on
   hover (and jumps back unseen when the pointer leaves) */
.hero__disc::before,
.about__arch::after,
.stage__media::after,
.g-item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 44%, rgba(255, 255, 255, 0.45) 49%, rgba(255, 255, 255, 0.15) 52%, transparent 56%) no-repeat;
    background-size: 250% 100%;
    background-position: 130% 0;
    pointer-events: none;
}

.stage__media::after {
    border-radius: 50%;
}

.hero__visual:hover .hero__disc::before,
.about__arch-wrap:hover .about__arch::after,
.stage:hover .stage__media::after,
.g-item:hover::before,
.g-item:focus-visible::before {
    background-position: -30% 0;
    transition: background-position 1s var(--ease);
}

/* Hover zoom */
.about__photo {
    transition: transform 1.2s var(--ease);
}

.about__arch-wrap:hover .about__photo {
    transform: scale(1.16);
}

/* The About arch's back panel and gold outline drift apart */
.about__arch-back,
.about__arch-line {
    transition: translate 0.9s var(--ease);
}

.about__arch-wrap:hover .about__arch-back {
    translate: -2% 2%;
}

.about__arch-wrap:hover .about__arch-line {
    translate: 2% -2%;
}

/* The stage portraits: the coloured arc turns and the badge lifts */
.stage__media::before {
    transition: rotate 1s var(--ease);
}

.stage:hover .stage__media::before {
    rotate: 40deg;
}

.stage__badge {
    z-index: 2;
    transition: translate 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.stage:hover .stage__badge {
    translate: 0 -6px;
}

/* --------------------------------------------------------------------------
   About: when the section comes into view
   - the arch's dotted back panel fades in from a little smaller (0.1s)
   - the photo frame wipes open from left to right (0.2s) while the photo
     settles from a slight zoom, and the gold outline follows (0.6s)
   - the eyebrow's gold rule draws in towards its text, and the degrees and
     the paragraphs rise one after another
   Each step runs once and keeps nothing afterwards (`backwards`). The panel
   and outline use `scale` and `opacity`, so they don't clash with their
   `transform` offsets or the hover drift (`translate`). The wipe ends past
   the frame's edges so its shadow is never cut off when it finishes.
   -------------------------------------------------------------------------- */

@keyframes soft-in {
    from {
        opacity: 0;
        scale: 0.9;
    }

    to {
        opacity: 1;
        scale: none;
    }
}

@keyframes wipe-right {
    from {
        clip-path: inset(-20px 100% -50px 0);
    }

    to {
        clip-path: inset(-20px -20px -50px -20px);
    }
}

@keyframes line-grow {
    from {
        scale: 0 1;
    }

    to {
        scale: none;
    }
}

.js-enabled .about__visual.is-visible .about__arch-back {
    animation: soft-in 1.2s var(--ease) 0.1s backwards;
}

.js-enabled .about__visual.is-visible .about__arch {
    animation: wipe-right 1.3s cubic-bezier(0.65, 0, 0.35, 1) 0.2s backwards;
}

.js-enabled .about__visual.is-visible .about__photo {
    animation-duration: 2s;
    animation-delay: 0.2s;
}

.js-enabled .about__visual.is-visible .about__arch-line {
    animation: soft-in 1.2s var(--ease) 0.6s backwards;
}

.about .eyebrow::before {
    transform-origin: right center;
}

.js-enabled .about .eyebrow.is-visible::before {
    animation: line-grow 0.8s var(--ease) 0.25s backwards;
}

/* The lists fade in as a whole while their items rise in turn */
.js-enabled .about__creds.is-visible,
.js-enabled .about__bio.is-visible {
    animation-name: fade;
}

.js-enabled .about__creds.is-visible li {
    animation: rise 0.7s var(--ease) backwards;
}

.js-enabled .about__creds.is-visible li:nth-child(2) { animation-delay: 0.07s; }
.js-enabled .about__creds.is-visible li:nth-child(3) { animation-delay: 0.14s; }
.js-enabled .about__creds.is-visible li:nth-child(4) { animation-delay: 0.21s; }
.js-enabled .about__creds.is-visible li:nth-child(5) { animation-delay: 0.28s; }

.js-enabled .about__bio.is-visible p {
    animation: rise 0.8s var(--ease) backwards;
}

.js-enabled .about__bio.is-visible p:nth-child(2) { animation-delay: 0.1s; }
.js-enabled .about__bio.is-visible p:nth-child(3) { animation-delay: 0.2s; }

/* Expertise wheel: the ring arcs and connector lines draw themselves, then the
   gold dots appear, once the wheel comes into view */
.js-enabled .x-wheel__ring,
.js-enabled .x-wheel__line {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.js-enabled .x-wheel__dot {
    opacity: 0;
}

.js-enabled .x-wheel__hub.is-visible .x-wheel__ring {
    animation: draw 1.4s var(--ease) 0.2s forwards;
}

.js-enabled .x-wheel__hub.is-visible .x-wheel__line {
    animation: draw 0.9s var(--ease) 0.8s forwards;
}

.js-enabled .x-wheel__hub.is-visible .x-wheel__dot {
    animation: fade 0.5s var(--ease) 1.4s both;
}

/* --------------------------------------------------------------------------
   FAQ: answers slide open where the browser can animate to height: auto
   -------------------------------------------------------------------------- */

@supports (interpolate-size: allow-keywords) {
    .faq-item {
        interpolate-size: allow-keywords;
    }

    .faq-item::details-content {
        height: 0;
        overflow: clip;
        transition: height 0.45s var(--ease), content-visibility 0.45s allow-discrete;
    }

    .faq-item[open]::details-content {
        height: auto;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion: no movement, everything shown at once
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    .ticker__track,
    .hero__orbit text,
    .hero__visual::after {
        animation: none !important;
    }

    .ticker__track {
        flex-wrap: wrap;
        width: auto;
        justify-content: center;
    }

    .ticker__list[aria-hidden="true"] {
        display: none;
    }

    .ticker__list {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 6px;
    }
}
