
/* ==========================================================================
   UNIVERSAL ALL-DEVICES-FRIENDLY RESPONSIVE ENGINE (v6.0)
   Pixel-Perfect Layouts for 320px to 4K Displays
   ========================================================================== */

/* --- 1. SAFE AREA INSETS & UNIVERSAL RESET --- */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sar: env(safe-area-inset-right, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --nav-height: 80px;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

html {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-left: var(--sal) !important;
    padding-right: var(--sar) !important;
    font-size: 1rem;
    line-height: 1.5;
}

body.mobile-nav-locked {
    overflow: hidden !important;
    touch-action: none !important;
}

/* --- 2. ELIMINATE 300MS TAP DELAY & ACCESSIBLE TOUCH TARGETS --- */
a, button, input, select, textarea, label, [role="button"], .nav-trigger-btn, .mobile-acc-trigger {
    touch-action: manipulation;
}

button, a, input, select, textarea {
    min-height: 44px;
}

/* Inline links in paragraphs exempt from 44px height */
p a, span a, td a, li a {
    min-height: unset;
}

/* --- 3. PREVENT iOS SAFARI INPUT AUTO-ZOOM (<16px bug) --- */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* --- 4. MEDIA, IMAGES, VECTORS & TABLES RESPONSIVENESS --- */
img, svg, video, canvas, iframe {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
}

.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* --- 5. UNIVERSAL BULLETPROOF MOBILE NAV DRAWER --- */
#mobile-nav-drawer {
    display: none;
    position: fixed !important;
    top: var(--nav-height) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--nav-height)) !important;
    background: #090D16 !important;
    z-index: 999999 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: calc(var(--sab) + 3rem) !important;
    padding-left: max(1.5rem, var(--sal)) !important;
    padding-right: max(1.5rem, var(--sar)) !important;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease !important;
}

#mobile-nav-drawer.drawer-open {
    display: block !important;
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.mobile-acc-content {
    transition: all 0.25s ease;
}

@media (min-width: 1024px) {
    #mobile-nav-drawer {
        display: none !important;
    }
}

/* --- 6. FLUID RESPONSIVE TYPOGRAPHY (320px to 640px) --- */
@media screen and (max-width: 640px) {
    h1, .text-6xl, .text-7xl, .text-8xl {
        font-size: clamp(2.1rem, 9.5vw, 3.2rem) !important;
        line-height: 1.08 !important;
        letter-spacing: -0.03em !important;
    }
    h2, .text-4xl, .text-5xl {
        font-size: clamp(1.65rem, 6.5vw, 2.3rem) !important;
        line-height: 1.2 !important;
    }
    h3, .text-3xl {
        font-size: clamp(1.35rem, 5vw, 1.8rem) !important;
        line-height: 1.25 !important;
    }
    p, .text-xl, .text-2xl {
        font-size: clamp(0.95rem, 4vw, 1.15rem) !important;
        line-height: 1.55 !important;
    }

    /* Container padding on mobile */
    .px-6, .px-8, .px-10 {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .py-24, .py-28, .py-32, .py-40 {
        padding-top: 4.5rem !important;
        padding-bottom: 4.5rem !important;
    }

    /* Grid collapses to 1 column on phones */
    .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-cols-6 {
        grid-template-columns: 1fr !important;
    }

    /* Hero button stack */
    .btn-primary, .btn-secondary {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 0.9rem 1.5rem !important;
        font-size: 1rem !important;
    }

    /* Floating Hub & WhatsApp positioning */
    #quick-hub {
        bottom: calc(var(--sab) + 1rem) !important;
        right: max(1rem, var(--sar)) !important;
    }
    #quick-hub-btn {
        width: 3.25rem !important;
        height: 3.25rem !important;
    }
}

/* --- 7. TABLET / IPAD ADAPTATIONS (641px to 1023px) --- */
@media screen and (min-width: 641px) and (max-width: 1023px) {
    h1, .text-7xl, .text-8xl {
        font-size: clamp(3rem, 7vw, 4.5rem) !important;
    }
    h2, .text-5xl {
        font-size: clamp(2.2rem, 5vw, 3rem) !important;
    }

    /* 2 columns on tablets */
    .grid-cols-3, .grid-cols-4, .grid-cols-5, .grid-cols-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .py-32, .py-40 {
        padding-top: 6rem !important;
        padding-bottom: 6rem !important;
    }
}

/* --- 8. SMALL MOBILE SPECIFIC FIXES (320px to 374px) --- */
@media screen and (max-width: 374px) {
    h1 {
        font-size: 1.85rem !important;
    }
    h2 {
        font-size: 1.5rem !important;
    }
    .px-6 {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }
    #mobile-nav-toggle {
        padding: 0.4rem !important;
    }
}

/* --- 9. ULTRA-WIDE & 4K DISPLAY ENHANCEMENTS (1920px+) --- */
@media screen and (min-width: 1920px) {
    .max-w-7xl, .max-w-6xl, .max-w-5xl {
        max-width: 1600px !important;
    }
    body {
        font-size: 1.125rem;
    }
}

/* --- 10. CRITICAL VISIBILITY GUARANTEE --- */
.gsap-reveal {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#bg-canvas {
    pointer-events: none !important;
}

/* ==========================================================================
   GALAXY INFOSYS ULTRA-LUXURY FX & UI/UX ENGINE (v4.0)
   ========================================================================== */

/* 1. Sleek Modern Micro-Scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: #14A800 #0B0F19;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0B0F19;
}

::-webkit-scrollbar-thumb {
    background: #14A800;
    border-radius: 9999px;
    border: 2px solid #0B0F19;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #38EF7D;
}

/* 2. Accessible Focus-Visible Keyboard Rings */
:focus-visible {
    outline: 2px solid #14A800 !important;
    outline-offset: 3px !important;
}

/* 3. Universal Scroll Reveal Animation System */
.galaxy-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.galaxy-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Entrance Classes */
.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }
.stagger-5 { transition-delay: 0.40s; }

/* 4. Liquid Aurora Gradient Text Animation */
@keyframes auroraTextFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.text-aurora {
    background: linear-gradient(135deg, #14A800 0%, #38EF7D 30%, #00F0FF 65%, #14A800 100%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: auroraTextFlow 7s ease-in-out infinite;
}

/* 5. Interactive Cursor Glow Card */
.glow-card {
    position: relative;
    overflow: hidden;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(20, 168, 0, 0.13),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.glow-card:hover::before {
    opacity: 1;
}

/* 6. Shimmer Border Beam Animation */
@keyframes borderBeam {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.beam-container {
    position: relative;
    overflow: hidden;
}

.beam-border {
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from 0deg, transparent 0 340deg, #14A800 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: borderBeam 4s linear infinite;
    z-index: 10;
}

/* 7. 3D Tilt Card Physics */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    will-change: transform;
}

/* 8. Click Ripple Wave */
.galaxy-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleWave 0.6s linear;
    pointer-events: none;
    z-index: 20;
}

@keyframes rippleWave {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 9. Ambient Pulse Glow */
@keyframes ambientGlow {
    0%, 100% {
        box-shadow: 0 0 25px -5px rgba(20, 168, 0, 0.22);
    }
    50% {
        box-shadow: 0 0 50px 8px rgba(20, 168, 0, 0.42);
    }
}

.pulse-glow {
    animation: ambientGlow 4s ease-in-out infinite;
}

/* 10. Kinetic Badge Float */
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-7px) rotate(1deg); }
}

.badge-float {
    animation: badgeFloat 4.5s ease-in-out infinite;
}

/* 11. Smart Navbar Scroll Animation */
#galaxy-navbar {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

#galaxy-navbar.nav-hidden {
    transform: translateY(-100%);
}

#galaxy-navbar.nav-scrolled {
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

/* 12. Dashboard & Infographic Interactive Hover Illumination */
[id$="-dashboard-proof"] img,
[id$="-showcase"] img,
[id$="-radar"] img,
.portfolio-card img {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

[id$="-dashboard-proof"] img:hover,
[id$="-showcase"] img:hover,
[id$="-radar"] img:hover,
.portfolio-card img:hover {
    filter: drop-shadow(0 0 18px rgba(20, 168, 0, 0.25));
}

/* 13. Universal Frosted Toast Notification Styles */
.galaxy-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.galaxy-toast-item {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #FFFFFF;
    padding: 14px 20px;
    border-radius: 18px;
    border: 1px solid rgba(20, 168, 0, 0.4);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(20, 168, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 600;
    max-width: 420px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.galaxy-toast-item.show {
    transform: translateY(0);
    opacity: 1;
}

/* 14. Tactile Audio Feedback Indicator */
#audio-feedback-toggle {
    transition: all 0.25s ease;
}

#audio-feedback-toggle.audio-active {
    color: #14A800;
    border-color: #14A800;
}

/* 15. Respect User Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    .galaxy-reveal,
    .glow-card::before,
    .tilt-card,
    .galaxy-ripple,
    .pulse-glow,
    .badge-float,
    .beam-border,
    .text-aurora {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* 16. Accessible WCAG AA & AAA High-Contrast Button & Text Styles */
.btn-primary {
    background-color: #047857 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.btn-primary:hover {
    background-color: #065f46 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.45) !important;
}

/* 17. High Performance Font Display Fallbacks */
@font-face {
    font-family: "Phosphor";
    font-display: swap;
}
@font-face {
    font-family: "Phosphor-Bold";
    font-display: swap;
}
@font-face {
    font-family: "Phosphor-Fill";
    font-display: swap;
}