/* ==========================================================================
   DESIGN TOKENS (ZMIENNE SYSTEMOWE)
   ========================================================================== */
:root {
    --bg-main: #07090e;
    --bg-surface: rgba(13, 17, 22, 0.75);
    
    --primary: #00f2fe;
    --primary-hover: #00b4d8;
    --primary-glow: rgba(0, 242, 254, 0.25);
    --primary-dim: rgba(0, 242, 254, 0.08);

    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --text-dim: #718096;

    --border-subtle: rgba(0, 242, 254, 0.15);
    --border-active: rgba(0, 242, 254, 0.4);

    --container-width: min(90%, 1400px);
    --radius-lg: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BAZA
   ========================================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a:focus-visible,
button:focus-visible {
    outline: 1px solid var(--primary);
    outline-offset: 3px;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-main);
    background-image: 
        linear-gradient(to right, rgba(0, 242, 254, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    background-attachment: fixed;
    
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Usuwanie strzałek ze scrollbara */
::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:vertical:decrement,
::-webkit-scrollbar-button:vertical:increment {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.25);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* ==========================================================================
   NAWIGACJA (DESKTOP + MOBILE)
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(7, 9, 14, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

body.lightbox-open .site-header {
    transform: translateY(-100%);
    pointer-events: none;
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
    padding-bottom: 4px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

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

.btn-cv {
    color: var(--primary) !important;
    border: 1px solid var(--primary);
    padding: 0.5rem 1.25rem !important;
    border-radius: 6px;
    box-shadow: 0 0 10px var(--primary-dim);
}

.btn-cv:hover {
    background-color: var(--primary-dim);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-cv.active::after {
    display: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    position: relative;
    transition: var(--transition-smooth);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    transition: var(--transition-smooth);
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* ==========================================================================
   SEKCJA HERO
   ========================================================================== */
.hero {
    padding: 7rem 0 3rem 0;
    width: 100%;
}

.hero-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    width: 100%;
}

.hero-text {
    flex: 1.2;
}

.hero-text h1 {
    font-size: clamp(1.85rem, 6vw, 3.8rem);
    line-height: 1.15;
    font-weight: 800;
    margin-bottom: 1rem;
    overflow-wrap: break-word;
}

.accent-text {
    color: var(--primary);
    text-shadow: 0 0 25px var(--primary-glow);
}

.hero-text h2 {
    font-size: clamp(1.15rem, 2.5vw, 1.35rem);
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.25rem;
}

.hero-text p {
    font-size: clamp(0.98rem, 1.8vw, 1.15rem);
    color: var(--text-dim);
    max-width: 640px;
    line-height: 1.65;
    margin-bottom: 2.25rem;
}

/* ==========================================================================
   NOWOCZESNE PRZYCISKI
   ========================================================================== */
.buttons {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #05070a;
    box-shadow: 0 0 20px var(--primary-glow), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    border: none;
}

.btn-primary .btn-icon {
    transition: transform 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

.btn-secondary {
    background: rgba(13, 17, 22, 0.7);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #04eb2a;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-secondary:hover .status-dot {
    transform: scale(1.3);
}

.btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   NOWOCZESNE ANIMOWANE OKNO KODU MACOS
   ========================================================================== */
.hero-image {
    flex: 1.1;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.code-window {
    width: 100%;
    max-width: 530px;
    background: rgba(4, 6, 10, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8), 0 0 30px var(--primary-dim);
    transition: var(--transition-smooth);
}

.code-window:hover {
    border-color: var(--border-active);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 40px var(--primary-glow);
    transform: translateY(-4px);
}

.window-header {
    background: rgba(13, 17, 22, 0.9);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.window-controls {
    display: flex;
    gap: 7px;
    align-items: center;
}

.window-controls .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}

/* Żywe kolory kontrolek macOS */
.window-controls .dot-red { 
    background-color: #ff5f56 !important; 
    box-shadow: 0 0 6px rgba(255, 95, 86, 0.4);
}

.window-controls .dot-yellow { 
    background-color: #ffbd2e !important; 
    box-shadow: 0 0 6px rgba(255, 189, 46, 0.4);
}

.window-controls .dot-green { 
    background-color: #27c93f !important; 
    box-shadow: 0 0 6px rgba(39, 201, 63, 0.4);
}

.window-filename {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.window-badge {
    font-size: 0.7rem;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    font-weight: 600;
}

.window-body {
    padding: 1.5rem;
    height: 310px;
    display: flex;
    align-items: flex-start;
}

.window-body pre {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.92rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Kolorowanie składni (Syntax Highlighting) */
.kw   { color: #ff5370; font-style: italic; }
.type { color: #ffcb6b; }
.str  { color: #c3e88d; }
.var  { color: #82b1ff; }
.func { color: var(--primary); }
.op   { color: #ffffff; }
.com  { color: #546e7a; font-style: italic; }
.pass { color: #27c93f; font-weight: bold; }
.cmd  { color: #00f2fe; font-weight: 600; }

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.15em;
    background-color: var(--primary);
    margin-left: 2px;
    vertical-align: middle;
    animation: blinkCursor 0.8s infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   SEKCJA PROJEKTY
   ========================================================================== */
.projects-section {
    max-width: var(--container-width);
    margin: 4rem auto;
    padding: 0 2rem;
    width: 100%;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 700;
}

.section-subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.project-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-active);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-dim);
}

.project-preview {
    width: 100%;
    height: 190px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-preview img {
    transform: scale(1.05);
}

.project-body {
    padding: 1.5rem;
    flex: 1;
}

.project-title {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    margin-bottom: 0.75rem;
}

.project-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.project-card:hover .project-title a {
    color: var(--primary);
}

.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.project-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.project-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid rgba(0, 242, 254, 0.2);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.project-links {
    display: flex;
    gap: 0.75rem;
}

.project-links a {
    display: flex;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.project-links a:hover {
    color: var(--primary);
    transform: scale(1.15);
}

.project-links svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ==========================================================================
   STRONA O MNIE (ABOUT ME)
   ========================================================================== */
.about-section {
    padding: 7rem 0 5rem 0;
    width: 100%;
}

.about-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 5rem;
}

.about-story h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.about-story p {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

.fact-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fact-number {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.fact-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.about-terminal-card {
    background: #04060a;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-dim);
}

.terminal-header {
    background: rgba(13, 17, 22, 0.9);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-dot.red { background-color: #ff5f56; }
.terminal-dot.yellow { background-color: #ffbd2e; }
.terminal-dot.green { background-color: #27c93f; }

.terminal-title {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-left: 0.5rem;
}

.terminal-body {
    padding: 1.5rem;
    overflow-x: auto;
}

.terminal-body pre {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #e2e8f0;
}

.json-key { color: var(--primary); }
.json-val { color: #a0aec0; }

.terminal-footer {
    padding: 1.25rem 1.5rem;
    background: rgba(13, 17, 22, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.about-pillars-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 4rem;
}

.pillars-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.pillar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.pillar-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-active);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-dim);
}

.pillar-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-dim);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.pillar-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.pillar-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.pillar-card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ==========================================================================
   STRONA UMIEJĘTNOŚCI (SKILLS)
   ========================================================================== */
.skills-section {
    padding: 7rem 0 5rem 0;
    width: 100%;
}

.skills-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transition: var(--transition-smooth);
}

.dots-meter:has(.dot:nth-child(3).active) .dot.active {
    background: #00f2fe;
    box-shadow: 0 0 8px #00f2fe;
}
.skill-meter:has(.dot:nth-child(3).active) .meter-text {
    color: #00f2fe;
}

.dots-meter:has(.dot:nth-child(2).active):not(:has(.dot:nth-child(3).active)) .dot.active {
    background: #ffbd2e;
    box-shadow: 0 0 8px #ffbd2e;
}
.skill-meter:has(.dot:nth-child(2).active):not(:has(.dot:nth-child(3).active)) .meter-text {
    color: #ffbd2e;
}

.dots-meter:has(.dot:nth-child(1).active):not(:has(.dot:nth-child(2).active)) .dot.active {
    background: #a855f7;
    box-shadow: 0 0 8px #a855f7;
}
.skill-meter:has(.dot:nth-child(1).active):not(:has(.dot:nth-child(2).active)) .meter-text {
    color: #a855f7;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 2.5rem;
    margin-bottom: 5rem;
}

.skill-category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.skill-category-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-active);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-dim);
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.category-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: var(--primary-dim);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.category-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.category-header p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.skills-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.skill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(4, 6, 10, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.skill-row:hover {
    border-color: rgba(0, 242, 254, 0.3);
    background: rgba(0, 242, 254, 0.03);
}

.skill-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-right: 0.5rem;
}

.skill-meter {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.meter-text {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.dots-meter {
    display: flex;
    gap: 4px;
}

.skills-cta-banner {
    background: linear-gradient(135deg, rgba(13, 17, 22, 0.9) 0%, rgba(7, 9, 14, 0.95) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.skills-cta-banner h2 {
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.skills-cta-banner p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

/* ==========================================================================
   STRONA KONTAKTOWA
   ========================================================================== */
.contact-section {
    padding: 7rem 0 5rem 0;
    width: 100%;
    overflow-x: hidden;
}

.contact-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 2.5rem;
    align-items: start;
    margin-top: 2.5rem;
}

.contact-info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-width: 0;
}

.contact-info-header h2 {
    font-size: clamp(1.25rem, 2.5vw, 1.4rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.contact-info-header p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.contact-method-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.contact-icon {
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    max-width: 48px;
    max-height: 48px;
    aspect-ratio: 1 / 1;
    background-color: var(--primary-dim);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--primary);
}

.contact-method-item > div:last-child {
    min-width: 0;
    flex: 1;
}

.contact-method-item h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.contact-method-item a,
.contact-method-item p {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    overflow-wrap: break-word;
    word-break: break-word;
}

.contact-method-item a:hover {
    color: var(--primary);
}

.status-highlight {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.contact-form-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-width: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    background-color: #04060a;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #4a5568;
}

.btn-submit {
    cursor: pointer;
    border: none;
    margin-top: 0.5rem;
    width: 100%;
}

.btn-submit:disabled {
    cursor: wait;
    opacity: 0.7;
}

.btn-submit.is-success {
    background: linear-gradient(135deg, #52e3a4 0%, #25b87b 100%);
    color: #06120d;
}

.btn-submit.is-error {
    background: linear-gradient(135deg, #ff7b8a 0%, #d94b5d 100%);
    color: #1a0508;
}

.btn-label {
    min-width: 8.5rem;
}

.form-trap {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.form-privacy-notice {
    color: var(--text-dim);
    font-size: 0.78rem;
    line-height: 1.5;
}

.form-privacy-notice a,
.footer-privacy-link {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: var(--transition-smooth);
}

.form-privacy-notice a:hover,
.footer-privacy-link:hover {
    color: var(--primary);
}

/* ==========================================================================
   STRONA BŁĘDU 404
   ========================================================================= */
.error-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem 2rem;
}

.error-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.error-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background-color: var(--primary-dim);
    color: var(--primary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    font-family: monospace;
}

.error-code {
    font-size: clamp(5.5rem, 15vw, 9rem);
    line-height: 1;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 40px var(--primary-glow);
    margin-bottom: 0.5rem;
    letter-spacing: -2px;
}

.error-title {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.error-description {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.error-buttons .btn-primary:hover .btn-icon {
    transform: rotate(180deg) translateX(4px);
}

/* ==========================================================================
   STOPKA
   ========================================================================== */
.site-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    background-color: var(--bg-main);
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.footer-socials {
    display: flex;
    gap: 1.25rem;
}

.footer-privacy-link {
    font-size: 0.9rem;
}

.footer-socials a {
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.footer-socials a:hover {
    color: var(--primary);
    transform: scale(1.15);
}

.footer-socials svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* ==========================================================================
   POLITYKA PRYWATNOŚCI
   ========================================================================== */
.privacy-section {
    padding: 7rem 0 5rem;
    width: 100%;
}

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

.privacy-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.privacy-content h2 {
    color: var(--text-main);
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
}

.privacy-content h2:first-child {
    margin-top: 0;
}

.privacy-content p,
.privacy-content li {
    color: var(--text-muted);
    font-size: 0.98rem;
}

.privacy-content p {
    margin-bottom: 1rem;
}

.privacy-content ul {
    margin: 0 0 1rem 1.25rem;
}

.privacy-content li {
    margin-bottom: 0.4rem;
}

.privacy-content a {
    color: var(--primary);
}

.privacy-updated {
    border-top: 1px solid var(--border-subtle);
    color: var(--text-dim) !important;
    font-size: 0.85rem !important;
    margin-top: 2rem;
    padding-top: 1rem;
}

/* ==========================================================================
   STRONA PROJEKTÓW (ARCHIWUM I FILTRY)
   ========================================================================== */
.projects-page-section {
    padding: 7rem 0 5rem 0;
    width: 100%;
}

.projects-page-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.project-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.filter-btn {
    background: rgba(13, 17, 22, 0.7);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.55rem 1.25rem;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.filter-btn:hover {
    color: var(--text-main);
    border-color: rgba(0, 242, 254, 0.4);
}

.filter-btn.active {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.project-card.is-hidden {
    display: none !important;
}

/* ==========================================================================
   NEONOWY PASEK POSTĘPU (TOP LOADER)
   ========================================================================== */
.top-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #00b4d8 0%, #00f2fe 100%);
    box-shadow: 0 0 12px #00f2fe, 0 0 4px #00f2fe;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.top-loader.is-loading {
    opacity: 1;
}

/* ==========================================================================
   STRONA SZCZEGÓŁÓW PROJEKTU (CASE STUDY & GALERIA)
   ========================================================================== */
.case-study-section {
    padding: 7rem 0 5rem 0;
    width: 100%;
}

.case-study-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Przycisk powrotu */
.back-to-projects {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 2rem;
    transition: var(--transition-smooth);
}

.back-to-projects:hover {
    color: var(--primary);
    transform: translateX(-4px);
}

.project-category-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background-color: var(--primary-dim);
    color: var(--primary);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 1.25rem;
}

.case-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.case-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 850px;
    margin-bottom: 2.5rem;
}

/* Pasek metadanych projektu */
.case-meta-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}

.case-action-buttons {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 3.5rem;
}

/* Główny duży zrzut ekranu */
.case-hero-image {
    width: 100%;
    height: 480px; /* Zmniejszona, stała wysokość na komputerach */
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-dim);
    margin-bottom: 3.5rem;
}

.case-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Zdjęcie wypełnia kadr bez zniekształceń */
    object-position: center;
    display: block;
}

/* Opis inżynieryjny (Grid 2-kolumnowy) */
.case-content-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3.5rem;
    align-items: start;
    margin-bottom: 5rem;
}

.case-text-block h2 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.case-text-block h2:first-child {
    margin-top: 0;
}

.case-text-block p {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.case-bullet-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.case-bullet-list li {
    font-size: 0.98rem;
    color: var(--text-dim);
    line-height: 1.6;
    position: relative;
    padding-left: 1.5rem;
}

.case-bullet-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.case-bullet-list strong {
    color: var(--text-main);
}

/* Pasek boczny ze statystykami */
.case-sidebar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.case-sidebar-card h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 1.25rem;
}

.case-metric {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.case-metric:last-of-type {
    border-bottom: none;
}

.metric-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   PŁYWAJĄCA GALERIA / SLIDER (OBSŁUGA DOWOLNEJ LICZBY ZDJĘĆ)
   ========================================================================== */
.case-gallery-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 4rem;
}

.gallery-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.gallery-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.gallery-subtitle {
    font-size: 0.95rem;
    color: var(--text-dim);
}

/* Kontrolki nawigacyjne (Licznik + Strzałki) */
.gallery-nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.gallery-counter {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    background: var(--primary-dim);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 242, 254, 0.2);
    font-weight: 700;
}

.gallery-arrows {
    display: flex;
    gap: 0.5rem;
}

.gallery-arrow-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.gallery-arrow-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Pływający tor ze slajdami */
.gallery-slider-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.5rem 0 1.5rem 0;
    -webkit-overflow-scrolling: touch;

    /* 1. Ukrycie scrollbara w Firefox i IE */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 2. Całkowite wyłączenie paska w Chrome, Edge, Safari i Opera */
.gallery-slider-track::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.gallery-slider-track::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.2);
    border-radius: 4px;
}

/* Karta pojedynczego zrzutu (slajd) */
.gallery-slide {
    flex: 0 0 78%;
    max-width: 920px;
    scroll-snap-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.gallery-slide.is-portrait {
    flex-basis: 42%;
    max-width: 520px;
}

.gallery-slide:hover {
    border-color: var(--border-active);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px var(--primary-dim);
}

.gallery-slide img {
    width: 100%;
    height: 440px;
    object-fit: contain;
    background: var(--bg-main);
    display: block;
}

.gallery-caption {
    padding: 1.1rem 1.5rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(13, 17, 22, 0.6);
}

/* ==========================================================================
   PRZYCISKI W PANELU METRYK I POWIĘKSZANIE ZDJĘĆ (LIGHTBOX)
   ========================================================================== */

/* Przyciski pod metrykami */
.case-sidebar-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.hidden-honeypot {
    display: none;
}

.icon-rotated-180 {
    transform: rotate(180deg);
}

.case-stack-title {
    margin-top: 2rem;
}

.case-stack-tags {
    margin-bottom: 2rem;
}

.cta-banner-spaced {
    margin-top: 5rem;
}

.skills-grid-spaced {
    margin-top: 2rem;
}

/* Wskaźnik, że zdjęcie można kliknąć i powiększyć */
.gallery-slide {
    cursor: zoom-in;
}

.gallery-slide:focus-visible {
    outline: 1px solid var(--primary);
    outline-offset: 4px;
}

/* Pełnoekranowy modal powiększenia (Lightbox) */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.is-active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 1300px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transform-origin: center center;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 30px var(--primary-dim);
}

.lightbox-caption {
    margin-top: 1.25rem;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

/* Przycisk zamknięcia (krzyżyk) */
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.lightbox-close:hover {
    color: var(--primary);
    transform: scale(1.15);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border: 3px solid var(--border-subtle);
    border-radius: 50%;
    background: rgba(7, 9, 14, 0.8);
    color: var(--text-main);
    font-size: 0;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.lightbox-nav::before {
    content: '';
    display: block;
    width: 0.65rem;
    height: 0.65rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.lightbox-nav-prev::before {
    transform: rotate(-135deg);
    margin-left: 0.25rem;
}

.lightbox-nav-next::before {
    transform: rotate(45deg);
    margin-right: 0.25rem;
}

.lightbox-nav:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

.lightbox-nav.is-navigating {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
    box-shadow: 0 0 22px var(--primary-glow);
}

.lightbox-nav-prev {
    left: 2.5rem;
}

.lightbox-nav-next {
    right: 2.5rem;
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden; /* KLUCZOWE: Całkowicie wyłącza fokus z ukrytego okna */
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.is-active {
    opacity: 1;
    visibility: visible; /* Pokazuje okno i włącza interakcję */
    pointer-events: auto;
}

.case-study-section .gallery-arrow-btn {
        font-size: 1.5rem;
    }

/* ==========================================================================
   CYBERPUNKOWE OŻYWIENIE TŁA (ANIMACJE I POŚWIATY)
   ========================================================================== */

/* 1. Pulsująca poświata po lewej stronie */
body::before {
    content: '';
    position: fixed;
    top: 15%;
    left: -120px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, rgba(7, 9, 14, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: sidePulseLeft 10s infinite ease-in-out;
}

/* 2. Pulsująca poświata po prawej stronie */
body::after {
    content: '';
    position: fixed;
    bottom: 10%;
    right: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.07) 0%, rgba(7, 9, 14, 0) 70%);
    pointer-events: none;
    z-index: 0;
    animation: sidePulseRight 12s infinite ease-in-out;
}

/* Animacje oddychania poświat */
@keyframes sidePulseLeft {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(30px, 50px) scale(1.2);
        opacity: 1;
    }
}

@keyframes sidePulseRight {
    0%, 100% {
        transform: translate(0, 0) scale(1.1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-40px, -40px) scale(0.9);
        opacity: 0.3;
    }
}

/* 3. Płynne wejście elementów (subtelne podnoszenie się sekcji) */
section {
    animation: fadeInSection 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   CYBERPUNKOWE PŁYWAJĄCE CZĄSTKI W TLE
   ========================================================================== */
.cyber-particle {
    position: fixed;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none; /* KLUCZOWE: Myszka "przenika" przez cząstki */
    z-index: -1;          /* KLUCZOWE: Zawsze pod wszystkimi elementami strony */
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
    animation: floatUpward linear infinite;
}

@keyframes floatUpward {
    0% {
        transform: translateY(105vh) translateX(0);
        opacity: 0;
    }
    20% {
        opacity: 0.5;
    }
    80% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-10vh) translateX(30px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .lightbox-modal {
        padding: 1rem;
    }

    .lightbox-content img {
        touch-action: none;
        transform-origin: center center;
        will-change: transform;
    }

    .lightbox-close {
        top: 1rem;
        right: 1.5rem;
        font-size: 2.5rem;
    }

    .lightbox-nav {
        display: none;
    }

    .lightbox-caption {
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   RESPONSYWNOŚĆ CASE STUDY NA TELEFONY
   ========================================================================== */
@media (max-width: 968px) {
    .case-study-section {
        padding: 6rem 0 4rem 0;
    }

    .case-study-container {
        padding: 0 1rem;
    }

    .case-meta-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .case-action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .case-action-buttons .btn {
        width: 100%;
    }

    .case-content-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    /* Dopasowanie karuzeli na smartfony */
    .gallery-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .gallery-nav-controls {
        width: 100%;
        justify-content: space-between;
    }

    .case-study-section .gallery-slide {
        flex: 0 0 100%;
    }

    .case-study-section .gallery-slide.is-portrait {
        flex-basis: 100%;
    }

    .case-study-section .gallery-slider-track {
        gap: 1rem;
    }

    .gallery-slide img {
        height: 230px;
    }

    .projects-page-section {
        padding: 6rem 0 4rem 0;
    }

    .projects-page-container {
        padding: 0 1rem;
    }
}

@media (max-width: 968px) {
    .projects-page-section {
        padding: 6rem 0 4rem 0;
    }

    .projects-page-container {
        padding: 0 1rem;
    }
}

/* ==========================================================================
   RESPONSYWNOŚĆ (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 968px) {
    .contact-section,
    .about-section,
    .skills-section {
        padding: 6rem 0 4rem 0;
    }

    .contact-container,
    .about-container,
    .skills-container {
        padding: 0 1rem;
    }

    .contact-container .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-left: -1rem;
    width: calc(100% + 2rem);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-info-card,
    .contact-form-container {
        padding: 1.75rem 1.25rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-bottom: 3.5rem;
    }

    .about-facts-grid {
        grid-template-columns: 1fr;
    }

    .pillars-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pillar-card {
        padding: 1.5rem;
    }

    .skills-container .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 3.5rem;
        margin-left: -1rem;
        width: calc(100% + 2rem);
    }

    .skill-category-card {
        padding: 1.75rem 1.25rem;
    }

    .skills-cta-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .terminal-body {
        padding: 1rem 1.1rem;
        overflow-x: hidden;
    }

    .terminal-body pre {
        font-size: clamp(0.74rem, 2.6vw, 0.82rem);
        line-height: 1.55;
    }
    
    .case-hero-image {
        height: 230px; /* Zgrabny banner na małym ekranie */
        margin-bottom: 2.5rem;
    }
    
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background-color: #0b0e14;
        border-left: 1px solid var(--border-subtle);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        z-index: 1000;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    }

    .nav-links.is-open {
        display: flex;
        animation: slideIn 0.3s ease forwards;
    }

    @keyframes slideIn {
        from {
            transform: translateX(100%);
        }
        to {
            transform: translateX(0);
        }
    }

    .menu-toggle.is-active .hamburger {
        background-color: transparent;
    }
    .menu-toggle.is-active .hamburger::before {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.is-active .hamburger::after {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Na telefonie: tekst z przyciskami na górze, terminal z kodem pod spodem */
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
        padding: 0 1rem;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    /* Pełna responsywność okna kodu na smartfony */
    .hero-image {
        width: 100%;
        justify-content: center;
    }

    .code-window {
        max-width: 100%;
        border-radius: 12px;
    }

    .window-header {
        padding: 0.65rem 1rem;
    }

    .window-filename {
        font-size: 0.78rem;
        margin-left: auto;
        white-space: nowrap;
    }

    .window-badge {
        display: none;
    }

    .window-body {
        padding: 1rem 1.1rem;
        height: 250px; /* Stała wysokość mieści Wszelkie 3 sceny bez rozpychania */
        overflow: hidden;
    }

    .window-body pre {
        font-size: clamp(0.74rem, 2.6vw, 0.82rem);
        line-height: 1.55;
    }

    .buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.85rem;
    }

    .btn {
        width: 100%;
    }

    .projects-page-container .projects-grid {
        grid-template-columns: 1fr;
        margin-left: -1rem;
        width: calc(100% + 2rem);
    }

    .projects-section .projects-grid {
        grid-template-columns: 1fr;
        margin-left: -2rem;
        width: calc(100% + 4rem);
    }

    .case-study-section .case-content-grid > * {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .case-study-section .case-text-block,
    .case-study-section .case-text-block h2,
    .case-study-section .case-text-block p,
    .case-study-section .case-text-block li,
    .case-study-section .case-sidebar-card,
    .case-study-section .gallery-caption {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .case-study-section .case-gallery-section {
        padding-top: 0;
    }

    .case-study-section .case-sidebar-actions .btn-icon {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
    }

    .footer-container {
        flex-direction: column-reverse;
        gap: 1.5rem;
        text-align: center;
    }

    .case-study-container .case-header .case-meta-bar {
        margin-left: -1rem;
        width: calc(100% + 2rem);
    }

    .case-study-container .case-hero-image {
        margin-left: -1rem;
        width: calc(100% + 2rem);
    }

    .case-study-container .case-gallery-section .gallery-slider-wrapper {
        margin-left: -1rem;
        width: calc(100% + 2rem);
    }
}

/* --- Główny układ nagłówka --- */
.section-header.with-avatar {
    display: flex;
    align-items: center; /* Wyrównuje w pionie środek zdjęcia ze środkiem tekstu */
    gap: 24px; /* Odstęp między zdjęciem a tekstem */
    margin-bottom: 40px; /* Odstęp od dolnej sekcji z tekstem */
}

/* --- "Okno", w którym znajduje się zdjęcie --- */
.header-avatar-wrapper {
    width: 110px; /* Szerokość zdjęcia */
    height: 110px; /* Wysokość zdjęcia */
    flex-shrink: 0; /* Zapobiega ściskaniu zdjęcia przez tekst */
    border-radius: 16px; /* Nowoczesny, zaokrąglony kwadrat */
    border: 2px solid #333; /* Subtelna ramka (możesz zamienić na swój cyjan: #00f2fe) */
    overflow: hidden; /* KLUCZOWE: Ucina rogi i przybliżone elementy */
}

/* --- Samo zdjęcie + Zoom (Styl 2) --- */
.header-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Wypełnia kadr bez zniekształceń */
    
    /* ZARZĄDZANIE ZOOMEM I POZYCJĄ: */
    transform: scale(1.3); /* Przybliża zdjęcie o 30%. Zmień np. na 1.5, żeby przybliżyć mocniej */
    object-position: 30% -10%; /* 50% (prawo-lewo), 20% (góra-dół). Zmieniaj te wartości, żeby trafić idealnie w twarz! */
}

/* --- Responsywność dla telefonów --- */
@media (max-width: 768px) {
    .section-header.with-avatar {
        flex-direction: column; /* Ustawia zdjęcie nad tekstem */
        text-align: center;
        gap: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .cyber-particle,
    .cursor {
        display: none;
    }
}