@tailwind base;
@tailwind components;
@tailwind utilities;

/* CSS CUSTOM PROPERTIES */
:root {
    /* Colors */
    --color-gunmetal: #1A1A1A;
    --color-offwhite: #E0E0E0;
    --color-n8n: #FF6D5A;
    --color-flow: #20c765;

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Manrope', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --nav-height: 80px;

    /* Transitions */
    --transition-smooth: all 0.3s ease;
}

/* GLOBAL SETTINGS */
html { scroll-behavior: smooth; }
body { 
    background-color: #1A1A1A; /* Gunmetal */
    color: #E0E0E0; /* Off-White */
    overflow-x: hidden;
    width: 100%;
}

/* TYPOGRAPHY SYSTEM */
h1, h2, h3, h4, .font-heading { font-family: 'Space Grotesk', sans-serif; }
body, p, a, li { font-family: 'Manrope', sans-serif; }
.font-mono, code { font-family: 'JetBrains Mono', monospace; }

/* UTILITY CLASSES */
.text-flow { color: #20c765; } /* Malachite Green */
.text-n8n { color: #FF6D5A; } /* Bittersweet Orange */
.bg-flow { background-color: #20c765; }
.bg-n8n { background-color: #FF6D5A; }

/* ANIMATIONS */
@keyframes marquee { 
    0% { transform: translateX(0%); } 
    100% { transform: translateX(-100%); } 
}
.animate-marquee { animation: marquee 25s linear infinite; }

/* GLASSMORPHISM CARD ENGINE */
.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.glass-panel:hover {
    border-color: rgba(32, 199, 101, 0.3); /* Green Glow on Hover */
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(32, 199, 101, 0.1);
}

/* FORM STYLES */
input:-webkit-autofill, textarea:-webkit-autofill {
    -webkit-text-fill-color: #E0E0E0 !important;
    -webkit-box-shadow: 0 0 0px 1000px #262626 inset !important;
}

/* TIMELINE STEP INDICATORS */
.timeline-dot {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.timeline-dot.active {
    background-color: #FF6D5A;
    border-color: #FF6D5A;
}

/* LAYOUT FIXES */
section { position: relative; z-index: 10; }

/* ACCESSIBILITY - Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* KEYBOARD FOCUS INDICATORS */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid #20c765;
    outline-offset: 2px;
    border-radius: 2px;
}

.glass-panel:focus-within {
    border-color: rgba(32, 199, 101, 0.5);
    box-shadow: 0 0 0 3px rgba(32, 199, 101, 0.2);
}

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

    .animate-marquee {
        animation: none;
    }

    .animate-pulse {
        animation: none;
    }
}

/* MOBILE MENU STYLES */
.mobile-menu {
    position: fixed;
    top: 80px;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: calc(100vh - 80px);
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 40;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: 30;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 13px 10px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #E0E0E0;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* CROSS-BROWSER COMPATIBILITY - Backdrop Filter Fallback */
@supports not (backdrop-filter: blur(10px)) {
    .glass-panel {
        background: rgba(40, 40, 40, 0.95);
    }

    nav {
        background: rgba(26, 26, 26, 0.95) !important;
    }
}

@supports (backdrop-filter: blur(10px)) {
    .glass-panel {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* PERFORMANCE - Transform Optimization */
.glass-panel:hover,
a[href]:hover,
button:hover {
    will-change: transform;
}

.glass-panel:not(:hover),
a[href]:not(:hover),
button:not(:hover) {
    will-change: auto;
}

/* PRINT STYLES */
@media print {
    nav,
    footer,
    .mobile-menu,
    .mobile-menu-overlay,
    #contact,
    .hamburger {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .glass-panel {
        border: 1px solid #ccc;
        background: white;
        box-shadow: none;
    }

    a {
        text-decoration: underline;
    }

    section {
        page-break-inside: avoid;
    }
}
