:root {
    --bg: #f3f6f9;
    --panel: #ffffff;
    --text: #17212d;
    --muted: #536273;
    --line: #d8e0e8;
    --accent: #12558f;
    --accent-2: #0d78a8;
    --accent-soft: #e9f3fb;
    --shadow: 0 8px 28px rgba(12, 29, 52, 0.08);
    --shadow-hover: 0 14px 32px rgba(11, 30, 53, 0.14);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
            radial-gradient(circle at 86% -15%, #d9e9f7 0%, rgba(217, 233, 247, 0) 38%),
            linear-gradient(180deg, #ecf3f8 0%, var(--bg) 320px);
    line-height: 1.55;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid #71abdd;
    outline-offset: 2px;
    border-radius: 8px;
}

.site {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.15rem 3rem;
}

.topnav {
    position: sticky;
    top: 0.65rem;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(248, 251, 254, 0.78);
    border: 1px solid rgba(167, 187, 207, 0.44);
    box-shadow: 0 10px 20px rgba(11, 31, 53, 0.08);
    border-radius: 14px;
    margin: 0;
    padding: 0.58rem;
}

.topnav-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: none;
    gap: 0.45rem;
    flex-direction: column;
    margin-top: 0.5rem;
}

.topnav.open .topnav-list {
    display: flex;
}

.nav-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid #c9daea;
    border-radius: 10px;
    background: #f6fbff;
    color: #1d3348;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
    display: block;
    width: 14px;
    height: 2px;
    border-radius: 999px;
    background: #1d3348;
    content: "";
}

.nav-toggle__icon {
    position: relative;
}

.nav-toggle__icon::before {
    position: absolute;
    top: -4px;
    left: 0;
}

.nav-toggle__icon::after {
    position: absolute;
    top: 4px;
    left: 0;
}

.topnav a {
    display: inline-block;
    white-space: nowrap;
    padding: 0.45rem 0.82rem;
    border-radius: 999px;
    background: transparent;
    color: #253648;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.topnav a:hover {
    background: #edf5fb;
    text-decoration: none;
    transform: translateY(-1px);
}

.topnav a.active {
    background: #1a5d93;
    color: #fff;
}

.hero {
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    background: linear-gradient(145deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid #d8e4ef;
    border-radius: calc(var(--radius) + 4px);
    padding: 1.55rem;
    box-shadow: var(--shadow);
}

.hero::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -70px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(78, 142, 196, 0.2) 0%, rgba(78, 142, 196, 0) 70%);
    pointer-events: none;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 760;
    letter-spacing: -0.02em;
}

.subtitle {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 1.03rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #d3e0ec;
    border-radius: 999px;
    padding: 0.48rem 0.82rem;
    background: #fff;
    font-size: 0.89rem;
    color: #1f3446;
    transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.chip:hover {
    text-decoration: none;
    background: #f4f9fd;
    border-color: #b7d0e6;
    transform: translateY(-1px);
}

.chip-button {
    cursor: pointer;
    font: inherit;
}

.section {
    margin-top: 1.1rem;
    background: var(--panel);
    border: 1px solid #d9e3ec;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.section h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    letter-spacing: -0.015em;
}

.timeline {
    display: grid;
    gap: 0.75rem;
}

.work-subsection {
    margin-top: 1rem;
    border-top: 1px solid #d8e3ee;
    padding-top: 0.95rem;
}

.work-subsection-title {
    margin: 0;
    font-size: 1rem;
    color: #21384e;
}

.work-subsection-intro {
    margin: 0.35rem 0 0.75rem;
    color: #4a5f74;
    font-size: 0.9rem;
}

.timeline-secondary .entry::before {
    background: linear-gradient(180deg, #76879a 0%, #9faeba 100%);
}

#volunteer .entry::before {
    background: linear-gradient(180deg, #2f8f84 0%, #6ab3ab 100%);
}

.entry-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
}

.entry-badge {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    padding: 0.24rem 0.56rem;
}

.entry-badge-side {
    color: #334b60;
    background: #eef3f8;
    border: 1px solid #cedce9;
}

.entry {
    --entry-logo-size: 62px;
    --entry-gap: 0.85rem;
    position: relative;
    border: 1px solid #dbe5ee;
    border-radius: 5px 14px;
    padding: 0.95rem;
    display: block;
    background: #fff;
    transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

.entry-summary {
    display: grid;
    grid-template-columns: var(--entry-logo-size) 1fr;
    gap: var(--entry-gap);
    align-items: start;
    list-style: none;
    cursor: pointer;
}

.entry-summary::-webkit-details-marker {
    display: none;
}

.entry-summary::marker {
    content: "";
}

.entry-content {
    margin-top: 0.35rem;
    margin-left: calc(var(--entry-logo-size) + var(--entry-gap));
}

.entry::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, #2f7db9 0%, #67a2cd 100%);
    opacity: 0.85;
}

.entry:hover {
    transform: translateY(-2px);
    border-color: #bfd3e4;
    box-shadow: 0 10px 24px rgba(16, 38, 61, 0.12);
}

.entry-logo {
    width: var(--entry-logo-size);
    height: var(--entry-logo-size);
    border-radius: 12px;
    border: 1px solid #dfe7ef;
    object-fit: contain;
    padding: 0.38rem;
    background: #fcfdff;
}

.entry-main {
    min-width: 0;
}

.entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.entry-title {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.entry-date {
    color: #2a445d;
    background: #edf6fd;
    border: 1px solid #c8dfef;
    border-radius: 999px;
    padding: 0.2rem 0.58rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.entry-org {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: #304557;
}

.entry p {
    margin: 0;
    color: #3a4f63;
    font-size: 0.93rem;
}

.entry-description {
    margin: 0;
}

.entry-tags {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
}

.entry-tag {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 520;
    line-height: 1;
    padding: 0.36rem 0.54rem;
    border-radius: 999px;
    border: 1px solid #d1e2f0;
    background: #f3f8fd;
    color: #21425f;
}

.course-list {
    display: grid;
    gap: 0.6rem;
}

.projects-grid {
    display: grid;
    gap: 0.75rem;
}

.project-card {
    display: block;
    border: 1px solid #dbe5ee;
    border-radius: 14px;
    padding: 0.95rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform 170ms ease, box-shadow 170ms ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(16, 38, 61, 0.12);
}

.project-card-link:hover,
.project-card-link:focus,
.project-card-link:active {
    text-decoration: none;
}

.project-card-link:focus-visible {
    outline: 2px solid #71abdd;
    outline-offset: 2px;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.project-title {
    margin: 0;
    font-size: 1.03rem;
    color: #1a3045;
}

.project-status {
    font-size: 0.78rem;
    font-weight: 600;
    color: #21425f;
    border: 1px solid #cfe1ef;
    background: #eef6fc;
    border-radius: 999px;
    padding: 0.24rem 0.56rem;
}

.project-year {
    margin: 0.35rem 0 0;
    font-size: 0.83rem;
    color: #5a6e82;
}

.project-description {
    margin: 0.45rem 0 0;
    color: #3a4f63;
    font-size: 0.93rem;
}

.course {
    border: 1px solid #dbe5ee;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    background: #fff;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.course:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(14, 36, 58, 0.1);
}

.course h3 {
    margin: 0;
    font-size: 1rem;
}

.course .meta {
    margin-top: 0.2rem;
    font-size: 0.92rem;
    color: #304557;
}

.course .date {
    font-size: 0.82rem;
    color: #2c455f;
    background: #ecf6fd;
    border: 1px solid #c8deee;
    border-radius: 999px;
    padding: 0.24rem 0.58rem;
    white-space: nowrap;
}

.cert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.cert-card {
    border: 1px solid #dbe5ee;
    border-radius: 14px;
    padding: 0.85rem;
    text-align: center;
    background: #fff;
    transition: transform 160ms ease, box-shadow 160ms ease;
    height: 100%;
}

.cert-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.cert-card img {
    margin: 0 auto 0.7rem;
    max-height: 105px;
    object-fit: contain;
}

.cert-card h3 {
    margin: 0;
    color: #17212b;
    font-size: 0.97rem;
    line-height: 1.32;
}

.footer-note {
    margin-top: 1.15rem;
    color: var(--muted);
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (min-width: 760px) {
    .nav-toggle {
        display: none;
    }

    .topnav-list,
    .topnav.open .topnav-list {
        display: flex;
        flex-direction: row;
        margin-top: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hero {
        padding: 2rem;
    }

    .hero-grid {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .section {
        padding: 1.55rem;
    }

    .entry {
        --entry-logo-size: 72px;
        padding: 1.05rem;
    }

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

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

@media (max-width: 680px) {
    .site {
        padding: 0 0.75rem 2rem;
    }

    .section,
    .hero {
        padding: 1rem;
    }

    .entry {
        --entry-logo-size: 56px;
        gap: 0.7rem;
        padding-left: 0.95rem;
    }

    .entry-summary {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }

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

    .entry::before {
        width: 3px;
    }

    .entry-meta {
        justify-content: flex-start;
    }

    .cert-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        margin: 12mm;
    }

    body {
        background: #fff;
    }

    .topnav,
    #export-pdf-btn,
    .footer-note,
    .entry-date,
    .project-year,
    .course .date {
        display: none !important;
    }

    .site {
        max-width: 100%;
        padding: 0;
    }

    .hero,
    .section,
    .entry,
    .course,
    .project-card,
    .cert-card {
        box-shadow: none !important;
        background: #fff !important;
    }

    .section,
    .entry,
    .course,
    .project-card,
    .cert-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    a {
        color: #000;
        text-decoration: none;
    }
}
