/* =========================================================
   Weerawat Phattarasukkumjorn — Academic Website
   Visual direction: soft gray / off-white / black UI,
   rounded panels, fine borders, grid-like details.
   Font: Maitree (Google Fonts)
   ========================================================= */

:root {
    --bg: #dfe1e3;
    --surface: #f5f5f3;
    --surface-2: #eeeeec;
    --ink: #1d1e20;
    --muted: #70757a;
    --line: #c8c9ca;
    --line-dark: #222426;
    --link: #00abe0;
    --accent: #f2bd00;
    --shadow: 0 22px 55px rgba(30, 32, 34, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,.58), transparent 28%),
        radial-gradient(circle at 82% 75%, rgba(255,255,255,.42), transparent 30%),
        var(--bg);
    color: var(--ink);
    font-family: "Maitree", serif;
    font-weight: 400;
    line-height: 1.55;
}

a {
    color: inherit;
}

.site-shell {
    width: min(1220px, calc(100% - 48px));
    margin: 48px auto;
    background: var(--surface);
    border: 1px solid #c4c6c8;
    border-radius: 26px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ---------- Navigation ---------- */

.navbar {
    min-height: 76px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 245, 243, .92);
}

.nav-brand {
    font-family: "Maitree", serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .18em;
    white-space: nowrap;
}

.nav-brand::before {
    content: "";
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 12px;
    border-radius: 3px;
    background: var(--ink);
    vertical-align: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    position: relative;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color .2s ease;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -7px;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* ---------- Main layout ---------- */

.page-grid {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
}

.profile-panel {
    position: sticky;
    top: 20px;
    align-self: start;
    min-height: 100%;
    padding: 58px 38px 48px;
    border-right: 1px solid var(--line);
    background:
        radial-gradient(circle, #d8dadd 1px, transparent 1.5px) 0 0 / 16px 16px,
        var(--surface-2);
}

.profile-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 42px;
    border: 1.5px solid var(--line-dark);
    border-radius: 50%;
    background: var(--surface);
}

.profile-mark span {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .05em;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--muted);
    font-family: "Maitree", serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    line-height: 1.4;
    text-transform: uppercase;
}

.profile-panel h1 {
    margin: 0;
    font-size: clamp(31px, 3vw, 43px);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.profile-rule {
    width: 56px;
    height: 4px;
    margin: 30px 0 24px;
    border-radius: 4px;
    background: var(--accent);
}

.affiliation {
    margin: 0 0 14px;
    color: #44474a;
    font-size: 15px;
    line-height: 1.65;
}

.email {
    color: var(--link);
    font-size: 13px;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.email:hover {
    text-decoration: underline;
}

.research-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 36px;
}

.research-tags span {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #565a5e;
    background: rgba(255,255,255,.38);
    font-size: 10px;
    line-height: 1.3;
}

/* ---------- Content ---------- */

.content-panel {
    min-width: 0;
    padding: 58px 58px 34px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 17px;
    margin-bottom: 30px;
    border-bottom: 1.5px solid var(--line-dark);
    scroll-margin-top: 30px;
}

.section-heading h2 {
    margin: 0;
    font-size: 29px;
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.section-number {
    color: #999da1;
    font-family: "Maitree", serif;
    font-size: 12px;
    letter-spacing: .1em;
}

.publication-group {
    margin-bottom: 12px;
}

.publication-group h3 {
    margin: 0 0 3px;
    color: var(--link);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .05em;
}

.publication-list,
.publication-group > ul {
    margin: 0;
    padding-left: 22px;
}

.publication-list li,
.publication-group > ul > li {
    padding: 0 0 9px 5px;
}

.publication-list li:last-child,
.publication-group > ul > li:last-child {
    margin-bottom: 0;
}

.publication-list li::marker,
.publication-group > ul > li::marker {
    color: #9da1a4;
}

.empty-item {
    color: var(--muted);
    font-size: 14px;
}

.publication-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.publication-title-row a {
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease;
}

.publication-title-row a:hover {
    color: var(--link);
}

.publication-title-row time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.publication-journal {
    margin-top: 3px;
    color: #767a7d;
    font-size: 14px;
}

.thai {
    font-size: 14px;
}

.thai small {
    color: #767a7d;
    font-size: 11px;
}

.education-heading {
    margin-top: 60px;
}

.education-item {
    position: relative;
    padding: 0 0 28px 22px;
    margin-left: 8px;
    border-left: 1px solid var(--line);
}

.education-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid var(--line-dark);
    background: var(--surface);
}

.education-item:last-child {
    padding-bottom: 36px;
}

.education-meta {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.education-item h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.education-item p {
    margin: 4px 0 0;
    color: #575b5e;
    font-size: 13px;
}

.education-item em {
    color: #333638;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 58px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    color: #85898c;
    font-size: 14px;
}

footer a {
    color: #55595c;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .site-shell {
        width: min(100% - 24px, 720px);
        margin: 12px auto;
        border-radius: 18px;
    }

    .navbar {
        padding: 16px 20px;
        align-items: flex-start;
        gap: 15px;
        flex-direction: column;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px 18px;
    }

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

    .profile-panel {
        position: relative;
        top: auto;
        min-height: auto;
        padding: 40px 28px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .profile-mark {
        margin-bottom: 25px;
    }

    .content-panel {
        padding: 40px 28px 28px;
    }
}

@media (max-width: 560px) {
    .site-shell {
        width: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .navbar {
        min-height: auto;
    }

    .nav-links a {
        font-size: 11px;
    }

    .profile-panel h1 {
        font-size: 34px;
    }

    .content-panel {
        padding: 34px 20px 24px;
    }

    .section-heading h2 {
        font-size: 25px;
    }

    .publication-title-row {
        display: block;
    }

    .publication-title-row time {
        display: block;
        margin-top: 4px;
    }

    .education-meta {
        display: block;
    }

    .education-meta span {
        display: block;
        margin-bottom: 2px;
    }

    footer {
        display: block;
    }

    footer a {
        display: block;
        margin-top: 8px;
    }
}

/* ---------- Print ---------- */

@media print {
    body {
        background: #fff;
    }

    .site-shell {
        width: 100%;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .navbar {
        display: none;
    }

    .page-grid {
        grid-template-columns: 240px 1fr;
    }

    .profile-panel {
        position: static;
    }

    .content-panel {
        padding: 30px;
    }
}
