/* === VARIABLES === */
:root {
    /* Color Palette - Premium Navy & Gold */
    --primary: #0A1628;       /* Deep Navy */
    --primary-light: #162a47; /* Lighter Navy */
    --primary-dark: #050b14;  /* Darkest Navy */
    --accent: #C9A96E;        /* Muted Gold */
    --accent-light: #DFCDA5;  /* Champagne Gold */
    --accent-dark: #A6884C;   /* Deep Gold */
    --gray-100: #f4f7fa;      /* Very Light Gray/Blue */
    --gray-200: #E6E6E6;      /* Light Gray */
    --gray-300: #d9d9d9;      /* Medium Light Gray */
    --gray-400: #cccccc;      /* Medium Gray */
    --gray-500: #A1A1A1;      /* Medium Dark Gray */
    --gray-600: #828282;      /* Dark Gray */
    --gray-700: #666666;      /* Darker Gray */
    --gray-800: #333333;      /* Very Dark Gray */
    --white: #ffffff;
    --black: #222222;         /* Off-black Text */
    --error: #e53e3e;         /* Error Red */
    --success: #38a169;       /* Success Green */

    /* Shadows & Transitions */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition-fast: all 0.2s ease;
    --transition: all 0.3s ease;
    --transition-slow: all 0.5s ease;

    /* Typography */
    --font-primary: 'Inter', system-ui, sans-serif;
    --font-heading: 'Plus Jakarta Sans', var(--font-primary);
    --fs-xs: 0.75rem;    /* 12px */
    --fs-sm: 0.875rem;   /* 14px */
    --fs-base: 1rem;     /* 16px */
    --fs-md: 1.125rem;   /* 18px */
    --fs-lg: 1.25rem;    /* 20px */
    --fs-xl: 1.5rem;     /* 24px */
    --fs-2xl: 1.875rem;  /* 30px */
    --fs-3xl: 2.25rem;   /* 36px */
    --fs-4xl: 3rem;      /* 48px */
    --line-height-base: 1.6;
    --line-height-heading: 1.2;

    /* Spacing */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    --space-20: 5rem;    /* 80px */

    /* Borders & Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --border-width: 1px;
    --border-width-lg: 2px;
}

/* === BASE STYLES === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 100%; /* Use 100% for base, allows user scaling */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    color: var(--black);
    line-height: var(--line-height-base);
    background-color: var(--white);
    overflow-x: hidden; /* Re-evaluate if causes issues */
}

/* Add visible focus styles for accessibility */
*:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(125, 218, 196, 0.4); /* Optional: softer glow */
}
/* Remove default outline when :focus-visible is supported */
*:focus:not(:focus-visible) {
    outline: none;
}


img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    max-width: 100%;
    height: auto; /* Default height behavior */
}

/* Ensure images added via HTML have height/width attributes */
img[width], img[height] {
    height: attr(height) px; /* Maintain aspect ratio if only one is set */
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 { /* Include h6 */
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: var(--line-height-heading);
    letter-spacing: -0.03em;
    color: var(--primary); /* Default heading color */
}

h1 {
    font-size: clamp(var(--fs-3xl), 5vw, var(--fs-4xl)); /* Responsive font size */
    margin-bottom: var(--space-6); /* Adjusted margin */
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(var(--fs-2xl), 4vw, var(--fs-3xl)); /* Responsive font size */
    margin-bottom: var(--space-12); /* Combined margin + space for ::after */
    position: relative;
    padding-bottom: var(--space-4); /* Space for the underline */
}

/* Centralized underline style */
h2::after,
.section-title h2::after { /* Combine rules */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0; /* Default left alignment */
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    border-radius: var(--radius-full);
}

/* Specific centering for section titles */
.section-title h2::after {
    left: 50%;
    transform: translateX(-50%);
}

h3 {
    font-size: var(--fs-xl);
    margin-bottom: var(--space-4);
}

p {
    margin-bottom: var(--space-6);
    max-width: 75ch; /* Improve readability */
}

a {
    color: var(--accent-dark);
    text-decoration: none; /* Remove underline by default */
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent);
    text-decoration: underline; /* Add underline on hover */
}

ul, ol {
  list-style: none; /* Remove default list style */
}

/* === LAYOUT === */
.container {
    width: 100%;
    max-width: 1400px; /* Standard max width */
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.section {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-12);
}

.section-title p {
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
    color: var(--gray-600);
}

/* === COMPONENTS === */

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    color: var(--primary-dark);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none; /* Remove underline from button links */
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: var(--fs-base);
    min-width: 160px; /* Consider removing fixed min-width */
    height: 48px;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-sm);
    position: relative; /* Needed for ripple */
    overflow: hidden; /* Contain ripple */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(to right, var(--accent-dark), var(--accent));
    text-decoration: none; /* Ensure no underline on hover */
}

.btn:active {
    transform: translateY(-1px); /* Slight press down effect */
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background: transparent;
    border: var(--border-width-lg) solid var(--accent);
    color: var(--accent-dark);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--primary-dark);
    border-color: var(--accent);
}

/* Button Loading State */
.btn-loading {
    color: transparent !important; /* Hide text */
    pointer-events: none; /* Prevent clicks */
    position: relative;
}

.btn-loading::after {
    content: '';
    display: block;
    width: 1.5em; /* Size of spinner */
    height: 1.5em;
    border-radius: 50%;
    border: 2px solid currentColor; /* Use button text color */
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -0.75em; /* Center spinner */
    margin-top: -0.75em;
    color: var(--primary-dark); /* Spinner color for main btn */
}

.btn-outline.btn-loading::after {
     color: var(--accent-dark); /* Spinner color for outline btn */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* Ripple Effect */
.ripple {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.5); /* Ripple color */
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none; /* Prevent interference */
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- Header --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    /* transition applied via JS for scroll effect */
    height: 80px; /* Maintain fixed height */
    display: flex; /* Use flex to center content vertically */
    align-items: center; /* Center content vertically */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%; /* Ensure container fills header height */
    /* Inherits padding from .container */
}

/* Logo */
.logos img {
    max-width: 250px; /* Keep original max-width */
    display: block; /* Remove extra space below image */
    /* width/height set in HTML */
}

/* Navigation */
nav ul {
    display: flex;
    list-style: none;
    gap: var(--space-8);
    align-items: center;
}

/* Use a more specific class or direct child selector if needed */
nav a:not(.btn) { /* Exclude button styled links */
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: var(--space-2) 0;
    display: inline-block; /* Ensures padding works correctly */
}

nav a:not(.btn):hover {
    color: var(--primary);
    text-decoration: none; /* Remove underline */
}

nav a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    transition: var(--transition-fast);
}

nav a:not(.btn):hover::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    font-size: var(--fs-xl);
    cursor: pointer;
    color: var(--primary);
    padding: var(--space-2); /* Add some padding for easier tapping */
}

/* --- Cards (General - Apply to Service, Case, Blog cards if abstracting) --- */
.service-card,
.case-card, /* Uncomment if using */
.blog-card { /* Uncomment if using */
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-10) var(--space-12);
    box-shadow: 0 10px 30px rgba(10, 22, 40, 0.04);
    transition: var(--transition-slow);
    border: 1px solid rgba(201, 169, 110, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(10, 22, 40, 0.08);
    border-color: rgba(201, 169, 110, 0.3);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card p {
    margin-bottom: var(--space-4);
}

.service-card h3,
.service-card p {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

/* --- Icons (Service, Benefit) --- */
.service-icon,
.benefit-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-8);
    color: var(--primary);
    transition: var(--transition);
}

.service-icon {
    background: rgba(201, 169, 110, 0.1);
    color: var(--accent-dark);
}

.service-card:hover .service-icon {
    background: var(--accent);
    color: var(--white);
    transform: rotateY(180deg);
}

.service-icon i {
    width: 28px;
    height: 28px;
}

.benefit-icon {
    width: 56px; /* Specific size for benefit */
    height: 56px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: var(--white);
    box-shadow: 0 10px 15px -3px rgba(27, 36, 50, 0.2);
}


/* --- Popup Form --- */
.popup-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: var(--space-4); /* Dodaje odstęp od krawędzi ekranu na małych urządzeniach */
}

.popup-overlay[hidden] {
    display: none; /* Ensure hidden when attribute is present */
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-container {
    background-color: var(--white);
    border-radius: var(--radius-md);
    width: 100%; /* Kluczowe: Pozwala kontenerowi się zmniejszać */
    max-width: 500px; /* Kluczowe: Ogranicza maksymalną szerokość na dużych ekranach */
    padding: var(--space-8); /* Wewnętrzny padding */
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 90vh; /* Ogranicza maksymalną wysokość */
    overflow-y: auto; /* Umożliwia przewijanie, jeśli treść jest za długa */
    display: flex; /* Opcjonalnie: Ułatwia zarządzanie wysokością, jeśli formularz jest prosty */
    flex-direction: column; /* Opcjonalnie: Elementy w kolumnie */
}

.popup-overlay.active .popup-container {
    transform: scale(1);
    opacity: 1;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    border-bottom: var(--border-width) solid var(--gray-200);
    padding-bottom: var(--space-4);
}

.popup-header h3 {
    margin: 0;
    font-size: var(--fs-lg); /* Slightly smaller heading */
    color: var(--primary);
}

.popup-close {
    background: none;
    border: none;
    font-size: var(--fs-xl);
    cursor: pointer;
    color: var(--gray-500);
    transition: color 0.2s ease;
    padding: var(--space-1); /* Easier click target */
    line-height: 1; /* Prevent extra spacing */
}

.popup-close:hover {
    color: var(--primary);
}

/* Form Styles */
.form-status {
    padding: var(--space-3);
    margin-bottom: var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    border-left-width: 4px;
    border-left-style: solid;
}

.form-status.success {
    background-color: rgba(56, 161, 105, 0.1); /* Success background */
    border-left-color: var(--success);
    color: var(--success);
}

.form-status.error {
    background-color: rgba(229, 62, 62, 0.1); /* Error background */
    border-left-color: var(--error);
    color: var(--error);
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-500); /* Jaśniejszy kolor dla placeholdera */
    opacity: 1;
    font-size:small; /* Przeglądarki czasem ustawiają niższą przezroczystość */
    /* font-style: italic; */ /* Opcjonalnie: styl kursywy */
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%; /* Zajmuje pełną dostępną szerokość kontenera */
    max-width: 100%; /* Dodatkowe zabezpieczenie przed przekroczeniem szerokości */
    padding: var(--space-3);
    border: var(--border-width) solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    background-color: var(--white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(125, 218, 196, 0.3); /* Focus ring matching :focus-visible */
    outline: none; /* Remove default outline as we have box-shadow */
}

.form-group textarea {
    min-height: 100px; /* Set a minimum height */
    resize: vertical; /* Allow vertical resize */
}

/* Checkbox Styles */
.form-checkbox {
    position: relative;
    margin-bottom: var(--space-6);
    display: flex; /* Use flex for alignment */
    align-items: flex-start; /* Align items to the top */
    gap: var(--space-2); /* Space between checkbox and label */
}

.form-checkbox input[type="checkbox"] {
    /* Visually hide the checkbox but keep it accessible */
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.form-checkbox label {
    font-size: var(--fs-sm);
    color: var(--gray-700);
    line-height: 1.4;
    cursor: pointer;
    position: relative; /* Needed for custom checkbox */
    padding-left: 30px; /* Space for the custom checkbox */
    margin: 0; /* Reset default label margin */
    display: inline-block; /* Ensure padding works */
}

/* Custom checkbox appearance using ::before */
.form-checkbox label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0; /* Align with text top */
    height: 20px;
    width: 20px;
    background-color: var(--white);
    border: var(--border-width) solid var(--gray-400); /* Slightly darker border */
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom checkmark appearance using ::after */
.form-checkbox label::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0); /* Hidden by default */
    transition: transform 0.2s ease;
}

/* Styles when checkbox is checked */
.form-checkbox input[type="checkbox"]:checked + label::before {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-checkbox input[type="checkbox"]:checked + label::after {
    transform: rotate(45deg) scale(1); /* Show checkmark */
}

/* Focus styles for the custom checkbox */
.form-checkbox input[type="checkbox"]:focus-visible + label::before {
     outline: 2px solid var(--accent);
     outline-offset: 2px;
     box-shadow: 0 0 0 3px rgba(125, 218, 196, 0.3);
}

.form-checkbox label a {
    text-decoration: underline; /* Ensure link is visible */
}

.form-submit {
    margin-top: var(--space-6);
    text-align: right; /* Align button to the right */
}

/* === SECTIONS === */

/* --- Hero Section --- */
.hero {
    padding: 160px 0 80px;
    background: radial-gradient(circle at 70% 20%, rgba(201, 169, 110, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 10% 80%, rgba(22, 42, 71, 0.03) 0%, transparent 40%),
                var(--white);
    position: relative;
    overflow: hidden;
}

/* Hero Decorative Element */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 140%;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    opacity: 0.03;
    z-index: 0;
    transform: rotate(-15deg);
    filter: blur(80px);
}

.hero-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1 1 55%;
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-image {
    flex: 1 1 50%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    opacity: 0;
    transform: scale(0.9) rotate(5deg);
    animation: imageReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes imageReveal {
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.hero-image img {
    filter: drop-shadow(0 20px 50px rgba(10, 22, 40, 0.1));
    width: 100%;
    max-width: 750px;
    height: auto;
    object-fit: contain;
    transition: var(--transition-slow);
}

.hero-image:hover img {
    transform: translateY(-10px) scale(1.02);
}

.hero-subtitle {
    color: var(--accent-dark);
    font-weight: 700;
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-6);
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
}

.hero-subtitle::before {
    content: '';
    width: 30px;
    height: 2px;
    background-color: var(--accent);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: var(--space-8);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on small screens */
    gap: var(--space-4);
    margin-top: var(--space-8);
}

/* --- Clients Section --- */
.clients {
    background: var(--white);
    padding: var(--space-16) 0;
}

.clients-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-12) var(--space-16);
    opacity: 0.6;
}

.client-logo {
    flex: 0 0 auto;
    filter: grayscale(100%);
    transition: var(--transition-slow);
    max-width: 160px;
}

.client-logo:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.1);
}

.client-logo img {
    max-height: 60px;
    object-fit: contain;
}

/* Strzałki karuzeli */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9); /* Lekko mniej przezroczyste tło */
    border: 1px solid var(--gray-300); /* Dodano delikatną ramkę */
    width: 40px; /* Ustalona szerokość */
    height: 40px; /* Ustalona wysokość */
    display: flex; /* Wyśrodkowanie ikony */
    align-items: center; /* Wyśrodkowanie ikony */
    justify-content: center; /* Wyśrodkowanie ikony */
    font-size: var(--fs-lg); /* Mniejszy font dla ikony */
    cursor: pointer;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    z-index: 10;
    color: var(--primary);
    padding: 0; /* Usunięto padding, bo wymiary są ustalone */
}

.carousel-arrow:hover {
    background-color: var(--accent);
    color: var(--primary-dark);
    transform: translateY(-50%) scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: transparent; /* Ukryj ramkę na hover */
}

.carousel-arrow.disabled { /* Styl dla nieaktywnej strzałki */
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none; /* Wyłącz kliknięcia */
}

.carousel-arrow-left {
    left: 10px; /* Pozycjonowanie wewnątrz paddingu */
}

.carousel-arrow-right {
    right: 10px; /* Pozycjonowanie wewnątrz paddingu */
}



/* --- Services Section --- */
.services {
    background-color: var(--gray-100); /* Changed background */
    position: relative;
    /* Removed ::before element */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: var(--space-6);
    position: relative;
    z-index: 1;
}

/* --- Why Us Section --- */
.why-us {
    background-color: var(--white); /* Changed background */
    position: relative;
    overflow: hidden;
    border-top: var(--border-width) solid var(--gray-200);
}

/* Why Us Decorative Element */
.why-us::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 80%;
    background-color: var(--primary);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Responsive grid */
    gap: var(--space-12) var(--space-8);
    position: relative;
    z-index: 1;
}

.benefit-item {
    display: flex;
    gap: var(--space-6);
    align-items: flex-start;
    background: var(--white);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.benefit-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.benefit-icon {
    background: rgba(10, 22, 40, 0.05);
    color: var(--primary);
    width: 50px;
    height: 50px;
}

.benefit-item:hover .benefit-icon {
    background: var(--primary);
    color: var(--accent);
}

/* --- Process Section --- */
.process {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    position: relative;
    overflow: hidden;
}

/* Process Decorative Element */
.process::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.process .section-title h2,
.process .section-title p {
    color: var(--white); /* Ensure title text is white */
}

.process h2::after {
    background: var(--accent); /* White background for underline */
}

.process-steps {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: space-between;
    position: relative;
    margin-top: var(--space-16);
    gap: var(--space-6); /* Add gap for wrapped items */
}

/* Dashed line connector */
.process-steps::before {
    content: '';
    position: absolute;
    top: 40px; /* Align with center of number */
    left: 5%; /* Start after first item margin */
    right: 5%; /* End before last item margin */
    height: 2px;
    background-image: linear-gradient(to right, rgba(125, 218, 196, 0.5) 50%, transparent 50%);
    background-size: 10px 2px; /* Dashed line effect */
    z-index: 0;
}

.process-step {
    flex: 1 1 18%; /* Allow shrinking/growing, aim for 5 items */
    min-width: 180px; /* Minimum width before wrapping */
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 0 var(--space-4);
}

.step-number {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1); /* Softer background */
    border: var(--border-width-lg) solid var(--accent);
    border-radius: var(--radius-full);
    background-color: #30316f;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--white);
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.process-step:hover .step-number {
    background-color: var(--accent);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(125, 218, 196, 0.4);
    color: var(--primary-dark);
}

.process-step h3 {
    color: var(--white); /* Ensure heading is white */
}

.process-step p {
    color: var(--gray-300); /* Lighter text for description */
    font-size: var(--fs-sm);
}

/* --- Case Studies Section --- */
/* Styles kept commented as in original */
/* .case-studies { ... } */
/* .cases-grid { ... } */
/* .case-card { ... } */
/* .case-image { ... } */
/* .case-content { ... } */
/* .case-category { ... } */
/* .case-stats { ... } */
/* .case-stat { ... } */
/* .stat-value { ... } */
/* .stat-label { ... } */

/* --- Team Section --- */
.team {
    background-color: var(--gray-100); /* Changed background */
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-12);
}

.team-member {
    text-align: center;
    background: var(--white);
    padding: var(--space-10);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    transition: var(--transition-slow);
}

.team-member:hover {
    box-shadow: 0 30px 60px rgba(10, 22, 40, 0.1);
    transform: translateY(-10px);
}

.member-photo {
    width: 200px;
    height: 200px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    margin: 0 auto var(--space-8);
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 6px solid var(--white);
    transition: var(--transition-slow);
}

.team-member:hover .member-photo {
    border-radius: var(--radius-full);
    border-color: var(--accent);
}

.member-photo img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    filter: grayscale(100%);
    transition: var(--transition-slow);
}

.team-member:hover .member-photo img {
    filter: grayscale(0);
    transform: scale(1.1);
}

.member-name {
    font-size: var(--fs-xl);
    font-weight: 800;
    margin-bottom: var(--space-2);
    color: var(--primary);
}

.member-position {
    color: var(--accent-dark);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-6);
    font-weight: 700;
}

.member-bio {
    font-size: var(--fs-base);
    color: var(--gray-700);
    line-height: 1.6;
    max-width: 90%;
    margin: 0 auto;
}

/* --- Blog Section --- */
/* Styles kept commented as in original */
/* .blog { ... } */
/* .blog-grid { ... } */
/* .blog-card { ... } */
/* .blog-image { ... } */
/* .blog-content { ... } */
/* .blog-date { ... } */

/* --- CTA Section --- */
.cta {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: var(--space-20) 0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    margin: 0 var(--space-6) var(--space-20);
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(201, 169, 110, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 20% 80%, rgba(223, 205, 165, 0.1) 0%, transparent 40%);
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta h2 {
    color: var(--white);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-8);
}

.cta h2::after {
    background: var(--accent);
    left: 50%;
    transform: translateX(-50%);
}

.cta p {
    color: var(--accent-light);
    font-size: var(--fs-lg);
    margin-bottom: var(--space-12);
    opacity: 0.9;
}


.cta-buttons {
    margin-top: var(--space-8);
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center;
    gap: var(--space-4);
}

/* --- Footer --- */
footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: var(--space-20) 0 var(--space-8);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: var(--space-12);
    margin-bottom: var(--space-16);
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

.footer-col h3 {
    margin-bottom: var(--space-8);
    font-size: var(--fs-lg);
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--white);
}

.footer-description {
    margin-bottom: var(--space-6);
    color: var(--gray-300);
    font-size: var(--fs-sm);
    line-height: 1.5; /* Slightly tighter line height */
}

.footer-social {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    gap: var(--space-3);
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
    color: var(--white);
    font-size: var(--fs-base); /* Ensure icon text size is appropriate */
}

/* Visually hidden text for screen readers if using icon fonts/SVGs */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.social-icon:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
    color: var(--primary-dark);
}

/* Simplified selector */
.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition);
    font-size: var(--fs-sm);
    display: inline-block; /* Prevent layout shifts on hover */
}

.footer-links a:hover {
    color: var(--accent);
    text-decoration: none; /* Keep no underline */
    transform: translateX(var(--space-1)); /* Slight move effect */
}

/* Simplified selector */
.footer-contact {
    list-style: none;
}

.footer-contact li {
    display: flex; /* Align icon and text */
    align-items: baseline; /* Align text baseline */
    gap: var(--space-2); /* Reduced gap */
    margin-bottom: var(--space-3); /* Reduced margin */
    color: var(--gray-300);
    font-size: var(--fs-sm);
}

.footer-contact li a {
    color: var(--gray-300);
    text-decoration: none; /* Remove underline from contact links */
    transition: var(--transition);
    display: inline; /* Allow text flow */
}

.footer-contact li a:hover {
    color: var(--accent);
    text-decoration: underline; /* Add underline on hover for contact links */
}

/* Footer Bottom */
.footer-bottom {
    border-top: var(--border-width) solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-6);
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--gray-400);
}

.footer-bottom a {
    color: var(--gray-300);
    text-decoration: underline; /* Underline legal links */
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--accent);
}


/* === RESPONSIVE STYLES === */

/* Medium Devices (Tablets, smaller desktops) */
@media (max-width: 1024px) {
    :root {
        /* Slightly reduce base font size */
        /* font-size: 93.75%; /* 15px base */
        /* Consider adjusting spacing variables instead if needed */
    }

    /* Adjust grid columns for services, cases, team, blog */
    .services-grid,
    .cases-grid, /* Uncomment if using */
    .team-grid,
    .blog-grid { /* Uncomment if using */
        /* Handled by auto-fit */
    }

    .benefits-grid {
        /* Handled by auto-fit */
    }

    /* Adjust process steps layout for fewer items per row */
    .process-steps::before {
        /* Hide line on medium screens if stacking */
        /* display: none; */
    }
    .process-step {
       flex-basis: 48%; /* Aim for 2 items per row */
       min-width: 250px;
       /* Optional: Add vertical alignment if heights differ */
       /* display: flex; flex-direction: column; */
    }

    /* Adjust hero layout earlier if needed */
    .hero-wrapper {
        gap: var(--space-8);
    }
    .hero-content {
        max-width: 55%; /* Adjust flex basis/max-width */
    }
    .hero-image {
         max-width: 40%;
    }
}

/* Smaller Tablets & Large Phones */
@media (max-width: 768px) {
    :root {
         /* Further reduce base font size if necessary */
        /* font-size: 87.5%; /* 14px base */
    }

    .section {
        padding-top: var(--space-16);
        padding-bottom: var(--space-16);
    }

    h1 {
         font-size: var(--fs-3xl); /* Use clamp defined earlier */
    }

    h2 {
         font-size: var(--fs-2xl); /* Use clamp defined earlier */
    }

    /* Mobile Menu Activation */
    .mobile-menu-btn {
        display: block; /* Show button */
        z-index: 1001; /* Ensure button is above nav */
    }

    nav {
        position: fixed;
        top: 0;
        right: 0; /* Start off-screen */
        width: min(75%, 300px); /* Responsive width */
        height: 100vh;
        background-color: var(--white);
        box-shadow: var(--shadow-md);
        transform: translateX(100%); /* Start off-screen */
        transition: transform var(--transition);
        z-index: 1000; /* Below button but above content */
        padding: var(--space-16) var(--space-6) var(--space-8);
        overflow-y: auto; /* Allow scrolling if menu is long */
        display: flex;
        flex-direction: column;
    }

    nav.active {
        transform: translateX(0); /* Slide in */
    }

    nav ul {
        flex-direction: column;
        gap: var(--space-4); /* Reduced gap */
        align-items: flex-start;
        width: 100%; /* Full width */
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        padding: var(--space-3) var(--space-2); /* Adjust padding */
        display: block; /* Make links full width */
        width: 100%;
    }
    nav ul li a:hover,
    nav ul li a:focus-visible {
         background-color: var(--gray-100); /* Add background on hover/focus */
         color: var(--primary);
    }
    nav ul li a::after {
         display: none; /* Hide underline effect */
    }
    nav .btn {
        width: 100%; /* Make contact button full width */
        margin-top: var(--space-6);
    }



    /* Stack hero elements */
    .hero {
        padding-top: 100px; /* Adjust padding below fixed header */
        padding-bottom: var(--space-12);
    }
    .hero-wrapper {
        flex-direction: column;
        text-align: center; /* Center text content */
    }
    .hero-content {
        max-width: 100%;
        order: 2; /* Text below image */
    }
    .hero-image {
        max-width: 80%; /* Adjust image size */
        order: 1; /* Image above text */
        margin-bottom: var(--space-8);
    }
    .hero-buttons {
        justify-content: center; /* Center buttons */
    }

    /* Stack benefit items */
    .benefit-item {
        flex-direction: column;
        text-align: center;
        align-items: center; /* Center icon */
    }
    .benefit-icon {
        margin-bottom: var(--space-4); /* Adjust margin */
    }

    
    .benefits-grid {
        grid-template-columns: 1fr; /* Ustawiamy jedną kolumnę na mniejszych ekranach */
        gap: var(--space-8); /* Opcjonalnie: zmniejsz odstęp pionowy */
    }

    /* Stack process steps */
    .process-steps::before {
        /* Vertical line for stacked layout */
        left: 40px; /* Position relative to step number */
        right: auto;
        top: 5%;
        bottom: 5%;
        width: 2px;
        height: auto;
        background-image: linear-gradient(to bottom, rgba(125, 218, 196, 0.5) 50%, transparent 50%);
        background-size: 2px 10px;
    }
    .process-step {
        flex-basis: 100%; /* Full width */
        display: flex; /* Align number and text */
        align-items: flex-start; /* Align to top */
        text-align: left;
        gap: var(--space-6);
    }
    .step-number {
        margin: 0; /* Remove auto margin */
        flex-shrink: 0; /* Prevent shrinking */
    }

    /* Adjust footer layout */
    .footer-content {
       gap: var(--space-8);
    }

    /* Ukryj strzałki na małych ekranach i włącz natywne przewijanie */

    .carousel-arrow {
        display: none;
    }
    .clients-carousel {
        padding: var(--space-4) var(--space-4); /* Zmniejsz padding boczny na mobile */
        overflow-x: auto; /* Włącz natywne przewijanie poziome */
        scroll-snap-type: x mandatory; /* Włącz przyciąganie */
        -webkit-overflow-scrolling: touch; /* Płynne przewijanie iOS */
    }
    .carousel-track {
        scroll-snap-align: start; /* Każde logo przyciąga */
         /* Na mobile JS nie kontroluje transform, więc resetujemy */
        transform: translateX(0) !important;
        /* Można usunąć transition na mobile, bo przewijanie jest natywne */
        transition: none;
    }
     .client-logo {
         scroll-snap-align: start; /* Każde logo przyciąga */
     }
}



/* Small Devices (Phones) */
@media (max-width: 576px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .hero {
        padding-top: 90px;
        padding-bottom: var(--space-10);
    }

    .hero-image {
        max-width: 90%; /* Slightly larger image on small phones */
    }

     .process-steps::before {
        left: 20px; /* Adjust line position */
     }
     .process-step {
         padding-left: 0; /* Remove horizontal padding */
         padding-right: 0;
         gap: var(--space-4);
     }
     .step-number {
         width: 50px; /* Smaller number circle */
         height: 50px;
         font-size: var(--fs-lg);
     }

    /* Adjust popup padding */
    @media (max-width: 576px) {
        .popup-container {
            padding: var(--space-6); /* Zmniejsz padding wewnętrzny na bardzo małych ekranach */
        }
    
        .form-group {
            margin-bottom: var(--space-3); /* Zmniejsz marginesy między polami */
        }
    
        .form-submit {
            text-align: center;
        }
        .form-submit .btn {
             width: 100%; /* Przycisk na całą szerokość */
        }
    
}
}

/* === ANIMATIONS === */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Delay for grid items */
.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.2s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.4s; }
.service-card:nth-child(5) { transition-delay: 0.5s; }
.service-card:nth-child(6) { transition-delay: 0.6s; }

/* === UTILITIES === */
.visually-hidden { /* Added from footer section */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}