/*
 * styles.css
 * Purpose: Stylesheet for Elementa Oy one-page website with a sleek, dark theme inspired by Linear.app
 * Author: Elementa Oy
 * Date: April 25, 2025
 */

:root {
    --dark-900: #0a0e1a;
    --dark-800: #12162a;
    --dark-700: #1a1f38;
    --dark-600: #2a2f4a;
    --blue-600: #3b82f6;
    --blue-700: #2563eb;
    --gray-100: #f3f4f6;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-800);
    color: var(--gray-100);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Contact Popup */
#contact-popup {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#contact-popup.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#contact-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#contact-popup .transform {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

#contact-popup.show .transform {
    transform: scale(1);
    opacity: 1;
}

#contact-popup.hidden .transform {
    transform: scale(0.92);
    opacity: 0;
}

/* Form Elements */
#contact-form input,
#contact-form textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    background: var(--dark-600);
}

#contact-form button {
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

/* Animations */
[data-animate="fade-in"] {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

[data-delay="200"] {
    animation-delay: 0.2s;
}

[data-delay="400"] {
    animation-delay: 0.4s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    h2 {
        font-size: 2.75rem;
    }

    p {
        font-size: 1.1rem;
    }

    #contact-popup .max-w-lg {
        width: 95%;
    }

    nav {
        padding: 1rem;
    }
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
}

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

/* Performance optimizations */
* {
    will-change: transform, opacity;
    transform: translateZ(0);
}