@font-face {
  font-family: "Instrument Sans";
  src: url("instrument-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("pretendard-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #faf9f6;
  --ink: #172238;
  --secondary: #3b465b;
  --muted: #546073;
  --line: #d8dade;
  --accent: #344999;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.6 var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }

html[lang="ko"] {
  --font: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.67;
  word-break: keep-all;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}

a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.reading-progress {
  position: fixed;
  z-index: 5;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: left;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  @view-transition { navigation: auto; }

  .language-indicator { view-transition-name: language-indicator; }

  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  ::view-transition-old(root) { opacity: 0; }

  ::view-transition-group(language-indicator) {
    animation-duration: 380ms;
    animation-timing-function: var(--motion-ease);
  }

  ::view-transition-old(language-indicator) { display: none; }
  ::view-transition-new(language-indicator) { animation: none; }
}

.skip {
  position: absolute;
  inset: 1rem auto auto 1rem;
  z-index: 6;
  padding: 8px 16px;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-200%);
}

.skip:focus { transform: none; }

.page {
  width: min(1120px, calc(100% - 36px));
  margin-inline: auto;
  padding-top: clamp(10px, 2vw, 23px);
}

.masthead {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  column-gap: clamp(12px, 2.25vw, 32px);
  padding: 5px clamp(12px, 2.1vw, 26px);
  border: 1px solid #d8dadeb3;
  border-radius: 13px;
  background: rgb(250 249 246 / .85);
  backdrop-filter: blur(12px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0 clamp(12px, 2.4vw, 28px);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--secondary);
  font-size: .93rem;
  font-weight: 550;
  text-decoration: none;
}

.site-nav a:hover, .wordmark:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-nav a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.language-switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(50px, 1fr));
  align-items: center;
  justify-self: end;
  border-radius: 999px;
}

.language-switch::before {
  position: absolute;
  pointer-events: none;
  content: "";
  z-index: -1;
  inset: 6px 0;
  border: 1px solid var(--line);
  border-radius: inherit;
  background: #eeede9;
}

.language-indicator {
  position: absolute;
  z-index: 1;
  inset-block-end: 9px;
  inset-inline-start: calc(25% - 9px);
  width: 18px;
  height: 2px;
  border-radius: inherit;
  background: var(--accent);
  pointer-events: none;
}

html[lang="ko"] .language-indicator {
  inset-inline-start: calc(75% - 9px);
}

.language-switch a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding-inline: 7px;
  border-radius: inherit;
  color: var(--muted);
  font-size: .81rem;
  text-decoration: none;
}

.language-switch a[aria-current],
.language-switch a:hover {
  color: var(--ink);
}

.language-switch a[aria-current] { font-weight: 650; }

.intro {
  display: grid;
  grid-template:
    "name name"
    "details portrait"
    "links links"
    / minmax(0, 1fr) clamp(62px, 19vw, 118px);
  align-content: center;
  gap: 15px clamp(14px, 3vw, 40px);
  margin-bottom: clamp(32px, 4vw, 52px);
  padding-block: clamp(38px, 5.3vw, 74px) clamp(36px, 5vw, 68px);
  border-bottom: 1px solid var(--line);
}

h1 {
  grid-area: name;
  min-width: 0;
  font-size: clamp(2.1rem, 10.5vw, 4.8rem);
  font-weight: 650;
  line-height: .99;
  letter-spacing: -.071em;
}

.intro-details { grid-area: details; min-width: 0; }

html[lang="ko"] .intro h1 { letter-spacing: -.057em; font-weight: 710; }

.name-word {
  display: inline-block;
  overflow: clip;
  margin-block: -.12em;
  padding-block: .12em;
  vertical-align: bottom;
}

.name-word + .name-word { margin-inline-start: .025em; }
html[lang="ko"] .name-word + .name-word { margin-inline-start: 0; }

.name-word > span { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .name-word > span {
    animation: name-roll 680ms var(--motion-ease) backwards;
    animation-delay: calc(var(--word-index) * 82ms);
  }
}

@keyframes name-roll {
  0% { transform: translateY(112%); }
  76% { transform: translateY(-.045em); }
  100% { transform: none; }
}

@keyframes page-arrival {
  from { transform: translateY(.38em); opacity: .35; }
  to { transform: none; opacity: 1; }
}

.roles {
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 620;
  line-height: 1.5;
}

.roles li + li { margin-top: 3px; color: var(--secondary); }
.roles a { font-weight: 650; }

.bio {
  max-width: 51ch;
  margin-top: 12px;
  color: var(--secondary);
  font-size: clamp(.94rem, 1.65vw, 1.06rem);
}

.profile-links {
  grid-area: links;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px clamp(12px, 2.1vw, 22px);
  margin-top: 5px;
  font-size: .92rem;
}

.profile-links > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-weight: 600;
}

.cv-link {
  gap: 6px;
  padding-inline: clamp(13px, 1.8vw, 20px);
  border-radius: 6px;
  background: #263551;
  color: #fff;
  text-decoration: none;
}

.cv-link:hover { background: #33466c; }
.cv-link span { font-size: .77em; }

.portrait {
  grid-area: portrait;
  align-self: center;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 4.65;
  object-fit: cover;
  object-position: center 32%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eeede9;
}

.content-section {
  padding-block: 30px 42px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 20px;
}

.home-index > .content-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.home-index h2 a {
  display: inline-block;
  color: inherit;
  text-decoration-color: #6772896b;
}

.home-index h2 a:hover { text-decoration-color: var(--accent); }

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

.index-list li {
  padding-block: 11px;
  border-bottom: 1px solid var(--line);
}

.index-list li:first-child { padding-top: 0; }
.index-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.index-list a, .index-list strong { font-weight: 620; }
.index-list a { display: inline-block; color: var(--ink); }
.index-list p { margin-top: 2px; color: var(--muted); font-size: .92rem; }
.index-more { margin-top: 12px; font-size: .92rem; }
.index-more a { color: var(--accent); }

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4.1vw, 3.1rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -.053em;
}

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

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 20px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}

.record:last-child { border-bottom: 0; }
.record:first-child { padding-top: 0; }

.record :is(h2, h3) {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 650;
  text-wrap: pretty;
}

.record h2 a, .project-copy h2 a {
  display: inline-block;
  color: inherit;
  text-decoration-color: #6772896b;
}

.record h2 a:hover, .project-copy h2 a:hover { text-decoration-color: var(--accent); }

.record-date {
  color: var(--muted);
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}

.record-details { color: var(--secondary); }
.metadata { font-size: .93rem; }
.summary { max-width: 64ch; margin-top: 6px; }
.source-link { margin-top: 4px; font-size: .93rem; }
.source-link a { display: inline-block; padding-block: 4px; }

footer {
  padding-block: 16px 24px;
  border-top: 1px solid var(--line);
  font-size: .92rem;
}

footer a { display: inline-flex; align-items: center; min-height: 44px; }

.route-heading {
  max-width: 880px;
  margin-block: clamp(35px, 6vw, 82px) clamp(25px, 4vw, 44px);
}

.route-heading h1 {
  font-size: clamp(2.38rem, 5.5vw, 4.65rem);
  line-height: 1.06;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}

.detail-page .route-heading h1 { font-size: clamp(2.12rem, 4.4vw, 3.83rem); }
html[lang="ko"] .route-heading h1 { letter-spacing: -.042em; }
.route-heading p { margin-top: 11px; }
.route-heading .summary { color: var(--secondary); font-size: 1.08rem; }
.route-heading .metadata { color: var(--muted); }

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-size: .92rem;
}

.section-page, .detail-page {
  padding-bottom: clamp(36px, 5vw, 64px);
}

.section-page > .records { max-width: 880px; }
.section-page .records > li { padding-block: 21px; }
.section-page .record :is(h2, h3) { font-size: 1.32rem; }
.section-page .record:first-child { padding-top: 0; }
.detail-page > .project-figure { max-width: 820px; margin-block: 22px 40px; }

.article-body { max-width: 70ch; }
.article-body > section + section { margin-top: 34px; }
.article-body h2 {
  margin-bottom: 10px;
  font-size: clamp(1.42rem, 3.2vw, 1.9rem);
  letter-spacing: -.036em;
}
.article-body p + p { margin-top: 13px; }
.article-body p { color: var(--secondary); }
.article-body .records { margin-top: 14px; }
.article-body section { scroll-margin-top: 96px; }

@media (prefers-reduced-motion: no-preference) {
  .home-index .section-title-entered:not(:focus-within),
  .route-heading h1 { animation: page-arrival 420ms var(--motion-ease) backwards; }
}

@media (max-width: 710px) {
  .masthead { grid-template-columns: 1fr auto; }
  .site-nav { grid-column: 1 / -1; justify-content: space-between; gap: 0 4px; }
  .site-nav a { font-size: clamp(.76rem, 3.4vw, .89rem); }
}

@media (max-width: 560px) {
  .intro {
    grid-template-areas:
      "name portrait"
      "details details"
      "links links";
    align-items: center;
  }

  .intro h1 { font-size: clamp(1.96rem, 8.6vw, 3.15rem); }
  .profile-links { gap: 6px 10px; font-size: .86rem; }
}

@media (max-width: 360px) {
  .page { width: calc(100% - 20px); }
  .masthead { padding-inline: 10px; }
  .site-nav { column-gap: 2px; }
  .site-nav a { font-size: .75rem; }
  .profile-links { font-size: .82rem; }
  .cv-link { padding-inline: 11px; }
}

@media (min-width: 620px) {
  .page { width: min(1120px, calc(100% - 72px)); }
  .record { grid-template-columns: minmax(0, 1fr) auto; }
  .record-date { text-align: right; padding-top: 2px; }
  .record-details { grid-column: 1 / -1; }
}

@media (min-width: 820px) {
  .masthead {
    position: sticky;
    z-index: 3;
    top: 14px;
  }

  .intro {
    grid-template:
      "name portrait"
      "details portrait"
      "links portrait"
      / minmax(0, 1fr) clamp(144px, 16vw, 188px);
    column-gap: clamp(26px, 5vw, 72px);
  }

  h1 { font-size: clamp(3.45rem, 6.3vw, 6.5rem); }

  .content-section {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr);
    gap: clamp(32px, 5vw, 72px);
    padding-block: 43px 52px;
    scroll-margin-top: 90px;
  }

  h2 { margin-bottom: 0; }
}
