:root {
  color-scheme: light dark;
  --black: #000000;
  --white: #ffffff;
  --paper: #ffffff;
  --ink: #000000;
  --muted: #4f4f4f;
  --line: #d8d8d8;
  --line-dark: rgba(255, 255, 255, 0.24);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "Noto Sans KR", "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.72;
}

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

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 34px;
  width: 100%;
  padding: 12px max(24px, calc((100vw - var(--max)) / 2));
  background: var(--black);
  color: var(--white);
  font-weight: 700;
}

.brand {
  font-size: 20px;
}

nav {
  display: flex;
  gap: 72px;
}

nav a {
  border-bottom: 1px solid transparent;
}

nav a:hover,
nav a:focus-visible {
  border-color: currentColor;
}

.language-switch {
  display: flex;
  align-self: center;
  justify-self: end;
  width: max-content;
  max-width: max-content;
  flex: 0 0 auto;
  border: 1px solid var(--white);
}

.lang-button {
  flex: 0 0 auto;
  border: 0;
  border-right: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.lang-button:last-child {
  border-right: 0;
}

.lang-button.is-active {
  background: var(--white);
  color: var(--black);
}

.panel {
  min-height: 100vh;
  padding: 78px max(30px, calc((100vw - var(--max)) / 2)) 68px;
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.85s ease, transform 0.85s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--paper);
  transition: background-color 900ms ease;
}

body[data-theme="dark"] .page-backdrop {
  background: var(--black);
}

.panel-light {
  background: transparent;
  color: var(--ink);
  transition: color 500ms ease;
}

.panel-dark {
  background: transparent;
  color: var(--white);
  transition: color 500ms ease;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  align-content: end;
  gap: 58px 30px;
  padding-top: 120px;
  padding-bottom: 88px;
}

.hero-contact {
  display: grid;
  gap: 6px;
  grid-column: 1;
  font-size: 14px;
}

.hero-identity {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
}

.name-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hero-contact strong {
  font-size: 19px;
  line-height: 1.25;
}

.latin-name,
.birth-date {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.birth-date {
  font-style: italic;
}

.hero-contact a {
  width: fit-content;
  border-bottom: 1px solid currentColor;
}

.hero-profile {
  grid-column: 1;
  max-width: 600px;
  font-size: 14px;
}

.hero-profile p {
  margin: 0 0 28px;
}

.hero-profile p:last-child {
  margin-bottom: 0;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.42;
}

.title-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.title-sub:empty {
  display: none;
}

.section-label,
.meta {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.interest-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
  gap: 96px;
  align-items: end;
}

.section-kicker {
  align-self: start;
  padding-top: 36px;
  position: sticky;
  top: 76px;
  z-index: 1;
}

.section-kicker p {
  margin: 0;
  font-weight: 700;
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 64px 86px;
  width: min(760px, 100%);
  margin-left: auto;
  padding-bottom: 54px;
}

.interest-grid article {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
}

.interest-grid p {
  color: var(--muted);
}

.academic-layout {
  display: grid;
  grid-template-columns: minmax(380px, 0.74fr) minmax(0, 1.5fr);
  column-gap: 40px;
  align-items: start;
  padding-top: 122px;
}

.academic-aside {
  display: grid;
  gap: 34px;
  align-content: start;
}

.academic-parts {
  position: relative;
  display: grid;
  row-gap: 140px;
  margin-top: 0;
}

.academic-parts::before {
  content: "";
  position: absolute;
  left: 180px;
  top: 0;
  width: 1px;
  height: calc(100% - 30px);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.72) 58%,
    rgba(255, 255, 255, 0.52) 88%,
    rgba(255, 255, 255, 0) 100%
  );
}

.academic-part {
  display: grid;
  grid-template-columns: 160px minmax(0, 1.4fr);
  column-gap: 40px;
}

.part-head {
  grid-column: 1;
  position: sticky;
  top: 76px;
  align-self: start;
  justify-self: end;
  text-align: right;
  display: grid;
  gap: 3px;
  margin-top: 34px;
}

.part-head h2 {
  margin: 0;
}

.part-body {
  grid-column: 2;
  display: grid;
  gap: 26px;
  max-width: 600px;
  margin-top: 58px;
}

.education-part .part-body article:first-child {
  border-top: none;
  padding-top: 0;
}

.academic-photo {
  margin: 0;
}

.academic-photo img {
  width: 188px;
  height: 188px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 48% 34%;
  filter: grayscale(100%) contrast(1.08);
}

.skills {
  display: grid;
  row-gap: 9px;
  column-gap: 0;
  margin-top: 42px;
}

.skill-row {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-items: start;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  line-height: 1.08;
}

.hero-profile .skill-row {
  margin: 0;
}

.skill-row .row-label {
  grid-column: 1 / -1;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  line-height: 1;
}

.skill-row:has(.row-label) {
  margin-top: 7px;
}

.skill-row-compact {
  margin-top: -2px;
}

.skill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.hero-profile .skill {
  color: var(--ink);
}

.hero-profile .row-label {
  color: var(--muted);
}

.hero-profile .skill {
  border-color: rgba(0, 0, 0, 0.24);
}

.part-body article {
  border-top: 1px solid var(--line-dark);
  padding-top: 16px;
}

.part-body p,
.publication-list {
  color: rgba(255, 255, 255, 0.78);
}

.column-intro {
  max-width: 640px;
  font-weight: 700;
}

.publication-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
}

.publication-list li {
  padding-left: 4px;
}

.projects-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1.38fr);
  gap: 92px;
  align-items: start;
}

.project-heading {
  position: sticky;
  top: 92px;
  padding-top: 8px;
}

.project-content {
  display: grid;
  gap: 38px;
  max-width: 860px;
  margin-left: auto;
}

.project-thumb {
  width: 76px;
  height: 76px;
  border: 0;
  background: #f4f4f4;
  overflow: hidden;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.5) blur(0.4px);
  transform: scale(1.03);
}

.project-thumb span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.project-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 28px;
  border-top: 1px solid var(--ink);
  padding-top: 18px;
}

.project-item .meta {
  margin-bottom: 8px;
  color: #777777;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
}

.project-item p {
  color: var(--muted);
}

.project-body h3 + p {
  color: var(--ink);
  font-weight: 700;
}

.project-points {
  display: grid;
  gap: 0;
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
}

.project-body .project-copy {
  margin-bottom: 0 !important;
  color: var(--muted) !important;
  font-weight: 400 !important;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button.primary {
  background: var(--ink);
  color: var(--white);
}

.button.secondary {
  background: transparent;
}

footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  gap: 40px;
  align-items: center;
  min-height: 112px;
  padding: 26px max(30px, calc((100vw - var(--max)) / 2));
  background: var(--black);
  color: var(--white);
}

.footer-contact {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-start;
  opacity: 1;
  transform: none;
}

footer .contact-actions {
  opacity: 1;
  transform: none;
}

.footer-contact h2 {
  margin: 0;
  color: var(--white);
  font-size: 15px;
}

footer .button {
  border-color: var(--white);
  min-height: 36px;
  padding: 7px 14px;
}

footer .button.primary,
footer .button.secondary {
  background: var(--white);
  color: var(--black);
}

footer p {
  justify-self: end;
  margin: 0;
  color: var(--white);
  text-align: right;
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 14px 24px;
  }

  nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 28px;
    width: 100%;
    overflow-x: auto;
  }

  .language-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: max-content;
    max-width: max-content;
  }

  .hero-layout,
  .academic-layout,
  .interest-layout,
  .projects-layout {
    grid-template-columns: 1fr;
  }

  .academic-layout {
    column-gap: 0;
    row-gap: 40px;
  }

  .interest-layout {
    gap: 40px;
  }

  .academic-parts {
    margin-top: 0;
    row-gap: 40px;
  }

  .academic-parts::before {
    display: none;
  }

  .skills {
    margin-top: 30px;
  }

  .academic-part {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .part-head {
    grid-column: auto;
    position: static;
    justify-self: start;
    text-align: left;
    margin-top: 0;
  }

  .part-body {
    grid-column: auto;
    max-width: 720px;
    margin-top: 0;
  }

  .section-kicker {
    position: static;
    padding-top: 0;
  }

  .hero-contact,
  .hero-profile {
    grid-column: auto;
    grid-row: auto;
  }

  .hero-profile {
    max-width: 720px;
  }

  .interest-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    width: 100%;
    margin-left: 0;
    padding-bottom: 0;
  }

  .project-heading {
    position: static;
  }

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

  .project-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .project-thumb {
    width: 72px;
    height: 72px;
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 12px 16px;
    padding: 12px 24px;
  }

  .brand {
    min-width: 0;
  }

  nav {
    gap: 24px;
    padding-bottom: 2px;
  }

  .panel {
    min-height: auto;
    padding: 132px 24px 64px;
  }

  .hero-layout,
  .interest-layout {
    min-height: 100vh;
  }

  .hero-contact,
  .hero-profile {
    font-size: 15px;
  }

  .academic-photo img {
    width: 180px;
    height: 180px;
  }

  .project-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-thumb {
    width: 76px;
    height: 76px;
  }

  footer {
    grid-template-columns: 1fr;
    align-items: start;
  }

  footer p {
    justify-self: start;
    text-align: left;
  }
}
