
:root {
    --bg-color: #f8f7fd;
    --surface-color: #ffffff;
    --surface-soft: #f0ecff;
    --text-color: #222222;
    --muted-color: #57536b;
    --main-color: #754ef9;
    --main-color-strong: #6038e0;
    --white-color: #ffffff;
    --border-color: rgba(117, 78, 249, 0.18);
    --shadow-color: rgba(20, 16, 40, 0.12);
    --error-color: #d92d20;
}

body.dark {
    --bg-color: #0f1020;
    --surface-color: #171a2e;
    --surface-soft: #1f213c;
    --text-color: #f5f5fb;
    --muted-color: #c7c6da;
    --white-color: #ffffff;
    --border-color: rgba(255, 255, 255, 0.12);
    --shadow-color: rgba(0, 0, 0, 0.38);
    --error-color: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: "Poppins", sans-serif;
}

*::selection {
    background: var(--main-color);
    color: var(--bg-color);
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.65;
}

html.menu-open,
body.menu-open {
    overflow: hidden !important;
    height: 100vh !important;
    overflow-y: hidden !important;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 10000;
    padding: 0.8rem 1.2rem;
    background: var(--main-color);
    color: var(--white-color);
}

.skip-link:focus {
    top: 0;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--main-color);
    z-index: 10001;
}

/* ── Header ── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    padding: 1.5rem 4%;
    background: rgba(248, 247, 253, 0.72);
    top: 0;
    width: 100%;
    border-radius: 0;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(128, 90, 213, 0.08);
    box-shadow:
        0 8px 24px rgba(128, 90, 213, 0.06),
        0 2px 10px rgba(0,0,0,0.03);
    z-index: 1000;
    transition:
        background 0.4s ease,
        box-shadow 0.4s ease,
        transform 0.3s ease;
}

.header.floating {
    top: 1.2rem;
    width: 92%;
    margin: 0 auto;
    border-radius: 1.8rem;
}

body.dark .header {
    background: rgba(15, 16, 32, 0.82);
}

.header.sticky {
    background: rgba(248, 247, 253, 0.95);
    box-shadow: 0 0.2rem 1.2rem var(--shadow-color);
}

body.dark .header.sticky {
    background: rgba(15, 16, 32, 0.95);
}

.logo {
    font-size: 2.2rem;
    color: var(--main-color);
    font-weight: 600;
    margin-right: auto;
    white-space: nowrap;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 2.4rem;
}

.navbar a {
    position: relative;
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text-color);
    margin-right: 0;
    transition: all 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
    color: var(--main-color);
}

.navbar a.active {
    color: var(--main-color) !important;
}

.navbar a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0%;
    height: 0.22rem;
    border-radius: 999px;
    background: var(--main-color);
    transition: width 0.3s ease;
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

.theme-toggle {
    width: 4.4rem;
    height: 4.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--main-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 0.6rem 1.6rem rgba(20, 16, 40, 0.08);
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
}

#darkMode-icon,
#menu-icon {
    color: var(--main-color);
}

#darkMode-icon {
    font-size: 2.4rem;
    cursor: pointer;
}

#menu-icon {
    font-size: 3.6rem;
    display: none;
    background: transparent;
    cursor: pointer;
}

/* ── Nav Resume Button ── */
.nav-resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 2rem;
    margin-left: 1.6rem;
    background: var(--main-color);
    color: var(--white-color);
    border-radius: 999px;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--main-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}
.nav-resume-btn i {
    font-size: 1.6rem;
}
.nav-resume-btn:hover {
    background: transparent;
    color: var(--main-color);
}

/* ── Sections ── */
section {
    min-height: auto;
    padding: 8rem 7%;
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

span {
    color: var(--main-color);
}

.heading {
    font-size: clamp(3.4rem, 4vw, 4.6rem);
    line-height: 1.15;
    margin-bottom: 2.4rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ── Hero Section ── */
.home {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 7% 6rem;
    gap: 2.5rem;
}

.home-content {
    max-width: 72rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.home-content h1 {
    font-size: clamp(5.5rem, 9vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    color: var(--text-color);
    margin: 0;
}

.home-content h3,
.home-content p {
    color: var(--text-color);
}

.home-content h3 {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.home-content p {
    font-size: 1.8rem;
    line-height: 1.9;
    color: var(--muted-color);
    max-width: 62rem;
    margin: 0 auto;
}

.home-img {
    margin-bottom: 1rem;
}

.home-img img,
.home-img picture img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid white;
    box-shadow: 0 20px 50px rgba(117,78,249,0.14);
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
}

.home-img img:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 70px rgba(117,78,249,0.22);
}

.hero-vp {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
}



.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.home-content .social-media {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-top: 1rem;
}

.home-content .social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4.8rem;
    height: 4.8rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--main-color);
    font-size: 2rem;
    margin: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.home-content .social-media a:hover {
    transform: translateY(-6px);
    background: var(--main-color);
    color: white;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 3rem;
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--main-color);
    color: white;
    border: none;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
    box-shadow: 0 10px 24px rgba(117, 78, 249, 0.18);
}

.btn:hover {
    background: var(--main-color-strong);
    color: var(--white-color);
}

.btn-outline {
    background: transparent;
    color: var(--main-color);
    border: 2px solid var(--main-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--main-color);
    color: var(--white-color);
}

/* ── About Section ── */
.about {
    display: flex;
    justify-content: center;
    gap: 5rem;
    align-items: flex-start;
}

.about-content h2 {
    text-align: left;
    line-height: 1.2;
}

.about-content h3 {
    font-size: 2.1rem;
    line-height: 1.55;
}

.about-content p {
    font-size: 1.6rem;
    margin: 0 0 1.4rem;
    color: var(--muted-color);
    line-height: 1.8;
}

.about-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8rem;
    margin-top: 2.4rem;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--surface-color);
    padding: 2rem 2.2rem;
    border-radius: 1.6rem;
    box-shadow: 0 0.1rem 0.5rem var(--shadow-color);
    border-left: 0.5rem solid var(--main-color);
    min-height: 9.2rem;
}

.info-card i {
    font-size: 3rem;
    color: var(--main-color);
}

.info-card h5 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-color);
}

.info-card p {
    font-size: 1.4rem;
    margin: 0;
    opacity: 0.8;
    color: var(--text-color);
}

.info-card a {
    color: var(--main-color);
}

.email-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    opacity: 0.8;
    color: var(--text-color);
}

/* Fix 27 — About photo as CSS background-image */
.about-img {
    flex-shrink: 0;
}

.about-photo {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: url('../images/ProfilePicture.webp') center/cover no-repeat;
    flex-shrink: 0;
    box-shadow: 0 20px 50px rgba(117,78,249,0.14);
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
    cursor: default;
}

.about-photo:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 30px 70px rgba(117,78,249,0.25);
}

/* ── Skills Section ── */
.skills {
    min-height: auto;
    padding-bottom: 7rem;
    scroll-margin-top: 9rem;
}

.skills h2,
.timeline .heading,
.portfolio h2 {
    margin-bottom: 3.2rem;
}

.skills-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.4rem;
    font-size: 1.4rem;
    color: var(--muted-color);
    margin-bottom: 3.6rem;
    flex-wrap: wrap;
}

.skills-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.skill-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.dot-proficient { background: #22c55e; }
.dot-familiar   { background: var(--main-color); }
.dot-learning   { background: #f59e0b; }

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    justify-content: center;
    gap: 3rem;
}

.skills-box {
    background: var(--surface-color);
    padding: 3rem;
    border-radius: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1.2rem 3rem var(--shadow-color);
    transition: 0.3s ease;
}

.skills-box:hover {
    border-color: var(--main-color);
    transform: translateY(-5px);
}

.skills-title {
    font-size: 2.4rem;
    text-align: left;
    margin-bottom: 2.6rem;
    color: var(--text-color);
}

.skills-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 1.6rem 2.2rem;
}

.skills-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 0;
}

.skills-item i {
    font-size: 4rem;
    color: var(--main-color);
}

.skills-item h4 {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-color);
}

/* ── Activity Section ── */
.activity {
    min-height: auto;
    padding-bottom: 10rem;
    scroll-margin-top: 9rem;
}

.activity-intro {
    max-width: 72rem;
    margin: 1.2rem auto 3.2rem;
    font-size: 1.6rem;
    text-align: center;
    line-height: 1.6;
    opacity: 0.85;
    color: var(--muted-color);
}

.activity-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 34rem), 1fr));
    gap: 2rem;
    align-items: stretch;
    max-width: 1120px;
    margin: 0 auto;
}

.activity-card {
    width: 100%;
    padding: 2.5rem;
    border-radius: 20px;
    background: linear-gradient(
        145deg,
        rgba(117, 78, 249, 0.08),
        rgba(255, 255, 255, 0.02)
    );
    border: 1px solid rgba(117, 78, 249, 0.2);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.activity-card--leetcode {
    display: flex;
    flex-direction: column;
}

.activity-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(117, 78, 249, 0.2);
}

.activity-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.activity-card-top h3 {
    font-size: 2.2rem;
}

.heatmap-container {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.06);
    transition: background 0.3s ease;
}

.heatmap-container img {
    width: 100%;
    border-radius: 10px;
    display: block;
    min-height: 12.8rem;
    background: var(--surface-soft);
    transition: opacity 0.3s ease;
}

/* Dark mode: give heatmap a white card so the light SVG looks intentional */
body.dark .heatmap-container {
    background: rgba(255, 255, 255, 0.92);
    padding: 1.2rem 1rem;
}

body.dark .heatmap-container img {
    opacity: 0.95;
}

.activity-footer {
    margin-top: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
    color: var(--muted-color);
}

.leetcode-activity {
    display: flex;
    align-items: center;
    gap: 2rem;
    min-height: 16rem;
    padding: 1.5rem;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.06);
}

.leetcode-activity img {
    width: 12rem;
    height: 12rem;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 1.2rem;
}

.leetcode-stats {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.leetcode-stats strong {
    color: var(--main-color);
    font-size: 3.2rem;
    line-height: 1;
}

.leetcode-stats span {
    color: var(--text-color);
    font-size: 1.6rem;
    font-weight: 700;
}

.leetcode-stats p {
    color: var(--muted-color);
    font-size: 1.35rem;
    line-height: 1.6;
    margin-top: 0.4rem;
}

.panel-eyebrow {
    font-size: 1.3rem;
    color: var(--muted-color);
    opacity: 0.75;
}

.panel-link {
    font-size: 1.4rem;
    color: var(--main-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    position: relative;
    transition: gap 0.2s ease, color 0.2s ease;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.panel-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--main-color);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.panel-link:hover {
    color: var(--main-color-strong);
    gap: 0.5rem;
}

.panel-link:hover::after {
    width: 100%;
}

.panel-link .arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.panel-link:hover .arrow {
    transform: translate(3px, -3px);
}

/* Live dot animation */
.live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ── Work Experience (Timeline) Section ── */
.timeline {
    min-height: auto;
    padding-bottom: 7rem;
    scroll-margin-top: 9rem;
}

.timeline .heading {
    margin-bottom: 5rem;
}

.timeline-container {
    position: relative;
    max-width: 98rem;
    margin: 0 auto;
}

.timeline-container::after {
    content: "";
    position: absolute;
    width: 2px;
    background-color: var(--main-color);
    opacity: 0.3;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 1.2rem 3.5rem;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::after {
    content: "";
    position: absolute;
    width: 2rem;
    height: 2rem;
    background-color: var(--bg-color);
    border: 2px solid var(--main-color);
    border-radius: 50%;
    top: 2.5rem;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after  { right: -1rem; }
.timeline-item:nth-child(even)::after { left: -1rem; }

.timeline-content {
    padding: 2.4rem 2.6rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.8rem;
    box-shadow: 0 1.2rem 3rem var(--shadow-color);
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
}

.timeline-date {
    display: block;
    color: var(--main-color);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.timeline-duration {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--muted-color);
    opacity: 0.8;
}

.timeline-title {
    font-size: 2.1rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.timeline-company {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    color: var(--text-color);
    opacity: 0.8;
    font-weight: 500;
}

.company-logo-icon {
    font-size: 2.2rem;
    color: var(--main-color);
    margin-right: 0.8rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.timeline-bullets {
    list-style: none;
    padding: 0;
    margin: 1.2rem 0 0;
}

.timeline-bullets li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    line-height: 1.75;
    color: var(--text-color);
}

.timeline-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.9rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--main-color);
    opacity: 0.7;
}

/* ── Education Section ── */
.edu-section {
    min-height: auto;
    padding-bottom: 7rem;
    scroll-margin-top: 9rem;
}

.edu-section .heading {
    margin-bottom: 5rem;
}

.edu-timeline {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 3.2rem 1fr;
    row-gap: 4rem;
    max-width: 960px;
    margin: 0 auto;
}

.edu-timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0.8rem;
    bottom: 0.8rem;
    width: 2px;
    background: var(--main-color);
    opacity: 0.4;
    z-index: 0;
}

.edu-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.6rem;
    padding: 2.4rem 2.8rem;
    box-shadow: 0 1.2rem 3rem var(--shadow-color);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    align-self: center;
}

.edu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 2rem 4rem var(--shadow-color);
}

.edu-left  { grid-column: 1; text-align: right; }
.edu-right { grid-column: 3; text-align: left; }

.edu-dot {
    grid-column: 2;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--main-color);
    align-self: center;
    justify-self: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(117, 78, 249, 0.18);
}

.edu-spacer { align-self: center; }

.edu-date {
    display: block;
    color: var(--main-color);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.6rem;
}

.edu-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

.edu-institution {
    font-size: 1.5rem;
    color: var(--muted-color);
    font-weight: 500;
    margin: 0 0 0.8rem;
}

.edu-detail {
    font-size: 1.5rem;
    color: var(--text-color);
    line-height: 1.5;
    margin: 0;
}

/* ── Projects Section ── */
.portfolio {
    min-height: auto;
    padding-bottom: 10rem;
    scroll-margin-top: 9rem;
}

.portfolio h2 {
    margin-bottom: 4rem;
}

/* Filter bar */
.project-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4rem;
}

.filter-btn {
    padding: 0.8rem 2rem;
    border-radius: 2rem;
    font-size: 1.4rem;
    font-weight: 500;
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--main-color);
    color: #fff;
    border-color: var(--main-color);
    box-shadow: 0 4px 16px rgba(117, 78, 249, 0.28);
    transform: translateY(-2px);
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.project-card {
    background: var(--surface-color);
    border-radius: 2.4rem;
    overflow: hidden;
    border: 1px solid rgba(117,78,249,0.08);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease,
        border-color 0.35s ease,
        opacity 0.3s ease,
        scale 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(117,78,249,0.3);
    box-shadow: 0 24px 60px rgba(117,78,249,0.12);
}

.project-card.hiding {
    opacity: 0;
    scale: 0.96;
    pointer-events: none;
}

/* Case study number watermark */
.case-study-number {
    position: absolute;
    top: 1.2rem;
    right: 1.6rem;
    font-size: 4rem;
    font-weight: 900;
    color: var(--main-color);
    opacity: 0.08;
    line-height: 1;
    z-index: 0;
    pointer-events: none;
    letter-spacing: -0.02em;
}

/* Project frame */
.project-card .project-frame {
    border: none !important;
    border-radius: 10px;
    overflow: hidden;
    margin: 14px 14px 0;
}

.project-cover {
    position: relative;
    width: 100%;
    height: 19rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    border-radius: 8px;
    overflow: hidden;
    background: #111827;
}

.project-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.project-cover .overlay {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 4rem 1.6rem 1.6rem;
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.9));
    z-index: 1;
}

.project-status {
    align-self: center;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.95);
    color: #111827;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.project-cover-title {
    position: relative;
    z-index: 1;
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.project-cover-stack {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.52);
    letter-spacing: 0.06em;
    text-align: center;
}

/* Project info */
.project-info {
    padding: 16px 20px 22px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.project-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px;
}

.project-tag {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted-color);
}

.project-desc {
    font-size: 13px;
    color: var(--muted-color);
    line-height: 1.6;
    margin-bottom: 12px;
    flex-grow: 1;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tech-badge {
    background: rgba(117, 78, 249, 0.1);
    color: var(--main-color);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(117, 78, 249, 0.2);
}

.project-btns {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 0;
}

.btn-demo {
    background: var(--main-color);
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s ease;
    border: none;
}

.btn-demo:hover {
    background: var(--main-color-strong);
}

.btn-demo--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--main-color);
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    font-family: inherit;
}

.btn-github {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--main-color);
    border: 1.5px solid var(--main-color);
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-github:hover {
    background: rgba(117, 78, 249, 0.1);
}

/* ── Contact Section ── */
.contact {
    background: var(--bg-color);
    padding: 80px 5%;
    min-height: auto;
    scroll-margin-top: 9rem;
}

.contact-wrapper {
    max-width: 680px;
    margin: 0 auto;
}

.contact-title {
    text-align: center;
    font-size: clamp(3.4rem, 4vw, 4.6rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-color);
    margin-bottom: 2.8rem;
}

.contact-title span {
    color: var(--main-color);
}

.contact-email-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2.4rem;
    flex-wrap: wrap;
    padding: 1.4rem 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.2rem;
    box-shadow: 0 0.4rem 1.2rem var(--shadow-color);
}

.contact-email-label {
    font-size: 1.4rem;
    color: var(--muted-color);
}

.contact-email-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--main-color);
}

/* Contact form fields */
.cf-field {
    position: relative;
    margin-bottom: 16px;
}

.cf-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--main-color);
    pointer-events: none;
    z-index: 1;
}

.cf-field--textarea .cf-icon {
    top: 2.2rem;
    transform: none;
}

.cf-field input,
.cf-field textarea {
    width: 100%;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 18px 18px 52px !important;
    color: var(--text-color);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.cf-field textarea {
    min-height: 150px;
    resize: vertical;
}

.cf-field input::placeholder,
.cf-field textarea::placeholder {
    color: var(--muted-color);
}

.cf-field input:focus,
.cf-field textarea:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(117, 78, 249, 0.12);
}

.cf-field.has-error input,
.cf-field.has-error textarea {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1);
}

.error-message {
    display: block;
    min-height: 1.8rem;
    margin-top: 0.6rem;
    font-size: 1.2rem;
    color: var(--error-color);
}

.cf-send-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--main-color), var(--main-color-strong));
    color: var(--white-color);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    font-family: inherit;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.cf-send-btn:hover {
    opacity: 0.88;
    transform: translateY(-2px);
}

.cf-send-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
    pointer-events: none;
}

/* Send Button Spinner */
.btn-spinner {
    display: none;
    width: 1.8rem;
    height: 1.8rem;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cf-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

.cf-send-btn.loading .btn-text   { display: none; }
.cf-send-btn.loading .btn-icon   { display: none; }
.cf-send-btn.loading .btn-spinner { display: inline-flex; }

/* Form messages */
.form-success-msg {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 12px;
    padding: 1.6rem 2rem;
    color: #16a34a;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1.6rem;
    animation: fadeInUp 0.4s ease;
}

.form-error {
    background: rgba(217, 45, 32, 0.08);
    border: 1px solid rgba(217, 45, 32, 0.28);
    border-radius: 12px;
    padding: 1.6rem 2rem;
    color: var(--error-color);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-top: 1.6rem;
    animation: fadeInUp 0.4s ease;
}

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

.form-notice {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 1rem;
    padding: 1.4rem 1.8rem;
    font-size: 1.4rem;
    color: #d97706;
    margin-bottom: 2rem;
    line-height: 1.75;
}

.char-counter {
    font-size: 1.2rem;
    color: var(--muted-color);
    text-align: right;
    display: block;
    margin-top: 0.4rem;
    transition: color 0.2s ease;
}

/* ── Copy to Clipboard Button ── */
.copy-email-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    background: var(--surface-color);
    color: var(--main-color);
    cursor: pointer;
    font-size: 1.6rem;
    margin-left: 0.8rem;
    transition: all 0.25s ease;
    position: relative;
    vertical-align: middle;
}

.copy-email-btn:hover {
    background: rgba(117, 78, 249, 0.08);
    border-color: var(--main-color);
}

.copy-email-btn.copied {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

.copy-tooltip {
    position: absolute;
    top: -3.2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #1a1a2e;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.copy-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a2e;
}

.contact-email-row .copy-email-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 3.2rem;
    height: 3.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--main-color);
    font-size: 1.6rem;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
    flex-shrink: 0;
}

.contact-email-row .copy-email-btn:hover {
    background: var(--main-color);
    color: #fff;
    transform: scale(1.1);
}

/* ── Footer ── */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex-wrap: wrap;
    padding: 60px 5% 32px;
    gap: 24px;
    text-align: center;
    background: var(--surface-soft);
    border-top: 1px solid var(--border-color);
}

.footer-brand {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 800;
    color: var(--main-color);
    margin: 0;
}

.footer-nav {
    display: flex;
    gap: 20px 32px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 0;
    max-width: 800px;
}

.footer-nav a {
    color: var(--muted-color);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: var(--main-color);
}

.footer-socials {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.footer-socials a {
    width: 46px;
    height: 46px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-color);
    font-size: 22px;
    text-decoration: none;
    background: var(--surface-color);
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px var(--shadow-color);
}

.footer-socials a:hover {
    border-color: var(--main-color);
    color: var(--main-color);
    background: var(--surface-soft);
    box-shadow: 0 4px 14px var(--shadow-color);
}

.footer-copy {
    font-size: 14px;
    color: var(--muted-color);
    margin: 0;
}

/* ── Scroll to Top Button ── */
.scroll-to-top {
    position: fixed;
    bottom: 9rem;
    right: 2.5rem;
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 50%;
    background: var(--main-color);
    color: var(--white-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    box-shadow: 0 0.8rem 2rem rgba(117, 78, 249, 0.25);
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: all 0.35s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--main-color-strong);
    transform: translateY(-4px);
    box-shadow: 0 1.2rem 3rem rgba(117, 78, 249, 0.35);
}

/* ── Dark Mode Overrides ── */
body.dark .case-study-number   { opacity: 0.06; }
body.dark .scroll-to-top       { box-shadow: 0 0.8rem 2rem rgba(117, 78, 249, 0.35); }
body.dark .copy-tooltip        { background: #2d2d4e; }
body.dark .copy-tooltip::after { border-top-color: #2d2d4e; }

body.dark .leetcode-activity {
    background: rgba(255, 255, 255, 0.04);
}

body.dark .form-success-msg {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.22);
}

body.dark .form-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.28);
    color: #ff6b6b;
}

/* ═══════════════════ RESPONSIVE BREAKPOINTS ═══════════════════ */

@media (max-width: 1200px) {
    html { font-size: 55%; }
}

@media (max-width: 1024px) {
    .header { padding: 2rem 3%; }

    section { padding: 10rem 3% 6rem; }

    .home { gap: 4rem; }

    .about { gap: 4rem; }
}

@media (max-width: 991px) {
    .home-img {
        display: block !important;
        margin-top: 4rem;
        width: 100%;
        text-align: center;
    }

    .home-img img {
        position: relative !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 auto;
        display: block;
        max-width: 50%;
        height: auto;
        max-height: 350px;
        object-fit: contain;
    }

    #scrollToTopBtn { bottom: 95px !important; }

    .about-img img { max-width: 280px !important; }

    .footer { padding: 2rem 3%; }
}

@media (max-width: 768px) {
    #menu-icon { display: block; }

    #darkMode-icon {
        position: static;
        font-size: 2.6rem;
        color: var(--main-color);
        margin-right: 1.6rem;
    }

    .navbar {
        position: absolute;
        top: calc(100% + 1rem);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
        padding: 1.8rem;
        margin: 0 4%;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
        border-radius: 1.6rem;
        box-shadow: 0 1rem 2.4rem var(--shadow-color);
    }

    .navbar.active {
        display: flex;
        max-height: calc(100vh - 7rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .navbar a {
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
    }

    .navbar a::before { display: none; }

    .theme-toggle { margin-left: 0; }

    .nav-resume-btn { display: none; }

    section { padding: 8rem 4%; }

    .header { padding: 1.4rem 4%; }

    .home {
        flex-direction: column;
        text-align: center;
        padding: 10rem 4% 8rem;
    }

    .home-content .social-media,
    .hero-actions,
    .project-btns {
        justify-content: center;
    }

    .about {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-content h2 { text-align: center; }

    .about-img {
        display: block;
        margin-bottom: 3rem;
    }

    .about-photo {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }

    .about-info { grid-template-columns: 1fr; }

    .skills-legend { gap: 1.4rem; font-size: 1.3rem; }

    .skills-container { grid-template-columns: 1fr; }

    .footer-nav { gap: 1.2rem 2rem; }

    .activity { padding-bottom: 6rem; }

    .projects-grid { grid-template-columns: minmax(0, 1fr); }

    .contact-email-row {
        flex-direction: column;
        gap: 0.6rem;
    }

    /* Timeline mobile */
    .timeline-container::after { left: 1.5rem; }

    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 1.2rem 0 1.2rem 4rem;
    }
    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 0.5rem;
        right: auto;
    }

    .timeline-content { margin-left: 0; }

    /* Education mobile */
    .edu-timeline {
        grid-template-columns: 1fr;
        row-gap: 2rem;
    }

    .edu-timeline::before { display: none; }

    .edu-left,
    .edu-right {
        grid-column: 1;
        text-align: left;
    }

    .edu-dot,
    .edu-spacer { display: none; }

    .edu-card {
        border-left: 4px solid var(--main-color);
        padding-left: 2rem;
        margin-bottom: 2.4rem;
    }
}

@media (max-width: 580px) {
    section { padding: 9.5rem 4% 5.5rem; }

    .skills-container { grid-template-columns: 1fr; }

    .hero-actions .btn,
    .project-btns .btn { width: 100%; }

    .timeline-bullets li { font-size: 1.4rem; }

    .leetcode-activity {
        flex-direction: column;
        text-align: center;
    }

    .leetcode-stats { align-items: center; }
}

@media (max-width: 480px) {
    html { font-size: 50%; }

    .header.floating {
        width: 100%;
        top: 0;
        margin: 0;
        border-radius: 0;
    }

    .hero-actions .btn { width: 100%; text-align: center; }

    .project-btns {
        flex-direction: column;
        align-items: stretch;
    }

    .project-btns .btn,
    .project-btns .btn-demo,
    .project-btns .btn-github {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 1024px) {
    .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
}

@media (max-width: 365px) {
    .home-content h1 { font-size: 4.5rem; }
    .logo { font-size: 1.8rem; }
    #darkMode-icon { font-size: 2.2rem; margin-right: 1.2rem; }
    #menu-icon { font-size: 3.2rem; }
}
