/* ==========================================================================
   JaeSeong Kim — personal website
   ========================================================================== */

:root {
    --bg: #fbfaf8;
    --surface: #ffffff;
    --text: #1b1c1e;
    --text-2: #45484d;
    --muted: #6b7078;
    --border: #e8e6e1;
    --border-strong: #d7d4cd;
    --accent: #3070b3;          /* TUM blue */
    --accent-hover: #245a92;
    --accent-soft: rgba(48, 112, 179, 0.08);
    --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.06);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

    --container: 880px;
    --nav-h: 64px;
    --radius: 12px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1114;
        --surface: #16191e;
        --text: #e9eaec;
        --text-2: #c3c6cc;
        --muted: #8e939b;
        --border: #24282e;
        --border-strong: #333840;
        --accent: #6fa8e6;
        --accent-hover: #93bff0;
        --accent-soft: rgba(111, 168, 230, 0.12);
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover { color: var(--accent-hover); }

p a, li a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-underline-offset: 3px;
}

p a:hover, li a:hover { text-decoration-color: currentColor; }

strong { font-weight: 600; color: var(--text); }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.site-nav.scrolled { border-bottom-color: var(--border); }

.wide .nav-inner,
.wide .site-footer .container { max-width: 1240px; }

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    min-height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-name {
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.nav-name:hover { color: var(--text); }

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

.nav-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.nav-links a.active { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
    padding: 56px 0 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 232px;
    gap: 48px;
    align-items: start;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 46px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 14px;
}

.hero-role {
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
}

.hero-org {
    font-size: 15px;
    color: var(--muted);
    margin: 2px 0 0;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    font-size: 14px;
    color: var(--muted);
    margin-top: 10px;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-meta .icon { width: 14px; height: 14px; }

.hero-photo { padding-top: 8px; }

.hero-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 50% 30%;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.bio {
    margin-top: 28px;
    color: var(--text-2);
    font-size: 16.5px;
}

.bio p { margin: 0 0 16px; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.tags li {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 12px;
    border-radius: 999px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.btn .icon { width: 15px; height: 15px; }

/* ---------- Sections ---------- */

.section {
    padding: 44px 0;
    border-top: 1px solid var(--border);
    scroll-margin-top: var(--nav-h);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0 0 28px;
}

.subsection-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 36px 0 16px;
}

/* ---------- News ---------- */

.news {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news li {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 20px;
    padding: 12px 0;
    color: var(--text-2);
}

.news li + li { border-top: 1px dashed var(--border); }

.news time,
.talks time {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-top: 1px;
}

.news li.highlight strong { color: var(--accent); }

/* ---------- Publications / projects ---------- */

.entry {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    padding: 24px 0;
}

.entry + .entry { border-top: 1px solid var(--border); }

.entry-thumb {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    aspect-ratio: 4 / 3;
}

.entry-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.entry:hover .entry-thumb img { transform: scale(1.04); }

.entry h3 {
    font-size: 17.5px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px;
    letter-spacing: -0.005em;
}

.entry-authors {
    font-size: 14.5px;
    color: var(--text-2);
    margin: 0 0 4px;
}

.entry-authors .me {
    font-weight: 600;
    color: var(--text);
}

.entry-venue {
    font-size: 14.5px;
    color: var(--muted);
    margin: 0 0 10px;
}

.entry-venue em { font-style: italic; }

.badge {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 6px;
    vertical-align: 1px;
}

.entry-desc {
    font-size: 15px;
    color: var(--text-2);
    margin: 0 0 12px;
}

.entry-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entry-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 3px 11px;
    border-radius: 999px;
    transition: border-color 0.2s, color 0.2s;
}

.entry-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.entry-links .icon { width: 13px; height: 13px; }

/* ---------- Talks ---------- */

.talks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.talks li {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 20px;
    padding: 12px 0;
}

.talks li + li { border-top: 1px dashed var(--border); }

.talk-title {
    display: block;
    color: var(--text);
    font-weight: 500;
}

.talk-venue {
    display: block;
    font-size: 14.5px;
    color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0 48px;
    margin-top: 24px;
    font-size: 14px;
    color: var(--muted);
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
}

/* ---------- Photography ---------- */

.page-header {
    max-width: 1240px;
    margin: 0 auto;
    padding: 56px 24px 24px;
}

.page-header h1 {
    font-family: var(--font-serif);
    font-size: 44px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 10px;
}

.page-header p {
    color: var(--muted);
    margin: 0;
}

.gallery-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 16px 24px 40px;
}

.gallery {
    columns: 3 300px;
    column-gap: 16px;
}

.gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    margin: 0 0 16px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    cursor: zoom-in;
    break-inside: avoid;
}

.gallery-item img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.gallery-item:hover img { transform: scale(1.03); }

.gallery-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 9, 11, 0.94);
}

.lightbox.open { display: flex; }

.lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox button:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox button .icon { width: 22px; height: 22px; }

.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lb-count {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

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

@media (max-width: 760px) {
    .nav-inner {
        flex-wrap: wrap;
        gap: 0;
        padding: 10px 16px 6px;
    }

    .nav-links {
        overflow-x: auto;
        scrollbar-width: none;
        margin: 4px -10px 0;
        width: calc(100% + 20px);
    }

    .nav-links::-webkit-scrollbar { display: none; }

    .container { padding: 0 16px; }

    .hero { padding: 32px 0 28px; }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hero-photo { order: -1; }
    .hero-photo img { width: 140px; border-radius: 16px; }

    .hero h1 { font-size: 36px; }

    .section { scroll-margin-top: 100px; padding: 36px 0; }

    .entry {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .entry-thumb { max-width: 360px; }

    .news li, .talks li {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .page-header { padding: 32px 16px 16px; }
    .page-header h1 { font-size: 34px; }

    .gallery-wrap { padding: 8px 16px 32px; }
    .gallery { column-gap: 12px; }
    .gallery-item { margin-bottom: 12px; }

    .lb-prev { left: 8px; }
    .lb-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}
