/* Layout modeled on the AcademicPages / Minimal Mistakes theme */
:root {
  --text: #494e52;
  --text-light: #7a8288;
  --bg: #fff;
  --border: #f2f3f3;
  --link: #2f7f93;
  --link-hover: #23606f;
  --font: -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI",
          "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 70px 0 6em;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* Top navigation */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; height: 70px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.masthead__inner {
  max-width: 1120px; margin: 0 auto; padding: 0 1em;
  height: 100%; display: flex; align-items: center; overflow-x: auto;
}
.masthead ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4em; white-space: nowrap; }
.masthead a { color: var(--text); font-size: 0.95em; }
.masthead a:hover { color: var(--link); text-decoration: none; }
.masthead .site-title { font-weight: 700; padding-right: 1em; }
.masthead a.active { color: var(--link); }

/* Main grid */
#main {
  max-width: 1120px; margin: 0 auto; padding: 2em 1em 0;
  display: grid; grid-template-columns: 270px 1fr; gap: 3em;
}

/* Sidebar */
.sidebar { position: sticky; top: 100px; align-self: start; font-size: 0.85em; }
.author__avatar img {
  width: 100%; max-width: 265px; border-radius: 50%;
  border: 1px solid #e3e5e6; padding: 5px; display: block;
}
.author__name { margin: 0.8em 0 0.2em; font-size: 1.1em; color: var(--text); }
.author__bio { margin: 0 0 1em; color: var(--text-light); }
.author__urls { list-style: none; margin: 0; padding: 0; }
.author__urls li { margin-bottom: 0.45em; white-space: nowrap; }
.author__urls a { color: var(--text); }
.author__urls a:hover { color: var(--link); }
.author__urls i { width: 1.4em; text-align: center; margin-right: 0.35em; color: var(--text-light); }

/* Content */
.page__title { margin: 0 0 0.6em; font-size: 1.563em; line-height: 1.2; }
.page__content h2 {
  font-size: 1.25em; margin: 2em 0 0.6em; padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}
.page__content h3 { font-size: 1.05em; margin: 1.6em 0 0.4em; }
.page__content p, .page__content li { font-size: 0.95em; }
.page__content ul { padding-left: 1.3em; }
.page__content li { margin-bottom: 0.3em; }
.meta { color: var(--text-light); font-size: 0.85em; }
.entry { margin-bottom: 1.4em; }
.entry h3 { margin: 0 0 0.15em; display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; }
.entry h3 .meta { font-weight: normal; }
.badge {
  display: inline-block; font-size: 0.75em; font-weight: 600; color: #fff;
  background: #c0841a; border-radius: 3px; padding: 0 0.4em; margin-right: 0.3em;
}

/* Footer */
.page__footer {
  max-width: 1120px; margin: 4em auto 0; padding: 1.5em 1em 0;
  border-top: 1px solid var(--border);
  color: var(--text-light); font-size: 0.75em;
}

/* Phone width */
@media (max-width: 760px) {
  #main { grid-template-columns: 1fr; gap: 1.5em; padding-top: 1.2em; }
  .sidebar {
    position: static; display: grid; grid-template-columns: 150px 1fr;
    gap: 0 1em; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1em;
  }
  .author__avatar { grid-row: span 2; }
  .author__avatar img { max-width: 150px; }
  .author__name { margin-top: 0; }
  .author__urls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.2em 1em; margin-top: 0.8em; }
}
@media (max-width: 480px) {
  .masthead ul { gap: 0.9em; }
  .masthead a { font-size: 0.85em; }
  .masthead .site-title { padding-right: 0.2em; }
}

/* Project screenshots */
.project-img { display: block; margin: 0.6em 0 0.8em; }
.project-img img {
  display: block; width: 100%; height: auto;
  border: 1px solid #e3e5e6; border-radius: 6px;
}
.project-img:hover img { border-color: var(--link); }

/* Home: CV-style sections */
.page__content h2.first { margin-top: 0; }
.meta.row { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; margin-top: 0; }
.masthead .fa-file-pdf { color: #c0392b; margin-left: 0.2em; }

/* Experience-style entries: title + date, org in accent, short description */
.xp { margin: 0 0 2.2em; }
.xp__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4em 1.5em; flex-wrap: wrap; }
.xp__head h3 { margin: 0; font-size: 1.15em; line-height: 1.35; color: #2f3437; }
.xp__date { color: var(--text-light); font-size: 0.85em; white-space: nowrap; }
.page__content .xp__org { margin: 0.35em 0 0; color: var(--link); font-size: 0.92em; }
.page__content .xp__desc { margin: 0.6em 0 0; line-height: 1.75; }
.xp .project-img { margin: 0.9em 0 0; }
.page__content h2 { margin-bottom: 1.1em; }

/* Home intro */
.intro { margin-bottom: 2.6em; }
.intro__name { margin: 0; font-size: 2.3em; line-height: 1.15; color: #2f3437; }
.page__content .intro__role { margin: 0.35em 0 1em; font-size: 1.3em; color: var(--link); }
.page__content .intro__text { font-size: 1.02em; line-height: 1.9; }
.intro__text a { text-decoration: underline; text-decoration-color: #9fc9d3; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Education and work experience table */
.timeline { width: 100%; border-collapse: collapse; font-size: 0.95em; border: 1px solid #e8eaeb; }
.timeline td { padding: 0.8em 1em; border-bottom: 1px solid #e8eaeb; vertical-align: top; }
.timeline td.timeline__date { width: 9em; white-space: nowrap; border-left: 1px solid #e8eaeb; }
.timeline tr.current td { background: #f2f3f3; font-weight: 700; }

/* Project chunks: text left, images right, divided by rules */
.chunk {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2em;
  align-items: start; padding: 2em 0; border-top: 1px solid #e3e5e6;
}
.chunk:last-child { border-bottom: 1px solid #e3e5e6; }
.chunk--text { grid-template-columns: 1fr; }
.chunk__text h3 { margin: 0 0 0.3em; font-size: 1.15em; line-height: 1.35; color: #2f3437; }
.chunk__date { display: block; margin-top: 0.25em; font-size: 0.78em; font-weight: normal; color: var(--text-light); }
.page__content .chunk__link { margin: 0 0 0.6em; font-size: 0.9em; }
.chunk__text ul { list-style: square; margin: 0.6em 0 0; }
.page__content .chunk__text li { margin-bottom: 0.45em; line-height: 1.6; }
.chunk__media { display: grid; gap: 0.6em; }
.chunk__media img { display: block; width: 100%; height: auto; border: 1px solid #e3e5e6; border-radius: 4px; }
.chunk__media a:hover img { border-color: var(--link); }

@media (max-width: 900px) {
  .chunk { grid-template-columns: 1fr; gap: 1.2em; }
}
@media (max-width: 480px) {
  .intro__name { font-size: 1.9em; }
  .timeline td { padding: 0.65em 0.7em; }
  .timeline td.timeline__date { width: auto; }
}
.chunk__media img.thumb { max-width: 380px; }
.page__content p.chunk__link:not(:has(a)) { color: var(--link); }

/* LinkedIn-style experience list */
.xl__item { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 0 1.1em; padding: 1.4em 0; border-bottom: 1px solid #e8eaeb; }
.xl__item:first-child { padding-top: 0.3em; }
.xl__item:last-child { border-bottom: 0; }
.xl__logo img, .xl__logo-fallback { display: block; width: 48px; height: 48px; object-fit: contain; border-radius: 4px; }
.xl__logo-fallback { display: flex; align-items: center; justify-content: center; background: #eef1f2; color: var(--text-light); font-size: 1.3em; }
.page__content .xl p { margin: 0; }
.xl__role { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.3em 2em; }
.xl__main { min-width: 0; }
.page__content .xl__org { font-weight: 700; color: #2f3437; font-size: 1.02em; margin-bottom: 0.7em; }
.page__content .xl__title { font-weight: 600; color: #2f3437; font-size: 1em; line-height: 1.4; }
.page__content .xl__sub { font-size: 0.92em; margin-top: 0.15em; }
.page__content .xl__note { font-size: 0.88em; color: var(--text-light); margin-top: 0.25em; line-height: 1.5; }
.xl__side { flex-shrink: 0; text-align: right; font-size: 0.85em; color: var(--text-light); line-height: 1.55; white-space: nowrap; }
.xl__roles { list-style: none; margin: 0; padding: 0; }
.page__content .xl__roles li { position: relative; margin: 0; padding: 0 0 1.1em 1.3em; font-size: 1em; }
.page__content .xl__roles li:last-child { padding-bottom: 0; }
.xl__roles li::before { content: ""; position: absolute; left: 1px; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; background: #b9bec1; }
.xl__roles li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 1.35em; bottom: 0.2em; width: 2px; background: #e1e4e5; }
@media (max-width: 600px) {
  .xl__role { flex-direction: column; }
  .xl__side { text-align: left; white-space: normal; margin-top: 0.3em; }
  .xl__side p { display: inline; }
  .xl__side p + p::before { content: " · "; }
}

/* Project titles: full-width header row above text and images */
.chunk { row-gap: 1em; padding: 2.2em 0; }
.chunk__head {
  grid-column: 1 / -1; display: flex; justify-content: space-between;
  align-items: baseline; gap: 0.3em 1.5em; flex-wrap: wrap;
}
.page__content h3.chunk__title {
  margin: 0; font-size: 1.32em; font-weight: 700; line-height: 1.3;
  color: #1f2427; letter-spacing: -0.01em;
}
.chunk__head .chunk__date {
  display: inline-block; margin: 0; font-size: 0.85em; color: var(--text-light); white-space: nowrap;
}
.page__content .chunk__text .chunk__link { margin-top: 0; }
.chunk__text ul { margin-top: 0; }

/* Korean one-line intro under the role */
.page__content .intro__ko { margin: -0.5em 0 1.1em; font-size: 0.95em; color: var(--text-light); }
