/* ============================================
   DAMIAN TARNOWSKI - PORTFOLIO
   Modern Dark Theme with AI/Tech Vibe
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Spacing */
    --section-padding: clamp(4rem, 10vw, 8rem);
    --container-max: 1200px;
    --container-padding: clamp(1.5rem, 5vw, 3rem);
    
    /* Typography */
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Accent colors - shared between themes */
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #ec4899 100%);
}

/* ---------- Dark Theme (default) ---------- */
:root, [data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.7);
    --bg-card-hover: rgba(35, 35, 50, 0.8);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --text-accent: #00d4ff;
    
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(0, 212, 255, 0.3);
    --glow-primary: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-secondary: 0 0 30px rgba(124, 58, 237, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.5);
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
    
    --accent-gradient-subtle: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
}

/* ---------- Light Theme ---------- */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    
    --text-primary: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.7);
    --text-tertiary: rgba(15, 23, 42, 0.5);
    --text-accent: #0891b2;
    
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-accent: rgba(0, 212, 255, 0.4);
    --glow-primary: 0 0 20px rgba(0, 212, 255, 0.2);
    --glow-secondary: 0 0 30px rgba(124, 58, 237, 0.2);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.15);
    
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-blur: blur(20px);
    
    --accent-gradient-subtle: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
}

/* Light theme specific overrides */
[data-theme="light"] .hero-orb {
    opacity: 0.3;
}

[data-theme="light"] .hero-grid {
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.08) 1px, transparent 1px);
}

[data-theme="light"] body::before {
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
}

[data-theme="light"] .gradient-text {
    background: linear-gradient(135deg, #0891b2 0%, #7c3aed 50%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .nav.scrolled {
    background: rgba(248, 250, 252, 0.9);
}

[data-theme="light"] .hero-3d-canvas {
    opacity: 0.6;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Prevent unwanted outlines/borders on headings and text elements */
h1, h2, h3, h4, h5, h6,
.hero-name,
.section-title,
.blog-post-title,
.case-study-title,
[class*="title"],
.blog-post-body h1,
.blog-post-body h2,
.blog-post-body h3,
.blog-post-body h4,
.gradient-text,
.glitch {
    outline: none;
    border: none;
    box-shadow: none;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Selection */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 65ch;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

em {
    color: var(--accent-primary);
    font-style: normal;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

section {
    padding: var(--section-padding) 0;
    position: relative;
    min-height: 100px; /* Ensure sections have minimum height */
}

/* Force visibility for debugging */
.about, .stack, .projects, .services, .contact {
    display: block !important;
    visibility: visible !important;
}

/* ---------- Navigation ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--transition-base);
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.75rem 0;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Navigation Controls (theme + language) */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    transform: rotate(15deg);
}

.theme-icon {
    transition: transform var(--transition-base);
}

.theme-toggle:hover .theme-icon {
    transform: scale(1.1);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    color: var(--text-secondary);
}

.lang-btn.active {
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    /* iOS touch fixes */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
    pointer-events: none; /* Prevent spans from capturing touch */
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        z-index: 1001; /* Above nav-links */
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        height: 100dvh; /* iOS dynamic viewport height */
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        background: var(--bg-secondary);
        border-left: 1px solid var(--glass-border);
        transition: right var(--transition-base);
        z-index: 1000;
        /* iOS fixes */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .nav-links.open {
        right: 0;
    }
    
    /* Hamburger animation */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .nav-link {
        font-size: 1.25rem;
        /* iOS touch fix */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
    color: var(--bg-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-accent);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: rgba(0, 212, 255, 0.15);
    color: var(--text-primary);
    box-shadow: var(--glow-primary);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.btn-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    transform: scale(1.1);
}

/* ---------- Cards ---------- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), var(--glow-primary);
}

/* ---------- Section Headers ---------- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
}

.section-title {
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-tertiary);
}

/* Gradient text */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Hero Section ---------- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 3D Hero Canvas */
.hero-3d-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

.hero-3d-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Animated background grid */
.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: -50%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(60px); }
}

/* Floating orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}

.hero-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.hero-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: 20%;
    right: 15%;
    animation-delay: -2s;
}

.hero-orb-3 {
    width: 200px;
    height: 200px;
    background: #ec4899;
    top: 60%;
    left: 60%;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.05); }
    50% { transform: translate(-10px, 20px) scale(0.95); }
    75% { transform: translate(-30px, -10px) scale(1.02); }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
    /* Prevent any unwanted borders */
    outline: none;
    border: none;
}

.hero-title {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-tagline {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-tertiary);
    margin-bottom: 2.5rem;
    min-height: 2em;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

/* Typed text cursor */
.typed-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: var(--accent-primary);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 1s;
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.5s;
}

.hero-scroll-icon {
    width: 24px;
    height: 40px;
    border: 2px solid var(--border-accent);
    border-radius: 12px;
    position: relative;
}

.hero-scroll-icon::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ---------- About Section ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

.about-visual {
    position: relative;
}

.about-image-wrapper {
    position: relative;
    padding: 2rem;
}

.about-image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    border-radius: 24px;
    opacity: 0.1;
    transform: rotate(3deg);
}

.about-focus-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-focus-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.about-focus-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(8px);
}

.focus-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 10px;
    font-size: 1.25rem;
}

.focus-text {
    font-weight: 500;
    color: var(--text-primary);
}

/* ---------- Tech Stack Section ---------- */
.stack-categories {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.stack-category {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease;
}

.stack-category-title {
    font-size: 1rem;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent-primary);
}

.stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-base);
    cursor: default;
}

.tech-badge:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

.tech-badge-icon {
    font-size: 1.5rem;
}

.tech-badge-primary {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    color: var(--accent-primary);
}

.tech-badge-primary:hover {
    background: rgba(0, 212, 255, 0.2);
}

/* ---------- Projects Section ---------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevated), var(--glow-primary);
}

/* Project Thumbnail - w prawym górnym rogu */
.project-thumbnail {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    transition: all 0.3s ease;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-thumbnail {
    transform: scale(1.05) rotate(2deg);
    border-color: var(--accent-primary);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.3);
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.1);
}

.project-header {
    padding: 1.5rem 1.5rem 1rem;
    padding-right: 110px; /* przestrzeń na miniaturkę */
    border-bottom: 1px solid var(--border-subtle);
}

.project-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.project-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.project-body {
    padding: 1rem 1.5rem;
    flex: 1;
}

.project-desc {
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem 1rem;
}

.project-tech-item {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.project-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    color: var(--accent-primary);
    font-weight: 500;
    font-size: 0.9rem;
    background: var(--bg-tertiary);
    transition: all var(--transition-base);
}

.project-link:hover {
    background: rgba(0, 212, 255, 0.15);
    gap: 0.75rem;
    color: var(--text-primary);
}

.project-confidential {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-secondary);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-tertiary);
}

/* ---------- Services Section ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base), box-shadow 0.3s ease;
}

.service-card:hover {
    border-color: transparent;
    box-shadow: 
        0 0 0 1px var(--accent-primary),
        0 0 20px rgba(0, 212, 255, 0.2),
        var(--shadow-elevated);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.service-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-desc {
    font-size: 1rem;
    color: var(--text-tertiary);
}

/* ========================================
   CASE STUDY PAGES - Premium Design
   ======================================== */

/* Not Found State */
.cs-not-found {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.cs-not-found-content {
    text-align: center;
    max-width: 500px;
}

.cs-not-found-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.cs-not-found h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cs-not-found p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Hero Section */
.cs-hero {
    position: relative;
    padding: 10rem 0 6rem;
    overflow: visible;
}

.cs-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: clip;
}

.cs-hero-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 255, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(136, 0, 255, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 0% 100%, rgba(0, 255, 136, 0.08), transparent);
}

.cs-hero-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at center, black 20%, transparent 70%);
}

.cs-hero-glow {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08), transparent 60%);
    filter: blur(60px);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.cs-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 3rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    transition: all var(--transition-base);
    position: relative;
    z-index: 1;
}

.cs-back-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.05);
    transform: translateX(-4px);
}

.cs-hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.cs-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(136, 0, 255, 0.1));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
    margin-bottom: 2rem;
}

.cs-badge-icon {
    font-size: 1.5rem;
}

.cs-badge-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cs-hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cs-hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 3rem;
}

.cs-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.cs-hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
}

.cs-hero-stat:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.cs-stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cs-stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.cs-hero-scroll {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    animation: fadeInUp 1s ease-out 1s both;
}

.cs-scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    position: relative;
}

.cs-scroll-indicator::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

/* Info Bar */
.cs-info-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.cs-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.cs-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cs-info-item svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.cs-info-item > div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cs-info-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cs-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 900px) {
    .cs-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 500px) {
    .cs-info-bar {
        display: none;
    }
}

/* Sections */
.cs-section {
    padding: 6rem 0;
    position: relative;
}

.cs-section-dark {
    background: var(--bg-secondary);
}

.cs-section-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.cs-section-number {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 100px;
}

.cs-section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
}

/* Overview */
.cs-overview-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.cs-lead-text {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.cs-overview-highlights {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cs-highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.cs-highlight-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(8px);
}

.cs-highlight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .cs-overview-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Challenge */
.cs-challenge-grid {
    max-width: 900px;
}

.cs-challenge-content {
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    position: relative;
}

.cs-challenge-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.15), rgba(255, 50, 50, 0.08));
    border: 1px solid rgba(255, 100, 100, 0.25);
    border-radius: 16px;
    color: #ff6b6b;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.cs-challenge-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cs-challenge-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cs-challenge-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 100, 100, 0.05);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.cs-challenge-list li::before {
    content: '⚠️';
    flex-shrink: 0;
}

/* Solution */
.cs-solution-content {
    max-width: 800px;
    margin-bottom: 4rem;
}

.cs-tech-section h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.cs-tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cs-tech-card {
    padding: 1rem 1.75rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(136, 0, 255, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
    transition: all var(--transition-base);
}

.cs-tech-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
}

.cs-tech-name {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Video Section */
.cs-section-video {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.cs-video-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

.cs-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
}

.cs-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.cs-video-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.1) 0%, 
        rgba(6, 182, 212, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.cs-video-container:hover::before {
    opacity: 1;
}

/* Results */
.cs-section-results {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.cs-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.cs-result-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.cs-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.cs-result-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
}

.cs-result-card:hover::before {
    transform: scaleX(1);
}

.cs-result-value {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.cs-result-label {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.cs-result-desc {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
}

/* Testimonial */
.cs-section-testimonial {
    background: 
        radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0, 212, 255, 0.08), transparent),
        radial-gradient(ellipse 50% 50% at 80% 20%, rgba(136, 0, 255, 0.08), transparent),
        var(--bg-primary);
    padding: 8rem 0;
}

.cs-testimonial {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.cs-testimonial-quote {
    color: var(--accent-primary);
    opacity: 0.3;
    margin-bottom: 2rem;
}

.cs-testimonial blockquote {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    line-height: 1.8;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
}

.cs-testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cs-author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.cs-author-role {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

/* CTA Section */
.cs-cta {
    padding: 8rem 0;
    background: 
        radial-gradient(ellipse 80% 50% at center, rgba(0, 212, 255, 0.1), transparent),
        var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.cs-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.cs-cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cs-cta-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.cs-cta h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.cs-cta p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.cs-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* Navigation */
.cs-navigation {
    padding: 0;
    border-top: 1px solid var(--glass-border);
}

.cs-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.cs-nav-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 3rem;
    transition: all var(--transition-base);
    border-right: 1px solid var(--glass-border);
}

.cs-nav-item:last-child {
    border-right: none;
    text-align: right;
}

.cs-nav-item:hover {
    background: rgba(0, 212, 255, 0.03);
}

.cs-nav-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cs-nav-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.cs-nav-item:hover .cs-nav-title {
    color: var(--accent-primary);
}

@media (max-width: 600px) {
    .cs-nav-grid {
        grid-template-columns: 1fr;
    }
    
    .cs-nav-item {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        text-align: left !important;
    }
    
    .cs-nav-item:last-child {
        border-bottom: none;
    }
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Deep Dive Button */
.cs-deep-dive-cta {
    margin-top: 3rem;
    text-align: center;
}

.cs-deep-dive-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(136, 0, 255, 0.1));
    border: 2px solid rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
    border-radius: 100px;
    transition: all var(--transition-base);
}

.cs-deep-dive-btn:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(136, 0, 255, 0.15));
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.2);
}

.cs-deep-dive-btn svg {
    color: var(--accent-primary);
}

/* Architecture Modal Portal */
#arch-modal-portal {
    display: none;
}

#arch-modal-portal.visible {
    display: block;
}

@keyframes archModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes archModalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.cs-arch-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    animation: archModalFadeIn 0.3s ease-out forwards;
}

.cs-arch-modal {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 1rem auto;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    animation: archModalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cs-arch-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.cs-arch-modal-close:hover {
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.3);
    color: #ff6b6b;
}

.cs-arch-modal-header {
    text-align: center;
    padding: 1.5rem 2rem 1rem;
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.05), transparent);
    border-bottom: 1px solid var(--glass-border);
}

.cs-arch-modal-icon {
    font-size: 2rem;
    display: inline-block;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.cs-arch-modal-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    display: inline-block;
    vertical-align: middle;
}

.cs-arch-modal-header p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.cs-arch-modal-content {
    padding: 1.5rem 2rem 2rem;
    max-height: 80vh;
    overflow-y: auto;
}

/* Markdown Styling */
.markdown-body h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.markdown-body h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--accent-primary);
    margin: 2rem 0 1rem;
}

.markdown-body h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem;
}

.markdown-body p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0.75rem 0;
}

.markdown-body li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.markdown-body li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.markdown-body li.nested {
    margin-left: 1.5rem;
}

.markdown-body li.nested::before {
    content: '•';
}

.markdown-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-body em {
    color: var(--accent-secondary);
    font-style: italic;
}

.markdown-body code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.2em 0.5em;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 4px;
    color: var(--accent-primary);
}

.markdown-body hr {
    border: none;
    height: 1px;
    background: var(--glass-border);
    margin: 2rem 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.markdown-body th,
.markdown-body td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--glass-border);
}

.markdown-body th {
    background: rgba(0, 212, 255, 0.1);
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-body td {
    color: var(--text-secondary);
}

.markdown-body tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
    .cs-arch-modal-overlay {
        padding: 1rem;
    }
    
    .cs-arch-modal-header,
    .cs-arch-modal-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cs-hero {
        padding: 6rem 0 3rem;
        min-height: auto;
    }
    
    .cs-hero-stats {
        gap: 1rem;
    }
    
    .cs-hero-stat {
        padding: 1rem 1.5rem;
        flex: 1 1 120px;
    }
    
    .cs-stat-value {
        font-size: 1.5rem;
    }
    
    .cs-hero-scroll {
        display: none;
    }
    
    .cs-section {
        padding: 4rem 0;
    }
    
    .cs-challenge-content {
        padding: 2rem;
    }
    
    .cs-result-value {
        font-size: 3rem;
    }
    
    .cs-cta {
        padding: 5rem 0;
    }
}

/* ---------- Blog Section ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all var(--transition-base);
    overflow: visible;
}

.blog-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 6px;
}

.blog-date {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.blog-title {
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.blog-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    flex: 1;
}

.blog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-tag {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.blog-read-more {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-primary);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.blog-read-more:hover {
    gap: 0.75rem;
    color: var(--text-primary);
}

.blog-cta {
    margin-top: 3rem;
    text-align: center;
}

.blog-cta-text {
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* ---------- Blog Post Page ---------- */
.blog-post-hero {
    padding: 8rem 0 4rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    transition: all var(--transition-fast);
}

.back-link:hover {
    color: var(--accent-primary);
    gap: 0.75rem;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.blog-post-category {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 8px;
}

.blog-post-date,
.blog-post-reading {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.blog-post-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    max-width: 900px;
}

.blog-post-excerpt {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Blog Post Content */
.blog-post-content {
    padding: var(--section-padding) 0;
}

.blog-post-body {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.blog-post-body h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin: 3rem 0 1.5rem;
    padding-top: 1rem;
}

.blog-post-body h3 {
    font-size: 1.35rem;
    color: var(--text-primary);
    margin: 2rem 0 1rem;
}

.blog-post-body p {
    margin-bottom: 1.5rem;
    max-width: none;
}

.blog-post-body ul,
.blog-post-body ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.blog-post-body li {
    margin-bottom: 0.75rem;
}

.blog-post-body strong {
    color: var(--text-primary);
}

.blog-post-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-post-body a:hover {
    color: var(--accent-secondary);
}

.blog-post-body pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.blog-post-body code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.blog-post-body pre code {
    color: var(--text-secondary);
}

.blog-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.blog-post-body th,
.blog-post-body td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.blog-post-body th {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--bg-tertiary);
}

.blog-post-body blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-tertiary);
}

/* Author Box */
.blog-author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    margin: 4rem auto 3rem;
    max-width: 750px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.author-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.author-details h4 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.author-details > p {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.author-bio {
    font-size: 0.95rem !important;
    color: var(--text-secondary) !important;
    line-height: 1.6;
}

.author-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.author-links a {
    font-size: 0.9rem;
    color: var(--accent-primary);
}

/* Related Posts */
.blog-related {
    max-width: 750px;
    margin: 0 auto 3rem;
}

.blog-related h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .author-avatar-large {
        margin: 0 auto;
    }
    
    .author-links {
        justify-content: center;
    }
}

.related-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all var(--transition-base);
}

.related-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.related-card .related-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-transform: uppercase;
}

.related-card h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Blog CTA Box */
.blog-cta-box {
    max-width: 750px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--accent-gradient-subtle);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    text-align: center;
}

.blog-cta-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-cta-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: none;
}

/* ---------- Page Transitions ---------- */
#page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

#page-transition.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.transition-loader {
    position: relative;
    width: 60px;
    height: 60px;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

.loader-ring::before,
.loader-ring::after {
    content: '';
    position: absolute;
    border: 3px solid transparent;
    border-radius: 50%;
}

.loader-ring::before {
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-top-color: var(--accent-secondary);
    animation: loader-spin 1.5s linear infinite reverse;
}

.loader-ring::after {
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border-top-color: var(--accent-tertiary);
    animation: loader-spin 2s linear infinite;
}

@keyframes loader-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Page content animation */
main,
[role="main"] {
    will-change: opacity, transform;
}

/* Section stagger animation */
section {
    will-change: opacity, transform;
}

/* ---------- Magnetic Buttons ---------- */
.magnetic-ready {
    will-change: transform;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.magnetic-ready:hover {
    /* Transform is handled by JS, only enhance shadows */
}

/* ---------- Noise Texture Overlay ---------- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

[data-theme="light"] body::before {
    opacity: 0.02;
}

/* ---------- Glitch Effect ---------- */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch::before {
    color: #ff00ff;
    z-index: -1;
}

.glitch::after {
    color: #00ffff;
    z-index: -2;
}

.glitch:hover::before {
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    opacity: 0.8;
}

.glitch:hover::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, -2px); }
    20% { clip-path: inset(92% 0 1% 0); transform: translate(2px, 2px); }
    40% { clip-path: inset(43% 0 1% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(25% 0 58% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(54% 0 7% 0); transform: translate(-2px, 2px); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(65% 0 25% 0); transform: translate(2px, 2px); }
    20% { clip-path: inset(10% 0 85% 0); transform: translate(-2px, -2px); }
    40% { clip-path: inset(50% 0 30% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(70% 0 15% 0); transform: translate(-2px, 2px); }
    80% { clip-path: inset(20% 0 70% 0); transform: translate(2px, 2px); }
    100% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, -2px); }
}

/* ---------- Animated Gradient Border ---------- */
.gradient-border-wrap {
    position: relative;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(
        var(--gradient-angle, 0deg),
        var(--accent-primary),
        var(--accent-secondary),
        var(--accent-tertiary),
        var(--accent-primary)
    );
    background-size: 300% 300%;
    animation: gradient-rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border-wrap:hover {
    opacity: 1;
}

.gradient-border-wrap > * {
    background: var(--bg-card);
    border-radius: 18px;
}

/* Glow border effect using box-shadow animation */
.glow-on-hover {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glow-on-hover:hover {
    border-color: transparent;
    box-shadow: 
        0 0 0 1px var(--accent-primary),
        0 0 20px rgba(0, 212, 255, 0.3),
        0 0 40px rgba(0, 212, 255, 0.1);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { 
        box-shadow: 
            0 0 0 1px var(--accent-primary),
            0 0 20px rgba(0, 212, 255, 0.3),
            0 0 40px rgba(0, 212, 255, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 0 1px var(--accent-secondary),
            0 0 30px rgba(139, 92, 246, 0.4),
            0 0 60px rgba(139, 92, 246, 0.15);
    }
}

@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Text Reveal ---------- */
.text-reveal {
    visibility: hidden;
}

.reveal-char {
    will-change: opacity, transform;
}

/* ---------- Bento Grid Layout ---------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-elevated);
}

.bento-card:hover::before {
    opacity: 1;
}

/* Bento sizes */
.bento-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-medium {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.bento-small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Bento content */
.bento-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.bento-large .bento-icon {
    font-size: 3.5rem;
}

.bento-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.bento-large .bento-title {
    font-size: 1.75rem;
}

.bento-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.bento-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bento-tags span {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding: 0.35rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.bento-row {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.bento-row .bento-icon {
    margin-bottom: 0;
}

/* Bento responsive */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bento-large {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .bento-large,
    .bento-medium,
    .bento-wide {
        grid-column: span 1;
    }
    
    .bento-card {
        padding: 1.5rem;
    }
}

/* ---------- Terminal Bio ---------- */
.terminal-container {
    background: #1a1b26;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    font-family: var(--font-mono);
    max-width: 700px;
    margin: 0 auto;
}

.terminal-header {
    background: linear-gradient(180deg, #3b3d4a 0%, #2d2f3a 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-btn.red { background: #ff5f57; }
.terminal-btn.yellow { background: #ffbd2e; }
.terminal-btn.green { background: #28ca42; }

.terminal-title {
    color: #a0a0a0;
    font-size: 0.8rem;
    flex: 1;
    text-align: center;
    margin-right: 60px;
}

.terminal-body {
    padding: 20px;
    min-height: 350px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.terminal-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.terminal-line.command {
    color: #7dcfff;
}

.terminal-line.output {
    color: #a9b1d6;
    padding-left: 20px;
}

.terminal-line.output.highlight {
    color: #bb9af7;
    font-weight: 600;
    font-size: 1rem;
}

.terminal-line.output.json {
    color: #9ece6a;
}

.terminal-prompt {
    color: #9ece6a;
    font-weight: bold;
}

.terminal-cursor {
    color: #7dcfff;
    animation: terminal-blink 1s step-end infinite;
}

@keyframes terminal-blink {
    50% { opacity: 0; }
}

.json-key {
    color: #7aa2f7;
}

.json-value {
    color: #9ece6a;
}

.status-open {
    color: #9ece6a;
    font-weight: 600;
}

/* Light theme terminal */
[data-theme="light"] .terminal-container {
    background: #fafafa;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .terminal-header {
    background: linear-gradient(180deg, #e8e8e8 0%, #d8d8d8 100%);
}

[data-theme="light"] .terminal-title {
    color: #666;
}

[data-theme="light"] .terminal-body {
    background: #1e1e2e;
}

/* Terminal responsive */
@media (max-width: 768px) {
    .terminal-container {
        border-radius: 8px;
    }
    
    .terminal-body {
        padding: 16px;
        font-size: 0.8rem;
        min-height: 300px;
    }
}

/* ---------- Testimonials Section ---------- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: all var(--transition-base);
}

.testimonial-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), var(--glow-primary);
}

.testimonial-quote {
    position: relative;
}

.quote-icon {
    position: absolute;
    top: -10px;
    left: -5px;
    color: var(--accent-primary);
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    padding-left: 1rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--bg-primary);
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.author-role {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ---------- Contact Section ---------- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
}

.contact-left {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.contact-right {
    position: sticky;
    top: 100px;
    min-width: 0;
}

@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .contact-right {
        position: static;
    }
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all var(--transition-base);
}

.contact-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(8px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: 12px;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
}

.contact-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.contact-item > div:last-child {
    min-width: 0;
}

.contact-links {
    display: flex;
    gap: 1rem;
}

.contact-social {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.contact-social:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: var(--bg-primary);
    transform: translateY(-4px);
}

/* ---------- Contact Form ---------- */
.contact-form-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
}

.contact-form-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.form-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-mark {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-subtle);
    border-radius: 4px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-checkbox input:checked ~ .checkbox-mark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-checkbox input:checked ~ .checkbox-mark::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox:hover .checkbox-mark {
    border-color: var(--accent-primary);
}

.form-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.form-submit {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
}

.form-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
    color: #22c55e;
    font-size: 0.95rem;
}

.form-error-message {
    padding: 1rem 1.25rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.95rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Footer ---------- */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Scroll animations - fade in up when element comes into view */
.animate-on-scroll {
    opacity: 1; /* DEBUG: Tymczasowo widoczne */
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ---------- Blazor Error Boundary ---------- */
.blazor-error-boundary {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    color: white;
    margin: 2rem;
}

.blazor-error-boundary::after {
    content: "An error has occurred. Please refresh the page.";
}

/* ---------- Custom Cursor ---------- */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
}

.cursor-dot {
    position: fixed;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease, top 0.2s ease, left 0.2s ease;
}

.cursor-dot.hover {
    width: 12px;
    height: 12px;
    top: -6px;
    left: -6px;
    background: var(--accent-primary);
}

.cursor-outline {
    position: fixed;
    top: -20px;
    left: -20px;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
    transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.cursor-outline.hover {
    width: 60px;
    height: 60px;
    top: -30px;
    left: -30px;
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
}

/* Hide custom cursor on mobile */
@media (max-width: 768px) {
    .custom-cursor {
        display: none;
    }
}

/* ---------- Scroll Progress Bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 1001;
    transition: width 0.1s ease-out;
}

/* ---------- Ripple Effect ---------- */
.btn {
    position: relative;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---------- Enhanced Card Hover Effects ---------- */
.project-card {
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 212, 255, 0.06),
        transparent 40%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

.service-card {
    position: relative;
}

.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(124, 58, 237, 0.08),
        transparent 40%
    );
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.service-card:hover::after {
    opacity: 1;
}

/* ---------- Responsiveness ---------- */
@media (max-width: 480px) {
    :root {
        --section-padding: 3rem;
    }
    
    .hero-name {
        font-size: 2.5rem;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-thumbnail {
        width: 60px;
        height: 60px;
        top: 0.75rem;
        right: 0.75rem;
        border-radius: 10px;
    }
    
    .project-header {
        padding-right: 80px;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TECH MODAL - Detailed Technology Info
   ============================================ */

.bento-clickable {
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
}

.bento-clickable:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--glow-primary), var(--shadow-elevated);
}

.bento-clickable::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: var(--accent-gradient);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-base);
}

.bento-clickable:hover::before {
    opacity: 0.3;
}

.bento-click-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.bento-clickable:hover .bento-click-hint {
    opacity: 1;
    transform: translateY(0);
}

.bento-click-hint::before {
    content: '👆';
}

/* Modal Portal Container */
#tech-modal-portal {
    display: none;
}

/* Modal Overlay */
.tech-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-modal-overlay.visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
}

/* Modal Container */
.tech-modal {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-radius: 24px;
    border: 1px solid var(--border-accent);
    box-shadow: 
        0 0 0 1px rgba(0, 212, 255, 0.1),
        0 25px 80px rgba(0, 0, 0, 0.5),
        var(--glow-primary);
    
    transform: scale(0.9) translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tech-modal-body {
    overflow-y: auto;
    flex: 1;
    margin: 0.5rem 0;
    padding-right: 0.5rem;
}

.tech-modal.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Scrollbar styling */
.tech-modal-body::-webkit-scrollbar {
    width: 6px;
}

.tech-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.tech-modal-body::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

/* Close Button */
.tech-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.tech-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: rotate(90deg);
}

/* Modal Header */
.tech-modal-header {
    text-align: center;
    padding: 3rem 3rem 2rem;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.tech-modal-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tech-modal-header h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tech-modal-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Modal Content */
.tech-modal-content {
    padding: 2rem 3rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.tech-modal-content p {
    margin-bottom: 1.5rem;
}

.tech-modal-content strong {
    color: var(--accent-primary);
}

.tech-modal-content em {
    color: var(--text-primary);
    font-style: italic;
}

.tech-modal-content h3 {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin: 2rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-accent);
}

/* Stack Items */
.tech-modal-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tech-stack-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all var(--transition-base);
}

.tech-stack-item:hover {
    background: rgba(0, 212, 255, 0.05);
    border-color: var(--border-accent);
    transform: translateX(8px);
}

.tech-stack-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: var(--accent-gradient);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
}

.tech-stack-item p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Modal Footer */
.tech-modal-footer {
    padding: 2rem 3rem 3rem;
    text-align: center;
    border-top: 1px solid var(--border-subtle);
    background: linear-gradient(0deg, rgba(0, 212, 255, 0.05) 0%, transparent 100%);
}

/* Light Theme */
[data-theme="light"] .tech-modal-overlay.visible {
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .tech-modal {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: 
        0 0 0 1px rgba(124, 58, 237, 0.1),
        0 25px 80px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .tech-stack-item {
    background: rgba(124, 58, 237, 0.03);
}

[data-theme="light"] .tech-stack-item:hover {
    background: rgba(124, 58, 237, 0.08);
}

/* Responsive */
@media (max-width: 768px) {
    .tech-modal-overlay {
        padding: 1rem;
    }
    
    .tech-modal {
        max-height: 90vh;
        border-radius: 20px;
    }
    
    .tech-modal-header,
    .tech-modal-content,
    .tech-modal-footer {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .tech-modal-header h2 {
        font-size: 2rem;
    }
    
    .tech-modal-icon {
        font-size: 3rem;
    }
    
    .tech-modal-close {
        top: 1rem;
        right: 1rem;
    }
}

/* ============================================
   CASE STUDY GALLERY
   ============================================ */

.cs-section-gallery {
    background: var(--bg-secondary);
}

.cs-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cs-gallery-featured {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
    box-shadow: var(--shadow-elevated);
}

.cs-gallery-featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.cs-gallery-featured:hover img {
    transform: scale(1.03);
}

.cs-gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.cs-gallery-featured:hover .cs-gallery-overlay {
    opacity: 1;
}

.cs-gallery-overlay svg {
    color: white;
}

.cs-gallery-overlay span {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.cs-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    font-size: 1rem;
}

.cs-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.cs-gallery-thumb {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-base);
}

.cs-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.cs-gallery-thumb:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--glow-primary);
}

.cs-gallery-thumb:hover img {
    transform: scale(1.1);
}

.cs-gallery-thumb.active {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

/* Lightbox */
.cs-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cs-lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10001;
    pointer-events: auto !important;
}

.cs-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.cs-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    z-index: 10;
}

.cs-lightbox-nav:hover:not(:disabled) {
    background: var(--accent-primary);
    color: black;
}

.cs-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cs-lightbox-nav.prev {
    left: 2rem;
}

.cs-lightbox-nav.next {
    right: 2rem;
}

.cs-lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    position: relative;
}

.cs-lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cs-lightbox-caption {
    text-align: center;
    padding: 1rem 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

.cs-lightbox-counter {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Gallery Responsive */
@media (max-width: 768px) {
    .cs-gallery-thumbs {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .cs-gallery-thumb {
        border-radius: 8px;
    }
    
    .cs-lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .cs-lightbox-nav.prev {
        left: 0.5rem;
    }
    
    .cs-lightbox-nav.next {
        right: 0.5rem;
    }
    
    .cs-lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   Accessibility: prefers-reduced-motion
   Wyłącza animacje dla użytkowników z tą preferencją
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll,
    .bento-card {
        opacity: 1 !important;
        transform: none !important;
    }

    .custom-cursor,
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    .hero-orb,
    .hero-grid,
    .hero-scroll-icon,
    .typed-cursor {
        animation: none !important;
    }
}
