@import 'variables.css';

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-weight: 500;
    border-radius: 4px; /* Slightly squarish for premium feel */
    cursor: pointer;
    transition: var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-invert);
    border: 1px solid var(--color-primary);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
    box-shadow: var(--glow-primary);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-white);
    color: var(--color-white);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Section Standard */
section {
    padding: var(--section-spacing) 0;
}

/* Header/Nav */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: rgba(17, 17, 16, 0.85); /* Glassmorphism base - Soft Black */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-white);
}

.logo span {
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--color-text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px; /* Offset for header */
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    font-weight: 300;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(114, 137, 122, 0.15) 0%, rgba(17, 17, 16, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

/* Animation Utilities */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays for common groups */
.portfolio-item:nth-child(1) { transition-delay: 0.1s; }
.portfolio-item:nth-child(2) { transition-delay: 0.2s; }
.portfolio-item:nth-child(3) { transition-delay: 0.3s; }
.portfolio-item:nth-child(4) { transition-delay: 0.4s; }
.portfolio-item:nth-child(5) { transition-delay: 0.5s; }
.portfolio-item:nth-child(6) { transition-delay: 0.6s; }

/* Sticky Header State */
header {
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
    background: rgba(11, 15, 25, 0.95);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Enhancements */
.hero-content h1 {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards 0.2s;
}

.hero-content p {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards 0.4s;
}

.hero-content .btn {
    opacity: 0;
    animation: fadeIn 1s ease-out forwards 0.6s;
}

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

/* --- Phase 4 Enhancements --- */

/* 1. Dynamic Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 50%, var(--color-text-main) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* 2. Breathing Background Animation */
@keyframes breathe {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
}

.hero-bg-glow {
    animation: breathe 8s ease-in-out infinite;
    background: radial-gradient(circle, rgba(114, 137, 122, 0.25) 0%, rgba(17, 17, 16, 0) 70%); /* Slightly stronger for visibility */
}

/* 3. Advanced Card Hover */
/* Applying to service cards (need to ensure class exists in HTML) and portfolio items */
.service-card, .portfolio-item {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy feel */
    background: linear-gradient(145deg, var(--color-bg-secondary), var(--color-bg-primary));
}

.service-card:hover, .portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: var(--color-primary);
}

.service-card:hover h3, .portfolio-item:hover h3 {
    color: var(--color-primary);
}

/* 4. Geometric Pattern for Placeholders */
.pattern-grid {
    background-color: var(--color-bg-secondary);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: hidden;
}

.pattern-grid::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--color-bg-secondary) 100%);
}
/* Mobile Responsiveness & Animations */

/* Tablet & Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    /* Header */
    .mobile-toggle {
        display: block !important;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--color-bg-secondary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        right: 0;
    }

    /* Hero */
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1rem;
    }

    /* Grids */
    div[style*="grid-template-columns: repeat(3, 1fr)"],
    .portfolio-grid,
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Specific overrides for flex adjustments */
    .hero-content div[style*="display: flex"] {
        flex-direction: column;
    }
    
    nav .btn {
        display: none; /* Hide CTA in header on mobile to save space, rely on content CTAs */
    }

    footer div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    footer ul {
        align-items: center;
    }
}

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

.hero-content, .text-center, .portfolio-item {
    animation: fadeIn 0.8s ease-out forwards;
}

.portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.portfolio-item:nth-child(2) { animation-delay: 0.2s; }
.portfolio-item:nth-child(3) { animation-delay: 0.3s; }

/* Additional Mobile Refinements */
@media (max-width: 768px) {
    /* Safe Area for modern phones */
    .nav-links {
        padding-top: 4rem;
        z-index: 999;
        width: 85%; /* Wider menu for better readability */
    }

    /* Secondary Page Headers */
    .page-header {
        padding-top: 120px !important;
        padding-bottom: 2rem !important;
    }

    .page-header h1 {
        font-size: 2rem !important;
    }
    
    /* Contact Form on Mobile */
    .form-group input, 
    .form-group select, 
    .form-group textarea {
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }

    /* Footer Stacking */
    footer {
        padding: 3rem 0;
        text-align: left; /* Reset center align from previous rule if needed */
    }
}
