:root {
    /* Color Palette */
    --primary-color: #5D8A78;
    /* Sage Green */
    --primary-dark: #3F6153;
    --secondary-color: #DBEBE4;
    /* Soft Teal/Green Tint */
    --background-color: #FAF8F5;
    /* Warm Beige */
    --surface-color: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #586B7D;
    --accent-color: #D4A373;
    /* Earthy decoration */

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 32px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    /* Safe Area Insets for Modern Mobile Devices */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    /* Remove tap highlight on mobile */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: var(--safe-bottom);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 max(var(--spacing-sm), var(--safe-left));
    padding-right: max(var(--spacing-sm), var(--safe-right));
}

.section {
    padding: var(--spacing-lg) 0;
}

.text-center {
    text-align: center;
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 1rem;
    min-height: 48px;
    /* Touch target size */
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    padding-top: max(1rem, var(--safe-top));
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 75px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    /* Desktop Alignment Fix */
    margin: 0;
    padding: 0;
}

.nav-link {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    padding: 0.5rem 0;
    /* Increase touch area */
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding-top: calc(125px + var(--spacing-lg));
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-dark);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    max-width: 500px;
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.hero-image-wrapper img {
    width: 100%;
    height: auto;
    transition: transform var(--transition-normal);
}

.hero-image-wrapper:hover img {
    transform: scale(1.02);
}

/* Sections General */
.section-title {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
    color: var(--primary-dark);
}

.section-title p {
    color: var(--text-secondary);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background: var(--surface-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.service-icon {
    width: 50px;
    height: 50px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.service-card h3 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.25rem;
}

.service-card p {
    color: var(--text-secondary);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.about-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.about-image img {
    width: 50%;
    /* Desktop width */
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--spacing-lg);
}

.contact-info-card {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 1.1rem;
}

.contact-form {
    background: var(--surface-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: border-color var(--transition-fast);
    appearance: none;
    /* Remove default styling on iOS */
    -webkit-appearance: none;
    font-size: 1rem;
    /* Prevent zoom on iOS */
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: white;
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-col h4 {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-col a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive / Mobile Styles */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    body {
        font-size: 16px;
        /* Base size for readability */
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height for mobile browsers */
        background: #FAF8F5;
        /* Solid background color matching theme */
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 100px;
        padding-bottom: 2rem;
        align-items: center;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: none;
        z-index: 2000;
        overflow-y: auto;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    /* Animation for menu items */
    .nav-links li {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
        width: 100%;
        max-width: 300px;
        display: block;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered Delay */
    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active li:nth-child(4) {
        transition-delay: 0.4s;
    }

    .nav-links.active li:nth-child(5) {
        transition-delay: 0.5s;
    }

    .nav-link {
        font-size: 1.25rem;
        font-weight: 500;
        color: var(--text-primary);
        background-color: white;
        display: block;
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-link.active {
        color: white;
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

    .nav-link::after {
        display: none;
    }

    /* Mobile Menu Button Styling */
    .nav-links .btn {
        width: 100%;
        min-width: unset;
        text-align: center;
        font-size: 1.25rem;
        box-shadow: var(--shadow-md);
    }

    .mobile-toggle {
        position: fixed;
        top: 15px;
        right: 15px;
        display: block;
        z-index: 2001;
        font-size: 1.5rem;
        color: var(--text-primary);
        padding: 10px;
        background: white;
        /* Solid background */
        border-radius: 50%;
        cursor: pointer;
        transition: color 0.3s ease;
        box-shadow: var(--shadow-sm);
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-toggle:hover {
        color: var(--primary-color);
    }

    .logo img {
        height: 45px;
        /* Proporcjonalnie mniejsze na mobile */
    }

    .hero {
        min-height: auto;
        padding-top: calc(100px + var(--spacing-md));
        padding-bottom: var(--spacing-lg);
        text-align: center;
    }

    .hero-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .hero-content h1 {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .hero-content p {
        margin: 0 auto var(--spacing-md);
    }

    .hero-grid {
        display: flex;
        flex-direction: column-reverse;
        /* Image FIRST */
    }

    .hero-image-wrapper {
        width: 100%;
        max-width: 400px;
        /* Limit max width */
        margin: 0 auto;
        /* Center it */
    }

    .hero-image-wrapper img {
        width: 100%;
        height: auto;
    }

    /* Order image first on mobile for About page */
    .about-grid {
        display: flex;
        flex-direction: column;
    }

    .about-image {
        order: -1;
        width: 100%;
    }

    .about-image img {
        width: 100%;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .contact-grid {
        display: flex;
        flex-direction: column;
    }

    .contact-info-card {
        order: -1;
    }
}