:root {
    --primary-color: #334155;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --background-color: #f8fafc;
    --light-bg: #f1f5f9;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

/* Header */
.main-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
    transition: all 0.3s ease;
}

.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    transition: all 0.3s ease;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.logo-link:hover {
    opacity: 0.9;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: font-size 0.3s ease;
}

.sticky-header .logo {
    font-size: 1.4rem;
}

.tagline {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    transition: opacity 0.3s ease, font-size 0.3s ease;
}

.sticky-header .tagline {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Navigation */
.main-nav {
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.nav-menu li {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

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

.nav-link.active {
    color: var(--accent-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1.5rem;
    z-index: 1001;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
    display: block;
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    top: 8px;
}

.menu-open .hamburger-icon {
    background-color: transparent;
}

.menu-open .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-open .hamburger-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #0284c7;
}

/* Responsive header and navigation */
@media (max-width: 768px) {
    .nav-menu {
        margin-top: 0;
    }
    
    .nav-menu li {
        margin: 0 1rem;
    }
    
    .sticky-header .tagline {
        display: none;
    }
}

@media (max-width: 576px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background-color: var(--background-color);
        flex-direction: column;
        justify-content: flex-start;
        padding: 6rem 2rem 2rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .menu-open .nav-menu {
        right: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .nav-link {
        display: block;
        padding: 0.5rem 0;
    }
    
    .sticky-header .logo {
        font-size: 1.2rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0 1rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.7rem;
    }
    
    .hero {
        padding: 4rem 0 2rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .cta-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Hero Section */
.hero {
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.network-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.3; /* Zwiększona nieprzezroczystość dla lepszej widoczności */
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.25rem;
    color: var(--secondary-color);
    max-width: 800px;
    margin: 0 auto 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #0284c7;
}

/* Sections */
section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

/* About Section */
.about-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    max-width: 1000px;
    margin: 0 auto;
    gap: 3rem;
}

.profile-image-container {
    flex: 0 0 350px;
}

.profile-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.profile-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.profile-image:hover img {
    transform: scale(1.02);
}

.about-content {
    flex: 1;
    text-align: left;
}

.about-content p {
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* Responsywność dla sekcji O mnie */
@media (max-width: 992px) {
    .about-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .profile-image-container {
        flex: 0 0 300px;
        max-width: 300px;
    }
    
    .about-content {
        text-align: center;
    }
}

/* Services Section */
.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.project-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #94a3b8;
    font-size: 2rem;
    display: none;
}

.no-image .project-image {
    display: none;
}

.no-image .image-placeholder {
    display: flex;
}

.project-card-content {
    padding: 1.5rem;
}

.project-card-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.project-card-content p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.project-link {
    display: inline-block;
    color: var(--accent-color);
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.project-link:hover {
    border-color: var(--accent-color);
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Project Detail Page */
.project-detail-header {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-detail-image {
    display: block;
    width: 100%;
    height: auto;
}

.project-image-placeholder {
    background-color: #f1f5f9;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #94a3b8;
}

.project-image-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    margin: 2rem 0;
}

.error-message h2 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.loading-message {
    text-align: center;
    padding: 3rem 0;
    color: var(--secondary-color);
}

/* Markdown content styling */
.markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.markdown-table th, 
.markdown-table td {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
}

.markdown-table th {
    background-color: #f8fafc;
    font-weight: 600;
    text-align: left;
}

.project-detail-content h1, 
.project-detail-content h2, 
.project-detail-content h3, 
.project-detail-content h4 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
}

.project-detail-content h1 {
    font-size: 2rem;
}

.project-detail-content h2 {
    font-size: 1.75rem;
}

.project-detail-content h3 {
    font-size: 1.5rem;
}

.project-detail-content h4 {
    font-size: 1.25rem;
}

.project-detail-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.project-detail-content ul, 
.project-detail-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.project-detail-content li {
    margin-bottom: 0.5rem;
}

.project-detail-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.project-detail-content a:hover {
    text-decoration: underline;
}

.project-detail-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--secondary-color);
    font-style: italic;
}

.project-detail-header-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    color: white;
}

.project-detail-header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.project-detail-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.project-detail-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-detail-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-detail-content ul,
.project-detail-content ol {
    margin-bottom: 1.5rem;
    margin-left: 1.5rem;
}

.project-detail-content li {
    margin-bottom: 0.5rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #0284c7;
}

.back-link i {
    margin-right: 0.5rem;
}

@media (max-width: 768px) {
    .project-slide {
        padding-bottom: 40%; /* Wyższe proporcje dla mobilnych */
    }
    
    .project-slide-content h3 {
        font-size: 1.4rem;
    }
    
    .project-detail-header {
        padding-bottom: 40%;
    }
    
    .project-detail-header-content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .project-slide {
        padding-bottom: 60%; /* Jeszcze wyższe proporcje dla bardzo małych ekranów */
    }
    
    .project-slide-content {
        padding: 1rem;
    }
    
    .project-slide-content h3 {
        font-size: 1.2rem;
    }
    
    .project-detail-header {
        padding-bottom: 60%;
    }
    
    .project-detail-header-content {
        padding: 1rem;
    }
    
    .project-detail-header-content h1 {
        font-size: 1.6rem;
    }
}

/* Experience Timeline */
.experience-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.timeline-item:last-child {
    border-left: 2px solid transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-color);
    left: -9px;
    top: 0;
}

.timeline-item h3 {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-item .timeline-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.timeline-item p {
    color: var(--text-color);
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #0284c7;
}

/* Google reCAPTCHA */
.g-recaptcha {
    margin-bottom: 1.5rem;
}

@media (max-width: 320px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
        margin-bottom: 1rem;
    }
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-links {
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: #e2e8f0;
    margin: 0 1rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: #e2e8f0;
    font-size: 1.5rem;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: white;
}

.contact-info {
    margin-bottom: 1.5rem;
}

.contact-info p {
    color: #e2e8f0;
    font-size: 1rem;
}

.contact-info a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: white;
    text-decoration: underline;
}

.copyright {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1.5rem;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 1rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .timeline-item {
        padding-left: 1.5rem;
    }
}