:root {
    --bg-color: #ffffff;
    --text-primary: #111111;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #eaeaea;
    --border-light: #f5f5f5;
    --accent: #fbbf24;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
    --bg-color: #111111;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --border-color: #333333;
    --border-light: #222222;
    --accent: #fbbf24;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Animated Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Background Style Picker */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
    cursor: default;
    user-select: none;
    transition: border-color 0.2s;
}

.live-counter:hover {
    border-color: var(--text-muted);
}

.visit-count-label {
    opacity: 0.6;
    font-weight: 600;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ef4444;
    border-radius: 50%;
    top: 0;
    left: 0;
    transform-origin: center center;
    animation: live-ripple 1.8s ease-out infinite;
}

@keyframes live-ripple {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    70% {
        transform: scale(3);
        opacity: 0;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}


.bg-picker {
    position: relative;
    z-index: 500;
    display: flex;
    flex-direction: column;
}

.bg-picker-trigger {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s;
}

.bg-picker:hover .bg-picker-trigger {
    color: var(--text-muted);
}

.bg-picker-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    opacity: 0;
    transform: translateY(6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    min-width: 130px;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
}

.bg-picker:hover .bg-picker-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.bg-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    transition: all 0.15s;
    width: 100%;
    text-align: left;
}

.bg-option i {
    width: 14px;
    text-align: center;
    font-size: 0.8rem;
}

.bg-option:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.bg-option.active {
    background: var(--border-light);
    color: var(--text-primary);
    font-weight: 600;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    position: sticky;
    top: 0;
    background: var(--bg-color);
    opacity: 0.95;
    backdrop-filter: blur(8px);
    z-index: 100;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

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

.nav-resume-btn {
    font-family: var(--font-mono);
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    text-decoration: none;
    color: var(--text-primary) !important;
    border: 1px solid var(--text-primary);
    padding: 5px 12px;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
}

.nav-resume-btn:hover {
    background: var(--text-primary) !important;
    color: var(--bg-color) !important;
}

.nav-resume-btn i {
    transition: color 0.2s;
}

.nav-resume-btn:hover i {
    color: var(--bg-color) !important;
}


/* Hero Section */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.avatar-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    padding: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.divider {
    color: var(--border-color);
}

.role {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bio {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

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

.social-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-align: left;
}

.social-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
    justify-content: flex-start;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.pill i {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.pill:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pill:hover i {
    color: var(--bg-color);
}

.hero-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Hero bottom-left decoration strip */
.hero-deco {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeInUp 0.8s ease 0.6s both;
}

.deco-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    opacity: 0.7;
}

.deco-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border-color);
}

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

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.action-btn i {
    transition: color 0.2s;
}

.action-btn:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.action-btn:hover i {
    color: var(--bg-color);
}

/* Sections */
.section {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* Stats Overview */
.stats-overview {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-item strong {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.project-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.04);
}

.project-image {
    height: 180px;
    background: linear-gradient(135deg, var(--border-light) 0%, var(--border-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(to right, rgba(0,0,0,0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.project-image i {
    font-size: 3rem;
    color: rgba(0,0,0,0.1);
    z-index: 1;
}

.project-content {
    padding: 24px;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.project-links a {
    color: var(--text-secondary);
    margin-left: 12px;
    font-size: 1rem;
    transition: color 0.2s;
}

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

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-stack-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tech-pill {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--border-light);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1;
}


.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    position: relative;
    flex-shrink: 0;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #10b981;
    transform-origin: center center;
    animation: status-ripple 2.2s ease-out infinite;
}

@keyframes status-ripple {
    0%   { transform: scale(1); opacity: 0.8; }
    70%  { transform: scale(2.8); opacity: 0; }
    100% { transform: scale(2.8); opacity: 0; }
}

.view-details {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.view-details:hover {
    color: var(--text-primary);
}

.center-btn {
    text-align: center;
    margin-top: 16px;
}

/* Codeforces Section */
.cf-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.cf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cf-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.cf-rating {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cf-rating strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.chart-container {
    height: 300px;
    width: 100%;
}

/* About Section */
.about-section p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 800px;
}

mark {
    background-color: rgba(135, 209, 188, 0.913); /* Soft yellow rgba(251, 191, 36, 0.3); */
    padding: 0 4px;
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Skeletons */
.skeleton-card {
    height: 400px;
    background: var(--border-light);
    border-radius: 16px;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: flex-end;
    padding: 40px 0;
}

.scroll-top {
    display: none;
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.blog-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.06);
}

.blog-card-cover {
    height: 160px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, var(--border-light), var(--border-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(0,0,0,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.04) 1px, transparent 1px);
    background-size: 16px 16px;
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-cover-icon {
    font-size: 2.5rem;
    color: rgba(0,0,0,0.08);
    z-index: 1;
}

.blog-card-body { padding: 20px; }

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag-pill {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
    background: var(--border-light);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.blog-card-excerpt {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.blog-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.blog-empty i { display: block; font-size: 2rem; margin-bottom: 12px; opacity: 0.3; }

.leetcode-calendar {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.leetcode-calendar .calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}
.leetcode-calendar .month-year-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 160px;
}
.leetcode-calendar .nav-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.leetcode-calendar .nav-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
    border-color: var(--text-muted);
}
.leetcode-calendar .calendar-header .month {
    font-size: 1.25rem;
    font-weight: 600;
}
.leetcode-calendar .calendar-header .year {
    font-size: 1rem;
    color: var(--text-secondary);
}

.leetcode-calendar .calendar-grid {
    display: grid;
    gap: 4px;
    justify-content: center;
}

.leetcode-calendar .calendar-grid .day {
    aspect-ratio: 1;
    border-radius: 3px;
    background: var(--border-light);
}

.leetcode-calendar .calendar-grid .day.empty {
    background: transparent;
}
.leetcode-calendar .calendar-grid .day.solved.level-1 {
    background: #d1fae5;
}
.leetcode-calendar .calendar-grid .day.solved.level-2 {
    background: #6ee7b7;
}
.leetcode-calendar .calendar-grid .day.solved.level-3 {
    background: #10b981;
}
.leetcode-calendar .calendar-grid .day.solved.level-4 {
    background: #047857;
}

/* Chakra Tech Stack Animation */
.tech-stack-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px dashed var(--border-color);
}

.tech-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.chakra-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    overflow: hidden;
}

.chakra-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chakra-center {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.chakra-center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.chakra-center-content i {
    font-size: 2.5rem;
    transition: all 0.3s ease;
}

.chakra-center-content span {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
}

.chakra-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px dashed var(--border-light);
    animation: spin 30s linear infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chakra-container:hover .chakra-ring {
    animation-play-state: paused;
}

.chakra-orbit {
    position: absolute;
    /* Must rotate before translate to form a circle */
    transform: rotate(calc(36deg * var(--i))) translateY(-150px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.chakra-icon {
    font-size: 2rem;
    color: var(--text-muted);
    background: var(--bg-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    /* Static offset to stay upright */
    transform: rotate(calc(-36deg * var(--i)));
    /* Animate the independent rotate property */
    animation: reverse-spin 30s linear infinite;
}

.chakra-container:hover .chakra-icon {
    animation-play-state: paused;
}

.chakra-icon:hover {
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

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

@keyframes reverse-spin {
    from { rotate: 0deg; }
    to { rotate: -360deg; }
}

/* Post Modal */
.post-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 24px 60px;
    overflow-y: auto;
}

.post-modal.hidden { display: none; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    background: var(--bg-color);
    border-radius: 20px;
    max-width: 740px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0,0,0,0.18);
    animation: modal-in 0.25s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-close:hover { color: var(--text-primary); transform: scale(1.05); }

.modal-cover {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.modal-body { padding: 36px; }

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.modal-meta {
    display: flex;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-meta span { display: flex; align-items: center; gap: 6px; }

.modal-loading {
    display: flex;
    justify-content: center;
    padding: 60px;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Rendered Markdown in Modal */
.modal-markdown { line-height: 1.85; font-size: 1rem; color: var(--text-secondary); }
.modal-markdown h1, .modal-markdown h2, .modal-markdown h3 { color: var(--text-primary); margin: 1.5em 0 0.5em; font-weight: 600; }
.modal-markdown h1 { font-size: 1.6rem; }
.modal-markdown h2 { font-size: 1.3rem; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.modal-markdown p { margin-bottom: 1em; }
.modal-markdown code { background: var(--border-light); border-radius: 4px; padding: 2px 6px; font-family: var(--font-mono); font-size: 0.85em; }
.modal-markdown pre { background: #f8f8f8; border: 1px solid var(--border-color); border-radius: 10px; padding: 18px; overflow-x: auto; margin: 1.2em 0; }
.modal-markdown pre code { background: none; padding: 0; }
.modal-markdown blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text-muted); font-style: italic; margin: 1em 0; }
.modal-markdown a { color: #2563eb; }
.modal-markdown ul, .modal-markdown ol { padding-left: 1.6em; margin-bottom: 1em; }
.modal-markdown img { max-width: 100%; border-radius: 8px; margin: 1em 0; }
.modal-markdown strong { color: var(--text-primary); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        flex-direction: column;
        gap: 4px;
    }
    .divider { display: none; }
    .hero-actions { justify-content: center; }

    /* Fix mobile horizontal overflow / content shift */
    body {
        overflow-x: hidden;
    }
    .container {
        padding: 0 16px;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .navbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 0;
    }
    .nav-links {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0.65rem;
    }
    .nav-links a {
        font-size: 0.65rem;
    }
    .nav-resume-btn {
        font-size: 0.65rem !important;
        padding: 4px 8px;
    }
    .nav-controls {
        gap: 10px;
    }
    .live-counter {
        font-size: 0.62rem;
        padding: 4px 8px;
    }
    .stats-overview {
        gap: 16px;
        flex-wrap: wrap;
    }
    .blog-grid {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .hero {
        padding: 48px 0 40px;
    }
}

/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 40px;
    margin-top: 24px;
}

.contact-form-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

/* .btn-primary {
    padding: 12px 24px;
    background: var(--bg-secondary);
    color: rgb(0, 0, 0);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
} */

/* Default state: inverted colors based on theme */
.btn-primary {
    padding: 12px 24px;
    background: var(--text-primary);
    color: var(--bg-color);
    border: 2px solid var(--text-primary);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

/* Ensure icon and text follow button color */
.btn-primary i,
.btn-primary span {
    color: inherit;
}

/* Hover state */
.btn-primary:hover {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Optional active state */
.btn-primary:active {
    transform: translateY(0);
}

.form-status {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.form-status.hidden { display: none; }
.form-status.error { color: #ef4444; }
.form-status.success { color: #10b981; }

.contact-info-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-info-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.contact-icon-box {
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-info-content h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.contact-info-content a,
.contact-info-content p {
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
}

.contact-socials {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.social-link {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.social-link:hover {
    background: var(--text-primary);
    color: var(--bg-color);
    border-color: var(--text-primary);
}

@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Hero Bolt Animation */
.hero-bolt {
    color: var(--text-primary);
    transition: all 0.3s ease;
}
.hero-bolt:hover {
    color: #fbbf24;
    animation: zap 0.4s ease-in-out;
}
@keyframes zap {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(-15deg); }
    50% { transform: scale(0.9) rotate(15deg); }
    75% { transform: scale(1.1) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Role Animation */
.role {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    display: inline-block;
}
.role.fade-out {
    opacity: 0;
    transform: translateY(-5px);
}
.role.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-light);
    margin-top: 60px;
}
.footer-content {
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Stylish Loader Styles ── */
.stylish-loader-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
    border-radius: 12px;
}

.stylish-loader-animation {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer Pulsing Ring (Clockwise) */
.stylish-loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-bottom-color: var(--accent);
    border-radius: 50%;
    animation: loader-spin-clockwise 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

/* Inner Spinning Square/Diamond (Anti-clockwise) */
.stylish-loader-inner {
    position: absolute;
    width: 60%;
    height: 60%;
    border: 2px solid transparent;
    border-left-color: var(--text-primary);
    border-right-color: var(--text-primary);
    border-radius: 50%;
    opacity: 0.8;
    animation: loader-spin-counter 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

/* Core glowing core */
.stylish-loader-core {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent);
    animation: loader-pulse 1.2s ease-in-out infinite alternate;
}

/* Bouncing network lines */
.stylish-loader-bars {
    display: flex;
    gap: 4px;
    margin-top: 24px;
    align-items: center;
    height: 20px;
}

.stylish-loader-bar {
    width: 3px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    animation: loader-bar-bounce 1s ease-in-out infinite;
}

.stylish-loader-bar:nth-child(1) { animation-delay: 0.1s; }
.stylish-loader-bar:nth-child(2) { animation-delay: 0.2s; }
.stylish-loader-bar:nth-child(3) { animation-delay: 0.3s; }
.stylish-loader-bar:nth-child(4) { animation-delay: 0.4s; }
.stylish-loader-bar:nth-child(5) { animation-delay: 0.5s; }

/* Status Text */
.stylish-loader-text {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
    animation: loader-text-pulse 1.5s ease-in-out infinite alternate;
}

/* Keyframes */
@keyframes loader-spin-clockwise {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes loader-spin-counter {
    0% { transform: rotate(360deg) scale(1); }
    50% { transform: rotate(-180deg) scale(0.9); }
    100% { transform: rotate(-360deg) scale(1); }
}

@keyframes loader-pulse {
    0% { transform: scale(0.8); opacity: 0.5; box-shadow: 0 0 5px var(--accent); }
    100% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 20px var(--accent); }
}

@keyframes loader-bar-bounce {
    0%, 100% { height: 6px; transform: translateY(0); opacity: 0.3; }
    50% { height: 18px; transform: translateY(-4px); opacity: 1; background: var(--accent); }
}

@keyframes loader-text-pulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}


/* ── Custom Rocket Scroll to Top ── */
.custom-rocket-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 30px;
    height: 60px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.custom-rocket-wrapper.show {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.custom-rocket-wrapper:hover {
    transform: translateY(-5px);
}

.rocket-body {
    position: absolute;
    top: 0;
    left: 5px;
    width: 20px;
    height: 45px;
    background: var(--text-primary);
    border-radius: 50% 50% 10% 10% / 40% 40% 10% 10%;
    z-index: 2;
    transition: background 0.3s, box-shadow 0.3s;
}

.custom-rocket-wrapper:hover .rocket-body {
    background: var(--accent);
}

.rocket-window {
    position: absolute;
    top: 12px;
    left: 5px;
    width: 10px;
    height: 10px;
    background: var(--bg-color);
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.rocket-fin-left, .rocket-fin-right {
    position: absolute;
    bottom: 15px;
    width: 12px;
    height: 20px;
    background: var(--text-secondary);
    z-index: 1;
    transition: background 0.3s;
}

.custom-rocket-wrapper:hover .rocket-fin-left,
.custom-rocket-wrapper:hover .rocket-fin-right {
    background: var(--text-primary);
}

.rocket-fin-left {
    left: -2px;
    border-radius: 100% 0 0 0;
    transform: skewY(-20deg);
}

.rocket-fin-right {
    right: -2px;
    border-radius: 0 100% 0 0;
    transform: skewY(20deg);
}

.rocket-exhaust {
    position: absolute;
    bottom: 12px;
    left: 9px;
    width: 12px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 0 0 50% 50%;
    z-index: 3;
}

/* Launching states */
.custom-rocket-wrapper.launching {
    animation: rocket-rumble 0.4s linear infinite;
    pointer-events: none;
}

.custom-rocket-wrapper.launching .rocket-body {
    background: var(--accent);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.custom-rocket-wrapper.fly-away {
    transition: transform 1.2s cubic-bezier(0.3, 0, 0.2, 1);
    transform: translateY(-120vh);
}

/* Smoke / fire particles */
.rocket-flame {
    position: fixed;
    width: 8px;
    height: 8px;
    background: #ef4444; /* red */
    border-radius: 50%;
    pointer-events: none;
    z-index: 998;
    box-shadow: 0 0 8px #ef4444;
    animation: flame-burn 0.6s ease-out forwards;
}

.rocket-flame.spark {
    background: #fbbf24; /* yellow */
    box-shadow: 0 0 8px #fbbf24;
}

/* Keyframes */
@keyframes rocket-rumble {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes flame-burn {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* Calendar X-Axis */
.calendar-x-axis {
    margin-top: 8px;
    padding: 0 4px;
}

.x-axis-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: left;
}