/* ══════════════════════════════════════════════════════════════
   KSM × TECH — VRINDAVAN MOTION CHOREOGRAPHY (V4)
   Crafted per Emil Kowalski Motion Doctrine (emilkowal.ski):
   - Strict property transitions (transform, opacity only; zero transition: all)
   - Fast tactile budgets (UI <= 200ms, editorial <= 500ms)
   - Natural physicality (never scale(0); scale(0.96) + opacity: 0)
   - Hardware-accelerated rAF & scroll-driven fallbacks
   - Full prefers-reduced-motion accessibility
   ══════════════════════════════════════════════════════════════ */

:root {
    /* Timing Tokens */
    --motion-fast: 160ms;
    --motion-normal: 260ms;
    --motion-slow: 480ms;
    --motion-editorial: 600ms;

    /* Custom Physicality Easings */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --ease-snap: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-vrindavan: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── 1 · READING PROGRESS HAIRLINE ─────────────────────── */
.marigold-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2.5px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

.marigold-progress::after {
    content: '';
    display: block;
    height: 100%;
    background: var(--marigold, #E8A33D);
    width: 100%;
    transform-origin: left;
    transform: scaleX(var(--scroll-pct, 0));
    will-change: transform;
    transition: transform 60ms linear;
}

@supports (animation-timeline: scroll()) {
    .marigold-progress::after {
        animation: marigold-fill linear both;
        animation-timeline: scroll(root);
        transition: none;
    }
}

@keyframes marigold-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ─── 2 · HEADER SCROLL STATE ────────────────────────────── */
.header {
    transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out), backdrop-filter 220ms var(--ease-out);
}
.header.scrolled {
    background: rgba(244, 235, 217, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line, #E2D7C3);
}
.reg-night .header.scrolled {
    background: rgba(31, 26, 23, 0.92);
    border-bottom-color: rgba(244, 235, 217, 0.1);
}

/* ─── 3 · TACTILE BUTTONS & CARDS (PRESS FEEDBACK) ───────── */
button, .btn, .nav-cta, .work-link-primary, .md-btn {
    transition: transform var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
    button:active, .btn:active, .nav-cta:active, .work-link-primary:active, .md-btn:active {
        transform: scale(0.97) translateY(1px) !important;
    }
}

/* ─── 4 · STAGGERED SCROLL REVEALS (.v-reveal) ───────────── */
.v-reveal {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
    transition: opacity var(--motion-slow) var(--ease-out), transform var(--motion-slow) var(--ease-snap);
    will-change: opacity, transform;
}

.v-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Stagger delay utilities */
.v-delay-1 { transition-delay: 60ms; }
.v-delay-2 { transition-delay: 120ms; }
.v-delay-3 { transition-delay: 180ms; }
.v-delay-4 { transition-delay: 240ms; }

/* ─── 5 · AMBIENT BREATHING & ORNAMENTS ─────────────────── */
.hero-ornament {
    transform-origin: center center;
    transition: transform 400ms var(--ease-out);
    will-change: transform;
}

@keyframes slowOrbit {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes quietBreath {
    from { transform: scale(0.97) rotate(-1deg); opacity: 0.22; }
    to   { transform: scale(1.03) rotate(1deg); opacity: 0.38; }
}

.ambient-rotate {
    animation: slowOrbit 90s linear infinite;
}

.ambient-breath {
    animation: quietBreath 7s ease-in-out infinite alternate;
}

/* ─── 6 · CLOSING MARIGOLD BLOOM ─────────────────────────── */
.marigold-bloom {
    display: flex;
    justify-content: center;
    padding: 60px 0 20px;
}
.marigold-bloom svg {
    width: 38px;
    height: 38px;
    color: var(--marigold, #E8A33D);
    transform: scale(0.92) rotate(-30deg);
    opacity: 0.6;
    transition: transform var(--motion-editorial) var(--ease-snap), opacity var(--motion-editorial) var(--ease-out);
}
.marigold-bloom.is-revealed svg {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

/* ─── 7 · CORNER QUARTER-LOTUS ORNAMENTS ─────────────────── */
.corner-ornament {
    position: absolute;
    width: 16px;
    height: 16px;
    color: var(--line-strong, #C4A97E);
    pointer-events: none;
    transition: color var(--motion-normal) var(--ease-out), transform var(--motion-normal) var(--ease-out);
}
.corner-tl { top: 8px; left: 8px; }
.corner-tr { top: 8px; right: 8px; transform: scaleX(-1); }
.corner-bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.corner-br { bottom: 8px; right: 8px; transform: scale(-1); }

.work-card:hover .corner-ornament {
    color: var(--art-a, #B33A2B);
}
.work-card:hover .corner-tl { transform: translate(-2px, -2px); }
.work-card:hover .corner-tr { transform: scaleX(-1) translate(-2px, -2px); }
.work-card:hover .corner-bl { transform: scaleY(-1) translate(-2px, -2px); }
.work-card:hover .corner-br { transform: scale(-1) translate(-2px, -2px); }

/* ─── 8 · HAIRLINE DIVIDERS ─────────────────────────────── */
.v-divider-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 0;
    color: var(--line-strong, #C4A97E);
}
.v-divider-strip svg {
    width: 120px;
    height: 10px;
}

/* ─── 9 · LIVING YAMUNA ENERGY STREAM (FOOTER BORDER) ─────── */
.footer-divider-stream {
    position: relative;
    width: 100%;
    height: 1px;
    background: rgba(232, 163, 61, 0.2);
    overflow: hidden;
    margin: 40px 0 28px;
}

.footer-divider-stream::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(232, 163, 61, 0.2) 20%, rgba(250, 244, 232, 0.9) 50%, rgba(232, 163, 61, 0.2) 80%, transparent 100%);
    animation: yamunaStream 6.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: transform;
}

@keyframes yamunaStream {
    0% { transform: translate3d(-100%, 0, 0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translate3d(250%, 0, 0); opacity: 0; }
}

@media (max-width: 800px), (hover: none), (pointer: coarse) {
    .footer-divider-stream::after {
        animation: none !important;
        display: none !important;
    }
}

/* ─── 10 · ILLUMINATED GOLDEN MANTRA SHIMMER ─────────────── */
.mantra-shimmer,
footer.footer-night .footer-mantra .devanagari,
.footer .footer-mantra .devanagari {
    display: inline-block;
    background: linear-gradient(110deg, #E8A33D 0%, #FAF4E8 25%, #E8A33D 45%, #C4A97E 70%, #FAF4E8 90%, #E8A33D 100%);
    background-size: 240% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: mantraGoldFlow 8s ease-in-out infinite;
    transition: transform 0.28s var(--ease-snap), filter 0.28s var(--ease-snap);
    transform-origin: center right;
}

.mantra-shimmer:hover,
footer.footer-night .footer-mantra:hover .devanagari,
.footer .footer-mantra:hover .devanagari {
    filter: drop-shadow(0 0 10px rgba(232, 163, 61, 0.65));
    transform: translateY(-1px) scale(1.03);
}

@keyframes mantraGoldFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ─── 11 · LIVING STUDIO BEACON ──────────────────────────── */
.footer-live-beacon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--ui, sans-serif);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(244, 235, 217, 0.75);
    margin-top: 6px;
}

.beacon-pulse {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2A9D9D; /* Peacock Lit */
    box-shadow: 0 0 8px #2A9D9D;
    flex-shrink: 0;
}

.beacon-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 1px solid #2A9D9D;
    animation: beaconRipples 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    opacity: 0.8;
}

@keyframes beaconRipples {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* ─── 12 · KINETIC DIRECTIONAL LINKS & MICRO-LEAPS ───────── */
.kinetic-link,
footer.footer-night .footer-col a,
.footer .footer-col a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.24s var(--ease-snap), color 0.24s var(--ease-out) !important;
    text-decoration: none;
    width: fit-content;
}

.kinetic-link::after,
footer.footer-night .footer-col a::after,
.footer .footer-col a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--marigold, #E8A33D);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.28s var(--ease-snap);
}

.kinetic-link:hover,
footer.footer-night .footer-col a:hover,
.footer .footer-col a:hover {
    transform: translateX(5px);
    color: #FAF4E8 !important;
}

.kinetic-link:hover::after,
footer.footer-night .footer-col a:hover::after,
.footer .footer-col a:hover::after {
    transform: scaleX(1);
}

.link-arrow {
    display: inline-block;
    transition: transform 0.22s var(--ease-snap);
}

.kinetic-link:hover .link-arrow,
footer.footer-night .footer-col a:hover .link-arrow,
.footer .footer-col a:hover .link-arrow {
    transform: translate(2.5px, -2.5px);
}

/* ─── 13 · CARD SPOTLIGHT PHYSICS & TACTILE DEPTH ─────────── */
.card-spotlight,
.work-card,
.pillar-card,
.trinity-card,
.bw-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--ease-snap), box-shadow 0.35s var(--ease-snap), border-color 0.35s var(--ease-out);
}

.card-spotlight::before,
.work-card::before,
.pillar-card::before,
.trinity-card::before,
.bw-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(232, 163, 61, 0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

.card-spotlight:hover::before,
.work-card:hover::before,
.pillar-card:hover::before,
.trinity-card:hover::before,
.bw-card:hover::before {
    opacity: 1;
}

.card-spotlight:hover,
.work-card:hover,
.pillar-card:hover,
.trinity-card:hover,
.bw-card:hover {
    transform: translateY(-4px) scale(1.006);
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.35);
    border-color: rgba(232, 163, 61, 0.45);
}

.card-spotlight:active,
.work-card:active,
.pillar-card:active,
.trinity-card:active,
.bw-card:active {
    transform: translateY(-1px) scale(0.99);
}

/* ─── 14 · LIVING YAMUNA 3D WAVE SYSTEM (FOOTER BOUNDARY) ─── */
.footer-wave-3d {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    background: transparent;
    margin-bottom: -2px; /* Flush seal with footer, zero subpixel gap */
    z-index: 5;
    content-visibility: auto;
    contain-intrinsic-size: 140px;
}

.footer-wave-3d .wave-svg-root {
    width: 110%;
    height: clamp(80px, 9.5vw, 145px);
    margin-left: -5%;
    display: block;
    filter: drop-shadow(0 -12px 24px rgba(14, 34, 68, 0.22));
}

.w-layer-deep {
    animation: wave3dDeep 18s ease-in-out infinite;
    transform-origin: 50% 100%;
}

.w-layer-mid {
    animation: wave3dMid 12s ease-in-out infinite;
    transform-origin: 50% 100%;
}

.w-layer-front {
    animation: wave3dFront 8s ease-in-out infinite;
    transform-origin: 50% 100%;
}

@keyframes wave3dDeep {
    0% { transform: translate3d(0, 0, 0) scaleY(1); }
    50% { transform: translate3d(-40px, 3px, 0) scaleY(1.12); }
    100% { transform: translate3d(0, 0, 0) scaleY(1); }
}

@keyframes wave3dMid {
    0% { transform: translate3d(0, 0, 0) scaleY(1); }
    50% { transform: translate3d(30px, -2px, 0) scaleY(0.95); }
    100% { transform: translate3d(0, 0, 0) scaleY(1); }
}

@keyframes wave3dFront {
    0% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-20px, 2px, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

/* Mobile GPU optimization: strip heavy drop-shadow filter and freeze infinite SVG wave transforms */
@media (max-width: 800px), (hover: none), (pointer: coarse) {
    .footer-wave-3d .wave-svg-root {
        filter: none !important;
    }
    .w-layer-deep,
    .w-layer-mid,
    .w-layer-front {
        animation: none !important;
        transform: none !important;
    }
}

/* ─── 15 · REDUCED MOTION (ACCESSIBILITY FIRST) ──────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
    .marigold-progress::after {
        transform: scaleX(1) !important;
    }
    .v-reveal {
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-ornament, .marigold-bloom svg, .ambient-rotate, .ambient-breath,
    .footer-divider-stream::after, .mantra-shimmer, .beacon-pulse::before,
    .w-layer-deep, .w-layer-mid, .w-layer-front,
    .footer-wave-layer-back, .footer-wave-layer-front {
        transform: none !important;
        opacity: 0.3 !important;
        animation: none !important;
    }
    .mantra-shimmer,
    footer.footer-night .footer-mantra .devanagari,
    .footer .footer-mantra .devanagari {
        background: var(--marigold, #E8A33D) !important;
        -webkit-text-fill-color: var(--marigold, #E8A33D) !important;
    }
}

/* ─── 16 · DOM CONTENT VISIBILITY CONTAINMENT (MOBILE 60FPS) ─── */
.cv-auto,
.work-section,
.story,
.footer-night,
.footer {
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

