/* Brian Text — Source Serif 4(Adobe, SIL OFL 1.1)를 개조한 전용 폰트. fonts/OFL.txt 참고 */
@font-face {
  font-family: "Brian Text";
  src: url("fonts/BrianText-Regular.woff2?v=3") format("woff2");
  font-style: normal; font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Brian Text";
  src: url("fonts/BrianText-Italic.woff2?v=3") format("woff2");
  font-style: italic; font-weight: 400; font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --ink: #17120e;
  --muted: #57534d;
  --line: #b3b0a8;
  --font: "Brian Text", Georgia, "Times New Roman", serif;
  --gutter: clamp(1.25rem, 6vw, 3rem);
  --measure: 46rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(1.1875rem, 1rem + 0.7vw, 1.3125rem);
  line-height: 1.4;
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, p { margin: 0; font-size: inherit; font-weight: inherit; }
a { color: inherit; }

.top, main, .bottom {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header and footer: small type */
.top, .bottom { font-size: .9375rem; letter-spacing: 0; }
.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 1.5rem;
  padding-top: clamp(1.5rem, 5vh, 3rem);
}
.top nav { display: flex; gap: 1.5rem; }
.top a, .bottom a {
  display: inline-block; padding-block: .625rem;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--line); text-underline-offset: .25em;
  transition: text-decoration-color .2s ease;
}
.top a:hover, .bottom a:hover { text-decoration-color: var(--ink); }
/* 명함식 이름: 스몰캡 + 넓은 자간 */
.top .name {
  text-decoration: none;
  font-size: 1.0625rem;
  font-variant-caps: small-caps;
  font-feature-settings: "smcp";
  letter-spacing: .09em;
  white-space: nowrap;
}

main { padding-block: clamp(4rem, 16vh, 9rem) clamp(4rem, 12vh, 7rem); }
main > h1, main > p, .intro > h1, .intro > p { margin-bottom: 1.4em; text-wrap: pretty; }
main > p:last-child { margin-bottom: 0; }

/* Essay: 제목. 폰트에 굵은 체가 없어서 크기와 여백으로 구분합니다. */
.essay > h1 {
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 1.875rem);
  line-height: 1.2; letter-spacing: -.012em;
  margin-bottom: 1.1em; text-wrap: balance;
}

/* Essay: 소제목과 요약 목록 */
main > h2 {
  margin: 2.6em 0 1em; font-size: .8em; font-weight: 400;
  font-variant-caps: all-small-caps; font-feature-settings: "c2sc", "smcp";
  letter-spacing: .09em; color: var(--muted);
}
main > ol { margin: -0.6em 0 1.4em; padding-left: 1.4em; }
main > ol li + li { margin-top: .2em; }

/* Home: 사진과 글을 나란히. 좁은 화면에서는 사진이 위로 올라갑니다. */
.home {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 0 clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
.home .portrait { width: 100%; margin: .35em 0 0; }
@media (max-width: 720px) {
  .home { display: block; }
  .home .portrait { width: 9rem; margin: 0 0 2rem; }
}

/* 수상·학력 한 줄 기록: 본문보다 작고 흐리게 */
.record { margin-top: 3em; font-size: .75em; line-height: 1.5; letter-spacing: 0; color: var(--muted); }
.record + .note, .record ~ .note { font-size: .7em; margin-top: 0; }

/* Portrait: images/portrait.jpg는 원본에서 테두리를 잘라낸 4:5 크롭본 */
.portrait { margin: 0 0 2.5rem; width: 6.5rem; }
.portrait img { display: block; width: 100%; height: auto; }

/* Clickable terms */
.term {
  font: inherit; letter-spacing: inherit; color: inherit;
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: inherit;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--line); text-underline-offset: .2em;
  transition: text-decoration-color .2s ease;
}
/* 외부 사이트로 나가는 본문 링크: 밑줄 단어와 같은 모양 */
.ext {
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: var(--line); text-underline-offset: .2em;
  transition: text-decoration-color .2s ease;
}
.ext:hover { text-decoration-color: var(--ink); }
.term:hover, .term[aria-expanded="true"] { text-decoration-color: var(--ink); }
.term[aria-expanded="true"] { text-decoration-thickness: 2px; }

.term:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px;
}

/* Explanations */
.note {
  margin: -0.6em 0 1.6em;
  padding-left: 1rem;
  border-left: 1px solid var(--ink);
  color: var(--muted);
  font-size: .75em;
  line-height: 1.5;
  letter-spacing: 0;
}
.note + .note { margin-top: -0.8em; }
.note p + a { display: inline-block; margin-top: .4em; }
.note p + p, .note a + p { margin-top: .7em; }
.note a {
  color: var(--ink); padding-block: .25rem;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.note a::after { content: " \2197"; }
.note[hidden] { display: none; }
.js .note { animation: note-in .25s ease-out; }
@keyframes note-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.cta {
  font-weight: 400;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em;
}

.bottom {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1.5rem;
  padding-bottom: 3rem; color: var(--muted);
}
.bottom span { margin-right: auto; padding-block: .625rem; }

@media (prefers-reduced-motion: reduce) {
  .js .note { animation: none; }
  * { transition-duration: 0s !important; }
}
