/* --- General Styling & Variables --- */
:root {
    --royal-blue: #295DE9; /* A strong, modern royal blue */
    --light-teal-accent: #E0E7FF; /* A very subtle, sophisticated blue/teal hint */
    --dark-charcoal: #2D3748; /* For primary text */
    --slate-gray: #4A5568;   /* For secondary text */
    --light-gray-bg: #F8F9FA;  /* For section backgrounds */
    --white: #FFFFFF;
    --border-color: #E2E8F0;
    --header-font: 'Cormorant Garamond', serif;
    --body-font: 'Raleway', sans-serif;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for fixed header */
}

body {
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--slate-gray);
    background-color: var(--white);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* --- Reusable Components --- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 0;
}

.section-title {
    font-family: var(--header-font);
    font-size: 2.8rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--royal-blue);
    color: var(--white);
    border: 2px solid var(--royal-blue);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--royal-blue);
    transform: translateY(-3px);
}

/* --- Header & Navigation --- */
#header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: top 0.3s;
}

#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

#navbar .logo {
    font-family: var(--header-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-charcoal);
    text-decoration: none;
}

#navbar ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

#navbar ul li a {
    text-decoration: none;
    color: var(--slate-gray);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

#navbar ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--royal-blue);
    transition: width 0.3s ease;
}

#navbar ul li a:hover::after,
#navbar ul li a.active::after {
    width: 100%;
}

/* --- Hero Section --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--light-gray-bg);
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-family: var(--header-font);
    font-size: 4.5rem;
    font-weight: 600;
    color: var(--dark-charcoal);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    color: var(--slate-gray);
}

/* --- Services Section --- */
#services {
    background-color: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    text-align: center;
}

.service-card {
    padding: 40px 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
}

.service-card h3 {
    font-family: var(--header-font);
    font-size: 1.5rem;
    color: var(--dark-charcoal);
    margin-bottom: 1rem;
}

/* --- Portfolio Section --- */
#portfolio {
    background-color: var(--light-gray-bg);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(41, 93, 233, 0.85);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay h3 {
    font-family: var(--header-font);
    font-size: 1.6rem;
    margin: 0;
    transform: translateY(10px);
    transition: transform 0.4s ease;
}

.portfolio-overlay p {
    margin: 10px 0 0;
    transform: translateY(10px);
    transition: transform 0.4s ease 0.1s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p {
    transform: translateY(0);
}

/* --- About Section --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text {
    padding-right: 20px;
}

.about-text .section-title {
    text-align: left;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0 auto;
    display: block;
}

/* --- Contact Section --- */
#contact {
    background-color: var(--light-gray-bg);
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--body-font);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--royal-blue);
}

.contact-form button {
    width: 100%;
    border-radius: 5px;
}

/* --- Footer --- */
#footer {
    background-color: var(--dark-charcoal);
    color: var(--light-gray-bg);
    text-align: center;
    padding: 30px 20px;
    position: relative;
}

.back-to-top {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: var(--royal-blue);
    color: var(--white);
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: opacity 0.3s, visibility 0.3s;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }

    .hero-title {
        font-size: 3rem;
    }
    
    #navbar {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
    }

    #navbar .logo {
        margin-bottom: 15px;
    }

    #navbar ul {
        gap: 20px;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-text {
        padding-right: 0;
    }

    .about-text .section-title {
        text-align: center;
    }

    .about-image {
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    html {
        scroll-padding-top: 120px; /* Adjust for taller mobile header */
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    #navbar ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
}