/* =============================================================
   Unhyeon Kang — Personal Site
   Design system & components  (v2.0, 2026-06)
   Single stylesheet shared by index / cv / gallery
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand — SNU identity */
  --navy:        #0f0f70;   /* SNU Blue */
  --navy-deep:   #0a0a4d;
  --beige:       #dcdab2;   /* SNU Beige */
  --accent:      #3a5ce0;   /* interactive blue (light) */
  --accent-soft: rgba(58, 92, 224, .10);
  --accent-line: rgba(58, 92, 224, .35);

  /* Neutrals (light theme) */
  --bg:        #ffffff;
  --bg-2:      #f5f7fb;
  --card:      #ffffff;
  --ink:       #14171f;
  --ink-2:     #3b4452;
  --muted:     #6b7384;
  --line:      #e7e9f0;
  --line-2:    #d8dbe7;

  /* Header is always dark-on-brand for a strong, consistent identity */
  --header-bg:   linear-gradient(120deg, #11116e, #0c0c55);
  --header-ink:  #ffffff;
  --header-line: rgba(255, 255, 255, .12);

  /* Effects */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --sh-sm: 0 1px 2px rgba(16, 24, 48, .06), 0 2px 8px rgba(16, 24, 48, .05);
  --sh:    0 8px 24px rgba(16, 24, 48, .08);
  --sh-lg: 0 24px 60px rgba(16, 24, 48, .14);
  --ring:  0 0 0 3px var(--accent-soft);

  --ease:  cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --container: 1120px;
  --header-h: 66px;

  --grad-brand: linear-gradient(135deg, #3a5ce0, #6a8bf0);
  color-scheme: light;
}

[data-theme="dark"] {
  --accent:      #6ea8ff;
  --accent-soft: rgba(110, 168, 255, .12);
  --accent-line: rgba(110, 168, 255, .38);
  --beige:       #d6d1a4;

  --bg:     #0b0f19;
  --bg-2:   #0f1524;
  --card:   #121a2c;
  --ink:    #e8ebf2;
  --ink-2:  #c3cad9;
  --muted:  #8d97aa;
  --line:   #1f2740;
  --line-2: #2a3553;

  --header-bg:   rgba(9, 12, 22, .72);
  --header-ink:  #eef1f8;
  --header-line: rgba(255, 255, 255, .08);

  --sh-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 10px rgba(0,0,0,.28);
  --sh:    0 10px 30px rgba(0,0,0,.4);
  --sh-lg: 0 28px 64px rgba(0,0,0,.55);
  --grad-brand: linear-gradient(135deg, #5b8cff, #8aa9ff);
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Pretendard Variable", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s var(--ease), color .35s var(--ease);
}
body:not([data-no-bg])::before {
  /* soft ambient backdrop */
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 82% -8%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 420px at -10% 8%, rgba(220,218,178,.16), transparent 55%);
}

img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; color: var(--ink); margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent); }
b, strong { font-weight: 700; color: var(--ink); }
i, em { font-style: italic; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.icon { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -.125em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 1px solid var(--header-line);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  transition: box-shadow .3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.site-header .container {
  display: flex; align-items: center; gap: 16px;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--header-ink); font-weight: 700; }
.brand:hover { color: var(--header-ink); }
/* Brand badge — matches the favicon (images/uk-logo.svg): navy gradient,
   beige hairline frame, white "UK". Reads on both the dark header and the light footer. */
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #1a1a8a, #0a0a4d);
  color: #fff; font-weight: 800; font-size: 13.5px; letter-spacing: -.01em;
  box-shadow: inset 0 0 0 1px rgba(220,218,178,.45), 0 3px 10px rgba(0,0,0,.28);
}
.brand-name { font-size: 15px; letter-spacing: .01em; }
.brand-name .kr { opacity: .62; font-weight: 500; margin-left: 4px; }

.nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list a {
  display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 9px;
  color: rgba(255,255,255,.78); font-size: 14.5px; font-weight: 500;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-list a:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav-list a.is-active { color: #fff; }
.nav-list a.is-active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px;
  background: var(--beige); border-radius: 2px;
}
.nav-list a { position: relative; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06); color: var(--header-ink); cursor: pointer;
  font-size: 15px; transition: background .2s var(--ease), transform .15s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.16); }
.icon-btn:active { transform: scale(.94); }
.lang-toggle {
  height: 38px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06);
  color: var(--header-ink); font-weight: 600; font-size: 13px; letter-spacing: .03em;
  transition: background .2s var(--ease);
}
.lang-toggle:hover { background: rgba(255,255,255,.16); }
.lang-toggle .on { color: var(--beige); }

.header-cv {
  height: 38px; padding: 0 15px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px;
  background: var(--beige); color: #1a1a1a; font-weight: 700; font-size: 13.5px;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}
.header-cv:hover { color: #1a1a1a; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(220,218,178,.4); filter: brightness(1.03); }

.nav-toggle { display: none; }

@media (max-width: 920px) {
  .nav { position: static; margin-left: auto; }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 40px; height: 40px; order: 3;
    border-radius: 10px; border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.06); color: #fff; cursor: pointer; font-size: 18px;
  }
  .nav-list {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--navy-deep);
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 12px 16px 18px; box-shadow: 0 24px 40px rgba(0,0,0,.4);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .nav-list.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-list a { padding: 12px 14px; font-size: 16px; }
  .nav-list a.is-active::after { display: none; }
  .nav-list a.is-active { background: rgba(255,255,255,.12); }
  .lang-toggle { display: none; }
}
@media (max-width: 560px) {
  .brand-name .kr { display: none; }
  .header-cv span.label { display: none; }
  .header-cv { padding: 0 12px; }
}

/* ---------- Section scaffolding ---------- */
.section { padding: clamp(64px, 9vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 38px; max-width: 720px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--beige); border-radius: 2px; }
.section-title { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.section-sub { color: var(--muted); margin-top: 12px; font-size: 16.5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: var(--r-pill); border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 10px 26px rgba(58,92,224,.32); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(58,92,224,.42); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.btn-solid { background: var(--navy); color: #fff; box-shadow: 0 10px 26px rgba(15,15,112,.28); }
.btn-solid:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15,15,112,.38); }
[data-theme="dark"] .btn-solid { background: #1b2546; border-color: var(--line-2); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 8vw, 92px) 0 clamp(60px, 8vw, 96px); position: relative; overflow: clip; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 64px); align-items: center; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 13px 6px 11px; border-radius: var(--r-pill);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  color: var(--accent); font-weight: 600; font-size: 13px; margin-bottom: 22px;
}
.hero-eyebrow .pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.hero h1 { font-size: clamp(38px, 6vw, 62px); font-weight: 800; letter-spacing: -.03em; }
.hero h1 .kr { display: block; font-size: .42em; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-top: 8px; }
.hero-role { margin-top: 18px; font-size: clamp(16px, 2vw, 19px); color: var(--ink-2); }
.hero-role b { color: var(--ink); }
.hero-tags {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px;
}
.hero-tags span {
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 5px 12px; border-radius: var(--r-pill);
}
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }

/* News ticker */
.news {
  margin-top: 30px; display: flex; align-items: flex-start; gap: 13px;
  max-width: 540px; padding: 13px 14px 13px 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-sm); transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.news:hover { border-color: var(--accent-line); box-shadow: var(--sh); }
.news-badge {
  flex: none; align-self: flex-start; margin-top: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--grad-brand); padding: 4px 9px; border-radius: 7px;
}
.news-track { position: relative; flex: 1; min-width: 0; }
.news-item {
  position: absolute; inset: 0; opacity: 0; transform: translateY(8px);
  transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none;
  font-size: 14.5px; line-height: 1.55; color: var(--ink-2); word-break: keep-all;
}
.news-item.active { position: relative; opacity: 1; transform: none; pointer-events: auto; }
.news-item a { font-weight: 600; }
.news-side { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.news-ctrls { display: flex; gap: 2px; }
.news-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 12px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.news-btn:hover { background: var(--accent-soft); color: var(--accent); }
.news-dots { display: flex; gap: 5px; }
.news-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: all .3s var(--ease); cursor: pointer; }
.news-dot.active { background: var(--accent); transform: scale(1.25); }

/* Hero visual */
.hero-visual { position: relative; display: grid; place-items: center; min-height: 380px; }
.blob {
  position: absolute; width: 118%; aspect-ratio: 1; max-width: 460px; z-index: 0;
  background: conic-gradient(from 0deg, #7fb0ff, #a78bff, #6ee7d4, #7fb0ff);
  filter: blur(46px); opacity: .45;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morph 14s var(--ease) infinite;
}
[data-theme="dark"] .blob { opacity: .35; }
@keyframes morph {
  0%,100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: rotate(0deg) scale(1); }
  33% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: rotate(120deg) scale(1.05); }
  66% { border-radius: 70% 30% 50% 50% / 30% 40% 70% 60%; transform: rotate(240deg) scale(.97); }
}

.gallery { position: relative; width: 100%; max-width: 380px; z-index: 1; }
.gallery-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--r-lg); border: 1px solid var(--line-2); box-shadow: var(--sh-lg);
  background: var(--bg-2);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.gallery:hover .gallery-stage { transform: translateY(-6px); box-shadow: var(--sh-lg), 0 0 0 1px var(--accent-line); }
.gallery-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; visibility: hidden; transform: scale(1.03);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.gallery-slide.active { opacity: 1; visibility: visible; transform: none; }
.gallery-slide.portrait-img { object-fit: cover; }
.gallery-slide.cover-img { object-fit: contain; background: #0a0c18; }

.gallery-caption {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  padding: 8px 13px; border-radius: 12px; font-size: 12.5px; font-weight: 600; color: #fff;
  background: rgba(10,12,24,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(8px); transition: all .35s var(--ease); pointer-events: none;
}
.gallery:hover .gallery-caption { opacity: 1; transform: none; }

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(10,12,24,.55); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .3s var(--ease), background .2s var(--ease);
}
.gallery:hover .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: var(--accent); }
.gallery-nav.prev { left: -16px; }
.gallery-nav.next { right: -16px; }
.gallery-dots { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.gallery-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); cursor: pointer; transition: all .3s var(--ease); }
.gallery-dots .dot.active { background: var(--accent); transform: scale(1.2); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; min-height: 0; }
  .gallery { max-width: 300px; }
  .news { max-width: 100%; }
}

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  text-align: center; padding: 22px 14px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-sm);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.stat:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--sh); }
.stat-num { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--accent); letter-spacing: -.02em; line-height: 1; }
.stat-label { margin-top: 8px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.about-lead { font-size: clamp(17px, 2vw, 19px); line-height: 1.75; color: var(--ink-2); }
.about-lead b { color: var(--ink); }
.about-lead p + p { margin-top: 18px; }
.quicklinks { display: grid; gap: 10px; }
.quicklink {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-weight: 600; box-shadow: var(--sh-sm);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.quicklink:hover { color: var(--ink); transform: translateX(5px); border-color: var(--accent-line); box-shadow: var(--sh); }
.quicklink .ql-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; flex: none; }
.quicklink .ql-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.quicklink .ql-meta small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.quicklink .ql-go { margin-left: auto; color: var(--muted); transition: transform .2s var(--ease), color .2s var(--ease); }
.quicklink:hover .ql-go { color: var(--accent); transform: translate(3px,-3px); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Cards (education / experience / awards) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 24px; box-shadow: var(--sh-sm);
  transition: transform .28s var(--ease), border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.card:hover { transform: translateY(-6px); border-color: var(--accent-line); box-shadow: var(--sh); }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.card-title .ic { color: var(--accent); font-size: 18px; }
.card-list { display: grid; gap: 16px; }
.card-list li { font-size: 15px; line-height: 1.5; }
.card-list.compact { gap: 11px; }
.card-list .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.card-list .meta { color: var(--accent); font-size: 13px; font-weight: 600; margin-top: 2px; }
@media (max-width: 980px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .card-grid { grid-template-columns: 1fr; } }

/* ---------- Research highlight ---------- */
.highlight {
  display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: clamp(24px, 4vw, 48px);
  align-items: center; padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 0% 0%, var(--accent-soft), transparent 55%),
    var(--card);
  box-shadow: var(--sh);
}
.highlight-media { position: relative; }
.highlight-media img { width: 100%; height: auto; border-radius: var(--r); box-shadow: var(--sh-lg); border: 1px solid var(--line-2); transition: transform .4s var(--ease); }
.highlight-media:hover img { transform: translateY(-6px) scale(1.01); }
.highlight-media .ribbon {
  position: absolute; top: 14px; left: -8px; z-index: 2;
  background: var(--beige); color: #1a1a1a; font-weight: 800; font-size: 12px; letter-spacing: .03em;
  padding: 6px 14px; border-radius: 6px; box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.highlight-body .tag-journal { display: inline-block; font-style: italic; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.highlight-body h3 { font-size: clamp(20px, 2.6vw, 27px); font-weight: 800; line-height: 1.25; }
.highlight-body p { margin-top: 14px; color: var(--ink-2); font-size: 15.5px; line-height: 1.7; }
.highlight-meta { margin-top: 12px; color: var(--muted); font-size: 14px; }
.highlight-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) { .highlight { grid-template-columns: 1fr; } .highlight-media { max-width: 280px; margin: 0 auto; } }

.interests { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.interests .chip-i {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--sh-sm); transition: transform .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.interests .chip-i:hover { transform: translateY(-3px); border-color: var(--accent-line); color: var(--accent); }
.interests .chip-i .ic { color: var(--accent); }

/* ---------- Works (tabs + publications) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; border-bottom: 1px solid var(--line); padding-bottom: 0; }
.tab-btn {
  position: relative; padding: 12px 20px; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 15.5px; border-radius: 10px 10px 0 0;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.tab-btn:hover { color: var(--ink); background: var(--accent-soft); }
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: var(--grad-brand); border-radius: 3px; }
.tab-count { font-size: 11.5px; font-weight: 700; margin-left: 6px; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); }
@media (max-width: 560px) { .tab-btn { padding: 10px 13px; font-size: 14px; } }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .4s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.pub-list { display: grid; gap: 4px; }
.pub-year {
  margin: 22px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); display: flex; align-items: center; gap: 12px;
}
.pub-year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pub-year:first-child { margin-top: 0; }
.pub-list li:not(.pub-year) {
  padding: 12px 14px; border-radius: 10px; font-size: 15px; line-height: 1.6;
  border-left: 2px solid transparent; color: var(--ink-2);
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.pub-list li:not(.pub-year):hover { background: var(--accent-soft); border-left-color: var(--accent); transform: translateX(5px); }
.pub-list u, .pub-list b u { color: var(--ink); }
.pub-list i { color: var(--ink-2); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 10px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--bg-2);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.chip-cover { background: var(--beige); border-color: var(--beige); color: #2a2a14; }
.tag-flag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--grad-brand); padding: 1px 8px; border-radius: var(--r-pill); margin-right: 8px; vertical-align: middle; }
.pub-list .meta { color: var(--accent); font-weight: 600; font-size: .88em; margin-left: 6px; white-space: nowrap; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: stretch; }
.contact-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; box-shadow: var(--sh-sm); }
.contact-list { display: grid; gap: 4px; }
.contact-list li > a, .contact-list li > .copy-wrap, .contact-list li.static {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px; border-radius: 10px;
  color: var(--ink); transition: background .2s var(--ease); width: 100%;
}
.contact-list li > a:hover, .contact-list li > .copy-wrap:hover { background: var(--accent-soft); color: var(--ink); }
.contact-list .ci { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.contact-list .cm { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.contact-list .cm small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.contact-list .cm .cval { font-weight: 600; overflow-wrap: anywhere; }
.copy-wrap { position: relative; cursor: pointer; }
.copy-tip {
  position: absolute; left: 64px; top: 50%; transform: translateY(-50%) scale(.85);
  background: var(--navy); color: #fff; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .2s var(--ease);
}
.copy-tip.show { opacity: 1; transform: translateY(-50%) scale(1); }
.contact-note { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--accent-soft); border: 1px dashed var(--accent-line); color: var(--ink-2); font-size: 14.5px; }
.map-wrap { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-sm); min-height: 320px; }
.map-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; filter: saturate(.95); }
[data-theme="dark"] .map-wrap iframe { filter: invert(.9) hue-rotate(180deg) saturate(.8) brightness(.95); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } .map-wrap { min-height: 300px; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 44px 0; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer-brand { display: flex; align-items: center; gap: 11px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.footer-copy { color: var(--muted); font-size: 14px; line-height: 1.7; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }
.footer-stats { text-align: right; }
.footer-stats .sl { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; margin-bottom: 8px; letter-spacing: .02em; }
.footer-stats .sl .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse 2.4s infinite; }
.footer-stats img { height: 20px; opacity: .92; }
@media (max-width: 620px) { .footer-stats { text-align: left; } }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--accent); border: 1px solid var(--line-2);
  box-shadow: var(--sh); font-size: 16px;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s var(--ease);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { transform: translateY(-4px); background: var(--accent); color: #fff; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

/* =============================================================
   CV PAGE
   ============================================================= */
.cv-main { max-width: 940px; margin: 0 auto; padding: 36px 24px 80px; }
.cv-sheet {
  background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--navy);
  border-radius: var(--r); box-shadow: var(--sh); padding: clamp(28px, 5vw, 56px);
}
.cv-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; font-weight: 600; color: var(--muted); }
.cv-back:hover { color: var(--accent); }
.cv-header { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; border-bottom: 2px solid var(--beige); padding-bottom: 34px; margin-bottom: 32px; }
.cv-name { font-size: clamp(30px, 5vw, 40px); font-weight: 800; color: var(--navy); }
[data-theme="dark"] .cv-name { color: var(--accent); }
.cv-name .kr { font-size: .5em; color: var(--muted); font-weight: 600; margin-left: 10px; }
.cv-role { font-size: 17px; color: var(--muted); margin: 8px 0 16px; }
.cv-role b { color: var(--ink); }
.cv-contact { display: grid; gap: 6px; font-size: 14.5px; }
.cv-contact li b { display: inline-block; min-width: 64px; color: var(--ink); }
.cv-contact a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.cv-contact a:hover { color: var(--accent); border-color: var(--accent); }
.cv-photo { width: 100%; max-width: 270px; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line-2); box-shadow: var(--sh); justify-self: center; }
.cv-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.cv-section { margin-bottom: 34px; }
.cv-section:last-child { margin-bottom: 0; }
.cv-title { font-size: 16px; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: .07em; border-bottom: 1.5px solid var(--navy); padding-bottom: 7px; margin-bottom: 18px; }
[data-theme="dark"] .cv-title { color: var(--accent); border-color: var(--accent); }
.cv-row { display: grid; grid-template-columns: 150px 1fr; gap: 20px; margin-bottom: 16px; }
.cv-row:last-child { margin-bottom: 0; }
.cv-row .when { font-weight: 700; color: var(--accent); font-size: 14px; }
.cv-row .what b { color: var(--ink); }
.cv-row .what .sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.cv-list { display: grid; gap: 9px; font-size: 15px; }
.cv-list li { padding-left: 18px; position: relative; }
.cv-list li::before { content: ""; position: absolute; left: 0; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--beige); }
.cv-pubs { display: grid; gap: 10px; counter-reset: pub; }
.cv-pubs li { font-size: 14.5px; line-height: 1.55; padding-left: 22px; text-indent: -22px; color: var(--ink-2); }
.cv-pubs u { color: var(--ink); }
.cv-doi { color: var(--accent); font-size: .85em; font-weight: 600; margin-left: 6px; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 12px; }
.cv-tag { background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 11px 16px; border-radius: 10px; font-size: 13.5px; color: var(--ink); font-weight: 600; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.cv-tag:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.cv-tag small { display: block; font-weight: 500; color: var(--muted); margin-top: 3px; font-size: 12px; }
.cv-lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) {
  .cv-header { grid-template-columns: 1fr; text-align: left; }
  .cv-photo { order: -1; max-width: 210px; justify-self: start; }
  .cv-row { grid-template-columns: 1fr; gap: 3px; }
  .cv-lang-grid { grid-template-columns: 1fr; }
}
@media print {
  .site-header, .to-top, .cv-back, .cv-actions, body::before { display: none !important; }
  body { background: #fff; }
  .cv-main { padding: 0; max-width: 100%; }
  .cv-sheet { box-shadow: none; border: 0; border-top: 4px solid var(--navy); padding: 0; }
  .cv-tag:hover { transform: none; box-shadow: none; }
}

/* =============================================================
   GALLERY PAGE
   ============================================================= */
.gal-main { max-width: 1200px; margin: 0 auto; padding: 44px 24px 90px; }
.gal-head { border-bottom: 2px solid var(--beige); padding-bottom: 26px; margin-bottom: 44px; }
.gal-head h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; color: var(--navy); }
[data-theme="dark"] .gal-head h1 { color: var(--accent); }
.gal-head p { color: var(--muted); font-size: 17px; margin-top: 10px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.gal-card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; cursor: pointer; box-shadow: var(--sh-sm);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.gal-card:hover { transform: translateY(-8px); border-color: var(--accent-line); box-shadow: var(--sh-lg); }
.gal-badge { position: absolute; top: 13px; right: 13px; z-index: 5; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-pill); background: rgba(10,12,24,.7); color: #fff; font-size: 12px; font-weight: 700; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gal-thumb { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; background: var(--bg-2); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gal-card:hover .gal-thumb img { transform: scale(1.05); }
.gal-info { padding: 20px 22px; border-top: 1px solid var(--line); }
.gal-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 9px; }
.gal-event { font-weight: 800; color: var(--navy); font-size: 16px; letter-spacing: -.01em; }
[data-theme="dark"] .gal-event { color: var(--ink); }
.gal-date { color: var(--accent); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.gal-caption { color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 300; display: none; padding: 4vh 24px; background: rgba(7,9,18,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modal.active { display: flex; flex-direction: column; align-items: center; justify-content: center; animation: modalIn .25s var(--ease); }
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-stage { position: relative; width: 100%; max-width: 980px; display: flex; flex-direction: column; align-items: center; }
.modal-imgwrap { position: relative; width: 100%; display: flex; justify-content: center; align-items: center; height: 64vh; }
.modal-img { max-width: 100%; max-height: 64vh; object-fit: contain; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.6); transition: transform .3s var(--ease); }
.modal-close { position: absolute; top: -6vh; right: 0; background: none; border: 0; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; padding: 8px; }
.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 18px; transition: background .2s var(--ease); z-index: 5; }
.modal-nav:hover { background: var(--accent); }
.modal-nav.prev { left: -68px; }
.modal-nav.next { right: -68px; }
.modal-info { margin-top: 22px; max-width: 820px; width: 100%; background: var(--card); border-left: 5px solid var(--accent); border-radius: 12px; padding: 20px 26px; animation: fadeUp .3s var(--ease); }
.modal-title { font-size: 19px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.modal-desc { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.modal-counter { display: inline-block; margin-top: 12px; color: var(--accent); font-size: 13px; font-weight: 700; }
@media (max-width: 1080px) { .modal-nav.prev { left: 8px; } .modal-nav.next { right: 8px; } .modal-nav { background: rgba(0,0,0,.4); } }
@media (max-width: 560px) { .gal-grid { grid-template-columns: 1fr; } .modal-close { top: -44px; right: 8px; } }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =============================================================
   v2.1 — Cross-device refinements (mobile · tablet · Mac/Safari)
   ============================================================= */

/* Remove iOS grey tap flash on custom controls (focus-visible still works) */
a, button, [role="button"], [tabindex] { -webkit-tap-highlight-color: transparent; }

/* Safari <16 lacks overflow:clip — fall back to hidden (still contains the blob) */
.hero { overflow: hidden; overflow: clip; }

/* Backdrop blur only where the header is actually translucent (dark mode).
   Light header is an opaque gradient, so the filter was a wasted GPU layer. */
.site-header { -webkit-backdrop-filter: none; backdrop-filter: none; }
[data-theme="dark"] .site-header {
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  transform: translateZ(0);
}

/* Lock background scroll while the mobile menu is open (sticky header survives) */
html.nav-open, html.nav-open body { overflow: hidden; }

/* Korean: keep words/particles intact instead of breaking mid-syllable */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: break-word; }

/* Fluid headings get real shrink headroom on the narrowest phones */
.section-title { font-size: clamp(22px, 6.2vw, 36px); }
.hero h1 { font-size: clamp(32px, 10.5vw, 62px); }
.section-title, .hero h1, .cv-name, .gal-head h1 { text-wrap: balance; }

/* Footer "Total visits" — lift contrast to pass AA on the grey footer */
.footer-stats .sl { color: var(--ink-2); }

/* Fixed UI respects the iOS home-indicator / notch safe areas */
.to-top {
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  right: calc(22px + env(safe-area-inset-right, 0px));
}

/* Robust gallery grid (never demands more width than available) */
.gal-grid { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }

/* ----- Lightbox: stable on landscape phones & tall-toolbar iOS ----- */
.modal { padding: 4svh 24px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.modal-imgwrap { height: 64svh; }
.modal-img { max-height: 64svh; }
.modal-close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 12px);
  z-index: 10;
}
@media (max-height: 520px) {
  .modal.active { justify-content: flex-start; overflow-y: auto; padding: 2vh 16px; }
  .modal-imgwrap { height: auto; max-height: 60svh; }
  .modal-img { max-height: 60svh; }
  .modal-info { margin-top: 12px; padding: 12px 16px; }
}

/* ----- Hero swipe ergonomics ----- */
.gallery { touch-action: pan-y; }
.gallery-stage, .gallery-slide { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* ----- Touch devices: reveal hover-only affordances & enlarge targets ----- */
@media (hover: none), (pointer: coarse) {
  /* Hero gallery arrows + caption are unreachable without hover — show them */
  .gallery-nav { opacity: 1; width: 44px; height: 44px; }
  .gallery-nav.prev { left: 6px; }
  .gallery-nav.next { right: 6px; }
  .gallery-caption { opacity: 1; transform: none; }

  /* 44px minimum tap targets */
  .icon-btn, .nav-toggle { width: 44px; height: 44px; }
  .header-cv { height: 44px; }
  .news-btn { width: 40px; height: 40px; }
  .chip { padding-top: 7px; padding-bottom: 7px; }
  .cv-contact .copy-wrap { display: inline-flex; align-items: center; min-height: 34px; }

  /* Expand indicator-dot hit areas without enlarging the painted dot */
  .gallery-dots, .news-dots { gap: 0; }
  .gallery-dots .dot, .news-dot {
    box-sizing: content-box; padding: 14px 9px; background-clip: content-box;
  }
}

/* ----- Narrow phones (<400px): recover horizontal breathing room ----- */
@media (max-width: 400px) {
  .container { padding: 0 16px; }
  .cv-main { padding-left: 16px; padding-right: 16px; }
  .gal-main { padding-left: 16px; padding-right: 16px; }
  .site-header .container { gap: 10px; }
  .header-actions { gap: 6px; }
  .brand-name { font-size: 14px; }
}

/* ----- News ticker: full-width track + no height jitter on phones ----- */
@media (max-width: 560px) {
  .news { flex-wrap: wrap; }
  .news-badge { order: 0; }
  .news-side { order: 1; flex-direction: row; align-items: center; margin-left: auto; }
  .news-track { order: 2; flex: 1 1 100%; min-height: 3.4em; }
  .tab-btn { padding-top: 12px; padding-bottom: 12px; }
}
