@font-face {
  font-family: "Coke Hand";
  src: url("assets/fonts/gaegu-good-boy.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #292b27;
  --muted: #686c65;
  --accent: #385b4d;
  --rule: #dedfd7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dce5da; }
a {
  color: var(--accent);
  text-decoration-color: #a9b9ac;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--ink); text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 1px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: 12px;
  left: 16px;
  padding: 8px 12px;
  background: var(--paper);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
.page {
  width: min(100% - 48px, 720px);
  margin-inline: auto;
  padding-block: 88px 32px;
}
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 36px;
  align-items: start;
  padding-bottom: 38px;
}
.intro-copy { min-width: 0; }
.portrait { position: relative; margin: 3px 0 0; }
.portrait-toggle {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.portrait-toggle:disabled { cursor: default; }
.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  object-position: 44% 50%;
  border-radius: 5px;
}
.portrait-human { filter: grayscale(1) sepia(0.12) contrast(0.94) brightness(1.08); }
.portrait .portrait-coke {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  object-position: 50% 70%;
  transform: scale(var(--coke-scale, 1));
  transition: opacity 180ms ease;
}
.portrait.is-coke .portrait-coke { opacity: 1; }
.portrait-caption {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  width: 100%;
  color: var(--muted);
  font: 11px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace;
  text-align: center;
  opacity: 0;
  transition: opacity 180ms ease;
}
.portrait.is-coke .portrait-caption { opacity: 1; }
.reward-effects {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.reward-particle { position: absolute; pointer-events: none; }
.reward-paw {
  left: 50%;
  top: 38%;
  width: 19px;
  height: 19px;
  animation: reward-paw-float 950ms ease-out both;
}
.reward-paw svg { display: block; width: 100%; height: 100%; }
.reward-point {
  left: 72%;
  top: 23%;
  padding: 5px 10px;
  border: 1px solid #fff4d7;
  border-radius: 12px;
  background: #ffd16e;
  color: #714319;
  box-shadow: 0 3px 10px #87581526;
  font: 700 20px/1.25 ui-monospace, "SFMono-Regular", Consolas, monospace;
  animation: reward-point-float 1150ms ease-out both;
}
.reward-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 6px;
  animation: reward-card-arrive 280ms ease-out both;
}
.reward-card-points { color: var(--muted); font-size: 11px; }
.reward-card-points b { color: #bb8428; font-size: 15px; font-weight: 600; }
.reward-card-divider { color: #b2b3a9; }
.reward-card-praise { color: #3d6a54; font: 700 23px/1.1 "Coke Hand", "Chalkboard SE", "Comic Sans MS", cursive; }
.reward-card-total {
  flex-basis: 100%;
  margin-top: 3px;
  color: #8a887d;
  font-size: 10px;
  line-height: 1.5;
}
@keyframes reward-paw-float {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(-10deg); }
  15% { opacity: 0.95; }
  65% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--angle)); }
}
@keyframes reward-point-float {
  0% { opacity: 0; transform: translate(0, 8px) scale(0.65) rotate(-9deg); }
  18% { opacity: 1; transform: translate(1px, -7px) scale(1.08) rotate(4deg); }
  65% { opacity: 1; }
  100% { opacity: 0; transform: translate(12px, -54px) scale(0.95) rotate(-3deg); }
}
@keyframes reward-card-arrive {
  from { opacity: 0; transform: translateY(5px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.rlhf-trigger {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted var(--muted);
  background: none;
  color: inherit;
  line-height: inherit;
}
.rlhf-trigger:hover { color: var(--accent); }
.rlhf-trigger:disabled { border-color: transparent; cursor: default; }
.name-line { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 42px);
  font-weight: 400;
  letter-spacing: -1.4px;
  line-height: 1.2;
}
.chinese-name { color: var(--muted); font-size: 17px; letter-spacing: 2px; }
.bio { max-width: 590px; margin-top: 24px; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px 25px; margin-top: 23px; font-size: 14px; }
.contact-links a { text-decoration: none; }
.contact-links a:hover { text-decoration: underline; }
.email-toggle, .copy-email {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  line-height: inherit;
}
.email-toggle, .email-address, .copy-email {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}
.email-toggle { border-bottom: 1px dashed #a9b9ac; }
.email-toggle:hover, .copy-email:hover { color: var(--ink); }
.email-details { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.email-address { overflow-wrap: anywhere; }
.email-fallback { color: var(--muted); font-size: 12px; }
.copy-email { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.section {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  column-gap: 26px;
  border-top: 1px solid var(--rule);
  padding-block: 27px 29px;
}
h2 { margin: 2px 0 0; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; line-height: 1.8; }
.section-body { min-width: 0; }
.lecture { margin-top: 19px; }
.lecture-note { color: var(--muted); font-size: 13px; }
@media (max-width: 600px) {
  .page { padding-top: 44px; }
  .intro { grid-template-columns: 1fr; gap: 25px; padding-bottom: 30px; }
  .portrait { grid-row: 1; width: 112px; margin: 0; }
  .portrait img { aspect-ratio: 1; }
  .portrait-caption {
    top: 50%;
    left: calc(100% + 16px);
    width: min(180px, calc(100vw - 176px));
    transform: translateY(-50%);
    text-align: left;
  }
  .reward-card { justify-content: flex-start; }
  .name-line { gap: 10px 16px; }
  .section { grid-template-columns: 1fr; gap: 13px; padding-block: 23px 25px; }
  h2 { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .portrait .portrait-coke, .portrait-caption { transition: none; }
  .reward-effects { display: none; }
  .reward-card { animation: none; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .page { width: 100%; padding: 0; }
  .skip-link { display: none; }
  .section { break-inside: avoid; }
  .portrait .portrait-coke, .portrait-caption { display: none; }
  .reward-effects { display: none; }
  .rlhf-trigger { border: 0; }
}
