/* ========================================
   PORTFOLIO - Hubert Gosciniak
   Cyberpunk Neon Theme
   ======================================== */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c2a;
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555570;
    --neon-blue: #00d4ff;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
    --neon-gradient: linear-gradient(135deg, #00d4ff, #a855f7);
    --neon-glow: 0 0 20px rgba(0, 212, 255, 0.3), 0 0 40px rgba(168, 85, 247, 0.15);
    --neon-glow-strong: 0 0 30px rgba(0, 212, 255, 0.5), 0 0 60px rgba(168, 85, 247, 0.3);
    --border-color: rgba(255, 255, 255, 0.06);
    --nav-bg: rgba(10, 10, 15, 0.85);
    --font-heading: 'Orbitron', monospace;
    --font-body: 'Space Grotesk', sans-serif;
    --font-accent: 'Rajdhani', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f0f0f5;
    --bg-secondary: #e8e8f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5ff;
    --text-primary: #1a1a2e;
    --text-secondary: #555577;
    --text-muted: #8888aa;
    --neon-blue: #0088cc;
    --neon-purple: #7c3aed;
    --neon-pink: #db2777;
    --neon-gradient: linear-gradient(135deg, #0088cc, #7c3aed);
    --neon-glow: 0 0 15px rgba(0, 136, 204, 0.2), 0 0 30px rgba(124, 58, 237, 0.1);
    --neon-glow-strong: 0 0 20px rgba(0, 136, 204, 0.35), 0 0 45px rgba(124, 58, 237, 0.2);
    --border-color: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(240, 240, 245, 0.9);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) var(--bg-secondary);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: none;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--neon-blue); border-radius: 3px; }

a { color: var(--neon-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--neon-purple); }

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

/* --- Custom Cursor --- */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, border-color 0.2s;
    mix-blend-mode: difference;
}

.cursor.hover {
    width: 50px;
    height: 50px;
    border-color: var(--neon-purple);
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--neon-blue);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    filter: blur(2px);
    transition: opacity 0.3s;
}

/* --- Particles Canvas --- */
#particlesCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
}

.nav.scrolled {
    padding: 0.6rem 2rem;
    box-shadow: var(--neon-glow);
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    cursor: none;
    transition: color var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-gradient);
    transition: width var(--transition);
}

.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: all var(--transition);
}

.theme-toggle:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--neon-glow);
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* --- Sections --- */
.section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 3rem;
}

.section-number {
    font-family: var(--font-accent);
    font-size: 1rem;
    color: var(--neon-blue);
    display: block;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
}

/* --- Hero --- */
.hero {
    padding: 0 2rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero-photo {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.hero-avatar {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.3), 0 0 60px rgba(0, 168, 255, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0, 168, 255, 0.5), 0 0 80px rgba(0, 168, 255, 0.2);
}

@media (max-width: 768px) {
    .hero-avatar {
        width: 160px;
        height: 160px;
    }
}

.hero-greeting {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hero-line {
    width: 40px;
    height: 2px;
    background: var(--neon-gradient);
}

.hero-greeting-text {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    color: var(--neon-blue);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.hero-name {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-name span {
    display: block;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text::before {
    color: var(--neon-blue);
    z-index: -1;
}

.glitch-text::after {
    color: var(--neon-purple);
    z-index: -1;
}

.glitch-text.active::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    opacity: 0.8;
}

.glitch-text.active::after {
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
    opacity: 0.8;
}

@keyframes glitch-1 {
    0% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, -1px); }
    20% { clip-path: inset(92% 0 1% 0); transform: translate(1px, 2px); }
    40% { clip-path: inset(43% 0 1% 0); transform: translate(-1px, 3px); }
    60% { clip-path: inset(25% 0 58% 0); transform: translate(3px, -1px); }
    80% { clip-path: inset(54% 0 7% 0); transform: translate(-3px, 2px); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(65% 0 13% 0); transform: translate(3px, 1px); }
    20% { clip-path: inset(15% 0 62% 0); transform: translate(-2px, -1px); }
    40% { clip-path: inset(82% 0 2% 0); transform: translate(1px, -3px); }
    60% { clip-path: inset(31% 0 28% 0); transform: translate(-3px, 2px); }
    80% { clip-path: inset(6% 0 72% 0); transform: translate(2px, 1px); }
    100% { clip-path: inset(44% 0 39% 0); transform: translate(-1px, -2px); }
}

.hero-role {
    font-family: var(--font-accent);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 600;
    color: var(--neon-blue);
    margin-bottom: 1.5rem;
    min-height: 2.5rem;
}

.typing-cursor {
    animation: blink 1s infinite;
    color: var(--neon-purple);
    font-weight: 300;
}

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

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 4px;
    border: none;
    cursor: none;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--neon-gradient);
    color: #fff;
    box-shadow: var(--neon-glow);
}

.btn-primary:hover {
    box-shadow: var(--neon-glow-strong);
    transform: translateY(-2px);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--neon-glow);
    color: var(--neon-blue);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-family: var(--font-accent);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: float 3s ease-in-out infinite;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--neon-gradient);
    animation: scroll-line 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes scroll-line {
    0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

/* --- Career Trail --- */
.career-trail {
    position: relative;
    z-index: 1;
    padding: 6rem 0 2rem;
    overflow: hidden;
}

.trail-subtitle {
    font-family: var(--font-body);
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: -2rem;
    margin-bottom: 2rem;
}

.trail-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 1200 / 800;
}

.trail-svg {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* Mountain layers */
.mountain-back {
    fill: #0c0f18;
}
.mountain-mid {
    fill: #0e1320;
}
.mountain-front {
    fill: #111828;
}

[data-theme="light"] .mountain-back {
    fill: rgba(180, 200, 230, 0.5);
}
[data-theme="light"] .mountain-mid {
    fill: rgba(160, 185, 220, 0.45);
}
[data-theme="light"] .mountain-front {
    fill: rgba(140, 170, 210, 0.4);
}

/* Trail path */
.trail-path {
    stroke: var(--neon-blue);
    filter: drop-shadow(0 0 3px var(--neon-blue));
}

.trail-path-glow {
    stroke: var(--neon-blue);
    opacity: 0.15;
    filter: blur(6px);
}

/* Trail dots */
.trail-dot {
    fill: var(--bg-primary);
    stroke: var(--neon-blue);
    stroke-width: 2;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.trail-dot.visible {
    opacity: 1;
}

/* Summit flag */
.summit-flag {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.summit-flag.visible {
    opacity: 1;
}

/* Hiker dot */
.trail-hiker {
    fill: var(--neon-blue);
    filter: drop-shadow(0 0 8px var(--neon-blue)) drop-shadow(0 0 16px var(--neon-blue));
    transition: cx 0.05s linear, cy 0.05s linear;
}

/* Milestone labels */
.trail-milestones {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.trail-milestone {
    position: absolute;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    pointer-events: auto;
}

.trail-milestone.visible {
    opacity: 1;
    transform: translateY(0);
}

.milestone-card {
    background: rgba(16, 16, 28, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    backdrop-filter: blur(8px);
    min-width: 160px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.milestone-card:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--neon-glow);
}

[data-theme="light"] .milestone-card {
    background: rgba(255, 255, 255, 0.9);
}

.milestone-summit {
    border-color: var(--neon-blue);
    box-shadow: var(--neon-glow);
}

.milestone-summit .milestone-year {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.milestone-year {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    color: var(--neon-blue);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
}

.milestone-card h4 {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-primary);
    margin: 0.2rem 0;
    line-height: 1.3;
}

.milestone-card p {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Responsive trail */
@media (max-width: 768px) {
    .career-trail {
        padding: 4rem 0 1rem;
    }

    .trail-wrapper {
        aspect-ratio: 3 / 2;
    }

    .milestone-card {
        padding: 0.3rem 0.5rem;
        min-width: 90px;
    }

    .milestone-card h4 {
        font-size: 0.6rem;
    }

    .milestone-card p {
        display: none;
    }

    .milestone-year {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .trail-wrapper {
        aspect-ratio: 3 / 2;
    }

    .milestone-card {
        min-width: 70px;
        padding: 0.25rem 0.4rem;
    }

    .milestone-card h4 {
        font-size: 0.55rem;
    }
}

/* --- About --- */
.about {
    padding: 6rem 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

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

.about-tech-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.tech-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.tech-name {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.tech-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.tech-fill {
    height: 100%;
    width: 0;
    background: var(--neon-gradient);
    border-radius: 2px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.tech-fill.animated {
    width: var(--fill);
}

/* --- Methodology Section --- */
.methodology {
    padding: 6rem 0;
    min-height: auto;
}

.method-subtitle {
    color: var(--text-secondary);
    font-family: var(--font-accent);
    font-size: 1.1rem;
    margin-top: -2rem;
    margin-bottom: 4rem;
    letter-spacing: 0.03em;
}

.method-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* Central vertical line */
.method-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.method-line-fill {
    width: 100%;
    height: 0%;
    background: var(--neon-gradient);
    transition: height 0.1s;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

/* Steps */
.method-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 3rem;
    position: relative;
}

.step-node {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--neon-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    flex-shrink: 0;
    box-shadow: var(--neon-glow);
    transition: all 0.5s;
}

.step-node span {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 900;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.method-step.visible .step-node {
    transform: scale(1.15);
    box-shadow: var(--neon-glow-strong);
}

/* Step card */
.step-card {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    width: calc(50% - 45px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    perspective: 800px;
}

.step-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--neon-glow);
    transform: translateY(-3px);
}

.step-left {
    margin-right: auto;
}

.step-right {
    margin-left: auto;
}

/* 3D rotating icon */
.step-3d-wrap {
    perspective: 400px;
    flex-shrink: 0;
}

.step-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: icon-float 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

.step-icon svg {
    width: 24px;
    height: 24px;
    color: var(--neon-blue);
}

.method-step:nth-child(even) .step-icon {
    animation-delay: -3s;
}

@keyframes icon-float {
    0%, 100% {
        transform: rotateY(0deg) rotateX(0deg) translateY(0);
    }
    25% {
        transform: rotateY(10deg) rotateX(5deg) translateY(-3px);
    }
    50% {
        transform: rotateY(-5deg) rotateX(-5deg) translateY(0);
    }
    75% {
        transform: rotateY(-10deg) rotateX(3deg) translateY(-2px);
    }
}

.step-content {
    flex: 1;
}

.step-badge {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--neon-purple);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.4rem;
}

.step-content h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

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

.step-tags span {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: var(--neon-purple);
    border-radius: 4px;
    font-weight: 500;
}

/* Certyfikaty */
.certs-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition);
}

.cert-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
}

.cert-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--neon-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

.cert-info h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.cert-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cert-date {
    font-family: var(--font-accent);
    font-size: 0.7rem;
    color: var(--neon-blue);
    font-weight: 600;
}

/* Methodology responsive */
@media (max-width: 768px) {
    .method-line { left: 25px; }
    .method-step {
        flex-direction: row !important;
        justify-content: flex-start;
        gap: 1rem;
        padding-left: 0;
    }
    .step-node {
        width: 40px;
        height: 40px;
        order: -1;
    }
    .step-card {
        width: 100%;
        margin: 0 !important;
    }
    .step-card.step-left,
    .step-card.step-right {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .step-3d-wrap { display: none; }
    .certs-row { flex-direction: column; }
}

/* --- Projects Trigger --- */
.projects-trigger {
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 0;
}

.projects-intro {
    color: var(--text-muted);
    font-family: var(--font-accent);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

/* --- 3D Journey --- */
.projects-journey {
    position: relative;
    height: 800vh;
    z-index: 1;
    background: var(--bg-primary);
}

#journeyCanvas {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

.journey-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
}

.journey-overlay.active {
    opacity: 1;
}

.journey-progress {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 200px;
    background: var(--border-color);
    border-radius: 2px;
}

.journey-progress-bar {
    width: 100%;
    height: 0%;
    background: var(--neon-gradient);
    border-radius: 2px;
    transition: height 0.1s;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.journey-cards {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.journey-cards.active {
    opacity: 1;
}

.journey-card {
    position: absolute;
    width: 500px;
    max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    opacity: 0;
    transform: translateZ(-500px) rotateY(15deg);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.journey-card.active {
    opacity: 1;
    transform: translateZ(0) rotateY(0deg);
    pointer-events: auto;
    box-shadow: var(--neon-glow);
}

.journey-card.exit-left {
    opacity: 0;
    transform: translateX(-120%) translateZ(-200px) rotateY(-30deg);
}

.journey-card.exit-right {
    opacity: 0;
    transform: translateX(120%) translateZ(-200px) rotateY(30deg);
}

.card-glow {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 12px;
    background: var(--neon-gradient);
    opacity: 0;
    z-index: -1;
    filter: blur(15px);
    transition: opacity var(--transition);
}

.journey-card.active .card-glow {
    opacity: 0.15;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.card-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-tag {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.card-tech span {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    padding: 0.25rem 0.7rem;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: var(--neon-blue);
    border-radius: 4px;
    font-weight: 500;
}

.card-features {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.card-features span {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-left: 1rem;
    position: relative;
}

.card-features span::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--neon-purple);
    font-family: var(--font-heading);
    font-size: 0.7rem;
}

/* --- Card Demo Button --- */
.card-demo {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-demo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    border-radius: 6px;
    cursor: none;
    transition: all var(--transition);
}

.btn-demo:hover {
    background: rgba(0, 212, 255, 0.15);
    box-shadow: var(--neon-glow);
    transform: translateY(-1px);
}

.demo-pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: demo-pulse 2s ease-in-out infinite;
}

@keyframes demo-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* --- Floating AI Button --- */
.ai-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.4rem;
    background: var(--bg-card);
    border: 1px solid var(--neon-blue);
    border-radius: 50px;
    color: var(--neon-blue);
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: none;
    transition: all var(--transition);
    box-shadow: var(--neon-glow);
}

.ai-fab:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: var(--neon-glow-strong);
    transform: translateY(-3px);
}

.ai-fab svg {
    flex-shrink: 0;
}

.ai-fab-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    animation: demo-pulse 2s ease-in-out infinite;
}

.ai-fab-label {
    white-space: nowrap;
}

/* --- AI Chat Modal --- */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.ai-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ai-modal {
    width: 500px;
    max-width: 95vw;
    max-height: 80vh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--neon-glow-strong);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-modal-overlay.active .ai-modal {
    transform: scale(1) translateY(0);
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.ai-modal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ai-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: demo-pulse 2s ease-in-out infinite;
}

.ai-modal-limit {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    color: var(--neon-blue);
    font-weight: 600;
}

.ai-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: none;
    padding: 0;
    line-height: 1;
    transition: color var(--transition);
}

.ai-modal-close:hover {
    color: var(--neon-pink);
}

/* Restore normal cursor inside AI modal */
.ai-modal-overlay, .ai-modal, .ai-modal * {
    cursor: auto !important;
}

body.ai-modal-open .cursor,
body.ai-modal-open .cursor-trail,
body.ai-modal-open #blobTrailCanvas {
    display: none !important;
}

body.ai-modal-open {
    cursor: auto !important;
}

/* Usage bar & info */
.ai-usage-bar {
    height: 3px;
    background: var(--bg-primary);
    width: 100%;
}

.ai-usage-fill {
    height: 100%;
    width: 100%;
    background: var(--neon-gradient);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.ai-usage-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 212, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-accent);
    font-size: 0.78rem;
}

#aiUsageText {
    color: var(--text-secondary);
}

#aiUsageText strong {
    color: var(--neon-blue);
    font-weight: 700;
}

.ai-usage-note {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.ai-usage-info.warning #aiUsageText strong {
    color: var(--neon-pink);
}

.ai-usage-info.depleted {
    background: rgba(236, 72, 153, 0.05);
}

.ai-usage-info.depleted #aiUsageText strong {
    color: var(--neon-pink);
}

.ai-usage-info.depleted .ai-usage-note {
    color: var(--neon-pink);
}

/* Chat area */
.ai-chat {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
    max-height: 50vh;
}

.ai-message {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.ai-message.ai-user {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 900;
    flex-shrink: 0;
}

.ai-bot .ai-avatar {
    background: var(--neon-gradient);
    color: #fff;
}

.ai-user .ai-avatar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.ai-bubble {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.ai-bot .ai-bubble {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.ai-user .ai-bubble {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-top-right-radius: 4px;
    color: var(--text-primary);
}

/* Streaming dots */
.ai-streaming {
    display: flex;
    gap: 4px;
    padding: 1rem 1.2rem;
}

.ai-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-blue);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.ai-input-form {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.ai-input {
    flex: 1;
    padding: 0.7rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    cursor: none;
    transition: border-color var(--transition);
}

.ai-input:focus {
    border-color: var(--neon-blue);
}

.ai-input:disabled {
    opacity: 0.5;
}

.ai-send {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neon-gradient);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: none;
    transition: all var(--transition);
    flex-shrink: 0;
}

.ai-send:hover:not(:disabled) {
    box-shadow: var(--neon-glow);
    transform: scale(1.05);
}

.ai-send:disabled {
    opacity: 0.4;
}

/* --- Contact --- */
.contact {
    padding: 6rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--neon-blue);
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all var(--transition);
}

.contact-email:hover {
    border-color: var(--neon-blue);
    box-shadow: var(--neon-glow);
    color: var(--neon-blue);
}

.contact-email-icon {
    font-size: 1.5rem;
    font-weight: 900;
    background: var(--neon-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    outline: none;
    transition: all var(--transition);
    cursor: none;
    resize: none;
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 0;
    font-family: var(--font-accent);
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.8rem;
    font-size: 0.75rem;
    color: var(--neon-blue);
}

.form-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-gradient);
    transition: width var(--transition);
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line {
    width: 100%;
}

.btn-submit {
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor, .cursor-trail { display: none; }

    .nav-links { display: none; }

    .hero-name {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .journey-card {
        width: 90vw;
        padding: 1.5rem;
    }

    .journey-progress { display: none; }
}

@media (max-width: 480px) {
    .hero { padding: 0 1rem; }
    .container { padding: 0 1rem; }
    .nav { padding: 0.8rem 1rem; }

    .card-title { font-size: 1.1rem; }
    .card-desc { font-size: 0.85rem; }
}

/* ===== CERTYFIKATY ===== */
.certyfikaty {
    padding: 4rem 0;
}
.certyfikaty .container {
    max-width: 900px !important;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}
.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin: 2rem auto 0;
}
.cert-item {
    /* kontener w orientacji pionowej */
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1510 / 2104;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    padding: 0;
    cursor: zoom-in;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.cert-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.55));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.cert-item:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7);
}
.cert-item:hover::after { opacity: 1; }
.cert-item img {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    /* po obrocie 90deg szerokość obrazu staje się wysokością kontenera */
    width: calc(100% * (2104 / 1510));
    height: auto;
    transform: translate(-50%, -50%) rotate(-90deg);
    transform-origin: center center;
    transition: transform 0.6s ease;
}
.cert-item:hover img {
    transform: translate(-50%, -50%) rotate(-90deg) scale(1.04);
}

/* Lightbox */
.cert-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 2rem;
}
.cert-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.cert-lightbox img {
    /* obrót o 90° w lewo — obraz poziomy staje się pionowy.
       Po obrocie wymiary zamieniają się miejscami, więc limity również. */
    max-width: 90vh;
    max-height: 90vw;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8);
    transform: rotate(-90deg) scale(0.92);
    transition: transform 0.35s ease;
    transform-origin: center center;
}
.cert-lightbox.active img {
    transform: rotate(-90deg) scale(1);
}
.cert-lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.cert-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    transform: rotate(-90deg);
}
@media (max-width: 1100px) {
    .cert-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
    .certyfikaty .container { padding: 0 1.5rem; }
}
@media (max-width: 700px) {
    .certyfikaty { padding: 3rem 0; }
    .cert-grid { grid-template-columns: 1fr; gap: 1rem; max-width: 280px; margin-top: 1.5rem; }
    .cert-lightbox-close { top: 1rem; right: 1rem; width: 42px; height: 42px; }
}
