/* Custom Styles - Unified Typography with Space Mono */

/* Nikita's note - used to be Space Mono,  */
* {
    font-family: "Figtree", sans-serif;
}

body {
    font-family: "Figtree", sans-serif;
}

/* Ensure all text uses Space Mono font */
h1, h2, h3, h4, h5, h6, p, span, div, a, button, input, textarea, select, label {
    font-family: "Figtree", sans-serif;
}

/* Header transparency transitions */
header {
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, opacity 0.3s ease;
}

/* Ensure nav links are always visible */
.nav-link {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    position: relative;
    z-index: 10;
    opacity: 1 !important;
    color: #ffffff !important;
    display: inline-block;
}

/* Enhanced visibility when header is transparent */
header[style*="rgba(13, 27, 46, 0.1)"] .nav-link,
header[style*="rgba(13, 27, 46, 0.2)"] .nav-link {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 1), 0 0 20px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    opacity: 1 !important;
    color: #ffffff !important;
}

/* Ensure nav links are always visible and clickable */
nav a,
.nav-link {
    opacity: 1 !important;
    color: #ffffff !important;
    cursor: pointer;
    pointer-events: auto;
    visibility: visible !important;
}

/* Hero Section - Very transparent to show brain background */
.hero-transparent {
    background: rgba(13, 27, 46, 0.05);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    position: relative;
}

.hero-transparent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(13, 27, 46, 0.1) 0%,
        rgba(13, 27, 46, 0.05) 50%,
        rgba(13, 27, 46, 0.08) 100%
    );
    pointer-events: none;
    z-index: 0;
}

.hero-transparent > * {
    position: relative;
    z-index: 1;
}

/* Ensure hero text has good contrast with stronger shadows */
.hero-transparent h1,
.hero-transparent p,
.hero-transparent .text-white {
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Make announcement banner very transparent too */
.hero-transparent .border-y {
    background: rgba(13, 27, 46, 0.05);
    backdrop-filter: blur(0.5px);
}

/* Enhance text contrast for better readability */
.hero-transparent h1 {
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.9), 0 6px 25px rgba(0, 0, 0, 0.7);
}

.hero-transparent .text-white {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Hover glow for "contact us" */
.contact-glow {
    color: #9CA3AF; /* gray-400 baseline */
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.group:hover .contact-glow {
    color: #0EA5E9; /* cyan-blue */
    text-shadow:
        0 0 8px rgba(14, 165, 233, 0.6),
        0 0 16px rgba(14, 165, 233, 0.4),
        0 0 32px rgba(14, 165, 233, 0.25);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}


/* Fallback for manual anchor scrolling (JS handles feature tabs clicks) */
#features {
  scroll-margin-top: 70px;
}

/* Testimonial Slider */
.testimonial-slider {
    position: relative;
    min-height: 200px;
}

.testimonial-slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.testimonial-slide.active {
    display: block;
    opacity: 1;
}

/* FAQ Accordion */
.faq-item {
    cursor: pointer;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    opacity: 1;
}

.faq-item.active .faq-icon {
    transform: translateX(-50%) scaleY(0);
}

/* Feature Tabs */
.feature-tab.active {
    color: #0d1b2e;
    font-weight: 600;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #3B82F6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0EA5E9;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: #0d1b2e;
    z-index: 120;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu.active {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Hero Text Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(14, 165, 233, 0.3);
    }
    50% {
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 40px rgba(14, 165, 233, 0.6);
    }
}

@keyframes letterReveal {
    from {
        opacity: 0;
        transform: translateY(20px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* Hero Title Animation */
.hero-title {
    animation: slideInUp 1s ease-out 0.5s both, glowPulse 3s ease-in-out 2s infinite;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(14, 165, 233, 0.3);
    transform-origin: center;
    position: relative;
    width: 100%;
    line-height: 1.1;
}

/* Hero Description Animation */
.hero-description {
    animation: slideInUp 1s ease-out 1s both;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    width: 100%;
    line-height: 1.5;
}

/* Decrypt Animation Styling */
.hero-title.decrypting,
.hero-description.decrypting {
    letter-spacing: normal;
}

/* Scrambled character styling */
.hero-title .scrambled-char,
.hero-description .scrambled-char {
    color: rgba(14, 165, 233, 0.6);
    text-shadow: 0 0 8px rgba(14, 165, 233, 0.8), 0 0 16px rgba(14, 165, 233, 0.4);
    animation: scrambleGlow 0.3s ease-in-out infinite;
    opacity: 0.8;
}

/* Revealed character styling */
.hero-title .revealed-char,
.hero-description .revealed-char {
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(14, 165, 233, 0.5);
    animation: revealGlow 0.5s ease-out;
    opacity: 1;
}

/* Space character styling */
.hero-title .space-char,
.hero-description .space-char {
    color: transparent;
}

/* Glow animation for scrambled characters */
@keyframes scrambleGlow {
    0%, 100% {
        text-shadow: 0 0 8px rgba(14, 165, 233, 0.8), 0 0 16px rgba(14, 165, 233, 0.4);
        opacity: 0.8;
    }
    50% {
        text-shadow: 0 0 12px rgba(14, 165, 233, 1), 0 0 24px rgba(14, 165, 233, 0.6);
        opacity: 1;
    }
}

/* Reveal animation for revealed characters */
@keyframes revealGlow {
    0% {
        color: rgba(14, 165, 233, 0.6);
        text-shadow: 0 0 8px rgba(14, 165, 233, 0.8);
        transform: scale(1.2);
        opacity: 0.8;
    }
    50% {
        color: rgba(255, 255, 255, 0.9);
        text-shadow: 0 0 16px rgba(14, 165, 233, 0.6), 0 0 24px rgba(14, 165, 233, 0.3);
        transform: scale(1.05);
    }
    100% {
        color: #ffffff;
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(14, 165, 233, 0.5);
        transform: scale(1);
        opacity: 1;
    }
}

/* Enhanced glow pulse for completed text */
@keyframes completedGlow {
    0%, 100% {
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(14, 165, 233, 0.3);
    }
    50% {
        text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 40px rgba(14, 165, 233, 0.6), 0 0 60px rgba(14, 165, 233, 0.3);
    }
}

.hero-title.completed {
    animation: completedGlow 3s ease-in-out infinite;
}

.hero-description.completed {
    animation: completedGlow 3s ease-in-out infinite;
}

/* Staggered letter animation for title (via JavaScript) */
.hero-title span {
    display: inline-block;
    animation: letterReveal 0.6s ease-out both;
}

/* Enhanced animations on load */
@keyframes heroEntrance {
    0% {
        opacity: 0;
        transform: translateY(80px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-title {
    animation: heroEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both,
               glowPulse 3s ease-in-out 2s infinite;
}

/* Feature Content Grid - All features are visible in grid */
.feature-content-item {
    display: flex;
}

/* Make logo completely white */
.logo-white,
.logo-white-filter {
    filter: brightness(0) invert(1);
}

/* Intro Animation */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d1b2e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.intro-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    display: block;
}

/* Ensure content is above Three.js brain background */
body {
    position: relative;
}

header,
main,
footer {
    position: relative;
    z-index: 100;
}

/* Brain background should be behind content */
canvas[style*="z-index: '1'"] {
    z-index: 1 !important;
}

/* Responsive adjustments - Comprehensive breakpoints for all devices */

/* Extra Small Mobile Devices (320px - 359px) - iPhone SE, small Android */
@media (max-width: 359px) {
    .container {
        padding: 0 0.75rem;
    }
    
    header {
        height: 60px;
    }
    
    header .container {
        padding: 0 0.75rem;
    }
    
    .intro-gif {
        object-fit: contain;
    }
    
    h1 {
        font-size: 2rem !important;
        line-height: 1.2;
    }
    
    .mobile-menu {
        top: 60px;
    }
    
    /* Adjust spacing for very small screens */
    section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Smaller text on tiny screens */
    .text-lg {
        font-size: 0.9rem;
    }
}

/* Small Mobile Devices (360px - 374px) - Most Android phones */
@media (min-width: 360px) and (max-width: 374px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2.25rem !important;
    }
}

/* Standard Mobile Devices (375px - 479px) - iPhone 12/13/14, Pixel */
@media (min-width: 375px) and (max-width: 479px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
    
    /* Ensure proper button sizing */
    button, .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }
}

/* Large Mobile Devices (480px - 767px) - Large Android phones, iPhone Plus */
@media (min-width: 480px) and (max-width: 767px) {
    .container {
        padding: 0 1.5rem;
    }
    
    h1 {
        font-size: 3rem !important;
    }
    
    /* Better spacing for larger mobile */
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Tablet Portrait (768px - 1023px) - iPad, Android tablets */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 2rem;
    }
    
    header {
        height: 70px;
    }
    
    .mobile-menu {
        top: 70px;
    }
    
    /* Ensure proper spacing on tablets */
    section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Adjust grid layouts for tablets */
    .lg\:grid-cols-12 > * {
        min-width: 0;
    }
    
    /* Better image sizing on tablets */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Tablet Landscape / Small Laptop (1024px - 1365px) - iPad Pro, small laptops */
@media (min-width: 1024px) and (max-width: 1365px) {
    .container {
        padding: 0 2rem;
        max-width: 1200px;
    }
    
    /* Adjust grid layouts for medium screens */
    .lg\:grid-cols-12 {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    
    /* Optimize spacing */
    .lg\:py-24 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Standard Laptop / Desktop (1366px - 1919px) - Most laptops, standard desktops */
@media (min-width: 1366px) and (max-width: 1919px) {
    .container {
        max-width: 1280px;
        padding: 0 2rem;
    }
    
    /* Ensure content doesn't stretch too wide */
    .max-w-\[1089px\] {
        max-width: 1089px;
    }
}

/* Large Desktop (1920px and above) - Large monitors, 4K displays */
@media (min-width: 1920px) {
    .container {
        max-width: 1440px;
        padding: 0 3rem;
    }
    
    /* Scale up font sizes for large displays */
    body {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 5rem !important;
    }
    
    h2 {
        font-size: 3.5rem !important;
    }
    
    /* Better spacing on large screens */
    section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    header {
        height: 60px;
    }
    
    .intro-overlay {
        height: 100vh;
    }
    
    .intro-gif {
        object-fit: cover;
    }
    
    /* Reduce vertical padding in landscape */
    .py-16, .py-24 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* High DPI / Retina Display Adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on retina displays */
    .logo-white,
    .logo-white-filter {
        image-rendering: -webkit-optimize-contrast;
    }
    
    /* Sharper borders on retina */
    img, svg {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve spacing for touch */
    nav a {
        padding: 0.75rem 1rem;
    }
    
    /* Larger tap targets */
    .feature-tab {
        padding: 1rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .intro-overlay,
    .mobile-menu,
    header,
    footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* Specific fixes for common device issues */

/* iPhone X and newer notch handling */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    header {
        padding-top: max(0px, env(safe-area-inset-top));
    }
}

/* Fix for iOS Safari viewport height issues */
@supports (-webkit-touch-callout: none) {
    .intro-overlay {
        height: -webkit-fill-available;
    }
    
    .intro-gif {
        height: -webkit-fill-available;
    }
}

/* Ensure images scale properly on all devices */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
    width: 100%;
}

/* Fix for flexbox issues on older browsers */
.flex {
    display: flex;
    flex-wrap: wrap;
}

/* Ensure proper text wrapping */
h1, h2, h3, h4, h5, h6, p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Hide scrollbar on mobile feature tabs */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Mobile contact form improvements */
@media (max-width: 767px) {
    #contact-form {
        width: 100%;
    }
    
    #contact-form input,
    #contact-form textarea {
        width: 100%;
        padding: 0.875rem;
    }
    
    #contact-form button {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
    
    /* Better spacing for contact section */
    #contact {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Grid layout for contact info */
    #contact .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ===== Dynamic AI Gradient Hero (Animated) ===== */
.hero-transparent::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    /* The gradient stack */
    background:
        radial-gradient(
            800px 400px at 15% 25%,
            rgba(14, 165, 233, 0.22),
            transparent 60%
        ),
        radial-gradient(
            600px 600px at 85% 40%,
            rgba(99, 102, 241, 0.18),
            transparent 65%
        ),
        radial-gradient(
            500px 300px at 50% 70%,
            rgba(14, 165, 233, 0.12),
            transparent 70%
        ),
        linear-gradient(
            180deg,
            rgba(13, 27, 46, 0.75),
            rgba(13, 27, 46, 0.35),
            rgba(13, 27, 46, 0.9)
        );

    /* Key part: give them room to move */
    background-size: 140% 140%, 160% 160%, 180% 180%, 100% 100%;
    background-position: 0% 0%, 100% 0%, 50% 100%, 50% 50%;

    /* Smooth glow motion */
    animation: heroGradientDrift 14s ease-in-out infinite alternate;
    will-change: background-position;
}

@keyframes heroGradientDrift {
    0% {
        background-position: 0% 0%, 100% 0%, 50% 100%, 50% 50%;
        filter: saturate(1.05) brightness(1);
    }
    50% {
        background-position: 60% 20%, 40% 60%, 55% 45%, 50% 50%;
        filter: saturate(1.15) brightness(1.03);
    }
    100% {
        background-position: 100% 40%, 0% 100%, 45% 60%, 50% 50%;
        filter: saturate(1.08) brightness(1.01);
    }
}

