:root {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-elev: rgba(255, 251, 244, 0.86);
  --ink: #1a1714;
  --muted: #6a635a;
  --line: #ddd4c6;
  --accent: #b2471e;
  --accent-2: #1f4d45;
  --soft: #efe4d4;
  --shadow: 0 18px 50px rgba(26, 23, 20, 0.08);
  --header: rgba(243, 239, 230, 0.82);
  --grid: rgba(26, 23, 20, 0.045);
  --logo-bg: #fff;
  --radius: 18px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12110f;
  --bg-elev: rgba(28, 26, 23, 0.86);
  --ink: #efe8dc;
  --muted: #b0a79c;
  --line: #2f2b26;
  --accent: #e07a4a;
  --accent-2: #8ec9bc;
  --soft: #2a221c;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --header: rgba(18, 17, 15, 0.82);
  --grid: rgba(239, 232, 220, 0.04);
  --logo-bg: #1f1c19;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
  font-family: "Figtree", sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
  font-size: 17px;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto auto 0;
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 8px;
  z-index: 20;
  background: var(--bg-elev);
  padding: 8px 12px;
  border-radius: 8px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.wrap {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 6px 10px;
  border-radius: 999px;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
  background: var(--soft);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .icon-sun,
[data-theme="dark"] .icon-moon {
  display: none;
}

main {
  position: relative;
  z-index: 1;
  padding: 40px 0 88px;
}

section {
  padding: 28px 0;
}

section[id] {
  scroll-margin-top: 88px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-family: "Fraunces", "Noto Serif SC", serif;
  font-size: 1.7rem;
  font-weight: 600;
}

.index {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.profile {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 22px 28px;
  align-items: start;
}

.bio {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 1.02rem;
}

.bio a {
  color: var(--accent-2);
  text-decoration: none;
}

.bio a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.avatar {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #f0f0f0;
}

.profile h1 {
  margin: 0 0 4px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.cnname {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: "Noto Serif SC", serif;
  font-size: 1.15rem;
}

.info-list {
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}

.info-list dt {
  color: var(--muted);
  font-size: 0.88rem;
}

.info-list div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-list a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pub-list,
.honor-list,
.exp-list {
  display: grid;
  gap: 14px;
}

.pub {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.pub-media {
  display: flex;
  align-items: center;
  min-height: 100%;
}

.pub-thumb {
  width: 100%;
  aspect-ratio: 2.4 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.pub-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pub h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.12rem;
  line-height: 1.35;
  font-weight: 600;
}

.authors,
.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.note {
  font-style: italic;
}

.authors a {
  color: var(--accent-2);
  text-decoration: none;
}

.authors a:hover,
.honor a:hover,
.note a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.honor a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.me {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.chip,
.copy-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip:hover,
.copy-btn:hover {
  background: var(--soft);
}

.honor,
.exp {
  display: grid;
  gap: 6px;
}

.honor {
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 16px;
}

.year {
  order: 2;
  color: var(--muted);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.honor h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
}

.exp {
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 16px;
}

.logo-box {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--logo-bg);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 8px;
}

.logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.exp-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

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

.exp-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.exp h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.exp-date {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .profile,
  .honor,
  .exp,
  .pub {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 128px;
    height: 128px;
  }

  .exp-top {
    flex-direction: column;
    gap: 4px;
  }

  .pub-thumb {
    aspect-ratio: 2.2 / 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
