/* ==========================================================================
   CSS Variables & Theme
   ========================================================================== */
:root {
    /* Light Theme (Default) */
    --bg-color: #fafafa;
    --bg-secondary: #f4f4f5;
    --text-primary: #09090b;
    --text-secondary: #3f3f46;
    --text-muted: #71717a;
    --border-color: rgba(0, 0, 0, 0.12);
    
    /* Brand Colors */
    --accent-color: #000000;
    --accent-glow: rgba(0, 0, 0, 0.1);
    
    /* Gradient Text Colors */
    --gradient-start: #000000;
    --gradient-end: #3f3f46;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.12);
    
    /* Components */
    --glass-bg-solid: rgba(255, 255, 255, 0.95);
    --hover-bg: rgba(0, 0, 0, 0.04);
    --hover-border: rgba(0, 0, 0, 0.15);
    --modal-bg: #ffffff;
    --hero-gradient: linear-gradient(180deg, rgba(250, 250, 250, 0) 0%, rgba(250, 250, 250, 1) 100%);
    
    
    /* Terminal Adaptive Colors */
    --terminal-bg: #ffffff;
    --terminal-header-bg: #f4f4f5;
    --terminal-text: #09090b;
    --color-green: #047857;
    --color-yellow: #b45309;
    --color-purple: #6b21a8;
    --color-light-purple: #7e22ce;
    --color-pink: #be185d;
    --color-blue: #1d4ed8;
    --color-red: #b91c1c;
    --color-cyan: #0369a1;
    --color-teal: #0f766e;

    /* Typography */
    --font-main: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-theme {
    --bg-color: #000000; /* Pure black for Apple feel */
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: rgba(255, 255, 255, 0.1);
    
    --accent-color: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.15);
    
    --gradient-start: #ffffff;
    --gradient-end: #71717a;
    
    --glass-bg: rgba(0, 0, 0, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --glass-bg-solid: rgba(15, 15, 17, 0.95);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --hover-border: rgba(255, 255, 255, 0.1);
    --modal-bg: #121212;
    --hero-gradient: linear-gradient(180deg, rgba(10, 10, 10, 0) 0%, rgba(15, 15, 15, 0.8) 100%);

    --terminal-bg: rgba(8, 8, 12, 0.96);
    --terminal-header-bg: rgba(18, 18, 22, 0.95);
    --terminal-text: #10b981;
    --color-green: #10b981;
    --color-yellow: #f59e0b;
    --color-purple: #8b5cf6;
    --color-light-purple: #a78bfa;
    --color-pink: #ec4899;
    --color-blue: #3b82f6;
    --color-red: #f43f5e;
    --color-cyan: #0ea5e9;
    --color-teal: #14b8a6;

}

/* Red Theme Override (Logo Matching) */
.theme-red {
    --color-purple: #cc0000; /* Rich crimson */
    --color-light-purple: #ff6666; /* Soft coral red */
    --color-pink: #990000; /* Dark ruby */
    --color-blue: #660000; /* Deep red */
    --color-green: #ffffff; /* White for accents */
    --terminal-text: #ff9999;
    --gradient-start: #ff3333;
    --gradient-end: #ffffff;
    
    --ai-gradient-start: rgba(204, 0, 0, 0.95);
    --ai-gradient-end: rgba(139, 0, 0, 0.95);
    --ai-shadow: rgba(204, 0, 0, 0.3);
    --ai-shadow-hover: rgba(204, 0, 0, 0.5);
}
.theme-red .hero-role {
    background: linear-gradient(135deg, #ff4d4d 0%, #990000 40%, #ffffff 100%) !important;
    background-size: 200% 200% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: initial; /* Lenis handles this */
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-medium), color var(--transition-medium);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth Theme Transitions for Core Layout Cards & Elements */
body, header, footer, .navbar, .glass-panel, .project-card, .blog-card, .why-card, .btn, .btn-icon, .form-input, .form-textarea, .inspect-btn, .cmd-palette, .music-player, .terminal-page {
    transition: background-color var(--transition-medium), color var(--transition-medium), border-color var(--transition-medium), box-shadow var(--transition-medium), backdrop-filter var(--transition-medium);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
body {
    cursor: none; /* Hide default cursor on desktop */
}
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
}
.custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, opacity 0.2s;
}
/* When hovering over links/buttons */
.cursor-hover .custom-cursor {
    width: 0;
    height: 0;
}
.cursor-hover .custom-cursor-follower {
    width: 60px;
    height: 60px;
    background: rgba(59, 130, 246, 0.1);
    border-color: transparent;
    backdrop-filter: blur(2px);
}

/* ==========================================================================
   Loader
   ========================================================================== */
html.hide-loader #loader {
    display: none !important;
}

.loader {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}
.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.loader-logo {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(161,161,170,1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255,255,255,0.2);
}
.loader-subtitle {
    font-size: 1rem;
    color: #a1a1aa;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}
.loader-line-container {
    width: 200px;
    height: 1px;
    background: rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}
.loader-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* PJAX Transition Class */
.is-transitioning {
    pointer-events: none;
}

/* ==========================================================================
   Navbar (Glassmorphism)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: padding var(--transition-medium), background var(--transition-medium);
}
.navbar.scrolled {
    padding: 1rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}
.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-links {
    display: flex;
    gap: 1.5rem;
}
.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-medium);
}
.nav-link:hover::after {
    width: 100%;
}

/* Navbar Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    padding: 0.5rem 0;
    transition: color var(--transition-fast);
}
.nav-dropdown-toggle:hover {
    color: var(--accent-color);
}
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--glass-bg-solid);
    backdrop-filter: blur(12px);
    border: 1px solid var(--hover-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1010;
}
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
    display: block;
    padding: 0.6rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.nav-dropdown-item:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: none; /* since we have custom cursor */
    border: none;
    outline: none;
}
.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
    box-shadow: 0 4px 14px 0 rgba(0,0,0,0.1);
}
.dark-theme .btn-primary {
    background: #fff;
    color: #000;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,255,255,0.15);
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: var(--bg-secondary);
}
.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-primary);
    display: flex;
    cursor: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 2rem 0; /* Offset for navbar */
    overflow: hidden;
}
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.5;
}
.hero-container {
    max-width: 1000px;
    text-align: center;
    z-index: 1;
    position: relative;
}
.hero-greeting {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-inline: auto;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}
.hero-social {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}
.social-link {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}
.social-link:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Footer
/* ==========================================================================
   Footer (Premium Design)
   ========================================================================== */
.footer {
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
    background: var(--hero-gradient);
    overflow: hidden;
}

/* Glowing Orb */
.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 500px; height: 300px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.12) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    gap: 2rem;
}

.footer-brand h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: 4rem;
    padding-right: 2rem; /* Add some padding so it doesn't collide with the fixed console if possible */
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-col h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.footer-col a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col a::before {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-fast);
    color: var(--accent-color);
}

.footer-col a:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

.footer-col a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-bottom {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
}

/* ==========================================================================
   Micro Interactions & Layout Helpers
   ========================================================================== */
.lift-card {
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}
.lift-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Markdown Typography (For Case Studies & Blog)
   ========================================================================== */
.markdown-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.markdown-content h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.markdown-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.markdown-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-content pre {
    background-color: #1e1e1e; /* hljs atom-one-dark background */
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.markdown-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    background-color: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

/* ==========================================================================
   Noise Layer (Subtle Film Grain)
   ========================================================================== */
.noise-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Spotlight Hover Effect
   ========================================================================== */
.lift-card {
    position: relative;
    overflow: hidden;
}
.lift-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}
.lift-card:hover::before {
    opacity: 1;
}

/* ==========================================================================
   Engineering Console (Premium Telemetry) 10/10
   ========================================================================== */
.engineering-console {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9900;
    width: 160px;
    min-width: 140px;
    min-height: 120px;
    max-width: 400px;
    max-height: 500px;
    resize: both;
    border-radius: 12px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    padding: 0.8rem;
    transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
    transform: translateY(150%);
    animation: slideUpConsole 0.8s 1s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpConsole {
    to { transform: translateY(0); }
}

.engineering-console:hover {
    background: var(--hover-bg);
    border-color: var(--hover-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.console-noise {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.console-header {
    margin-bottom: 1rem;
}

.console-header span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    display: block;
    line-height: 1.3;
}

.console-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.console-status-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.2rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--color-green);
    border-radius: 50%;
    animation: breathingDot 4s ease-in-out infinite;
}

@keyframes breathingDot {
    0%, 100% { box-shadow: 0 0 4px var(--color-green); opacity: 0.6; }
    50% { box-shadow: 0 0 10px var(--color-green); opacity: 1; }
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-green);
}

.primary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.stat-value {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
}

.inspect-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.inspect-btn:hover {
    background: var(--hover-border);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.inspect-btn.is-inspecting {
    background: var(--hover-bg);
    color: var(--color-green);
    border-color: var(--color-green);
    animation: pulseBtn 1s infinite alternate;
}

@keyframes pulseBtn {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Expanded Grid */
.console-expanded-grid {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.engineering-console.is-expanded .console-expanded-grid {
    display: flex;
}

.inspect-item {
    display: flex;
    align-items: center;
    font-size: 13px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s;
}

.engineering-console.is-expanded .inspect-item {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay */
.engineering-console.is-expanded .inspect-item:nth-child(1) { transition-delay: 0.1s; }
.engineering-console.is-expanded .inspect-item:nth-child(2) { transition-delay: 0.2s; }
.engineering-console.is-expanded .inspect-item:nth-child(3) { transition-delay: 0.3s; }
.engineering-console.is-expanded .inspect-item:nth-child(4) { transition-delay: 0.4s; }
.engineering-console.is-expanded .inspect-item:nth-child(5) { transition-delay: 0.5s; }
.engineering-console.is-expanded .inspect-item:nth-child(6) { transition-delay: 0.6s; }
.engineering-console.is-expanded .inspect-item:nth-child(7) { transition-delay: 0.7s; }

.inspect-icon {
    color: var(--color-green);
    margin-right: 8px;
    font-size: 11px;
}

.inspect-label {
    color: var(--text-secondary);
    flex: 1;
}

.inspect-val {
    color: var(--text-primary);
}

.inspect-val.mono {
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
}

.inspect-val.success {
    color: var(--color-green);
}

.system-healthy-msg {
    color: var(--color-green);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    text-align: center;
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s 0.9s, transform 0.4s 0.9s; /* Shows up last */
}

.engineering-console.is-expanded .system-healthy-msg {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .engineering-console {
        width: 100%;
        bottom: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }
}

/* ==========================================================================
   CMD+K Command Palette (Premium UI)
   ========================================================================== */
.cmd-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    opacity: 0;
    animation: fadeInOverlay 0.2s forwards ease-out;
}

@keyframes fadeInOverlay {
    to { opacity: 1; }
}

.cmd-palette {
    width: 100%;
    max-width: 640px;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--hover-border);
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: scale(0.98);
    animation: popInPalette 0.2s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popInPalette {
    to { transform: scale(1); }
}

.cmd-header {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cmd-search-icon {
    color: var(--text-secondary);
    margin-right: 12px;
}

#cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: var(--font-main);
    outline: none;
}

#cmd-input::placeholder {
    color: var(--text-secondary);
}

.cmd-badge {
    background: var(--hover-border);
    color: var(--text-secondary);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
}

.cmd-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Custom Scrollbar for CMD Body */
.cmd-body::-webkit-scrollbar { width: 6px; }
.cmd-body::-webkit-scrollbar-track { background: transparent; }
.cmd-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }

.cmd-group-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.75rem 1rem 0.25rem;
}

.cmd-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cmd-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    gap: 12px;
}

.cmd-item.is-selected, .cmd-item:hover {
    background: var(--hover-border);
    color: var(--text-primary);
}

.cmd-item-icon {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmd-item.is-selected .cmd-item-icon {
    color: var(--text-primary);
}

.cmd-item-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.cmd-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    height: 44px;
    padding: 0 1rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-secondary);
}

.cmd-shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.cmd-shortcut svg {
    color: var(--text-secondary);
}

/* ==========================================================================
   Architecture Decision Records (ADRs) Layout
   ========================================================================== */
.adr-page {
    min-height: 100vh;
    padding-bottom: 100px;
}

.adr-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    align-items: start;
}

@media (max-width: 992px) {
    .adr-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .adr-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 1rem;
    }
    
    .adr-sidebar-header {
        margin-bottom: 1rem !important;
    }
    
    .adr-nav ul {
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 10px !important;
        gap: 12px !important;
        scroll-snap-type: x mandatory;
    }
    
    .adr-nav ul::-webkit-scrollbar {
        height: 4px;
    }
    
    .adr-nav ul::-webkit-scrollbar-thumb {
        background: var(--glass-border);
        border-radius: 4px;
    }

    .adr-link {
        min-width: 200px;
        scroll-snap-align: start;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
    }
}

.adr-sidebar {
    position: sticky;
    top: 120px;
}

.adr-sidebar-header {
    margin-bottom: 2rem;
}

.adr-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.adr-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.adr-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adr-link {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.adr-link:hover {
    background: var(--glass-bg);
}

.adr-link.active {
    background: var(--hover-bg);
    border: 1px solid var(--hover-border);
}

.adr-link-id {
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.adr-link-title {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.adr-link-status {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.adr-link-status.accepted {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.adr-content-area {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
}

@media (max-width: 768px) {
    .adr-content-area {
        padding: 20px;
        border-radius: 16px;
    }
}

.adr-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--hover-border);
}

.adr-date {
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.adr-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
}

.adr-status-badge.accepted {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Premium Markdown Typography (Vercel / Notion Style)
   ========================================================================== */
.markdown-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 760px;
}

.markdown-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    border-bottom: 1px solid var(--hover-border);
    padding-bottom: 0.5rem;
}

.markdown-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.markdown-content p {
    margin-bottom: 1.5rem;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.markdown-content code {
    font-family: 'SF Mono', 'Roboto Mono', 'Courier New', Courier, monospace;
    font-size: 0.85em;
    background: var(--hover-bg);
    color: var(--color-pink);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.markdown-content pre {
    background: var(--terminal-bg);
    border: 1px solid var(--hover-border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 0 0 1px var(--glass-border);
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
}

.markdown-content blockquote {
    border-left: 3px solid var(--color-blue);
    margin: 0 0 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    color: var(--text-secondary);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), transparent);
    border-radius: 0 8px 8px 0;
}

/* ==========================================================================
   Mobile Menu & Responsiveness Updates
   ========================================================================== */

/* Utility Classes */
.mobile-only {
    display: none !important;
}

@media (max-width: 992px) {
    .custom-cursor,
    .custom-cursor-follower {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: inline-flex !important;
    }
    
    /* Navbar Mobile */
    .nav-links {
        display: none; /* Hidden by default on mobile, handled by overlay */
    }
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.is-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav-link {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--accent-color);
}

/* General Layout Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 2rem;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-top {
        flex-direction: column;
        gap: 3rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 3rem;
    }
    
    .footer-col {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .footer-col h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================================================
   Engineering Console & Music Widget
   ========================================================================== */

@media (max-width: 768px) {
    .engineering-console {
        display: none !important;
    }
}

.music-widget {
    position: fixed;
    top: 100px; /* Navbar'ın hemen altı */
    right: 30px;
    bottom: auto;
    left: auto;
    z-index: 900;
    display: flex;
    flex-direction: row-reverse; /* Buton sağda, player solda açılsın */
    align-items: center;
    gap: 15px;
}

.music-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.music-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.music-toggle.is-playing .music-icon {
    display: none; /* Hide static icon when playing */
}

/* Playing indicator on the toggle button */
.music-waves-icon {
    display: none; /* Hidden by default */
    align-items: center;
    gap: 3px;
    height: 16px;
}

.music-toggle.is-playing .music-waves-icon {
    display: flex; /* Show when playing */
}

.music-waves-icon .wave {
    width: 3px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 3px;
    transition: height 0.1s ease;
}

.music-toggle.is-playing .music-waves-icon .wave:nth-child(1) { animation: wave 1.2s infinite ease-in-out; }
.music-toggle.is-playing .music-waves-icon .wave:nth-child(2) { animation: wave 1.5s infinite ease-in-out 0.2s; }
.music-toggle.is-playing .music-waves-icon .wave:nth-child(3) { animation: wave 1.0s infinite ease-in-out 0.4s; }

@keyframes wave {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.music-player {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateX(20px) scale(0.9);
    transform-origin: right center;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.music-player.is-open {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: all;
}

.music-info {
    display: flex;
    flex-direction: column;
}

.music-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.music-artist {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.music-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.music-controls button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.music-controls button:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.volume-control input[type=range] {
    -webkit-appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.volume-control input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.volume-control input[type=range]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

@media (max-width: 768px) {
    .music-widget {
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: column-reverse; /* Buton altta, çalar üstte */
        align-items: flex-end;
    }
    .music-player {
        transform: translateY(20px) scale(0.9);
        transform-origin: bottom right;
    }
    .music-player.is-open {
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   Project Detail Page
   ========================================================================== */
.project-detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
}

@media (max-width: 992px) {
    .project-detail-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* ==========================================================================
   Projects Page & Bento Grid
   ========================================================================== */
.projects-header {
    padding-top: 150px;
    padding-bottom: 60px;
    text-align: center;
    position: relative;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.bento-item {
    grid-column: span 4;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
}

.bento-item.featured {
    grid-column: span 12;
    flex-direction: row;
    min-height: 360px;
}

.bento-item.featured .bento-image {
    width: 50%;
    height: 100%;
}

.bento-item.featured .bento-content {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.bento-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.bento-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-item:hover .bento-image img {
    transform: scale(1.05);
}

.bento-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bento-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.bento-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
}

.bento-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.bento-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

/* GitHub Repositories */
.github-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.github-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.github-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.github-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.github-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
}

.github-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.github-title:hover {
    text-decoration: underline;
}

.github-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 20px;
}

.github-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.github-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

.github-lang {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

@media (max-width: 992px) {
    .bento-item {
        grid-column: span 6;
    }
    .bento-item.featured {
        grid-column: span 12;
        flex-direction: column;
        min-height: auto;
    }
    .bento-item.featured .bento-image,
    .bento-item.featured .bento-content {
        width: 100%;
    }
    .bento-item.featured .bento-image {
        height: 250px;
    }
    .bento-item.featured .bento-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .bento-item {
        grid-column: span 12;
    }
}

/* ==========================================================================
   Language Toggle Button
   ========================================================================== */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.lang-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent-color);
}
.lang-toggle .lang-flag {
    font-size: 1rem;
    line-height: 1;
}

/* ==========================================================================
   Hero Animated Gradient Blob
   ========================================================================== */
.hero-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
    animation: blobFloat 12s ease-in-out infinite;
}
.hero-blob--1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -200px;
    left: -200px;
}
.hero-blob--2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -200px;
    right: -200px;
    animation-delay: -4s;
    animation-duration: 15s;
}
.hero-blob--3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    animation-delay: -8s;
    animation-duration: 18s;
}
@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -50px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(50px, 30px) scale(1.05); }
}
.dark-theme .hero-blob { opacity: 0.08; }

/* Hero Text Rotation */
.hero-role-wrapper {
    display: inline-block;
    position: relative;
    min-width: 300px;
}
.hero-role {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 50%, #f5576c 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ==========================================================================
   Tech Stack Cards (Premium Grid)
   ========================================================================== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
}
.tech-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.tech-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(120, 119, 255, 0.08), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.tech-card:hover::before { opacity: 1; }
.tech-card:hover {
    transform: translateY(-6px);
    border-color: rgba(120, 119, 255, 0.3);
    box-shadow: 0 12px 30px rgba(120, 119, 255, 0.1);
}
.tech-card-icon {
    font-size: 2rem;
    line-height: 1;
}
.tech-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* ==========================================================================
   Why Me Section
   ========================================================================== */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .why-grid { grid-template-columns: 1fr; }
}
.why-card {
    padding: 40px 30px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.why-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    transition: width 0.4s, background 0.4s;
}
.why-card:nth-child(1)::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.why-card:nth-child(2)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.why-card:nth-child(3)::before { background: linear-gradient(90deg, #f093fb, #f5576c); }
.why-card:hover::before { width: 100%; }
.why-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
.why-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.why-card:nth-child(1) .why-card-icon { background: rgba(102, 126, 234, 0.1); color: #667eea; }
.why-card:nth-child(2) .why-card-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.why-card:nth-child(3) .why-card-icon { background: rgba(240, 147, 251, 0.1); color: #f093fb; }
.why-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.why-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ==========================================================================
   Footer CTA & Redesign
   ========================================================================== */
.footer-cta {
    text-align: center;
    padding: 80px 2rem;
    position: relative;
    overflow: hidden;
}
.footer-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}
.footer-cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.footer-cta-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 2rem;
}
.footer-cta .btn-primary {
    padding: 14px 36px;
    font-size: 1.05rem;
    border-radius: 999px;
}

/* ==========================================================================
   Form Polish
   ========================================================================== */
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.form-input, .form-textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}
.form-input:focus, .form-textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.form-textarea {
    resize: vertical;
    min-height: 130px;
}

/* ==========================================================================
   Stats Bar
   ========================================================================== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 40px 0;
}
@media (max-width: 768px) {
    .stats-bar { gap: 30px; flex-wrap: wrap; }
}
.stat-item {
    text-align: center;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #667eea, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==========================================================================
   Section Divider
   ========================================================================== */
.section-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 0;
    border: none;
}

/* ==========================================================================
   Responsive: Tech Grid
   ========================================================================== */
@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .tech-card {
        padding: 16px 10px;
    }
    .footer-cta-title {
        font-size: 1.8rem;
    }
    .stats-bar {
        gap: 20px;
    }
    .stat-number {
        font-size: 1.8rem;
    }
}

.markdown-content img { border-radius: 12px; max-width: 100%; height: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.3); margin: 2rem 0; }
.markdown-content table { width: 100%; border-collapse: collapse; margin: 2rem 0; }
.markdown-content th, .markdown-content td { padding: 1rem; border: 1px solid var(--hover-border); text-align: left; }
.markdown-content th { background: var(--hover-bg); font-weight: 600; }

/* Cross-Document View Transitions */
@view-transition {
  navigation: auto;
}




/* ==========================================================================
   Phase 4: UI/UX Enhancements (Public Site)
   ========================================================================== */

/* 1. Custom Cursor */
body {
    cursor: none; /* Hide default cursor */
}
.custom-cursor, .custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}
.custom-cursor {
    width: 8px;
    height: 8px;
    background-color: var(--text-primary);
    mix-blend-mode: difference;
}
.custom-cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--text-secondary);
    transition: width 0.3s, height 0.3s, transform 0.1s ease-out;
}
.cursor-hover .custom-cursor {
    width: 4px;
    height: 4px;
}
.cursor-hover .custom-cursor-follower {
    width: 60px;
    height: 60px;
    background-color: rgba(255,255,255,0.05);
    border-color: var(--text-primary);
}

/* 2. Spotlight Effect */
.spotlight-card {
    position: relative;
    overflow: hidden;
}
.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(255,255,255,0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}
.spotlight-card:hover::before {
    opacity: 1;
}

/* 3. Scroll Animations (Fade-In Up) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 4. Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.show {
    transform: translateX(0);
}
.toast.success i { color: #10b981; }
.toast.error i { color: #ef4444; }

/* Footer Social Icons Styling */
.footer-social-wrapper {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.footer-social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--hover-border);
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary) !important;
    transition: all 0.3s ease !important;
    text-decoration: none;
    padding: 0 !important;
}
.footer-col .footer-social-link::before {
    display: none !important;
}
.footer-social-link:hover {
    background: var(--accent-color);
    color: #fff !important;
    border-color: var(--accent-color);
    transform: translateY(-3px) !important;
}

