@import url("fonts.css?v=e686ffd3");

/* ============================================================
   Seungjun Chu — personal site
   One typeface (Pretendard), one palette, light only.
   The accent is Korea University crimson. (The playground heatmap
   is separate — that uses the inferno colormap, as anomaly maps do.)
   ============================================================ */

:root {
  --bg:        #eef1f4;
  --bg-sunk:   #e5e9ee;
  --surface:   #ffffff;
  --ink:       #10151c;
  --ink-2:     #46525f;
  --ink-3:     #7c8894;
  --rule:      #d2d9e0;
  --rule-soft: #e2e7ec;
  /* Korea University crimson, the value KU uses on korea.ac.kr.
     --accent-ink is the darker variant for text: 7.0:1 on the page ground,
     where the base crimson only reaches 5.0:1. */
  --accent:    #cd0f2d;
  --accent-ink:#a30b24;
  --accent-bg: rgba(205, 15, 45, 0.09);
  --cool:      #33489b;

  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
          system-ui, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --page: 84rem;
  --measure: 46rem;

  --step: clamp(3rem, 6vw, 5rem);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.0625rem);
  line-height: 1.62;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- primitives ---------- */

.wrap {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* With a single family the utility voice comes from case, tracking and
   weight rather than from a second typeface. */
.eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.145em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.1rem;
  font-variant-numeric: tabular-nums;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.14;
  color: var(--ink);
  text-wrap: balance;
}

h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem); margin: 0 0 1rem; }
h3 { font-size: clamp(1.08rem, 1.02rem + 0.3vw, 1.22rem); margin: 0 0 0.45rem; font-weight: 600; letter-spacing: -0.015em; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

.lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--ink-2);
  max-width: var(--measure);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 0.6rem 1rem; z-index: 100; font-size: 0.85rem; font-weight: 500;
}
.skip:focus { left: 0; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.masthead__inner {
  max-width: var(--page); margin-inline: auto;
  padding: 0.75rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}
.masthead__name {
  font-weight: 700; font-size: 0.94rem; letter-spacing: -0.02em;
  text-decoration: none; white-space: nowrap; flex: none;
}
.nav {
  display: flex; gap: 1.5rem; margin-left: auto;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: 0.875rem; font-weight: 500; letter-spacing: -0.005em;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  padding-block: 0.3rem; border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

@media (max-width: 40rem) {
  .masthead__inner { flex-wrap: wrap; gap: 0.35rem 1rem; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 1.25rem; }
}

/* ---------- page plate ---------- */

.plate {
  padding-block: clamp(2.75rem, 6vw, 4.5rem) clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 1px solid var(--rule);
}
.plate h1 {
  font-size: clamp(2rem, 1.45rem + 2.6vw, 3.2rem);
  margin: 0 0 1rem; max-width: 22ch;
}

.section { padding-block: var(--step); }
.section + .section { border-top: 1px solid var(--rule-soft); }

/* ---------- home hero ---------- */

.hero {
  padding-block: clamp(2.25rem, 5vw, 4rem) clamp(2.25rem, 4vw, 3.25rem);
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.75rem);
  align-items: center;
}
.hero__photo {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule);
  filter: saturate(0.94);
}
.hero__name {
  font-size: clamp(2.6rem, 1.2rem + 6vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.042em;
  font-weight: 700;
  margin: 0 0 1.1rem;
}
.hero__thesis {
  font-size: clamp(1.2rem, 1.02rem + 0.85vw, 1.6rem);
  line-height: 1.34;
  letter-spacing: -0.022em;
  font-weight: 600;
  margin: 0 0 1.1rem;
  max-width: 26ch;
  text-wrap: balance;
}
.hero__thesis em { font-style: normal; color: var(--accent-ink); }
.hero__body { color: var(--ink-2); max-width: 48ch; }

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero__photo { max-width: 15rem; }
}

/* ---------- columns ---------- */

/* Fixed track counts, not auto-fit: auto-fit happily creates a fourth empty
   track and leaves three items huddled on the left of a wide page. */
.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.25rem clamp(1.75rem, 4vw, 4rem);
}
.three-up {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.25rem clamp(1.75rem, 4vw, 3.5rem);
}
@media (max-width: 62rem) { .three-up { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 44rem) {
  .two-up, .three-up { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- listings ---------- */

.stack { margin: 0; padding: 0; list-style: none; }
.stack > li { padding-block: 0.9rem; border-top: 1px solid var(--rule-soft); }
.stack > li:first-child { border-top: none; padding-top: 0; }

.entry__where { font-weight: 600; font-size: 0.97rem; letter-spacing: -0.014em; display: block; }
.entry__what { color: var(--ink-2); font-size: 0.94rem; display: block; }
.entry__when {
  font-size: 0.78rem; color: var(--ink-3); display: block;
  margin-top: 0.2rem; font-variant-numeric: tabular-nums;
}

/* ---------- research themes ---------- */

.theme { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: clamp(1.25rem, 4vw, 3.5rem); align-items: start; }
.theme + .theme { margin-top: var(--step); padding-top: var(--step); border-top: 1px solid var(--rule); }
.theme__head { position: sticky; top: 5rem; }
.theme__head h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem); }
.theme__body > p { color: var(--ink-2); max-width: var(--measure); }
.theme__body > p:first-child { color: var(--ink); }

@media (max-width: 56rem) {
  .theme { grid-template-columns: 1fr; }
  .theme__head { position: static; }
}

.aside-note {
  margin-top: 2rem; padding: 1.1rem 1.3rem;
  background: var(--surface); border: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 0 3px 3px 0;
  font-size: 0.95rem; max-width: var(--measure);
}
.aside-note .eyebrow { margin-bottom: 0.5rem; }

/* Papers run two-up on wide screens so the theme fills its column. */
.papers {
  margin: 1.6rem 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 3vw, 3rem);
  border-top: 1px solid var(--rule);
}
@media (max-width: 52rem) { .papers { grid-template-columns: 1fr; } }
.papers > li {
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.92rem; line-height: 1.5; color: var(--ink-2);
}
.papers > li strong { color: var(--ink); font-weight: 600; }

/* ---------- publications ---------- */

.pubgroup + .pubgroup { margin-top: var(--step); }
.pubgroup > h2 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); margin-bottom: 0.3rem; }
.pubgroup__note { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 1.4rem; }

.pubs { margin: 0; padding: 0; list-style: none; counter-reset: pub; }
.pubs > li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) minmax(0, 13rem);
  gap: 0.4rem 1.25rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--rule-soft);
  align-items: start;
}
.pubs > li:first-child { border-top: 1px solid var(--rule); }
.pubs > li::before {
  counter-increment: pub;
  content: counter(pub, decimal-leading-zero);
  font-size: 0.78rem; color: var(--ink-3); padding-top: 0.28rem;
  font-variant-numeric: tabular-nums;
}
.pub__title { font-size: 1rem; font-weight: 600; letter-spacing: -0.018em; line-height: 1.34; margin: 0 0 0.3rem; }
.pub__authors { font-size: 0.9rem; color: var(--ink-2); margin: 0 0 0.25rem; }
.pub__authors .self { color: var(--ink); font-weight: 600; }
.pub__venue { font-size: 0.89rem; color: var(--ink-2); margin: 0; }
.pub__meta { display: flex; flex-wrap: wrap; align-content: start; gap: 0.4rem; padding-top: 0.15rem; }

.badge {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.22rem 0.5rem; border: 1px solid var(--rule); border-radius: 2px;
  color: var(--ink-3); white-space: nowrap;
}
.badge--review { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-ink); background: var(--accent-bg); }
.badge--published { border-color: color-mix(in srgb, var(--cool) 40%, transparent); color: var(--cool); }
.badge--award { color: var(--ink-2); }

@media (max-width: 62rem) {
  .pubs > li { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .pub__meta { grid-column: 2; }
}
@media (max-width: 34rem) {
  .pubs > li { grid-template-columns: 1fr; }
  .pubs > li::before { padding-top: 0; }
  .pub__meta { grid-column: 1; }
}

/* ---------- cv ---------- */

.cv-section { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0.75rem clamp(1.25rem, 4vw, 3rem); }
.cv-section + .cv-section { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.cv-section > h2 { font-size: 1.05rem; margin: 0; padding-top: 0.15rem; }

@media (max-width: 52rem) {
  .cv-section { grid-template-columns: 1fr; }
  .cv-section > h2 { margin-bottom: 0.3rem; }
}

.awards { margin: 0; padding: 0; list-style: none; columns: 3; column-gap: 2.25rem; }
.awards li { break-inside: avoid; padding-block: 0.38rem; font-size: 0.9rem; line-height: 1.45; color: var(--ink-2); }
.awards li strong { color: var(--ink); font-weight: 600; }
@media (max-width: 70rem) { .awards { columns: 2; } }
@media (max-width: 44rem) { .awards { columns: 1; } }

details.more { margin-top: 1.2rem; }
details.more > summary {
  cursor: pointer; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--accent-ink); list-style: none;
  display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; font-size: 1rem; line-height: 1; }
details.more[open] > summary::before { content: "\2212"; }
details.more > summary:hover { color: var(--accent); }
details.more > div { padding-top: 1rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: inherit; font-size: 0.84rem; font-weight: 600; letter-spacing: -0.005em;
  padding: 0.55rem 1rem; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--bg); text-decoration: none; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:disabled:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost:disabled:hover { background: transparent; border-color: var(--rule); color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }

.contact-list { margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.contact-list li { padding-block: 0.28rem; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.contact-list a:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule); margin-top: var(--step);
  padding-block: 2rem 2.75rem; font-size: 0.8rem; color: var(--ink-3);
}
.foot__inner { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; justify-content: space-between; }
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }

/* ============================================================
   playground
   ============================================================ */

.pg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: start;
  padding-block: clamp(1.75rem, 3.5vw, 2.75rem) var(--step);
}

.pg__stage { position: relative; }
.pg__frame { border: 1px solid var(--rule); background: var(--surface); overflow: hidden; }
.pg__frame canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1;
  cursor: crosshair; touch-action: manipulation;
}
.pg__frame.is-done canvas { cursor: default; }
.pg__frame.is-busy canvas { cursor: progress; }

/* A status strip under the frame, never over it — a defect can sit anywhere,
   including hard against an edge. */
.pg__status {
  padding: 0.55rem 0.85rem; background: var(--bg-sunk);
  border-top: 1px solid var(--rule);
  font-size: 0.8rem; color: var(--ink-2);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
}
.pg__timer { color: var(--accent-ink); font-variant-numeric: tabular-nums; flex: none; font-weight: 600; }

.pg__legend { margin: 0.7rem 0 0; font-size: 0.8rem; line-height: 1.6; color: var(--ink-3); max-width: 62ch; }
.legend-actual { color: var(--cool); font-weight: 600; }
.legend-detector { color: var(--accent-ink); font-weight: 600; }

.pg__credit {
  margin: 1.1rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--rule-soft);
  font-size: 0.76rem; line-height: 1.6; color: var(--ink-3); max-width: 68ch;
}

.pg__panel { display: flex; flex-direction: column; gap: 1.6rem; }
.pg__field > .eyebrow { margin-bottom: 0.5rem; }

.segmented { display: flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.segmented button {
  flex: 1; font-family: inherit; font-size: 0.8rem; font-weight: 500;
  padding: 0.5rem 0.3rem; border: none; border-left: 1px solid var(--rule);
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented button:first-child { border-left: none; }
.segmented button:hover { background: var(--bg-sunk); color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 600; }

.board { border: 1px solid var(--rule); background: var(--surface); }
.board__row {
  display: grid; grid-template-columns: minmax(0, 1fr) 4rem 4.6rem; gap: 0.5rem;
  padding: 0.55rem 0.8rem; border-top: 1px solid var(--rule-soft);
  font-size: 0.84rem; font-variant-numeric: tabular-nums; align-items: baseline;
}
.board__row:first-child { border-top: none; }
.board__row--head { color: var(--ink-3); font-size: 0.66rem; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 600; }
.board__row span:not(:first-child) { text-align: right; }
.board__row--you .board__label { color: var(--accent-ink); }
.board__label { color: var(--ink); font-weight: 600; }
.board__val { color: var(--ink-2); }

.verdict {
  font-size: 0.86rem; line-height: 1.6;
  padding: 0.85rem 0.95rem; border: 1px solid var(--rule);
  border-left: 2px solid var(--ink-3); background: var(--surface);
  color: var(--ink-2); min-height: 7rem;
}
.verdict strong { color: var(--ink); font-weight: 600; }
.verdict.is-hit { border-left-color: var(--cool); }
.verdict.is-miss { border-left-color: var(--accent); }

.pg__explain { max-width: var(--measure); }
.pg__explain h2 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
.pg__explain p { color: var(--ink-2); }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps > li {
  counter-increment: s;
  display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: 0 0.85rem;
  padding-block: 0.65rem; border-top: 1px solid var(--rule-soft);
  color: var(--ink-2); font-size: 0.94rem;
}
.steps > li:first-child { border-top: 1px solid var(--rule); }
.steps > li::before {
  content: counter(s); font-size: 0.78rem; font-weight: 600;
  color: var(--accent-ink); padding-top: 0.3rem; font-variant-numeric: tabular-nums;
}

@media (max-width: 62rem) { .pg { grid-template-columns: 1fr; } }

/* ---------- erdős, last thing on the home page ---------- */

.erdos__n {
  margin: 0;
  font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

/* ---------- utilities ---------- */

.muted { color: var(--ink-2); }
.small { font-size: 0.96rem; }
.narrow { max-width: var(--measure); }
.gap-sm { margin-top: 0.3rem; }
.gap-top { margin-top: 1.4rem; }
.gap-lg { margin-top: 2.4rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
