:root {
    --primary-color: #007bff;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #343a40;
    --text-secondary-color: #6c757d;
    --border-color: #dee2e6;
    --body-bg-image: url('/patterns/geometry.svg');
}

body.dark-mode {
    --primary-color: #007bff;
    --background-color: #121417;
    --surface-color: #1f242d;
    --text-color: #f8f9fa;
    --text-secondary-color: #adb5bd;
    --border-color: #343a40;
    --body-bg-image: url('/patterns/geometry.svg');
}

* {
    margin: 0;
    padding: 0;

    box-sizing: border-box;
}

body {
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    margin: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: var(--body-bg-image);
    background-repeat: repeat;
    z-index: -9999 !important;
    filter: none;
    opacity: 0.04 !important;
}

body.dark-mode::before {
    opacity: 0.15;
    filter: invert(1) brightness(1.4);
}

.social-sidebar {
    position: static;
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 30px 0 30px;
}

.social-sidebar a {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: inherit;
    padding: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-sidebar a:hover {
}

body.dark-mode .social-sidebar a.github-link,
body.dark-mode .social-sidebar a.medium-link {
    background-color: #ffffff;
    border-radius: 6px;
}

body.dark-mode .social-sidebar a.leetcode-link {
    background-color: #ffffff;
    border-radius: 6px;
    color: #ffa116;
}

body.dark-mode .social-sidebar a.x-link {
    background-color: #ffffff;
    border-radius: 6px;
}

.social-sidebar a.linkedin-link {
    color: #0a66c2;
}

.social-sidebar a.leetcode-link {
    color: #ffa116;
}

.social-sidebar a.x-link {
    color: #000000;
}

.social-sidebar .social-link i {
    line-height: 1;
    font-size: 1.4rem;
}

.social-sidebar .social-img {
    width: 26px;
    height: 26px;
    display: inline-block;
}

.social-sidebar .icon-leetcode,
.social-sidebar .icon-medium {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-sidebar .icon-x {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-sidebar .icon-leetcode svg {
    width: 100%;
    height: 100%;
}

.social-sidebar .icon-medium svg {
    width: 100%;
    height: 100%;
}

.social-sidebar .icon-codeforces {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    transform: rotate(0deg);
}

.social-sidebar .icon-codeforces svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 600px) {
    .social-sidebar {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        padding: 16px;
    }

    .social-sidebar a {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 1.2rem;
    }
}

.main-content {
    padding: 40px;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-align: center;
}

h2 i {
    margin-right: 10px;
}

/* Header */
.page-header {
    padding: 40px 0; /* Reduced from 50px */
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}



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

.header-text .intro-greeting {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.header-text .intro-name {
    font-size: clamp(2.4rem, 5.5vw, 3.2rem);
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
    margin: 0 0 20px;
}

.header-text .intro-headline {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    margin: 0 0 18px;
    padding: 0;
    border: none;
    text-align: left;
}

.header-text .description {
    font-size: 1rem;
    color: var(--text-secondary-color);
    max-width: 38rem;
    margin: 0;
}

.profile-image-square {
    width: 200px;
    height: 200px;
    border-radius: 10%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    object-fit: cover; /* Ensures the image covers the area, cropping if necessary */
    object-position: center 30%; /* Focuses on the upper chest to face */
}

.theme-toggle-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.theme-toggle-btn:hover {
    color: var(--primary-color);
}



/* About Section */
#about {
    /* Styles moved to .boxed-section */
}

#about p {
    font-size: 1.1rem;
    line-height: 1.75; /* Slightly more breathing room for larger text */
    color: var(--text-color);
    padding-top: 15px; /* Reduced from 20px */
}

/* Contact Me Section */
#contact-me {
    padding: 30px 0;
}
    --body-bg-image: url('/patterns/geometry.svg');
    --pattern-opacity: 0.45;
#contact-me h2 i {
    margin-right: 10px;
}

.contact-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 620px;
    margin: 30px auto 0;
}

.contact-row {
    display: flex;
    gap: 24px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

.contact-row.top-row {
    justify-content: space-between;
    flex-wrap: wrap;
}

.contact-row.bottom-row {
    justify-content: center;
}

.contact-btn {
    text-decoration: none;
    color: #fff;
    padding: 14px 26px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 240px;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    background-color: var(--primary-color);
}

.contact-btn.phone { background-color: #0a7c4a; }
.contact-btn.email { background-color: #ea4335; }
.contact-btn.resume { background-color: #0066ff; }

.contact-btn .label {
    white-space: nowrap;
}

.contact-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.14);
}

.contact-container,
.contact-row {
    background-color: transparent !important;
}

.contact-row.top-row,
.contact-row.bottom-row {
    background-color: var(--surface-color) !important;
}

.brand-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.brand-icon svg,
.brand-icon i {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-icon i {
    line-height: 1;
}

.label {
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn i {
    margin-right: 8px;
}

/* Skills Section */
#skills {
    padding: 30px 0;
    background-color: var(--surface-color);
    margin-top: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#skills:hover {
    transform: translateY(-7px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.skills-categories {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 30px;
}

.skill-category h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.skill-category p {
    margin: 6px 0;
    color: var(--text-color);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

/* Featured Projects List */
#projects-list {
    padding: 30px 0;
}

#projects-list ul {
    list-style: none;
    text-align: center;
}

#projects-list li {
    margin-bottom: 10px;
}

#projects-list a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: color 0.3s, transform 0.3s, background-color 0.3s;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
}

#projects-list a:hover {
    color: #fff;
    background-color: var(--primary-color);
    transform: translateX(7px) scale(1.03);
}

#projects-list a i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* Projects Section */
#projects {
    padding: 30px 0;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1500px;
    margin: 0 auto;
}

.project-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: box-shadow 0.3s, transform 0.3s;
    background-color: var(--surface-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: flex;
    overflow: hidden;
}

.project-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-15px) scale(1.05);
}

.project-image-horizontal {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.project-image-placeholder-vertical {
    flex: 0 0 150px; /* Adjust width for vertical */
    background-color: var(--border-color);
    border-right: 1px solid var(--border-color);
    background-size: cover;
    background-position: center;
}

.project-content {
    padding: 35px;
    flex-grow: 1;
}

.project-content h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
    border-bottom: none;
    text-align: left;
}

.project-content p {
    margin-bottom: 15px;
    color: var(--text-color);
}

.project-content p strong {
    font-weight: 700;
    color: var(--primary-color);
}

.project-content p i {
    margin-right: 8px;
    color: var(--primary-color);
}

.project-tags {
    margin-top: 20px;
    margin-bottom: 15px;
}

.project-tags span {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-right: 10px;
    margin-bottom: 10px;
}

.project-tags span i {
    margin-right: 8px;
    color: #fff;
}

.project-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin-top: 15px;
}

.project-link:hover {
    text-decoration: underline;
}

.experience-section {
    padding: 40px 0;
}

.experience-block {
    max-width: 900px;
    margin: 0 auto;
}

.experience-entry {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    margin-bottom: 24px;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.experience-header h3 {
    margin-bottom: 6px;
    color: var(--text-color);
}

.experience-header .role {
    font-style: italic;
    color: var(--text-secondary-color);
}

.experience-meta {
    text-align: right;
    color: var(--text-secondary-color);
    font-weight: 600;
}

.experience-entry ul {
    padding-left: 20px;
    color: var(--text-color);
}

.experience-entry li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.experience-entry li strong {
    color: var(--text-color);
}

.projects-timeline {
    padding: 40px 0;
}

.projects-timeline .experience-block {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    padding: 0 20px;
}

.projects-timeline .experience-block h2 {
    grid-column: 1 / -1;
    text-align: center;
}

.project-entry {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-entry::before {
    content: none;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.project-header h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-color);
}

.project-stack {
    font-weight: 600;
    color: var(--text-secondary-color);
}

.project-entry ul {
    padding-left: 18px;
    margin: 10px 0;
    color: var(--text-color);
    font-size: 0.85rem;
}

.project-entry li {
    margin-bottom: 4px;
    line-height: 1.3;
}

.project-entry li strong {
    color: var(--text-color);
}

.project-link-inline {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
}

.project-link-inline i {
    font-size: 0.9rem;
}

.project-link-inline:hover {
    text-decoration: underline;
}

.project-entry .project-link {
    margin-top: auto;
}

.blogs-section {
    padding: 40px 0;
}

.blogs-section .container {
    max-width: 880px;
}

.blogs-section .blogs-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.blogs-section .blogs-grid h2 {
    grid-column: 1 / -1;
    text-align: center;
}

.blog-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-card h3 {
    font-size: 1.2rem;
    color: var(--text-color);
}

.blog-card p {
    color: var(--text-secondary-color);
    line-height: 1.5;
}

.blog-link {
    margin-top: auto;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.blog-link i {
    font-size: 0.9rem;
}

.blog-link:hover {
    text-decoration: underline;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    .container {
        padding: 10px;
    }

    .page-header {
        padding: 30px 0;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-image-placeholder-square {
        margin-bottom: 20px;
    }

    .header-text .intro-name {
        font-size: clamp(2rem, 9vw, 2.6rem);
        margin-bottom: 16px;
    }

    .header-text .intro-greeting {
        font-size: 0.95rem;
        letter-spacing: 0.08em;
    }

    .header-text .description {
        font-size: 0.95rem;
    }

    .theme-toggle-btn {
        top: 10px;
        right: 10px;
    }

    #about p {
        font-size: 1rem;
    }

    .contact-container {
        max-width: 320px;
        gap: 16px;
    }

    .contact-row {
        flex-direction: column;
        gap: 12px;
    }

    .contact-btn {
        width: 100%;
        min-width: 0;
    }

    .skills-categories {
        gap: 24px;
    }

    .project-card {
        flex-direction: column;
    }

    .project-image-placeholder-horizontal,
    .project-image-placeholder-vertical {
        width: 100%;
        height: 150px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .project-content {
        padding: 15px;
    }

    .project-content h3 {
        font-size: 1.4rem;
    }

    .project-tags span {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .projects-timeline .experience-block {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .blogs-section .blogs-grid {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
}

.project-image-gallery {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.project-image-gallery img {
    width: 50%;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes wave {
    0%, 40%, 100% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(-20px);
    }
}

.header-text h1 span {
    display: inline-block;
}

.header-text h1.animate-wave span {
    animation: wave 1.6s ease;
    animation-iteration-count: 1;
    animation-delay: calc(0.1s * var(--i));
    animation-fill-mode: forwards;
}

.wavy-hover span {
    display: inline-block;
    transition: color 0.3s ease, transform 0.3s ease;
}

.wavy-hover:hover span {
    color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
}

.wavy-hover:hover span:nth-child(1) {
    transition-delay: 0.05s;
}
.wavy-hover:hover span:nth-child(2) {
    transition-delay: 0.1s;
}
.wavy-hover:hover span:nth-child(3) {
    transition-delay: 0.15s;
}
.wavy-hover:hover span:nth-child(4) {
    transition-delay: 0.2s;
}
.wavy-hover:hover span:nth-child(5) {
    transition-delay: 0.25s;
}
.wavy-hover:hover span:nth-child(6) {
    transition-delay: 0.3s;
}
.wavy-hover:hover span:nth-child(7) {
    transition-delay: 0.35s;
}
.wavy-hover:hover span:nth-child(8) {
    transition-delay: 0.4s;
}
.wavy-hover:hover span:nth-child(9) {
    transition-delay: 0.45s;
}
.wavy-hover:hover span:nth-child(10) {
    transition-delay: 0.5s;
}
.wavy-hover:hover span:nth-child(11) {
    transition-delay: 0.55s;
}
.wavy-hover:hover span:nth-child(12) {
    transition-delay: 0.6s;
}
.wavy-hover:hover span:nth-child(13) {
    transition-delay: 0.65s;
}
.wavy-hover:hover span:nth-child(14) {
    transition-delay: 0.7s;
}
.wavy-hover:hover span:nth-child(15) {
    transition-delay: 0.75s;
}
.wavy-hover:hover span:nth-child(16) {
    transition-delay: 0.8s;
}
.wavy-hover:hover span:nth-child(17) {
    transition-delay: 0.85s;
}
.wavy-hover:hover span:nth-child(18) {
    transition-delay: 0.9s;
}
.wavy-hover:hover span:nth-child(19) {
    transition-delay: 0.95s;
}
.wavy-hover:hover span:nth-child(20) {
    transition-delay: 1.0s;
}
.wavy-hover:hover span:nth-child(21) {
    transition-delay: 1.05s;
}
.wavy-hover:hover span:nth-child(22) {
    transition-delay: 1.1s;
}
.wavy-hover:hover span:nth-child(23) {
    transition-delay: 1.15s;
}
.wavy-hover:hover span:nth-child(24) {
    transition-delay: 1.2s;
}
.wavy-hover:hover span:nth-child(25) {
    transition-delay: 1.25s;
}
.wavy-hover:hover span:nth-child(26) {
    transition-delay: 1.3s;
}
.wavy-hover:hover span:nth-child(27) {
    transition-delay: 1.35s;
}
.wavy-hover:hover span:nth-child(28) {
    transition-delay: 1.4s;
}
.wavy-hover:hover span:nth-child(29) {
    transition-delay: 1.45s;
}
.wavy-hover:hover span:nth-child(30) {
    transition-delay: 1.5s;
}
.wavy-hover:hover span:nth-child(31) {
    transition-delay: 1.55s;
}
.wavy-hover:hover span:nth-child(32) {
    transition-delay: 1.6s;
}
.wavy-hover:hover span:nth-child(33) {
    transition-delay: 1.65s;
}
.wavy-hover:hover span:nth-child(34) {
    transition-delay: 1.7s;
}
.wavy-hover:hover span:nth-child(35) {
    transition-delay: 1.75s;
}
.wavy-hover:hover span:nth-child(36) {
    transition-delay: 1.8s;
}
.wavy-hover:hover span:nth-child(37) {
    transition-delay: 1.85s;
}
.wavy-hover:hover span:nth-child(38) {
    transition-delay: 1.9s;
}
.wavy-hover:hover span:nth-child(39) {
    transition-delay: 1.95s;
}
.wavy-hover:hover span:nth-child(40) {
    transition-delay: 2.0s;
}

.fade-in {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

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