:root {
    --bg-main: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --accent-cyan: #06b6d4;
    --accent-teal: #2dd4bf;
    --border-color: rgba(255, 255, 255, 0.05);
    --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.4);
    --glow-teal: 0 0 30px rgba(45, 212, 191, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.success-modal {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(2, 6, 23, 0.85); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center;
    z-index: 9999; opacity: 0;
    visibility: hidden; pointer-events: none;
    transition: opacity 0.4s ease;
}

.success-modal.active { display: flex; opacity: 1; visibility: visible; pointer-events: all; }

.modal-content {
    background: var(--bg-card); border: 1px solid var(--border-color);
    padding: 3rem 4rem; border-radius: 20px;
    text-align: center; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--glow-teal);
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}

.icon-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(45, 212, 191, 0.1); border: 2px solid var(--accent-teal);
    display: flex; justify-content: center; align-items: center;
    color: var(--accent-teal); box-shadow: var(--glow-teal);
    transform: scale(0);
}

.modal-text { font-size: 1.8rem; font-weight: 700; color: #f8fafc; opacity: 0; transform: translateY(10px); }

.success-modal.active .icon-circle { animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.success-modal.active .modal-text { animation: fadeUpText 0.5s ease-out 0.5s forwards; }

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeUpText { to { opacity: 1; transform: translateY(0); } }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
}

ul { list-style: none; }

.glow-orb {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

.glow-orb.top-left {
    top: -200px;
    left: -200px;
    background: radial-gradient(circle, var(--accent-teal) 0%, transparent 70%);
}

.glow-orb.bottom-right {
    bottom: -200px;
    right: -200px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
}

h1, h2, h3 { line-height: 1.2; font-weight: 700; }

.gradient-text {
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-center { text-align: center; }

.btn-primary, .btn-secondary, .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
    color: #020617;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 0.5rem 1.2rem;
}

.btn-outline:hover {
    background: rgba(0, 229, 255, 0.1);
    box-shadow: var(--glow-cyan);
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.3));
}

.logo .accent { color: var(--accent-teal); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--accent-cyan); }

.lang-switch {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 0.2rem;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn.active {
    background: var(--accent-teal);
    color: #020617;
    box-shadow: var(--glow-teal);
}

.divider {
    width: 1px;
    height: 14px;
    background: var(--border-color);
    margin: 0 2px;
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero-content .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.code-window {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    transition: transform 0.5s ease;
    will-change: transform;
}

.code-window:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
}

.window-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.8rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.window-body {
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.kw { color: #f7768e; }
.var { color: #7aa2f7; }
.op { color: #89ddff; }
.str { color: #9ece6a; }
.fn { color: #bb9af7; }

.services { padding: clamp(4rem, 10vw, 8rem) 0; position: relative; }
.services h2 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: clamp(2rem, 5vw, 4rem); }

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.1);
}

.icon-wrap {
    width: 60px;
    height: 60px;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-cyan);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
}

.service-card h3 { margin-bottom: 1rem; font-size: 1.3rem; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }

.portfolio {
    padding: clamp(4rem, 10vw, 8rem) 0;
    background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.3), transparent);
}

.section-header {
    text-align: center;
    margin-bottom: clamp(2rem, 5vw, 4rem);
    max-width: 600px;
    margin-inline: auto;
}

.section-header h2 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 1rem; }
.section-header p { color: var(--text-muted); }

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 0 auto;
}

.project-card {
    width: 100%;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.5s ease;
    backdrop-filter: blur(12px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
    pointer-events: none;
    will-change: left;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(6, 182, 212, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.project-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.4);
}

.project-img-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(37, 99, 235, 0.25));
    mix-blend-mode: color;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-card:hover .project-img-wrapper::before {
    opacity: 0.15;
}

.project-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
    pointer-events: none;
    z-index: 2;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    filter: brightness(0.85) saturate(0.7) hue-rotate(10deg);
}

.project-card:hover .project-img {
    filter: brightness(1) saturate(0.9) hue-rotate(5deg);
}

.project-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;
    transform: translateY(-8px);
}

.project-card:hover .project-link {
    opacity: 1;
    transform: translateY(0);
}

.project-link:hover {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
    color: #020617;
    border-color: transparent;
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.4);
    transform: scale(1.1);
}

.project-link svg {
    transition: transform 0.3s ease;
}

.project-link:hover svg {
    transform: translate(1px, -1px);
}

.project-info {
    padding: 1.4rem 1.8rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.project-category {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent-teal);
    opacity: 0.8;
    transition: opacity 0.4s ease;
}

.project-card:hover .project-category {
    opacity: 1;
}

.project-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.3;
    background: linear-gradient(90deg, var(--accent-cyan) 0%, #e0f2fe 35%, var(--text-primary) 50%, #e0f2fe 65%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 100%;
    animation: shimmerName 6s ease-in-out infinite;
}

@keyframes shimmerName {
    0%, 100% { background-position: 100% 0; }
    50% { background-position: 0% 0; }
}

.project-card:hover h3 {
    animation-duration: 2.5s;
}



.project-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.contact { padding: clamp(4rem, 10vw, 8rem) 0; }

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
}

.contact-text h2 { font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 1rem; }
.contact-text p { color: var(--text-muted); margin-bottom: 3rem; }

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.info-item svg {
    color: var(--accent-cyan);
    min-width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-form {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    transition: border 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.05);
}

.contact-form .btn-primary { width: 100%; justify-content: center; padding: 1rem; }

.form-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-feedback.success { background: rgba(45, 212, 191, 0.1); color: var(--accent-teal); border: 1px solid rgba(45, 212, 191, 0.3); }
.form-feedback.error { background: rgba(244, 63, 94, 0.1); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.3); }
.hidden { display: none; }

.spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.success-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.success-modal.active {
    opacity: 1;
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 2.5rem 3rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(45, 212, 191, 0.25);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(45, 212, 191, 0.1);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.success-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(6, 182, 212, 0.15));
    border: 2px solid rgba(45, 212, 191, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-teal);
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(45, 212, 191, 0.15); }
    50% { box-shadow: 0 0 30px rgba(45, 212, 191, 0.3); }
}

.modal-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

footer { border-top: 1px solid var(--border-color); padding: 3rem 0; text-align: center; }
.footer-logo { margin-bottom: 1.5rem; }
.footer-logo span { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.footer-logo p { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.9rem; }

.footer-socials { display: flex; justify-content: center; gap: 1rem; }
.footer-socials a {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-card);
    display: flex; justify-content: center; align-items: center;
    color: var(--text-muted); transition: all 0.3s;
}

.footer-socials a:hover {
    color: #fff; background: var(--accent-cyan);
    box-shadow: var(--glow-cyan); transform: translateY(-3px);
}

.footer-socials svg { width: 1.25rem; height: 1.25rem; stroke-width: 2.2px; }

@media (max-width: 992px) {
    .services-grid, .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .hero .container, .contact-container { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; }
    .code-window { margin: 0 auto; max-width: 100%; transform: none !important; }
    .contact-text .info-item { justify-content: center; }
}

@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }
    .nav-links {
        display: none; position: absolute;
        top: 100%; left: 0; width: 100%;
        background: rgba(2, 6, 23, 0.95); backdrop-filter: blur(15px);
        flex-direction: column; padding: 2rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }
    .lang-switch { margin-right: 1rem; }
    .hero { padding-top: 100px; text-align: center; }
    .services-grid, .portfolio-grid { grid-template-columns: 1fr; }
    .code-window { display: none; }

    /* Optymalizacja portfolio dla mobile */
    .project-card { border-radius: 16px; }
    .project-info { padding: 1.2rem; gap: 0.5rem; }
    .project-info h3 { font-size: 1.35rem; }
    .project-desc { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
    .contact-form { padding: 1.5rem; }
}

[data-i18n], [data-i18n-placeholder] { transition: all 0.35s ease; }
.lang-animating { opacity: 0 !important; filter: blur(6px) !important; transform: scale(0.98) !important; }

/* Dostępność: Ustawienia dla preferencji wyłączenia animacji */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}