/* ==========================================================================
   Zmienne CSS
   ========================================================================== */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #FF9966;
    --text-color: #1f2937;
    --text-color-light: #6B7280;
    --text-color-dark: #374151;
    --light-bg: #f3f4f6;
    --shadow-sm: 0 2px 4px rgba(37, 99, 235, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition-normal: all 0.3s ease;
    /* Dodatkowe zmienne dla dostępności */
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.5);
    --focus-ring-offset: 2px;
}

/* ==========================================================================
   Reset i podstawowe style
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Lepszy focus outline dla dostępności */
:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Ukryj elementy tylko wizualnie, zachowując dostępność dla czytników ekranu */
.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;
}

/* Redukcja ruchu dla użytkowników, którzy tego preferują */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Zapobiega ukrywaniu nagłówków pod fixed header */
}

/* ==========================================================================
   Typografia
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Albert Sans', system-ui, -apple-system, sans-serif;
}

h1 {
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h2 {
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h3 {
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.font-bold, .font-semibold, .font-medium {
    font-weight: 500 !important;
}

/* ==========================================================================
   Komponenty
   ========================================================================== */
.counter {
    transition: var(--transition-normal);
    text-shadow: var(--shadow-sm);
    color: var(--secondary-color);
}

.counter:hover {
    transform: scale(1.05);
    text-shadow: var(--shadow-md);
}

[data-counter-plus] {
    color: var(--secondary-color) !important;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 2rem;
    transition: var(--transition-normal);
}

.cta-button:hover {
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

/* Checkmarki */
.checkmark-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkmark-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.checkmark-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--primary-color);
}

.checkmark-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-color-dark);
}

/* Nagłówki sekcji */
.section-header {
    position: relative;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    border-radius: 9999px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--text-color), var(--text-color-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-color-dark);
    max-width: 42rem;
    margin: 0 auto;
    line-height: 1.6;
}

.section-divider-line {
    width: 6rem;
    height: 2px;
    background-color: var(--accent-color);
    margin: 2rem auto;
    border-radius: 9999px;
    opacity: 0.85;
}

/* Separatory sekcji */
.section-divider {
    position: relative;
    transition: var(--transition-normal);
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(37, 99, 235, 0.08) 15%,
        rgba(255, 153, 102, 0.08) 50%,
        rgba(37, 99, 235, 0.08) 85%,
        transparent 100%
    );
    z-index: 1;
}

.section-divider::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.02));
    z-index: 1;
}

/* ==========================================================================
   Animacje
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes arrow-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

.fade-in, .fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-normal);
}

.fade-in.visible, .fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-arrow {
    animation: arrow-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.timeline-item {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

/* ==========================================================================
   Media Queries
   ========================================================================== */
@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        text-align: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .timeline-item {
        width: 100%;
        margin-top: 0 !important;
    }

    .grid.grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    [class*="absolute top-1/2 left-0 w-full h-1"],
    .timeline-item .absolute.-bottom-3,
    .timeline-item .absolute.-top-3,
    .timeline-item .w-1.h-16,
    .timeline-item::after {
        display: none;
    }
}

@media (min-width: 768px) {
    .section-divider {
        padding: 6rem 0;
    }
}

/* Efekt zagiętej kartki */
.folded-corner {
    position: relative;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.folded-corner:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05),
                0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

/* Tło dla sekcji z niebieskim kolorem */
.bg-blue-50\/70 {
    position: relative;
    background: linear-gradient(to bottom right, rgba(239, 246, 255, 0.85), rgba(219, 234, 254, 0.85));
    backdrop-filter: blur(8px);
}

.bg-blue-50\/70::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/hero_bg.webp') center/cover no-repeat fixed;
    opacity: 0.03;
    z-index: -1;
}

/* Style dla badge'y */
.timeline-item .bg-blue-50 {
    background-color: rgb(219, 234, 254);
}

/* Style dla logo */
.logo-container {
    margin-left: 0.5rem;
}

/* Lepsze stany hover/focus dla interaktywnych elementów */
.cta-button:focus-visible {
    box-shadow: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Płynne przewijanie dla sekcji */
.section {
    scroll-margin-top: 100px;
}

/* Aktywna sekcja w menu */
.nav-link.active {
    color: var(--primary-color);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

/* Progress bar */
#progress-bar {
    transform-origin: 0 50%;
    will-change: width;
}

/* Style dla zwijania/rozwijania opisów zespołu */
.team-description {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
    margin: 0;
    padding: 0;
}

.team-description.expanded {
    max-height: 500px; /* Zmniejszona wartość dla lepszej animacji */
    opacity: 1;
    margin-bottom: 1rem;
}

.toggle-description {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    transition: color 0.2s ease;
    gap: 0.5rem;
    transition: color 0.2s ease, transform 0.3s ease;
}

.toggle-description:hover {
    color: var(--secondary-color);
}

.toggle-description svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-description.expanded svg {
    transform: rotate(180deg);
}

.team-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.team-skill {
    background-color: #f3f4f6;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-color);
}