@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&family=Fira+Code:wght@400;700&display=swap');

:root {
    --navy: #0A192F;
    --darker-navy: #020617;
    --blue: #0070F3;
    --blue-glow: rgba(0, 112, 243, 0.6);
    --cyan: #00f2fe;
    --light-bg: #F8FAFC;
    --white: #FFFFFF;
    --gray: #8892b0;
    --light-gray: #E2E8F0;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--darker-navy);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- NAWIGACJA --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    padding: 30px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    padding: 15px 5%;
    background-color: rgba(2, 6, 23, 0.85); 
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 242, 254, 0.1);
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--white);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: font-size 0.4s;
    text-shadow: 0 0 10px rgba(0, 112, 243, 0.5);
}

header.scrolled .logo { font-size: 1.5rem; }
.logo span { color: var(--cyan); }

nav ul { display: flex; list-style: none; gap: 35px; align-items: center; }
nav a { text-decoration: none; color: var(--white); font-weight: 500; transition: color 0.3s, text-shadow 0.3s; }
nav a:hover { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }

/* --- GŁÓWNY PRZYCISK (CTA) --- */
.btn-primary {
    position: relative;
    background-color: transparent;
    color: var(--cyan);
    padding: 15px 35px;
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--cyan);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-block;
    overflow: hidden;
    /* transition z opóźnieniem, o które prosiłeś */
    transition: background-color 0.4s ease 0.1s, color 0.4s ease 0.1s, box-shadow 0.4s ease 0.1s, transform 0.2s ease;
    z-index: 1;
    cursor: pointer;
}

.btn-primary::before {
    content: "» » » » » »"; /* Bardziej techowy symbol */
    position: absolute;
    top: 50%;
    left: -50%;
    transform: translateY(-50%);
    width: 200%;
    color: var(--cyan);
    font-size: 1.5rem;
    opacity: 0;
    filter: blur(2px); /* Efekt poświaty/ruchu */
    letter-spacing: 20px;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-primary:hover {
    color: var(--darker-navy);
    background-color: var(--cyan);
    box-shadow: 0 0 30px var(--cyan);
}

/* Kliknięcie: Przycisk lekko się "wciska" */
.btn-primary:active {
    transform: scale(0.96);
}

/* Płynny, niekończący się przelot */
@keyframes arrowsFlow {
    0% { transform: translateY(-50%) translateX(-20%); }
    100% { transform: translateY(-50%) translateX(0); }
}

/* Hover: Animacja strzałek */
.btn-primary:hover::before {
    opacity: 0.4;
    left: 0;
    animation: arrowsFlow 1.5s linear infinite;
}

/* Poprawka dla przycisków wewnątrz sekcji (żeby nie uciekały na bok) */
.section-cta {
    text-align: center;
    margin-top: 50px;
    width: 100%;
}

.btn-nav {
    background-color: transparent;
    color: var(--cyan) !important;
    padding: 10px 20px;
    border: 1px solid var(--cyan);
    border-radius: 4px;
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.btn-nav:hover {
    background-color: rgba(0, 242, 254, 0.1);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
}

/* --- HAMBURGER MENU (MOBILE) --- */
.mobile-btn {
    display: none;
    margin-left: auto; /* Przesuwa hamburger do prawej */
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 2000;
}

.mobile-btn span {
    width: 30px;
    height: 3px;
    background-color: var(--cyan);
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

.mobile-btn.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-btn.active span:nth-child(2) { opacity: 0; }
.mobile-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* --- SEKCJA HERO --- */
#home {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10%;
    background-color: var(--navy);
    overflow: hidden;
}

#particles-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.hero-content { position: relative; z-index: 2; }

.hero-title {
    font-size: 3.8rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    max-width: 850px;
}

.hero-title span {
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 30px;
    max-width: 550px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    margin-top: 40px;
}

.project-card {
    background: rgba(10, 25, 47, 0.4); /* Półprzezroczyste tło */
    border: 1px solid rgba(0, 242, 254, 0.1); /* Delikatna ramka */
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Niebieski pasek z boku/u dołu dla podkreślenia tech-stylu */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px; /* Pionowa linia z boku */
    height: 100%;
    background: var(--blue);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(10, 25, 47, 0.8);
    border-color: var(--cyan);
    box-shadow: 0 10px 30px rgba(0, 242, 254, 0.1);
}

.project-card:hover::before {
    background: var(--cyan);
    box-shadow: 0 0 15px var(--cyan);
}

/* --- ANIMOWANA MYSZKA --- */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.3s;
    z-index: 2;
}

.mouse { width: 25px; height: 40px; border: 2px solid var(--gray); border-radius: 15px; position: relative; }
.wheel { width: 4px; height: 8px; background-color: var(--cyan); border-radius: 2px; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); animation: scrollWheel 2s infinite; }
@keyframes scrollWheel { 0% { top: 8px; opacity: 1; } 100% { top: 25px; opacity: 0; } }

/* --- WSPÓLNE DLA SEKCJI --- */
.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    display: block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--cyan);
    box-shadow: 0 0 10px var(--cyan);
}

.reveal { opacity: 0; transform: translateY(50px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.cyber-bg { background-image: linear-gradient(rgba(0, 112, 243, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 112, 243, 0.05) 1px, transparent 1px); background-size: 40px 40px; background-position: center center; }

/* --- SEKCJE --- */
#services, #about { padding: 100px 10%; background-color: var(--darker-navy); position: relative; }
#projects { padding: 100px 10%; background-color: var(--navy); position: relative; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; position: relative; z-index: 2; }
.service-card { background: rgba(10, 25, 47, 0.6); backdrop-filter: blur(10px); padding: 40px 30px; border-radius: 8px; border: 1px solid rgba(0, 242, 254, 0.1); transition: all 0.4s ease; position: relative; }
.service-card::before, .service-card::after { content: ''; position: absolute; width: 20px; height: 20px; border: 2px solid transparent; transition: all 0.4s; }
.service-card::before { top: -1px; left: -1px; border-top-color: var(--cyan); border-left-color: var(--cyan); }
.service-card::after { bottom: -1px; right: -1px; border-bottom-color: var(--blue); border-right-color: var(--blue); }
.service-card:hover { transform: translateY(-10px); background: rgba(10, 25, 47, 0.9); border-color: rgba(0, 242, 254, 0.4); box-shadow: 0 10px 30px rgba(0, 242, 254, 0.1); }
.service-card:hover::before, .service-card:hover::after { width: 100%; height: 100%; }

.service-icon { font-size: 2.5rem; margin-bottom: 20px; display: inline-block; background: linear-gradient(90deg, var(--blue), var(--cyan)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- TERMINAL --- */
.terminal-window { background-color: #0A192F; border: 1px solid #1e293b; border-radius: 8px; width: 100%; max-width: 800px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5); margin: 0 auto; }
.terminal-header { background-color: #1e293b; padding: 10px 15px; display: flex; align-items: center; gap: 8px; }
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background-color: #ff5f56; }
.dot-yellow { background-color: #ffbd2e; }
.dot-green { background-color: #27c93f; }
.terminal-title { color: var(--gray); font-family: 'Fira Code', monospace; font-size: 0.85rem; margin-left: auto; margin-right: auto; }
.terminal-body { padding: 30px; font-family: 'Fira Code', monospace; font-size: 1rem; color: #a8b2d1; line-height: 1.8; }
.terminal-line span.user { color: var(--cyan); }
.terminal-line span.path { color: var(--blue); }
.terminal-line span.cmd { color: var(--white); }
.terminal-cursor { display: inline-block; width: 10px; height: 18px; background-color: var(--cyan); vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- STOPKA --- */
footer { background-color: #000; color: var(--white); padding: 40px 10%; text-align: center; border-top: 1px solid rgba(0, 242, 254, 0.2); }
.footer-text { color: var(--gray); font-family: 'Fira Code', monospace; font-size: 0.8rem; }

/* ==========================================================================
   === MEDIA QUERIES (MUSZĄ BYĆ NA SAMYM KOŃCU) =============================
   ========================================================================== */
@media (max-width: 768px) {
    /* --- HERO NA TELEFON --- */
    .hero-title { font-size: 2.1rem !important; margin-bottom: 15px; }
    .hero-subtitle { font-size: 0.95rem !important; margin-bottom: 30px; max-width: 100%; }

    /* --- LOGO I HEADER --- */
    .logo { font-size: 1.5rem !important; } 
    header.scrolled .logo { font-size: 1.3rem !important; }
    header { background-color: transparent !important; border-bottom: 1px solid transparent !important; padding: 25px 5%; }
    header.scrolled { background-color: rgba(2, 6, 23, 0.95) !important; border-bottom: 1px solid rgba(0, 242, 254, 0.1) !important; padding: 15px 5%; }

    /* --- NAPRAWA NAGŁÓWKÓW --- */
    .section-title { font-size: 1.7rem !important; margin-bottom: 40px !important; display: block !important; width: 100% !important; text-align: center !important; left: 0 !important; transform: none !important; padding: 0 10px !important; }
    .section-title::after { left: 50% !important; transform: translateX(-50%) !important; width: 80px !important; }

    /* --- MARGINESY SEKCJI --- */
    #home { padding-left: 5% !important; padding-right: 5% !important; }
    #services, #projects, #about { padding: 60px 6% !important; }

    /* --- USŁUGI: IDEALNE KWADRATY --- */
    .services-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 15px !important; }
    
    .service-card {
        padding: 10px !important;
        aspect-ratio: 1 / 1 !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
    }

    .service-icon { font-size: 2rem !important; margin-bottom: 10px !important; }
    .service-card h3 { font-size: 0.85rem !important; line-height: 1.2 !important; margin-bottom: 0 !important; }
    .service-card div[style*="monospace"] { font-size: 0.6rem !important; margin-bottom: 5px !important; }
    .service-card p { display: none !important; } /* Ukrywa długi opis dla kwadratu */

.projects-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .project-card {
        padding: 30px 20px !important;
        aspect-ratio: auto !important; /* Na statystykach nie wymuszamy kwadratu */
    }



    /* --- MENU --- */
    .mobile-btn { display: flex !important; }
    nav ul {
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background-color: rgba(2, 6, 23, 0.98); backdrop-filter: blur(25px);
        flex-direction: column; justify-content: center; align-items: center; 
        gap: 30px; z-index: 1000; opacity: 0; visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }
    nav ul.active { opacity: 1; visibility: visible; }
    nav a { font-size: 2rem !important; font-weight: 700 !important; }
    .btn-nav { font-size: 1.5rem !important; padding: 15px 40px !important; border-width: 2px !important; }
}