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

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1424;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --text-primary: #f5f7fa;
    --text-secondary: #a8b0c2;
    --text-muted: #6b7385;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px var(--accent-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

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

/* === Scroll progress bar === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    transform-origin: 0 50%;
    transform: scaleX(0);
    z-index: 200;
    box-shadow: 0 0 12px var(--accent-glow);
    pointer-events: none;
}

/* === Particle canvas === */
.particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* === Navbar === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 14, 26, 0.7);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    background: rgba(10, 14, 26, 0.85);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: var(--transition);
}

.logo:hover {
    transform: translateY(-1px);
}

.logo-bracket {
    color: var(--accent-light);
}

.logo-text {
    color: var(--text-primary);
}

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

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

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

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

.nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-ghost:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-light);
}

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1rem;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: #6366f1;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    top: 30%;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: #ec4899;
    bottom: -100px;
    left: 30%;
    animation-delay: -14s;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    text-align: center;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--gradient-soft);
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-light);
    margin-bottom: 2rem;
    opacity: 0;
}

/* === Hero 3D Text === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hero-3d-stage {
    perspective: 1200px;
    perspective-origin: 50% 50%;
    margin: 0 0 1.5rem;
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: clamp(120px, 18vw, 200px);
}

.hero-3d-text {
    position: relative;
    display: inline-block;
    transform-style: preserve-3d;
    animation: rotate3d 14s linear 2.8s infinite both;
    transform: rotateY(0deg) rotateX(8deg);
    font-family: 'Inter', sans-serif;
    font-size: clamp(3rem, 13vw, 9rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    user-select: none;
    will-change: transform;
}

.hero-3d-text .layer {
    display: block;
    transform-style: preserve-3d;
    color: hsl(245, 65%, calc(55% - var(--i) * 2.5%));
    white-space: nowrap;
    text-shadow: 0 0 1px currentColor;
}

.hero-3d-text .layer-depth {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateZ(calc(var(--i) * -3px));
    pointer-events: none;
    opacity: 0;
}

.hero-3d-text .layer-front {
    position: relative;
    z-index: 50;
    transform-style: preserve-3d;
}

.hero-3d-text .layer-front .letter {
    display: inline-block;
    transform-style: preserve-3d;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 4px 20px rgba(139, 92, 246, 0.5));
    opacity: 0;
    will-change: transform, opacity;
}

@keyframes rotate3d {
    0% {
        transform: rotateY(0deg) rotateX(8deg);
    }
    50% {
        transform: rotateY(180deg) rotateX(8deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(8deg);
    }
}

.hero-tagline {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
    opacity: 0;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 auto 2.5rem;
    max-width: 650px;
    opacity: 0;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
    justify-content: center;
}

.hero-actions .btn {
    opacity: 0;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-stats .stat {
    opacity: 0;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 40px;
    border: 2px solid var(--border-strong);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-indicator span {
    width: 4px;
    height: 8px;
    background: var(--accent-light);
    border-radius: 2px;
    animation: scroll 2s ease-in-out infinite;
}

@keyframes scroll {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(12px);
        opacity: 0.3;
    }
}

/* === Sections === */
section {
    padding: 6rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

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

.about-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.about-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    transform: translateX(5px);
}

.about-card-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.about-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.about-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* === Skills === */
.skills {
    background: var(--bg-secondary);
    position: relative;
}

.skills::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-soft);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.skill-card > * {
    position: relative;
    z-index: 1;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-card.featured {
    background: var(--gradient-soft);
    border-color: var(--accent-light);
}

.skill-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    margin-bottom: 1.25rem;
}

.skill-icon svg {
    width: 28px;
    height: 28px;
}

.skill-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.skill-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tags li {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
}

/* === Experience === */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.exp-item {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    position: relative;
}

.exp-item:hover {
    transform: translateY(-3px);
    border-color: var(--accent-light);
}

.exp-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.exp-item h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.exp-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* === Portfolio === */
.portfolio {
    background: var(--bg-secondary);
    position: relative;
}

.portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
}

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

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.project-card:hover .project-thumb::after {
    opacity: 1;
}

.project-card:hover .project-thumb {
    transform: scale(1.02);
}

.project-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    transition: var(--transition);
    background-size: cover;
    background-position: center;
}

.project-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(10, 14, 26, 0.85) 100%);
    z-index: 1;
}

.project-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-soft);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

/* Placeholder thumbs — gradientowe tła. Można je podmienić na background-image: url(...) */
.project-thumb-1 {
    background: linear-gradient(135deg, #6366f1 0%, #1e1b4b 100%);
}

.project-thumb-1::after {
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 30%);
    opacity: 1;
}

.project-thumb-2 {
    background: linear-gradient(135deg, #ec4899 0%, #831843 100%);
}

.project-thumb-2::after {
    background-image:
        repeating-linear-gradient(45deg, transparent 0, transparent 20px, rgba(255,255,255,0.05) 20px, rgba(255,255,255,0.05) 21px);
    opacity: 1;
}

.project-thumb-3 {
    background: linear-gradient(135deg, #8b5cf6 0%, #4c1d95 100%);
}

.project-thumb-3::after {
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2) 0%, transparent 25%),
        radial-gradient(circle at 30% 70%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 70% 30%, rgba(255,255,255,0.1) 0%, transparent 20%);
    opacity: 1;
}

.project-thumb-4 {
    background: linear-gradient(135deg, #0ea5e9 0%, #0c4a6e 100%);
}

.project-thumb-4::after {
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgba(255,255,255,0.06) 30px, rgba(255,255,255,0.06) 31px),
        repeating-linear-gradient(90deg, transparent 0, transparent 30px, rgba(255,255,255,0.06) 30px, rgba(255,255,255,0.06) 31px);
    opacity: 1;
}

.project-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    padding: 0.4rem 0.85rem;
    background: rgba(10, 14, 26, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

.project-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}

.project-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.project-body > p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex: 1;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-light);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: var(--transition);
    align-self: flex-start;
}

.project-link svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--text-primary);
}

.project-link:hover svg {
    transform: translate(2px, -2px);
}

.portfolio-note {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.portfolio-note a {
    color: var(--accent-light);
    font-weight: 600;
    transition: var(--transition);
    border-bottom: 1px solid transparent;
}

.portfolio-note a:hover {
    border-bottom-color: var(--accent-light);
}

/* === Contact === */
.contact {
    padding-bottom: 8rem;
}

.contact-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.05));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 4rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 50%);
    opacity: 0.3;
    pointer-events: none;
}

.contact-card > * {
    position: relative;
}

.contact-actions {
    margin: 2rem 0 3rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* === Footer === */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === Reveal 3D animation === */
section {
    perspective: 1500px;
}

.reveal {
    opacity: 0;
    transform: translate3d(0, 60px, -120px) rotateX(-20deg);
    transition: opacity 0.9s ease-out, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}

.reveal.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0);
}

/* Stagger — opóźnienie dla kart w gridach */
.skills-grid .reveal:nth-child(2),
.portfolio-grid .reveal:nth-child(2),
.experience-grid .reveal:nth-child(2) {
    transition-delay: 0.08s;
}

.skills-grid .reveal:nth-child(3),
.portfolio-grid .reveal:nth-child(3),
.experience-grid .reveal:nth-child(3) {
    transition-delay: 0.16s;
}

.skills-grid .reveal:nth-child(4),
.portfolio-grid .reveal:nth-child(4),
.experience-grid .reveal:nth-child(4) {
    transition-delay: 0.24s;
}

.skills-grid .reveal:nth-child(5),
.portfolio-grid .reveal:nth-child(5) {
    transition-delay: 0.32s;
}

.skills-grid .reveal:nth-child(6) {
    transition-delay: 0.4s;
}

/* === 3D Tilt cards === */
.tilt-3d {
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out, box-shadow 0.3s ease-out;
    will-change: transform;
}

.tilt-3d > * {
    transform: translateZ(20px);
    transform-style: preserve-3d;
}

.tilt-3d .skill-icon,
.tilt-3d .project-thumb,
.tilt-3d .exp-number {
    transform: translateZ(40px);
}

.tilt-3d.is-tilted {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}

/* Glow podążający za kursorem na kartach */
.tilt-3d::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        420px circle at var(--mx, 50%) var(--my, 50%),
        rgba(139, 92, 246, 0.18),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.35s ease-out;
    pointer-events: none;
    z-index: 3;
}

.tilt-3d:hover::after {
    opacity: 1;
}

/* === Ripple effect na przyciskach === */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple 0.65s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Section titles — subtelne 3D wejście */
.section-header {
    perspective: 1000px;
}

.section-title {
    transform-style: preserve-3d;
}

/* === Parallax orbs reagują na scroll === */
.orb {
    will-change: transform;
}

/* === Responsive === */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    .container,
    .nav-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(10, 14, 26, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 1rem;
        width: 100%;
        text-align: center;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    section {
        padding: 4rem 0;
    }

    .contact-card {
        padding: 2.5rem 1.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }
}

/* === Legal page (Polityka prywatności) === */
.container-narrow {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 2rem;
}

.legal-hero {
    position: relative;
    padding: 9rem 0 4rem;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.legal-hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 820px;
}

.legal-hero h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 1rem 0 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.legal-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.legal-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto;
}

.legal-content {
    padding: 4rem 0 6rem;
}

.legal-section {
    margin-bottom: 3.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.legal-section:last-of-type {
    border-bottom: none;
}

.legal-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
    scroll-margin-top: 6rem;
}

.legal-section p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.legal-section ol,
.legal-section ul {
    color: var(--text-secondary);
    line-height: 1.75;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-section ol {
    list-style: decimal;
}

.legal-section ul {
    list-style: disc;
}

.legal-section li {
    margin-bottom: 0.6rem;
}

.legal-section li ul,
.legal-section li ol {
    margin-top: 0.6rem;
    margin-bottom: 0.6rem;
}

.legal-section a {
    color: var(--accent-light);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.legal-section a:hover {
    border-bottom-color: var(--accent-light);
}

.legal-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.contact-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem !important;
    list-style: none !important;
}

.contact-list li {
    margin-bottom: 0.5rem;
}

.contact-list li:last-child {
    margin-bottom: 0;
}

.legal-footer-note {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.legal-footer-note p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* === Footer nav === */
.footer-nav {
    display: flex;
    gap: 1.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.footer-nav a:hover {
    color: var(--accent-light);
}

/* === Custom cursor === */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    will-change: transform;
    transform: translate3d(-100px, -100px, 0);
}

.cursor-dot {
    width: 6px;
    height: 6px;
    margin-left: -3px;
    margin-top: -3px;
    background: #c084fc;
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.8);
    transition: opacity 0.2s, background 0.2s;
}

.cursor-outline {
    width: 36px;
    height: 36px;
    margin-left: -18px;
    margin-top: -18px;
    border: 1.5px solid rgba(192, 132, 252, 0.5);
    background: rgba(192, 132, 252, 0.04);
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                margin 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.3s,
                border-color 0.3s,
                opacity 0.2s;
}

.cursor-outline.is-hovering {
    width: 64px;
    height: 64px;
    margin-left: -32px;
    margin-top: -32px;
    background: rgba(192, 132, 252, 0.12);
    border-color: rgba(244, 114, 182, 0.7);
}

.cursor-outline.is-clicking {
    width: 24px;
    height: 24px;
    margin-left: -12px;
    margin-top: -12px;
}

@media (hover: none), (pointer: coarse) {
    .cursor-dot,
    .cursor-outline {
        display: none;
    }
}

/* === Char-by-char title splitting === */
.section-title .title-char,
.section-title .title-word {
    display: inline-block;
    opacity: 0;
    will-change: transform, opacity;
}

.section-title .title-word {
    white-space: nowrap;
}

/* === Hero element loader state (anime.js handles in) === */
.no-anime .hero-badge,
.no-anime .hero-tagline,
.no-anime .hero-subtitle,
.no-anime .hero-actions .btn,
.no-anime .hero-stats .stat,
.no-anime .hero-3d-text .layer-front .letter,
.no-anime .section-title .title-char,
.no-anime .section-title .title-word {
    opacity: 1 !important;
}

.no-anime .hero-3d-text .layer-depth {
    opacity: 0.7 !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-badge,
    .hero-tagline,
    .hero-subtitle,
    .hero-actions .btn,
    .hero-stats .stat,
    .hero-3d-text .layer-front .letter,
    .hero-3d-text .layer-depth,
    .section-title .title-char,
    .section-title .title-word {
        opacity: 1 !important;
    }
}
