:root {
    --bg: #f4f7ff;
    --bg-soft: #edf3ff;
    --panel: #ffffff;
    --panel-strong: #f8faff;
    --primary: #4f46e5;
    --primary-strong: #3b38c4;
    --primary-dark: #312e81;
    --secondary: #0f172a;
    --secondary-soft: #1e293b;
    --text: #111827;
    --muted: #5b6477;
    --line: rgba(79, 70, 229, 0.12);
    --shadow: 0 20px 45px rgba(31, 41, 55, 0.12);
    --yellow: #facc15;
    --success: #10b981;
    --radius: 22px;
    --container: 1180px;
    --header-bg: rgba(255, 255, 255, 0.82);
    --button-text: #ffffff;
    --navy: #0f172a;
    --purple: #5b4ae8;
    --sky: #dfeeff;
    --white: #ffffff;
}

body[data-theme="dark"] {
    --bg: #07111f;
    --bg-soft: #0d1a2a;
    --panel: #0f172a;
    --panel-strong: #101b2a;
    --primary: #8b5cf6;
    --primary-strong: #a78bfa;
    --primary-dark: #c4b5fd;
    --secondary: #f8fafc;
    --secondary-soft: #dfe7f3;
    --text: #e2e8f0;
    --muted: #b4c0d4;
    --line: rgba(148, 163, 184, 0.18);
    --shadow: 0 25px 60px rgba(15, 23, 42, 0.45);
    --success: #34d399;
    --header-bg: rgba(15, 23, 42, 0.82);
    --button-text: #f8fafc;
    --sky: rgba(147, 197, 253, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 34%, #ffffff 100%);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

body[data-theme="dark"] {
    background: linear-gradient(180deg, #07111f 0%, #0c1729 32%, #111827 100%);
}

img {
    display: block;
    max-width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font: inherit;
}

button,
a {
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.container {
    width: min(var(--container), calc(100% - 2rem));
    margin: 0 auto;
}

.section {
    padding: clamp(4.5rem, 7vw, 6.5rem) 0;
}

.alt-bg {
    background: rgba(128, 148, 255, 0.04);
}

body[data-theme="dark"] .alt-bg {
    background: rgba(139, 92, 246, 0.06);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 78px;
    gap: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.logo {
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--secondary);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--secondary-soft);
    font-size: 0.94rem;
    font-weight: 600;
    transition: color 0.25s ease;
    position: relative;
    padding: 0.25rem 0;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 0.28rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.8);
    justify-content: center;
    align-items: center;
    padding: 0.6rem;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--secondary);
}

.theme-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--secondary);
    cursor: pointer;
}

body[data-theme="dark"] .theme-toggle {
    background: rgba(15, 23, 42, 0.8);
    color: #facc15;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: rotate(180deg) scale(1.04);
    box-shadow: 0 18px 30px rgba(79, 70, 229, 0.18);
}

.hero {
    padding: clamp(3.5rem, 7vw, 5.5rem) 0 2.25rem;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
}

.hero-content {
    min-width: 0;
}

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.12rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.08);
    padding: 0.7rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.eyebrow.accent {
    background: rgba(79, 70, 229, 0.1);
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    line-height: 1.04;
    letter-spacing: -0.065em;
    margin-bottom: 1.2rem;
    color: var(--secondary);
    max-width: 760px;
    overflow-wrap: anywhere;
}

.hero-text {
    max-width: 620px;
    font-size: clamp(1.02rem, 1.8vw, 1.12rem);
    color: var(--muted);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 1rem 1.1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.95rem 1.6rem;
    border-radius: 14px;
    font-weight: 700;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 18px 32px rgba(79, 70, 229, 0.26);
}

.btn-secondary {
    background: var(--panel);
    border: 1px solid rgba(79, 70, 229, 0.14);
    color: var(--secondary);
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
}

.hero-points li {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--secondary-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 420px;
}

.profile-frame {
    position: relative;
    width: min(100%, 420px);
    aspect-ratio: 1;
    border-radius: 35% 65% 58% 42% / 38% 44% 56% 62%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2), rgba(96, 165, 250, 0.15));
    padding: 1rem;
    box-shadow: var(--shadow);
    transform: rotate(-6deg);
}

.profile-frame img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    border-radius: 35% 65% 58% 42% / 38% 44% 56% 62%;
    border: 6px solid rgba(255, 255, 255, 0.9);
    visibility: hidden;
}

.profile-frame.has-image img {
    visibility: visible;
}

.profile-placeholder {
    position: absolute;
    inset: 1rem;
    display: grid;
    place-items: center;
    border-radius: 35% 65% 58% 42% / 38% 44% 56% 62%;
    background: linear-gradient(135deg, var(--navy), var(--purple));
    color: #ffffff;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.profile-frame.has-image .profile-placeholder {
    display: none;
}

.floating-badge {
    position: absolute;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    padding: 0.8rem 1.1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 18px 35px rgba(17, 24, 39, 0.15);
}

.badge-top {
    top: 15%;
    right: 6%;
}

.badge-bottom {
    bottom: 11%;
    left: 2%;
}

.stats-strip {
    padding: 0.5rem 0 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.4rem 1rem;
    text-align: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.stat-number {
    display: block;
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.section-heading {
    text-align: center;
    margin-bottom: clamp(1.8rem, 3vw, 3rem);
}

.section-heading h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.055em;
    max-width: 780px;
    margin: 0 auto;
    color: var(--secondary);
}

.left-align {
    text-align: left;
}

.left-align h2 {
    margin-left: 0;
}

.about-panel,
.contact-box,
.education-item,
.skill-card,
.project-card,
.lead-card,
.cert-card,
.experience-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.04);
}

.about-panel {
    max-width: 900px;
    margin: 1.5rem auto 0;
    padding: clamp(1.4rem, 3vw, 2.5rem);
    background: var(--panel);
    text-align: left;
}

#about .section-heading {
    margin-bottom: 0;
}

.about-panel p {
    color: var(--muted);
    font-size: clamp(1rem, 1.5vw, 1.08rem);
    line-height: 1.85;
    margin-bottom: 1rem;
}

.about-panel p:last-child {
    margin-bottom: 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr));
    align-items: stretch;
    gap: clamp(1rem, 2vw, 1.4rem);
}

.skill-card {
    min-width: 0;
    height: 100%;
    padding: clamp(1.25rem, 2.5vw, 1.7rem);
    background: var(--panel);
}

.skill-card h3 {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-size: 1.18rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.skill-card p {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 0.6rem;
    overflow-wrap: anywhere;
}

.skill-card p:last-child {
    margin-bottom: 0;
}

.education-item {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 2.2rem;
}

.education-badge {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
    border-radius: 999px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
}

.education-item h3 {
    font-size: clamp(1.5rem, 2vw, 2.1rem);
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.role {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.education-item p {
    color: var(--muted);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
    gap: 1.5rem;
}

.project-card,
.lead-card,
.cert-card {
    padding: 1.7rem 1.5rem;
}

.project-tag {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.07rem;
    text-transform: uppercase;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border-radius: 999px;
    padding: 0.52rem 0.8rem;
    margin-bottom: 1rem;
}

.project-card h3,
.lead-card h3,
.cert-card h3,
.experience-content h3 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.project-card p,
.lead-card p,
.cert-card p,
.experience-content p {
    color: var(--muted);
    line-height: 1.75;
}

.project-tech {
    color: var(--secondary-soft) !important;
    font-weight: 500;
}

.project-links {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.project-links a {
    color: var(--primary);
    font-weight: 700;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(250, 204, 21, 0.12);
    color: #7c5a00;
    font-weight: 700;
    font-size: 0.78rem;
}

.experience-list {
    display: grid;
    gap: 1.2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.experience-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 1rem;
    align-items: start;
    padding: 1.8rem 1.5rem;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    margin-top: 0.45rem;
    position: relative;
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0.08);
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: 1.2rem;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.5rem;
}

.certificates-summary .section-heading {
    margin-bottom: 1.25rem;
}

.section#certifications {
    padding: clamp(2.75rem, 4vw, 4rem) 0;
}

.certificates-summary .section-heading h2 {
    max-width: 900px;
}

.certificates-summary-text {
    max-width: 760px;
    margin: 1rem auto 0;
    color: var(--muted);
}

.certificates-summary-action {
    display: flex;
    justify-content: center;
}

.certificates-page {
    min-height: calc(100vh - 160px);
}

.certificates-page .section-heading > p:last-child {
    max-width: 760px;
    margin: 1rem auto 0;
    color: var(--muted);
}

.certificates-page .section-heading h1 {
    max-width: 900px;
    margin: 0 auto;
    color: var(--secondary);
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.055em;
}

.certificate-card h2 {
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.certificate-image-link {
    display: block;
    margin-bottom: 1rem;
}

.certificate-image-link img {
    width: 100%;
    height: 190px;
    object-fit: contain;
    background: var(--panel-strong);
    border-radius: 14px;
    border: 1px solid var(--line);
}

.certificate-card .certificate-note {
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

.cert-card a {
    display: block;
    margin-bottom: 1rem;
}

.cert-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.contact-section {
    padding-bottom: 80px;
}

.contact-box {
    padding: clamp(1.8rem, 2vw, 2.6rem);
}

.contact-copy {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 760px;
    line-height: 1.85;
    margin-bottom: 1.3rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: var(--button-text);
    font-weight: 700;
    box-shadow: 0 20px 35px rgba(79, 70, 229, 0.18);
}

.contact-links a:hover,
.contact-links a:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 25px 40px rgba(79, 70, 229, 0.2);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.site-footer {
    padding: 1.5rem 0 3rem;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
}

.scroll-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    z-index: 100;
}

.scroll-buttons button {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.96);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}

.scroll-buttons button:hover,
.scroll-buttons button:focus-visible {
    transform: translateY(-2px);
    opacity: 0.9;
}

.nav-toggle:focus-visible,
.theme-toggle:focus-visible,
.btn:focus-visible,
.contact-links a:focus-visible,
.project-links a:focus-visible,
.nav-links a:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.3);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .nav {
        position: relative;
        min-height: 74px;
    }

    .nav-right {
        width: auto;
        flex: 1;
        justify-content: flex-end;
        gap: 0.65rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 0.7rem);
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: min(240px, 80vw);
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--line);
        border-radius: 18px;
        box-shadow: var(--shadow);
        padding: 0.85rem;
        z-index: 20;
    }

    body[data-theme="dark"] .nav-links {
        background: rgba(15, 23, 42, 0.96);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 0.45rem 0.3rem;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-text {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons,
    .hero-points,
    .contact-links {
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-visual {
        min-height: clamp(280px, 55vw, 400px);
    }
}

@media (max-width: 560px) {
    .section {
        padding: clamp(3.5rem, 14vw, 5rem) 0;
    }

    .hero {
        padding-top: 3rem;
    }

    .logo {
        font-size: clamp(1.05rem, 5vw, 1.25rem);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: clamp(2.15rem, 10vw, 2.5rem);
    }

    .btn,
    .contact-links a {
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .profile-frame {
        width: min(82vw, 340px);
    }

    .floating-badge {
        font-size: 0.7rem;
        padding: 0.7rem 0.9rem;
    }

    .scroll-buttons {
        right: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
