:root {
    --color-primary: #0077cc;
    --color-primary-dark: #005fa3;
    --color-primary-light: #3399dd;
    --color-accent: #ff6b35;
    --color-accent-alt: #f7931e;
    --color-dark: #1a1a2e;
    --color-text: #2d2d2d;
    --color-text-light: #666;
    --color-bg: #fafbfc;
    --color-white: #ffffff;
    --color-border: #e5e7eb;
    
    --font-display: 'Syne', sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
    
    --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 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.15);
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-bg) 0%, #f0f2f5 100%);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Grain overlay pro texturu */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Header */
header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    padding: 4rem 2rem 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    animation: fadeInDown 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-link {
    display: inline-block;
    transition: transform var(--transition-base);
}

.logo-link:hover {
    transform: scale(1.05) rotate(-2deg);
}

img.logo {
    max-height: 90px;
    max-width: 80vw;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.header-title {
    margin: 2.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.title-main {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-white) 0%, rgba(255, 255, 255, 0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}

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

.title-sub {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
    animation: fadeInScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s backwards;
}

.header-description {
    margin: 1.5rem 0 0;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.4s backwards;
}

.header-decoration {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    z-index: 1;
}

/* Main */
main {
    padding: 3rem 1.5rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.projects-intro {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.projects-intro h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 1rem;
}

.intro-line {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-alt) 100%);
    margin: 0 auto;
    border-radius: 2px;
}

/* Project Grid */
.project-grid {
    display: grid;
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.project-card {
    background: var(--color-white);
    border-radius: 16px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid var(--color-border);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card[data-project="1"].visible {
    animation: slideInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards;
}

.project-card[data-project="2"].visible {
    animation: slideInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s backwards;
}

.project-card[data-project="3"].visible {
    animation: slideInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.3s backwards;
}

.project-card[data-project="4"].visible {
    animation: slideInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s backwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary-light);
}

.project-card:hover .project-accent {
    transform: translateX(0);
    opacity: 1;
}

.project-number {
    position: absolute;
    top: -15px;
    right: 2rem;
    font-family: var(--font-display);
    font-size: 8rem;
    font-weight: 800;
    color: var(--color-bg);
    line-height: 1;
    z-index: 0;
    user-select: none;
    transition: all var(--transition-base);
}

.project-card:hover .project-number {
    color: rgba(0, 119, 204, 0.08);
    transform: scale(1.1);
}

.project-content {
    position: relative;
    z-index: 1;
}

.project-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.project-description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.project-description strong {
    color: var(--color-text);
    font-weight: 600;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.tag {
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, rgba(0, 119, 204, 0.08) 0%, rgba(0, 119, 204, 0.12) 100%);
    color: var(--color-primary-dark);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid rgba(0, 119, 204, 0.15);
    transition: all var(--transition-fast);
}

.project-card:hover .tag {
    background: linear-gradient(135deg, rgba(0, 119, 204, 0.12) 0%, rgba(0, 119, 204, 0.18) 100%);
    border-color: rgba(0, 119, 204, 0.25);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.75rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    border-radius: 10px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(0, 119, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.project-link:hover::before {
    left: 100%;
}

.project-link:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0, 119, 204, 0.4);
}

.project-link .arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.project-link:hover .arrow {
    transform: translateX(4px);
}

.project-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-alt) 50%, var(--color-primary) 100%);
    transform: translateX(-100%);
    opacity: 0;
    transition: all var(--transition-slow);
}

/* CTA Section */
.cta-section {
    margin: 5rem 0 3rem;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--color-dark) 0%, #2d2d44 100%);
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 107, 53, 0.1) 0%, transparent 60%),
                radial-gradient(circle at 70% 50%, rgba(0, 119, 204, 0.1) 0%, transparent 60%);
    z-index: 0;
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.cta-section h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-alt) 100%);
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 12px;
    transition: all var(--transition-base);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.4);
}

.cta-button svg {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-base);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
}

.cta-button:hover svg {
    transform: translate(3px, -3px);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--color-dark) 0%, #16162a 100%);
    color: rgba(255, 255, 255, 0.9);
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-text strong {
    color: var(--color-white);
    font-weight: 600;
}

.footer-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition-base);
}

.footer-link:hover::after {
    width: 100%;
}

.footer-link:hover {
    color: var(--color-accent-alt);
}

.footer-rights {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 3rem 1.5rem 4rem;
    }
    
    .header-description {
        font-size: 1rem;
    }
    
    .project-card {
        padding: 2rem 1.5rem;
    }
    
    .project-number {
        font-size: 5rem;
        top: -10px;
        right: 1rem;
    }
    
    .cta-section {
        padding: 3rem 1.5rem;
        margin: 3rem 0 2rem;
    }
    
    footer {
        padding: 2rem 1.5rem;
    }
    
    .footer-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .project-tags {
        gap: 0.5rem;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.35rem 0.8rem;
    }
    
    .project-link {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .grain-overlay,
    .header-decoration,
    .project-accent {
        display: none;
    }
    
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}