/* === SOLIDENERGY Custom Styles === */

body {
    background-color: #041329;
    color: #d6e3ff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Glassmorphism */
.glass-card {
    background: rgba(11, 25, 47, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Glow effects */
.cyan-glow {
    box-shadow: 0 0 20px rgba(20, 216, 255, 0.35);
}
.cyan-glow-text {
    text-shadow: 0 0 10px rgba(20, 216, 255, 0.6);
}

/* Premium Glow Cards with Interactive Mouse Tracking and Transitions */
.glow-card {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow;
}

.glow-card:hover {
    transform: translateY(-6px);
    border-color: rgba(20, 216, 255, 0.4) !important;
    box-shadow: 0 20px 40px -15px rgba(20, 216, 255, 0.15), 0 0 15px rgba(20, 216, 255, 0.05);
}

/* Glow gradient cursor spotlight effect (updated in JS) */
.glow-card-spotlight {
    position: relative;
    overflow: hidden;
}

.glow-card-spotlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        350px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(20, 216, 255, 0.06),
        transparent 80%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.glow-card-spotlight:hover::before {
    opacity: 1;
}

.glow-card-spotlight > * {
    position: relative;
    z-index: 2;
}

/* Reveal on Scroll Transitions */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive technical tooltip design */
.group:hover .pointer-events-none {
    pointer-events: auto !important;
}

/* Tech hotspots pulsing anim */
.tech-pulse-dot {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.tech-pulse-dot:hover {
    transform: scale(1.25);
}

/* Interactive Grid Background Anim */
.scada-grid {
    background-image: radial-gradient(rgba(20, 216, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    position: relative;
}

.scada-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(20, 216, 255, 0.01) 50%, transparent 60%);
    background-size: 100% 200%;
    animation: scada-scan 12s linear infinite;
    pointer-events: none;
}

@keyframes scada-scan {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 200%; }
}

/* Dynamic Shrinking Header */
#site-header {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
#site-header.is-scrolled {
    background-color: rgba(4, 19, 41, 0.94);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(20, 216, 255, 0.15);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

/* Smooth transitions */
* {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #041329;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(20, 216, 255, 0.5) !important;
}

/* Form message */
#se-form-msg.success,
#se-form-page-msg.success {
    background: rgba(94, 250, 213, 0.1);
    border: 1px solid rgba(94, 250, 213, 0.3);
    color: #5efad5;
    padding: 12px 16px;
    border-radius: 8px;
}
#se-form-msg.error,
#se-form-page-msg.error {
    background: rgba(255, 180, 171, 0.1);
    border: 1px solid rgba(255, 180, 171, 0.3);
    color: #ffb4ab;
    padding: 12px 16px;
    border-radius: 8px;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prose styles for content blocks */
.prose-invert a {
    color: #aeecff;
    text-decoration: underline;
}
.prose-invert a:hover {
    color: #14d8ff;
}
.prose-invert h2 {
    color: #d6e3ff;
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.prose-invert h3 {
    color: #d6e3ff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.prose-invert ul,
.prose-invert ol {
    padding-left: 1.5rem;
}
.prose-invert ul li {
    list-style-type: disc;
}
.prose-invert ol li {
    list-style-type: decimal;
}
.prose-invert blockquote {
    border-left: 2px solid #14d8ff;
    padding-left: 1rem;
    color: #bbc9ce;
    font-style: italic;
}
.prose-invert img {
    border-radius: 0.75rem;
}
.prose-invert hr {
    border-color: rgba(255, 255, 255, 0.1);
}

/* === Mobile Typography & Responsive Grid Architecture === */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .text-display-lg {
        font-size: 34px !important;
        line-height: 1.15 !important;
    }

    .text-display-md {
        font-size: 26px !important;
        line-height: 1.2 !important;
    }

    .text-headline-lg {
        font-size: 20px !important;
    }

    .text-headline-sm {
        font-size: 17px !important;
    }

    .text-body-lg {
        font-size: 15px !important;
    }

    .text-body-md {
        font-size: 14px !important;
    }

    /* Hero section mobile height optimization */
    .min-h-\[921px\] {
        min-height: auto !important;
        padding-top: 5rem;
        padding-bottom: 4rem;
    }

    /* Glass cards mobile refinement (softer blur, thinner borders) */
    .glass-card {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        background: rgba(11, 25, 47, 0.82);
    }

    /* Services grid: padding reduction for dense content */
    .p-10 {
        padding: 1.5rem !important;
    }

    /* CTA glass card padding */
    .p-12, .md\:p-20 {
        padding: 1.5rem !important;
    }

    /* Footer padding */
    .pt-20 { padding-top: 2.5rem !important; }
    .pb-10 { padding-bottom: 1.5rem !important; }
    .py-20 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Section spacing adjustments for shorter viewport travel */
    .py-24 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
    .py-32 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    /* Spacing units scale down */
    .mb-16 { margin-bottom: 2.25rem !important; }
    .mb-10 { margin-bottom: 1.5rem !important; }
    .gap-16 { gap: 1.75rem !important; }
    .gap-12 { gap: 1.5rem !important; }

    /* Hero parallax image alignment centering */
    .object-cover {
        object-position: center 35%;
    }

    .mobile-hide {
        display: none !important;
    }

    /* Premium Glass Dropdown Mobile Menu with Subtle Border Glow */
    #mobile-menu {
        border-radius: 0 0 1.5rem 1.5rem;
        box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4), 0 0 15px rgba(20, 216, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-top: none;
        overflow: hidden;
    }
    
    #mobile-menu:not(.hidden) {
        animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    /* Staggered mobile links click highlights */
    .mobile-nav-link {
        border-radius: 0.5rem;
        padding-left: 0.5rem;
        transition: all 0.2s ease;
    }
    .mobile-nav-link:active {
        background: rgba(20, 216, 255, 0.08);
        padding-left: 0.75rem;
        color: #14d8ff !important;
    }
}

@media (max-width: 480px) {
    .text-display-lg {
        font-size: 26px !important;
    }

    .text-display-md {
        font-size: 22px !important;
    }

    .text-headline-sm {
        font-size: 15px !important;
    }

    /* Stat numbers smaller on phone */
    .text-display-md.font-display-md {
        font-size: 26px !important;
    }

    /* Raw materials: force card scrolling limits */
    .raw-materials-grid > * {
        min-width: 72vw;
    }

    /* Premium Stacked Stat List for Small Viewports (guarantees zero word wrapping) */
    .hero-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    .hero-stats-grid > div {
        display: flex !important;
        align-items: center !important;
        gap: 1.25rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 0.75rem;
    }
    .hero-stats-grid > div:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .hero-stats-grid > div > div:first-child {
        margin-bottom: 0 !important;
        min-width: 3.5rem;
        text-align: left;
    }
}

/* === Mobile menu animation keyframe === */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Mobile hamburger hide === */
@media (min-width: 769px) {
    #mobile-menu {
        display: none !important;
    }
}

/* === Smooth tap highlight removal on touch targets === */
* {
    -webkit-tap-highlight-color: transparent;
}

/* === Prevent horizontal layout breaks === */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* === Horizontal scroll container (raw materials on mobile) === */
.scroll-x-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding-bottom: 0.5rem;
}
.scroll-x-container > * {
    scroll-snap-align: start;
    flex-shrink: 0;
}
.scroll-x-container::-webkit-scrollbar {
    height: 4px;
}
.scroll-x-container::-webkit-scrollbar-track {
    background: transparent;
}
.scroll-x-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

/* === Remove horizontal scroll on desktop === */
@media (min-width: 1024px) {
    .scroll-x-container {
        display: grid;
        overflow-x: visible;
    }
}

/* === Swipe fading edge mask for mobile scroll horizontal === */
@media (max-width: 1023px) {
    .scroll-x-container-wrapper {
        position: relative;
    }
    .scroll-x-container-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 36px;
        background: linear-gradient(to right, transparent, #041329);
        pointer-events: none;
        z-index: 10;
    }
}

/* === Technology Mobile Info Drawer transitions === */
#tech-info-drawer {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(12px);
    opacity: 0;
}
#tech-info-drawer.is-active {
    transform: translateY(0);
    opacity: 1;
}

/* === Mobile Element Centering Refinements === */
@media (max-width: 768px) {
    /* Header positioning override (scrolls with page naturally, not sticky on mobile) */
    #site-header {
        position: relative !important;
        top: 0 !important;
    }

    /* Hero Section Mobile Centering */
    #hero h1, #hero p, #hero .mb-4 {
        text-align: center !important;
        justify-content: center !important;
    }
    #hero .flex-col {
        align-items: center !important;
    }
    #hero .flex-wrap {
        justify-content: center !important;
    }
    #hero .hero-stats-grid {
        align-items: stretch !important;
    }
    
    /* About Section Mobile Centering */
    #about .lg:col-span-5 {
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center !important;
    }
    #about .lg:col-span-5 p {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    #about .lg:col-span-5 a {
        justify-content: center !important;
    }
    
    /* Technology Section Header Mobile Centering */
    #technology .mb-10 {
        text-align: center !important;
    }
    #technology .mb-10 p {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Raw Materials Header Mobile Centering */
    #raw-materials .flex-col {
        text-align: center !important;
        align-items: center !important;
    }
    #raw-materials .flex-col a {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Services Header Mobile Centering */
    #services .mb-10 {
        text-align: center !important;
    }
    
    /* Cases Header Mobile Centering */
    #cases .mb-10 {
        text-align: center !important;
    }
    
    /* CTA Header Mobile Centering */
    #cta h2, #cta p {
        text-align: center !important;
    }
    #cta .flex-col {
        align-items: center !important;
        justify-content: center !important;
    }
    #cta .text-on-surface-variant {
        align-items: center !important;
    }

    /* Inner Page Banners & Page Headers Mobile Centering */
    section.bg-surface-container-lowest .max-w-3xl,
    main.py-16.md\:py-24 .mb-16 {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    section.bg-surface-container-lowest .max-w-3xl h1,
    section.bg-surface-container-lowest .max-w-3xl p,
    section.bg-surface-container-lowest .max-w-3xl span,
    main.py-16.md\:py-24 .mb-16 h1,
    main.py-16.md\:py-24 .mb-16 p,
    main.py-16.md\:py-24 .mb-16 span {
        text-align: center !important;
    }
    section.bg-surface-container-lowest .breadcrumbs,
    main.py-16.md\:py-24 .breadcrumbs {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
}
