:root {
    /* Color variables */
    --primary-color: #4a4a92;
    --primary-light: rgba(74, 74, 146, 0.1);
    --secondary-color: #00b3ff;
    --secondary-light: rgba(0, 179, 255, 0.1);
    --accent-color: #ff5e94;
    --text-color: #e0e0e0;
    --text-color-muted: #a0a0a0;
    --light-bg: #2a2a2a;
    --card-bg: #1a1a1a;
    --card-bg-hover: #252525;
    --body-bg: #121212;
    
    /* Code theme colors */
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --code-comment: #6a9955;
    --code-keyword: #569cd6;
    --code-string: #ce9178;
    --code-function: #dcdcaa;
    --code-variable: #9cdcfe;
    --code-number: #b5cea8;
    --code-operator: #d4d4d4;
    --code-class: #4ec9b0;
    --code-gutter: #333333;
    --code-highlight: rgba(255, 255, 255, 0.04);
    
    /* Typography */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1.125rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;
    --line-height-tight: 1.2;
    --line-height-normal: 1.6;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* UI Elements */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --box-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.2);
    --transition-speed: 0.3s;
    --transition-speed-fast: 0.2s;
    --transition-speed-slow: 0.5s;
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

[data-theme="light"] {
    --primary-color: #3f51b5;
    --primary-light: rgba(63, 81, 181, 0.1);
    --secondary-color: #0056b3;
    --secondary-light: rgba(0, 86, 179, 0.1);
    --accent-color: #e91e63;
    --text-color: #333333;
    --text-color-muted: #666666;
    --light-bg: #f0f0f0;
    --card-bg: #ffffff;
    --card-bg-hover: #f8f8f8;
    --body-bg: #f5f5f5;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    
    /* Light theme code colors */
    --code-bg: #f5f5f5;
    --code-text: #24292e;
    --code-comment: #6a737d;
    --code-keyword: #d73a49;
    --code-string: #032f62;
    --code-function: #6f42c1;
    --code-variable: #005cc5;
    --code-number: #005cc5;
    --code-operator: #24292e;
    --code-class: #22863a;
    --code-gutter: #e1e4e8;
    --code-highlight: rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: var(--line-height-normal);
    color: var(--text-color);
    background-color: var(--body-bg);
    font-size: var(--font-size-base);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%234a4a92' fill-opacity='0.02'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-position: center center;
    background-size: 60px 60px;
    opacity: 0.05;
    z-index: -2;
}

[data-theme="light"] body::before {
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%233f51b5' fill-opacity='0.1'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

@media (max-width: 768px) {
    body {
        font-size: var(--font-size-sm);
    }
}

h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-md);
    font-weight: var(--font-weight-bold);
}

h1 {
    font-size: var(--font-size-3xl);
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: inline-block;
    position: relative;
    z-index: 5;
    font-weight: 800;
}

[data-theme="light"] h1 {
    color: var(--primary-color);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] header {
    color: var(--text-color);
    background-color: var(--light-bg);
}

h2 {
    font-size: var(--font-size-2xl);
    position: relative;
    display: inline-block;
    margin-bottom: var(--spacing-lg);
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 40px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
    transition: width var(--transition-speed) ease;
}

h2:hover::after {
    width: 100%;
}

h3 {
    font-size: var(--font-size-xl);
    color: var(--secondary-color);
}

p {
    margin-bottom: var(--spacing-md);
    max-width: 65ch;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all var(--transition-speed-fast) ease;
    position: relative;
}

a:hover {
    color: var(--accent-color);
}

a:not(.nav-links a):not(.social-links a):not(.project-links a)::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-color);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

a:not(.nav-links a):not(.social-links a):not(.project-links a):hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}


.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    box-shadow: var(--box-shadow);
    z-index: 1000;
    transition: all var(--transition-speed) ease;
}

[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: all var(--transition-speed-fast) ease;
    padding: var(--spacing-xs);
    position: relative;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transition: all var(--transition-speed-fast) ease;
    transform: translateX(-50%);
}

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

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

.nav-links a.active {
    color: var(--secondary-color);
}

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

[data-theme="light"] .nav-links a {
    color: var(--text-color);
}

.theme-toggle, .keyboard-help {
    background: var(--primary-light);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    font-size: var(--font-size-lg);
    cursor: pointer;
    padding: var(--spacing-xs);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed-fast) ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover, .keyboard-help:hover {
    color: var(--secondary-color);
    transform: rotate(15deg) scale(1.1);
    background: var(--secondary-light);
}

.keyboard-help {
    position: relative;
    font-size: var(--font-size-md);
}

/* Hamburger menu for mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
        gap: 1rem;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
        z-index: -1;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        z-index: 1001;
    }
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.skill-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    opacity: 0;
    z-index: -1;
    transform: scale(0.5);
    transition: transform var(--transition-speed-slow) ease, opacity var(--transition-speed) ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.skill-item:hover::before {
    opacity: 1;
    transform: scale(1);
}

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

.skill-icon, .project-header i, .project-header .heroku-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-light);
    border-radius: 50%;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
}

[data-theme="light"] .skill-icon, [data-theme="light"] .project-header i, [data-theme="light"] .project-header .heroku-icon {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.skill-item:hover .skill-icon {
    transform: rotate(360deg);
    color: var(--accent-color);
    background: var(--secondary-light);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--light-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0.5rem 0 1rem;
}

.progress {
    height: 100%;
    background: var(--secondary-color);
    transition: width 1.5s ease;
    position: relative;
}

.progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.2) 10px,
        rgba(255, 255, 255, 0.2) 20px
    );
    background-size: 200% 100%;
    animation: progress-animation 3s linear infinite;
}

@keyframes progress-animation {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.progress-percentage {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(0, -50%);
    font-size: var(--font-size-xs);
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    color: var(--text-color);
    background: var(--card-bg);
    padding: 0.1rem 0.4rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.skill-level {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    position: relative;
}

.skill-bar {
    display: flex;
    gap: 2px;
    width: 100%;
}

.skill-level-indicator {
    flex: 1;
    height: 4px;
    background-color: var(--light-bg);
    border-radius: 2px;
    transition: all 0.5s ease;
}

[data-theme="light"] .skill-level-indicator {
    background-color: rgba(0, 0, 0, 0.1);
}

.skill-level-indicator.active {
    background-color: var(--secondary-color);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
}

.project-links a {
    color: var(--secondary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-links a:hover {
    text-decoration: underline;
}

header {
    margin-top: 70px;
    background: var(--body-bg);
    color: var(--text-color);
    text-align: center;
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.8;
    z-index: 0;
}

[data-theme="light"] header::before {
    opacity: 0.5;
}

header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 60%);
    z-index: 1;
    animation: pulse 15s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(-5%, 5%); opacity: 0.7; }
    100% { transform: translate(0, 0); opacity: 0.5; }
}

header .container {
    position: relative;
    z-index: 2;
}

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

.intro {
    margin: 2rem 0;
}

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .projects {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    transition: all var(--transition-speed) ease;
    border-top: 3px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 250px;
    background-image: 
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0;
}

[data-theme="light"] .project-card {
    background-image: 
        linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(to right, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-speed) ease;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    z-index: 0;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

[data-theme="light"] .project-card::after {
    background: rgba(0, 0, 0, 0.05);
}

.project-header {
    position: relative;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-hover);
    background: var(--card-bg-hover);
}

.project-card:hover::before {
    transform: scaleX(1);
}

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

.project-card .skill-tag {
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: var(--font-size-lg);
    line-height: 1.3;
}

@media (max-width: 768px) {
    .project-card h3 {
        font-size: var(--font-size-md);
    }
    
    .project-card p {
        font-size: var(--font-size-sm);
    }
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.skill-tag {
    background: var(--primary-light);
    color: var(--secondary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.5px;
    display: inline-block;
    transition: all var(--transition-speed-fast) ease;
    border: 1px solid transparent;
}

[data-theme="light"] .skill-tag {
    border: 1px solid rgba(63, 81, 181, 0.1);
}

.skill-tag:hover {
    background: var(--secondary-light);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.contact {
    background: var(--primary-light);
    padding: 4rem 0;
    margin-top: 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .contact {
    background: rgba(63, 81, 181, 0.05);
}

.contact p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.contact .container {
    position: relative;
    z-index: 1;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
    border-left: 3px solid var(--secondary-color);
}

.social-links a i {
    font-size: 1.3rem;
    color: var(--secondary-color);
    transition: all var(--transition-speed-fast) ease;
}

[data-theme="light"] .social-links a i {
    color: var(--secondary-color);
}

.social-links a:hover {
    background-color: var(--card-bg-hover);
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-left-color: var(--accent-color);
}

.social-links a:hover i {
    color: var(--accent-color);
    transform: scale(1.2);
}

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

.heroku-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
}

.heroku-icon svg {
    width: 100%;
    height: 100%;
}

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

.header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.header-text {
    text-align: center;
}

.header-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-top: 0.5rem;
    color: white;
    font-weight: var(--font-weight-medium);
}

[data-theme="light"] .header-subtitle {
    color: var(--text-color);
    opacity: 0.9;
}

.header-image {
    flex-shrink: 0;
}

#profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 5;
    will-change: transform, opacity;
    opacity: 0;
}

[data-theme="light"] #profile-image {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#profile-image.loading {
    background-color: var(--card-bg);
    animation: pulse-bg 1.5s ease-in-out infinite;
}

#profile-image.loaded {
    opacity: 1;
    animation: float 6s ease-in-out infinite;
}

/* Optimized CSS animations */
@keyframes pulse-bg {
    0%, 100% { background-color: var(--card-bg); }
    50% { background-color: var(--light-bg); }
}

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

#profile-image.hover-enabled:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 179, 255, 0.4);
}

/* For mobile responsiveness */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column-reverse;
        text-align: center;
    }
}

/* Float animation added to the existing #profile-image definition above */

/* Code block styling */
.code-block {
    background-color: var(--code-bg);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1.5rem 0;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow-x: auto;
    position: relative;
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
}

.code-block::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 0;
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0 var(--border-radius) 0 var(--border-radius-sm);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-block:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

.code-block .line {
    display: block;
    position: relative;
    padding-left: 2rem;
}

.code-block .line::before {
    content: attr(data-line);
    position: absolute;
    left: 0;
    color: var(--code-comment);
    text-align: right;
    width: 1.5rem;
    font-size: 0.8rem;
    user-select: none;
}

.code-block .line.highlight {
    background-color: var(--code-highlight);
    margin: 0 -1rem;
    padding-right: 1rem;
    padding-left: 3rem;
    border-left: 2px solid var(--secondary-color);
}

.code-keyword { color: var(--code-keyword); }
.code-string { color: var(--code-string); }
.code-function { color: var(--code-function); }
.code-variable { color: var(--code-variable); }
.code-number { color: var(--code-number); }
.code-comment { color: var(--code-comment); }
.code-class { color: var(--code-class); }
.code-operator { color: var(--code-operator); }

/* Terminal styling */
.terminal {
    background-color: var(--code-bg);
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem 1.5rem;
    margin: 1.5rem 0;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    color: var(--code-text);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    text-align: left;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
}

[data-theme="light"] .terminal::before {
    background: rgba(0, 0, 0, 0.1);
}

.terminal::after {
    content: '●';
    position: absolute;
    top: 0.45rem;
    left: 0.75rem;
    font-size: 0.7rem;
    color: #ff5f56;
    text-shadow: 1.2rem 0 0 #ffbd2e, 2.4rem 0 0 #27c93f;
}

.prompt {
    display: block;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.prompt::before {
    content: '$ ';
    color: var(--accent-color);
}

.terminal-output {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

[data-theme="light"] .terminal-output {
    color: #333;
}

.cursor {
    display: inline-block;
    width: 0.6rem;
    height: 1rem;
    background-color: var(--secondary-color);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 0.2rem;
}

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

/* Code editor style tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all var(--transition-speed-fast) ease;
    z-index: 99;
}

[data-tooltip]::before {
    content: '';
    border: 6px solid transparent;
    border-bottom-color: var(--code-bg);
    top: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%);
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    width: max-content;
    max-width: 300px;
    word-wrap: break-word;
    background-color: var(--code-bg);
    color: var(--code-text);
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    box-shadow: var(--box-shadow);
    border-left: 2px solid var(--accent-color);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Keyboard shortcut styles */
.keyboard-shortcut {
    display: inline-flex;
    align-items: center;
    margin: 0 0.2rem;
}

.key {
    display: inline-block;
    background-color: var(--light-bg);
    color: var(--text-color);
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    margin: 0 0.15rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
    min-width: 1.5rem;
    text-align: center;
}

[data-theme="light"] .key {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.keyboard-shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
    padding: 2rem;
    overflow-y: auto;
}

.keyboard-shortcuts-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.keyboard-shortcuts-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--box-shadow);
    position: relative;
    margin: auto;
    /* Ensure it stays in viewport */
    transform: translateY(0);
}

.keyboard-shortcuts-content h3 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .keyboard-shortcuts-content h3 {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.shortcuts-group {
    margin-bottom: 1.5rem;
}

.shortcuts-group h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-md);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .shortcut-item {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.shortcut-description {
    font-size: var(--font-size-sm);
}

.close-shortcuts {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-speed-fast) ease;
}

.close-shortcuts:hover {
    color: var(--accent-color);
}

/* Latest Posts Section */
.latest-posts {
    margin-top: 2rem;
}

.latest-posts h3 {
    margin-bottom: 1.5rem;
}

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

/* Loading indicator */
.loading-indicator {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    border-left: 3px solid var(--secondary-color);
    animation: pulse-subtle 2s infinite ease-in-out;
}

.loading-indicator.error {
    border-left-color: var(--accent-color);
    background-color: rgba(255, 94, 148, 0.05);
    animation: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--primary-light);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    border-bottom-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin: 1rem auto;
    box-shadow: 0 0 15px rgba(0, 179, 255, 0.2);
}

@keyframes pulse-subtle {
    0%, 100% { transform: scale(1); box-shadow: var(--box-shadow); }
    50% { transform: scale(1.01); box-shadow: 0 5px 25px rgba(0, 179, 255, 0.15); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
    border-left: 3px solid var(--secondary-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    will-change: transform, box-shadow, opacity;
}

[data-theme="light"] .post-card {
    border-left: 3px solid var(--secondary-color);
}

.post-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: var(--box-shadow-hover);
    background: var(--card-bg-hover);
    border-left-color: var(--accent-color);
}

.post-title {
    font-size: var(--font-size-lg);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-date {
    font-size: var(--font-size-xs);
    color: var(--text-color-muted);
    margin-bottom: 0.5rem;
    font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
}

.post-excerpt {
    margin-bottom: 1rem;
    flex-grow: 1;
}

.post-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-weight: var(--font-weight-medium);
}

.post-link i {
    transition: transform var(--transition-speed-fast) ease;
}

.post-link:hover i {
    transform: translateX(3px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--card-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Animation classes for intersection observer */
.skill-item, .project-card, .post-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-speed) ease-out, 
                transform var(--transition-speed) ease-out,
                box-shadow var(--transition-speed) ease,
                background-color var(--transition-speed) ease;
    will-change: opacity, transform;
}

.skill-item.animate, .project-card.animate, .post-card.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Add special animation for dynamically loaded posts */
@keyframes card-appear {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* We already defined body::before earlier, removing duplicate */
@keyframes glow {
    0% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 0.5; transform: scale(1.5); }
}

/* Improved contrast for accessibility */
.social-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    background-color: var(--card-bg);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed) ease;
    border-left: 3px solid var(--secondary-color);
}

.social-links a:hover {
    background-color: var(--card-bg-hover);
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-left-color: var(--accent-color);
}

/* Print styles for better accessibility */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .nav, .keyboard-shortcuts-overlay, .terminal, .theme-toggle, .menu-toggle {
        display: none;
    }
    
    header {
        margin-top: 0;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    p, blockquote, ul, ol, dl, pre {
        page-break-inside: avoid;
    }
}

/* Structured data styles - hidden from visual users but available for screen readers */
.structured-data {
    display: none;
}