/* --- CSS Reset & Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color Palette */
    --background: #f5f4f1; /* Lighter version of rgb(143, 133, 112) */
    --text: rgb(73, 68, 57); /* Darker version of rgb(143, 133, 112) for readability */
    --primary: rgb(79, 116, 148); /* Blue gray */
    --primary-dark: rgb(63, 93, 118); /* Darker version for hover states */
    --primary-light: rgb(142, 171, 196); /* Lighter version for backgrounds */
    --secondary: rgb(143, 133, 112); /* The warm beige/taupe color */
    --secondary-dark: rgb(114, 105, 89);
    --secondary-light: rgb(179, 170, 154);
    --accent: rgb(211, 157, 108); /* Orange/terracotta */
    --accent-dark: rgb(189, 134, 91);
    --error: rgb(200, 50, 50);

    /* Fonts */
    --font-primary: 'Inter', sans-serif;
    --font-monospace: 'Roboto Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    color: var(--primary-dark);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.8rem; margin-bottom: var(--spacing-md); }
h2 { font-size: 2.2rem; margin-bottom: var(--spacing-lg); text-align: center; }
h3 { font-size: 1.8rem; margin-bottom: var(--spacing-sm); }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

.section-padding {
    padding: var(--spacing-xxl) 0;
}

.bg-light {
    background-color: var(--primary-light);
}

/* --- Buttons --- */
.button {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.primary-button {
    background-color: var(--primary);
    color: white;
}

.primary-button:hover {
    background-color: var(--primary-dark);
}

.secondary-button {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: calc(var(--spacing-sm) - 2px) calc(var(--spacing-md) - 2px); /* Adjust padding for border */
}

.secondary-button:hover {
    background-color: var(--primary);
    color: white;
}

/* --- Header & Navigation --- */
header {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://pub-2f3b9c7b89794e5095368a0a4c9c14c5.r2.dev/dkontis-images/hero-bg.jpg') no-repeat center center/cover;
    color: white;
    padding: var(--spacing-md) 0;
    min-height: 80vh; /* Make hero section cover more of the viewport */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

header .logo {
    font-family: var(--font-monospace);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-right: var(--spacing-md); /* Add some space for nav items */
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
}

header nav ul li {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm); /* For wrapped items */
}

header nav ul li a {
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.5rem 0; /* Add padding for click area */
}

header nav ul li a:hover {
    color: var(--accent);
}

.hero-content {
    text-align: center;
    padding: var(--spacing-xxl) 0;
    max-width: 800px;
    margin: auto; /* Center content horizontally */
}

.hero-content h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: var(--spacing-sm);
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-xl);
    color: rgba(255, 255, 255, 0.9);
}

/* --- About Section --- */
.about-content {
    display: flex;
    flex-direction: column; /* Default to column for mobile */
    gap: var(--spacing-xl);
    align-items: center;
}

.about-text {
    flex: 2;
    font-size: 1.1rem;
}

.about-image {
    flex: 1;
    text-align: center;
}

.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.about-image .image-caption {
    font-style: italic;
    color: var(--secondary-dark);
    margin-top: var(--spacing-xs);
    font-size: 0.9rem;
}

/* --- Experience Section (Timeline) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    transform: translateX(-50%); /* Center the line */
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px; /* Adjust based on line width */
    background-color: var(--primary);
    border: 4px solid var(--background); /* Color to match background */
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item:nth-child(even)::after {
    left: -10px; /* Adjust for even items */
}

.timeline-item h3 {
    color: var(--primary-dark);
    margin-bottom: 0.2rem;
}

.timeline-item .period {
    color: var(--secondary-dark);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
}

.timeline-item p {
    font-size: 1rem;
    color: var(--text);
}

/* --- Case Studies Section --- */
.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.case-study-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: var(--spacing-lg);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.case-study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.case-study-card h3 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

.case-study-card p {
    font-size: 1rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

/* --- Contact Section --- */
.contact-content {
    display: flex;
    flex-direction: column; /* Default to column for mobile */
    gap: var(--spacing-xl);
    max-width: 900px;
    margin: 0 auto;
}

.contact-form, .contact-details {
    flex: 1;
}

.contact-form label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--primary-dark);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--secondary-light);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text);
    background-color: white;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 116, 148, 0.2);
}

.contact-form button {
    width: auto; /* Allow button to size naturally */
    min-width: 150px; /* Ensure a decent size */
}

.contact-details h3 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

.contact-details p {
    margin-bottom: var(--spacing-xs);
}

.contact-details a {
    color: var(--primary-dark);
    text-decoration: underline;
}

.social-links a {
    display: inline-block;
    margin-right: var(--spacing-sm);
    font-size: 1.2rem;
    color: var(--primary);
}

.social-links a:hover {
    color: var(--primary-dark);
}

/* --- Modal (Case Study Request) --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
    display: flex; /* Use flex to center content */
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    display: flex; /* Show when active */
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--background);
    padding: var(--spacing-xl);
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close-button {
    color: var(--text);
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: var(--error);
    text-decoration: none;
    cursor: pointer;
}

.modal-form label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--primary-dark);
}

.modal-form input[type="text"],
.modal-form input[type="email"] {
    width: 100%;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--secondary-light);
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text);
    background-color: white;
}

.modal-form button {
    width: 100%;
}


/* --- Footer --- */
footer {
    background-color: var(--primary-dark);
    color: white;
    text-align: center;
    padding: var(--spacing-md) 0;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (min-width: 768px) {
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.5rem; }

    header nav ul {
        flex-wrap: nowrap;
    }
    header nav ul li {
        margin-bottom: 0;
    }

    .hero-content h1 {
        font-size: 4.5rem;
    }
    .hero-content p {
        font-size: 1.5rem;
    }

    .about-content {
        flex-direction: row; /* Row layout for larger screens */
    }
    .about-text, .about-image {
        padding: 0 var(--spacing-lg);
    }
    
    .contact-content {
        flex-direction: row;
    }

    /* Experience Timeline - Adjust for desktop layout */
    .timeline::after {
        left: 50%;
    }

    .timeline-item {
        width: 50%;
        padding-left: var(--spacing-xl);
        padding-right: var(--spacing-xl);
    }

    .timeline-item:nth-child(odd) {
        text-align: right;
        left: 0;
    }
    .timeline-item:nth-child(even) {
        left: 50%;
        text-align: left;
    }

    .timeline-item:nth-child(odd)::after {
        right: -10px; /* Circle on the right side of the line */
        left: unset;
    }

    .timeline-item:nth-child(even)::after {
        left: -10px; /* Circle on the left side of the line */
        right: unset;
    }
}

@media (max-width: 767px) {
    /* Adjustments for smaller screens */
    .container {
        padding: 0 var(--spacing-sm);
    }

    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }

    header nav {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: var(--spacing-md);
        align-items: flex-start;
    }
    header nav ul li {
        margin-left: 0;
        margin-bottom: var(--spacing-sm);
        width: 100%;
    }
    header nav ul li:last-child {
        margin-bottom: 0;
    }
    header .logo {
        margin-bottom: var(--spacing-sm);
    }

    .hero-content {
        padding: var(--spacing-xl) 0;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }

    /* Timeline for mobile */
    .timeline::after {
        left: 20px; /* Move line to the left */
        transform: translateX(0);
    }
    .timeline-item {
        width: 100%;
        padding-left: 50px; /* Make space for line and circle */
        padding-right: 10px;
        text-align: left;
        left: 0; /* Align all items to the left */
    }
    .timeline-item::after {
        left: 10px; /* Align circle with line */
        right: unset;
    }
}