:root {
    --ink: #111827;
    --muted: #5b6475;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #eef7f4;
    --border: #dfe5ee;
    --primary: #2563eb;
    --cyan: #06b6d4;
    --green: #16a34a;
    --coral: #f97316;
    --gold: #ca8a04;
    --shadow-sm: 0 8px 22px rgba(17, 24, 39, 0.07);
    --shadow-lg: 0 22px 60px rgba(17, 24, 39, 0.14);
    --font: 'Inter', Arial, sans-serif;
}

.dark-mode {
    --ink: #eef2ff;
    --muted: #b7c0cf;
    --bg: #0c111d;
    --surface: #141b2a;
    --surface-soft: #111f2a;
    --border: #263349;
    --shadow-sm: 0 8px 22px rgba(0, 0, 0, 0.26);
    --shadow-lg: 0 26px 70px rgba(0, 0, 0, 0.38);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    background:
        radial-gradient(circle at top left, rgba(6, 182, 212, 0.12), transparent 34rem),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.10), transparent 28rem),
        var(--bg);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.65;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.section-padding {
    padding: 76px 0;
}

.background-alt {
    background: rgba(255, 255, 255, 0.42);
    border-block: 1px solid rgba(125, 139, 161, 0.16);
}

.dark-mode .background-alt {
    background: rgba(255, 255, 255, 0.025);
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(247, 248, 251, 0.82);
    border-bottom: 1px solid rgba(125, 139, 161, 0.2);
    backdrop-filter: blur(18px);
}

.dark-mode header {
    background: rgba(12, 17, 29, 0.82);
}

.nav-container {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: auto 1fr auto auto;
    min-height: 74px;
}

.brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.brand span {
    color: var(--primary);
    margin-left: 3px;
}

nav {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
}

nav a {
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    padding: 9px 12px;
}

nav a:hover,
nav a:focus-visible {
    background: rgba(37, 99, 235, 0.09);
    color: var(--primary);
}

.menu-toggle,
.toggle-btn {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
    width: 42px;
}

.menu-toggle {
    display: none;
}

.menu-toggle:hover,
.toggle-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.hero {
    min-height: calc(100vh - 74px);
    position: relative;
}

.hero-grid {
    align-items: center;
    display: grid;
    gap: 42px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eyebrow {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 8px;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.hero h1,
.section-heading h1,
.section-heading h2,
.contact-grid h2 {
    font-size: clamp(2.15rem, 3.7vw, 3.05rem);
    letter-spacing: 0;
    line-height: 1.05;
    margin-bottom: 18px;
}

.section-heading h2,
.contact-grid h2 {
    font-size: clamp(1.7rem, 2.8vw, 2.35rem);
}

.summary,
.contact-grid p {
    color: var(--muted);
    font-size: clamp(0.98rem, 1.35vw, 1.08rem);
    max-width: 590px;
}

.hero-actions,
.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 46px;
    padding: 12px 22px;
}

.btn-primary {
    background: var(--ink);
    color: var(--bg);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--ink);
}

.btn-primary:hover,
.btn-secondary:hover,
.project-link:hover {
    transform: translateY(-2px);
}

.contact-links {
    display: flex;
    gap: 14px;
    margin-top: 24px;
}

.contact-links a {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    font-size: 1.1rem;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.contact-links a:hover {
    border-color: var(--cyan);
    color: var(--primary);
    transform: translateY(-3px);
}

.hero-panel {
    background: linear-gradient(145deg, rgba(255,255,255,0.72), rgba(255,255,255,0.34));
    border: 1px solid rgba(125, 139, 161, 0.22);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    justify-self: stretch;
    max-width: 620px;
    padding: 18px;
}

.dark-mode .hero-panel {
    background: linear-gradient(145deg, rgba(20,27,42,0.78), rgba(20,27,42,0.42));
}

.hero-image {
    aspect-ratio: 16 / 10;
    border-radius: 24px;
    max-height: 390px;
    overflow: hidden;
}

.hero-image img {
    height: 100%;
    object-fit: cover;
    object-position: center 34%;
    width: 100%;
}

.status-card {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: flex;
    font-weight: 700;
    gap: 10px;
    margin: 14px 0;
    padding: 10px 13px;
}

.status-dot {
    background: var(--green);
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
    height: 10px;
    width: 10px;
}

.metrics-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
}

.metrics-grid div,
.project-card,
.cert-card,
.skill-category,
.timeline-content,
.contact-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.metrics-grid div {
    padding: 12px;
}

.metrics-grid strong {
    display: block;
    font-size: 1.28rem;
    line-height: 1;
}

.metrics-grid span {
    color: var(--muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 4px;
}

.section-heading {
    margin-bottom: 34px;
    max-width: 760px;
}

.skills-grid,
.project-grid,
.cert-grid {
    display: grid;
    gap: 22px;
}

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

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

.cert-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.skill-category,
.project-card,
.cert-card,
.timeline-content {
    padding: 22px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.skill-category:hover,
.project-card:hover,
.cert-card:hover,
.timeline-content:hover {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.skill-category i,
.cert-icon,
.project-topline i {
    align-items: center;
    border-radius: 14px;
    display: inline-flex;
    font-size: 1.15rem;
    height: 42px;
    justify-content: center;
    margin-bottom: 16px;
    width: 42px;
}

.accent-blue i,
.cert-card:nth-child(4n + 1) .cert-icon {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.accent-green i,
.cert-card:nth-child(4n + 2) .cert-icon {
    background: rgba(22, 163, 74, 0.12);
    color: var(--green);
}

.accent-coral i,
.cert-card:nth-child(4n + 3) .cert-icon {
    background: rgba(249, 115, 22, 0.13);
    color: var(--coral);
}

.accent-gold i,
.cert-card:nth-child(4n + 4) .cert-icon {
    background: rgba(202, 138, 4, 0.14);
    color: var(--gold);
}

.skill-category h3,
.project-card h3,
.cert-card h3,
.timeline-content h3 {
    font-size: 1.05rem;
    line-height: 1.25;
    margin-bottom: 10px;
}

.skill-category p,
.project-card p,
.cert-card p,
.timeline-content li,
.note {
    color: var(--muted);
}

.featured-project {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.12), var(--surface) 58%);
}

.project-topline {
    align-items: center;
    color: var(--primary);
    display: flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: space-between;
    margin-bottom: 18px;
    text-transform: uppercase;
}

.project-meta,
.issuer,
.date,
.company {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.project-tech span {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.18);
    border-radius: 999px;
    color: #087990;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 6px 10px;
}

.dark-mode .project-tech span {
    color: #67e8f9;
}

.project-link {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    transition: transform 0.2s ease;
}

.timeline {
    display: grid;
    gap: 18px;
    margin-top: 12px;
    position: relative;
}

.timeline-item {
    display: grid;
    gap: 18px;
    grid-template-columns: 160px minmax(0, 1fr);
}

.timeline-date {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 800;
    padding-top: 24px;
}

.timeline-content ul {
    display: grid;
    gap: 8px;
}

.timeline-content li {
    padding-left: 18px;
    position: relative;
}

.timeline-content li::before {
    background: var(--cyan);
    border-radius: 999px;
    content: '';
    height: 6px;
    left: 0;
    position: absolute;
    top: 11px;
    width: 6px;
}

.cert-card {
    min-height: 205px;
}

.cert-card .project-link {
    margin-top: 12px;
}

.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.detail-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
}

.detail-item dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.detail-item dd {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
}

.detail-item dd small {
    color: var(--muted);
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}

.pdf-frame {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
}

.pdf-frame object {
    aspect-ratio: 1 / 1.414;
    border: 0;
    display: block;
    min-height: 520px;
    width: 100%;
}

.pdf-inline-note {
    color: var(--muted);
    padding: 48px 28px;
    text-align: center;
}

.pdf-inline-note a {
    color: var(--primary);
    font-weight: 800;
}

.pdf-fallback {
    align-items: center;
    display: none;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
    padding: 54px 28px;
    text-align: center;
}

.pdf-fallback > i {
    background: rgba(249, 115, 22, 0.13);
    border-radius: 14px;
    color: var(--coral);
    font-size: 1.6rem;
    height: 58px;
    line-height: 58px;
    text-align: center;
    width: 58px;
}

.pdf-fallback h3 {
    font-size: 1.12rem;
}

.pdf-fallback p {
    color: var(--muted);
    max-width: 52ch;
}

.pdf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}

.cert-shell > .pdf-actions {
    justify-content: flex-start;
}

.no-inline .pdf-frame object {
    display: none;
}

.no-inline .pdf-fallback {
    display: flex;
}

.contact-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(22, 163, 74, 0.10));
}

.contact-grid {
    align-items: start;
    display: grid;
    gap: 42px;
    grid-template-columns: 0.9fr 1.1fr;
}

.contact-mini-links {
    display: grid;
    gap: 10px;
    margin-top: 26px;
}

.contact-mini-links a {
    align-items: center;
    color: var(--primary);
    display: inline-flex;
    font-weight: 800;
    gap: 10px;
}

.contact-form {
    padding: 28px;
}

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

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 7px;
}

.form-group input,
.form-group textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--ink);
    font: inherit;
    padding: 13px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

footer {
    border-top: 1px solid var(--border);
    padding: 26px 0;
}

.footer-content {
    align-items: center;
    color: var(--muted);
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.footer-content a {
    color: var(--primary);
    font-weight: 800;
}

.hidden {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

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

@media (max-width: 980px) {
    .nav-container {
        grid-template-columns: auto auto auto;
    }

    .menu-toggle {
        display: inline-flex;
        justify-self: end;
    }

    nav {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: var(--shadow-lg);
        display: none;
        flex-direction: column;
        grid-column: 1 / -1;
        padding: 12px;
    }

    nav.is-open {
        display: flex;
    }

    nav a {
        width: 100%;
    }

    .hero-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        max-width: 560px;
    }

    .hero-image {
        max-height: none;
    }

    .skills-grid,
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .container {
        width: min(100% - 28px, 1120px);
    }

.section-padding {
        padding: 54px 0;
    }

    .hero {
        min-height: auto;
    }

    .hero-grid {
        gap: 34px;
    }

    .hero-actions,
    .project-actions,
    .pdf-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .metrics-grid,
    .skills-grid,
    .project-grid {
        grid-template-columns: 1fr;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .timeline-date {
        padding-top: 0;
    }

    .footer-content {
        align-items: flex-start;
        flex-direction: column;
    }
}
