/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Light Mode Variables */
    --bg-body: #ffffff;
    --bg-surface: #f9fafb;
    /* Slightly lighter gray */
    --text-primary: #18181b;
    /* Zinc 900 */
    --text-secondary: #52525b;
    /* Zinc 600 */
    --primary-color: #E63946;
    /* Bright Red from Logo 'd' */
    --primary-hover: #D02835;
    --accent-color: #1C1C1C;
    /* Dark Black/Maroon from Logo 'ersify' */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    /* Gradients */
    --hero-gradient: linear-gradient(135deg, #1C1C1C 0%, #E63946 100%);
    --text-gradient: linear-gradient(to right, #1C1C1C, #E63946);
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-body: #0a0a0a;
    /* Neutral 950 */
    --bg-surface: #171717;
    /* Neutral 900 */
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --primary-color: #FF4D4D;
    /* Brighter Red for Dark Mode */
    --primary-hover: #ff6b6b;
    --accent-color: #ffffff;
    --border-color: #262626;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.text-gradient {
    background: var(--text-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

[data-theme="dark"] header {
    background: rgba(15, 23, 42, 0.9);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-surface);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Placeholders for other sections (will add in detail later if needed but base is good) */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Card Styles (Services/Projects) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-surface);
    padding: 2rem;
    border-radius: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Burger Menu */
.burger-menu {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.burger-bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

/* Contact Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2.5rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 1rem;
    /* Prevent zoom on iOS */
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

/* Contact Layout */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* Shared Responsive Grid (About/Services) */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .burger-menu {
        display: block;
    }

    .contact-layout,
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 1.5rem;
    }

    /* Mobile Menu Overlay */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        /* Slightly wider for better touch targets */
        background: var(--bg-surface);
        flex-direction: column;
        justify-content: flex-start;
        /* Start from top */
        align-items: center;
        /* Center horizontally */
        padding-top: 6rem;
        /* Space for close button/logo logic */
        transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        border-left: 1px solid var(--border-color);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin: 1rem 0;
    }

    .nav-link {
        font-size: 1.25rem;
        /* Larger font for mobile touch */
        display: block;
        padding: 0.5rem 0;
    }

    /* Burger Animation */
    .burger-menu.active .burger-bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger-menu.active .burger-bar:nth-child(2) {
        opacity: 0;
    }

    .burger-menu.active .burger-bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero h1 {
        font-size: 2.5rem;
        word-wrap: break-word;
        /* Prevent overflow */
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section {
        padding: 3rem 0;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust Featured Project Layout for Mobile */
    .card[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column;
    }

    .card[style*="display: grid"] img {
        height: 250px !important;
        min-height: auto !important;
    }

    .card[style*="display: grid"]>div {
        padding: 1.5rem !important;
    }

    /* Utilities for visibility */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
        /* Allow overriding display: none */
    }

    /* Mobile Menu Specifics */
    .nav-links .mobile-controls {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        margin-top: 2rem;
        width: 100%;
    }

    .nav-links .btn {
        width: 80%;
        text-align: center;
    }
}

/* Desktop Only Utility - Hidden on mobile, handled by media query above */
.mobile-only {
    display: none;
}