/* =====================================================================
   Sangyeon Cho — personal site
   Design tokens. Neutral paper base + a single ink-blue accent, so the
   palette survives a change of affiliation.  Serif for titles
   (Newsreader), sans for everything else (Inter).
   ===================================================================== */

:root {
  --bg:          #fdfdfb;
  --surface:     #ffffff;
  --band:        #f5f4f0;
  --text:        #1b1a17;
  --text-2:      #55524b;
  --muted:       #8c887f;
  --border:      #e5e2db;
  --hover:       #f2f1ec;

  --accent:      #1f4257;   /* ink blue — headings, rules            */
  --accent-mid:  #2f6d8f;   /* links                                 */
  --accent-soft: #eaf1f5;

  /* Tag palette — 8 curated slots. A tag picks a slot number in
     js/render.js; nothing here needs to change to add one. */
  --tag-1-bg: #eaf1f5; --tag-1-fg: #245670;   /* blue   */
  --tag-2-bg: #f4eee2; --tag-2-fg: #6b5320;   /* amber  */
  --tag-3-bg: #e9f0e9; --tag-3-fg: #2c5637;   /* green  */
  --tag-4-bg: #f3ecef; --tag-4-fg: #6a3a52;   /* plum   */
  --tag-5-bg: #e4f0ef; --tag-5-fg: #1f5551;   /* teal   */
  --tag-6-bg: #f4ebe6; --tag-6-fg: #6d4530;   /* clay   */
  --tag-7-bg: #ecebf6; --tag-7-fg: #3c3d75;   /* indigo */
  --tag-8-bg: #eceef1; --tag-8-fg: #3d4855;   /* slate  */

  --serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --max-w: 820px;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #15171a;
    --surface:     #1b1e22;
    --band:        #1f2328;
    --text:        #e9e7e2;
    --text-2:      #aeaaa2;
    --muted:       #7d7a73;
    --border:      #2c3037;
    --hover:       #22262c;

    --accent:      #9fc4d8;
    --accent-mid:  #86b6d0;
    --accent-soft: #1e2831;

    --tag-1-bg: #1d2b34; --tag-1-fg: #a3c9dd;
    --tag-2-bg: #302819; --tag-2-fg: #d5be93;
    --tag-3-bg: #1d2a20; --tag-3-fg: #a6c9b0;
    --tag-4-bg: #2d2028; --tag-4-fg: #d6adc4;
    --tag-5-bg: #1b2b2a; --tag-5-fg: #9ccbc6;
    --tag-6-bg: #2c221c; --tag-6-fg: #d3ae95;
    --tag-7-bg: #22223a; --tag-7-fg: #b0b0e0;
    --tag-8-bg: #23272c; --tag-8-fg: #b3bcc6;
  }
}

:root[data-theme="dark"] {
  --bg:          #15171a;
  --surface:     #1b1e22;
  --band:        #1f2328;
  --text:        #e9e7e2;
  --text-2:      #aeaaa2;
  --muted:       #7d7a73;
  --border:      #2c3037;
  --hover:       #22262c;

  --accent:      #9fc4d8;
  --accent-mid:  #86b6d0;
  --accent-soft: #1e2831;

  --tag-1-bg: #1d2b34; --tag-1-fg: #a3c9dd;
  --tag-2-bg: #302819; --tag-2-fg: #d5be93;
  --tag-3-bg: #1d2a20; --tag-3-fg: #a6c9b0;
  --tag-4-bg: #2d2028; --tag-4-fg: #d6adc4;
  --tag-5-bg: #1b2b2a; --tag-5-fg: #9ccbc6;
  --tag-6-bg: #2c221c; --tag-6-fg: #d3ae95;
  --tag-7-bg: #22223a; --tag-7-fg: #b0b0e0;
  --tag-8-bg: #23272c; --tag-8-fg: #b3bcc6;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 600; color: var(--text); }

/* ---------- top nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 8px;
  min-height: 48px;
}
/* the links scroll sideways on narrow screens; the toggle never does */
.navlinks {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent 100%);
          mask-image: linear-gradient(to right, #000 92%, transparent 100%);
}
.navlinks::-webkit-scrollbar { display: none; }
.topbar a.navlink {
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius);
  white-space: nowrap;
}
.topbar a.navlink:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.topbar .spacer { flex: 1; }
#theme-toggle {
  background: none; border: 1px solid var(--border); color: var(--text-2);
  border-radius: var(--radius); cursor: pointer;
  width: 30px; height: 30px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
#theme-toggle:hover { background: var(--hover); color: var(--text); }



/* ---------- page ---------- */
.page { max-width: var(--max-w); margin: 0 auto; padding: 0 24px 96px; }

section { padding-top: 44px; }
.section-title {
  font-family: var(--serif);
  font-size: 25px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--accent);
  padding-bottom: 8px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* ---------- hero ---------- */
.hero { display: flex; gap: 36px; align-items: flex-start; padding-top: 52px; }
.hero-body { flex: 1; min-width: 0; }
.hero-name {
  font-family: var(--serif);
  font-size: 40px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.15; color: var(--text);
}
.hero-role { color: var(--text-2); font-size: 15px; margin-top: 6px; }
.hero-role .sep { color: var(--muted); margin: 0 7px; }
.hero-bio { margin-top: 18px; color: var(--text-2); }
.hero-bio p + p { margin-top: 10px; }
.hero-photo img {
  width: 168px; height: 168px; object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}
.contacts { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.contacts a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-2); background: var(--surface);
}
.contacts a:hover { background: var(--accent-soft); color: var(--accent-mid); border-color: var(--accent-mid); text-decoration: none; }

/* ---------- news ---------- */
.news-scroll {
  max-height: 268px; overflow-y: auto; padding-right: 8px;
  /* fade the last row instead of slicing it in half */
  -webkit-mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 88%, transparent 100%);
}
.news-scroll:hover { -webkit-mask-image: none; mask-image: none; }
.news-row { display: flex; gap: 16px; padding: 7px 0; align-items: baseline; }
.news-row + .news-row { border-top: 1px dashed var(--border); }
.news-date {
  flex: none; width: 68px;
  font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--muted); font-weight: 500;
}
.news-body { flex: 1; color: var(--text-2); font-size: 14.5px; }

/* ---------- publications ---------- */
.pub-note { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.pub-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.pub-filters button {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
}
.pub-filters button:hover { background: var(--hover); }
.pub-filters button.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.year-marker {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  color: var(--muted); margin: 24px 0 8px;
}
.pub-row { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.pub-id {
  flex: none; width: 34px; padding-top: 2px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.pub-main { flex: 1; min-width: 0; }
.pub-title {
  font-family: var(--serif); font-size: 17.5px; font-weight: 600;
  line-height: 1.35; color: var(--text);
}
.pub-authors { font-size: 13.5px; color: var(--text-2); margin-top: 4px; }
.pub-venue { font-size: 13.5px; color: var(--muted); font-style: italic; margin-top: 2px; }
.pub-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.tag-c1 { background: var(--tag-1-bg); color: var(--tag-1-fg); }
.tag-c2 { background: var(--tag-2-bg); color: var(--tag-2-fg); }
.tag-c3 { background: var(--tag-3-bg); color: var(--tag-3-fg); }
.tag-c4 { background: var(--tag-4-bg); color: var(--tag-4-fg); }
.tag-c5 { background: var(--tag-5-bg); color: var(--tag-5-fg); }
.tag-c6 { background: var(--tag-6-bg); color: var(--tag-6-fg); }
.tag-c7 { background: var(--tag-7-bg); color: var(--tag-7-fg); }
.tag-c8 { background: var(--tag-8-bg); color: var(--tag-8-fg); }

.paper-link {
  font-size: 12.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2);
}
.paper-link:hover { border-color: var(--accent-mid); color: var(--accent-mid); text-decoration: none; }

/* ---------- entries (experience / projects / education) ---------- */
.entry { padding: 14px 0; border-top: 1px solid var(--border); }
.entry-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.entry-title { font-family: var(--serif); font-size: 17.5px; font-weight: 600; color: var(--text); }
.entry-period {
  flex: none; font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.entry-sub { font-size: 14px; color: var(--text-2); margin-top: 1px; }
.entry ul { margin: 8px 0 0 18px; }
.entry li { font-size: 14.5px; color: var(--text-2); padding: 1px 0; }
.entry-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  background: var(--band); border-radius: var(--radius); padding: 2px 8px;
}

/* ---------- list rows (awards / honors) ---------- */
.list-row { display: flex; gap: 16px; padding: 8px 0; align-items: baseline; }
.list-row + .list-row { border-top: 1px dashed var(--border); }
.list-date {
  flex: none; width: 68px; font-size: 13px; color: var(--muted);
  font-weight: 500; font-variant-numeric: tabular-nums;
}
.list-body { flex: 1; font-size: 14.5px; }
.list-body .detail { color: var(--muted); }
.subhead {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  margin: 18px 0 2px;
}
.subhead:first-child { margin-top: 0; }

/* ---------- technologies ---------- */
.tech-row { display: flex; gap: 14px; padding: 9px 0; align-items: baseline; flex-wrap: wrap; }
.tech-row + .tech-row { border-top: 1px solid var(--border); }
.tech-label {
  flex: none; width: 110px; font-size: 13px; font-weight: 600; color: var(--text-2);
}
.tech-items { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- footer ---------- */
.footer {
  margin-top: 56px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------- loading / error ---------- */
.data-error {
  background: var(--band); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  font-size: 13.5px; color: var(--text-2);
}
.data-error code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 12.5px;
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .page { padding: 0 18px 72px; }
  .topbar-inner { padding: 0 18px; }
  .hero { flex-direction: column-reverse; gap: 22px; padding-top: 34px; }
  .hero-name { font-size: 33px; }
  .hero-photo img { width: 128px; height: 128px; }
  .pub-id { display: none; }
  .pub-row { gap: 0; }
  .entry-head { flex-direction: column; gap: 2px; }
  .tech-label { width: 100%; }
  .news-date, .list-date { width: 60px; }
}

@media print {
  .topbar, .pub-filters, #theme-toggle { display: none; }
  .news-scroll { max-height: none; overflow: visible; }
  body { font-size: 11pt; }
}
