:root {
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --border: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.reading-width {
    max-width: 760px;
}

/* Navbar */
.navbar {
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    font-size: 1.1rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

nav a:hover {
    color: #fff;
}

/* Przycisk hamburgerowy (ukryty na desktopie) */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}

.nav-toggle .bar {
    width: 22px;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animacja przejścia w krzyżyk (X) */
.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
    padding: 5.5rem 0 3.5rem;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 60%);
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: #60a5fa;
    margin-bottom: 1.25rem;
}

h1 {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Przyciski */
.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: #fff;
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-outline {
    border-color: var(--border);
    color: #fff;
}

.btn-outline:hover {
    border-color: #fff;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* Sekcje */
.section {
    padding: 5rem 0;
}

.section-dark {
    background: var(--bg-surface);
}

.section-title {
    font-size: 1.85rem;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

/* Karty */
.card, .project-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.card h3, .project-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.card p, .project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #60a5fa;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.tag {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Karta Certyfikatu */
.cert-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
}

/* Sztywny box na badge / zdjęcie */
.cert-image-wrapper {
    flex: 0 0 110px !important;
    width: 110px !important;
    max-width: 110px !important;
    height: 110px !important;
    max-height: 110px !important;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.cert-image-wrapper a {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    align-items: center !important;
    justify-content: center !important;
}

.cert-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cert-image:hover {
    transform: scale(1.05);
}

.cert-badge-placeholder {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
}

.cert-details {
    flex: 1 1 auto;
    min-width: 0;
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.cert-header h3 {
    font-size: 1.05rem;
    color: #fff;
    word-break: break-word;
}

.cert-year {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.cert-issuer {
    font-size: 0.85rem;
    color: #60a5fa;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.cert-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* O mnie */
.lead-text {
    font-size: 1.15rem;
    color: #d1d5db;
    line-height: 1.8;
}

/* Kontakt */
.text-center {
    text-align: center;
}

.contact-box {
    margin-top: 1.5rem;
}

.contact-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-link:hover {
    text-decoration: underline;
}

.separator {
    color: var(--text-secondary);
    margin: 0 1rem;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-link {
    color: var(--text-secondary);
    text-decoration: none;
}

.admin-link:hover {
    color: #fff;
}

/* RWD / Telefony i tablety */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .navbar {
        height: 64px;
    }

    .nav-content {
        position: relative;
    }

    /* Ukryte menu rozwijane z góry */
    #navMenu {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(11, 15, 25, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.5rem 1.5rem;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
    }

    #navMenu.open {
        display: flex;
    }

    #navMenu a {
        margin: 0;
        padding: 0.85rem 0;
        font-size: 1.05rem;
        border-bottom: 1px solid rgba(55, 65, 81, 0.4);
        display: block;
    }

    #navMenu a.nav-contact-btn {
        margin-top: 1rem;
        text-align: center;
        border-bottom: none;
        padding: 0.75rem 1rem;
    }

    /* Dopasowanie hero do notcha i bezpiecznych marginesów */
    .hero {
        padding: 1.5rem 0 2.5rem;
    }

    h1 {
        font-size: 2.1rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .cert-card {
        flex-direction: column;
    }
}