/* =====================================================
   TOKENS & RESET
   ===================================================== */
:root {
  --navy:       #0a192f;
  --navy-mid:   #112240;
  --navy-light: #1d3461;
  --accent:     #3b82f6;
  --accent-dim: #1d4ed8;
  --accent-glow:#93c5fd;
  --white:      #ffffff;
  --off-white:  #f8fafc;
  --slate-100:  #f1f5f9;
  --slate-200:  #e2e8f0;
  --slate-400:  #94a3b8;
  --slate-600:  #475569;
  --slate-800:  #1e293b;
  --text-dark:  #0f172a;
  --text-body:  #334155;
  --text-muted: #64748b;
  --radius-sm:  4px;
  --radius:     8px;
  --radius-lg:  14px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 36px rgba(0,0,0,.14);
  --transition: 200ms ease;
  --max-w:      1100px;
  --section-gap:80px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--text-body);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

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

.section {
  padding: var(--section-gap) 0;
}

.section-light { background: var(--white); }
.section-dark  { background: var(--navy); color: var(--white); }

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -8px;
  width: 40px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: var(--white); }

.btn-ghost {
  background: rgba(255,255,255,.08);
  color: var(--white);
  border-color: rgba(255,255,255,.2);
}
.btn-ghost:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.4); }

/* =====================================================
   NAVIGATION
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 25, 47, .96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .04em;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--slate-200);
  font-size: .8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent-glow); background: rgba(59,130,246,.1); }

/* Language switcher */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,.08);
  color: var(--slate-200);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
  background: rgba(59,130,246,.15);
  border-color: rgba(147,197,253,.5);
  color: var(--accent-glow);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  padding: 4px;
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lang-menu[hidden] { display: none; }
.lang-menu li {
  padding: 8px 12px;
  color: var(--slate-200);
  font-size: .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.lang-menu li:hover,
.lang-menu li:focus-visible { background: rgba(59,130,246,.15); color: var(--accent-glow); outline: none; }
.lang-menu li[aria-selected="true"] { color: var(--accent-glow); font-weight: 700; }

/* Korean: system Hangul fonts, and keep words intact when wrapping */
html:lang(ko) body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
               "Malgun Gothic", "Noto Sans KR", Roboto, sans-serif;
  word-break: keep-all;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  flex: 1;
}

.hero-text { max-width: 640px; }

.hero-pre {
  color: var(--accent);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-text h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero-title {
  color: var(--slate-400);
  font-size: clamp(.9rem, 2vw, 1.05rem);
  margin-bottom: 20px;
  font-weight: 400;
}

.hero-tagline {
  color: var(--slate-200);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Avatar / profile photo */
.hero-badge {
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.hero-photo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border: 3px solid var(--accent);
  box-shadow:
    0 0 0 7px rgba(59,130,246,.15),
    0 0 60px rgba(59,130,246,.25);
}

/* Scroll hint */
.hero-scroll-hint {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
  color: var(--slate-400);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* =====================================================
   ABOUT
   ===================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.about-bio p {
  color: var(--text-body);
  margin-bottom: 16px;
  font-size: 1.02rem;
  text-align: justify;
  hyphens: auto;
}
.about-bio p:last-child { margin-bottom: 0; }

.meta-card {
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.meta-value {
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-dark);
}

.meta-link { color: var(--accent); }
.meta-link:hover { text-decoration: underline; }

.bio-more-btn {
  display: inline;
  margin-left: .3em;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.bio-more-btn:hover { color: var(--accent-dim); }

/* =====================================================
   RESEARCH INTERESTS
   ===================================================== */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.interest-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.interest-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(59,130,246,.15);
}

.interest-icon {
  color: var(--accent);
  margin-bottom: 14px;
}

.interest-card h3 {
  font-size: .975rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.interest-card p {
  font-size: .85rem;
  color: var(--slate-200);
  line-height: 1.5;
}

/* =====================================================
   TIMELINE (EXPERIENCE)
   ===================================================== */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--slate-200);
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -27px; top: 16px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 3px var(--accent);
}

.timeline-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.timeline-card:hover {
  box-shadow: var(--shadow);
  transform: translateX(3px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.card-org {
  font-size: .875rem;
  color: var(--text-muted);
}
.card-org a { color: var(--accent); }
.card-org a:hover { text-decoration: underline; }

.card-period {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  background: rgba(59,130,246,.08);
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.card-bullets {
  margin-bottom: 16px;
}
.card-bullets li {
  font-size: .9rem;
  color: var(--text-body);
  padding: 4px 0 4px 18px;
  position: relative;
}
.card-bullets li::before {
  content: "▸";
  position: absolute; left: 0;
  color: var(--accent);
  font-size: .75rem;
  top: 5px;
}

.card-bullets-more-btn {
  display: inline-block;
  margin: -6px 0 16px;
  padding: 0;
  border: none;
  background: none;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
}
.card-bullets-more-btn:hover { text-decoration: underline; }

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(59,130,246,.1);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,.2);
}

/* =====================================================
   EDUCATION
   ===================================================== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.edu-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  transition: border-color var(--transition), transform var(--transition);
}
.edu-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.edu-degree-icon { color: var(--accent); flex-shrink: 0; }

.edu-period {
  font-size: .75rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
  display: block;
}

.edu-degree {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.edu-institution {
  font-size: .875rem;
  color: var(--slate-200);
  margin-bottom: 10px;
}

.edu-thesis {
  font-size: .83rem;
  color: var(--slate-200);
  line-height: 1.5;
  margin-bottom: 6px;
}

.edu-gpa {
  font-size: .8rem;
  color: var(--accent-glow);
  font-weight: 600;
}

.edu-supervisors {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.edu-sup-row {
  font-size: .78rem;
  line-height: 1.8;
}

.edu-sup-label {
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .68rem;
  margin-right: 5px;
}

.edu-sup-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-glow);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(147,197,253,.4);
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}
.edu-sup-link:hover {
  color: var(--white);
  text-decoration-color: currentColor;
}
.edu-sup-ext { flex-shrink: 0; opacity: .8; }

/* =====================================================
   PUBLICATIONS
   ===================================================== */
.pub-category-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  margin-bottom: 14px;
  margin-top: 36px;
}
.pub-category-title:first-of-type { margin-top: 0; }

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.pub-card {
  display: flex;
  gap: 16px;
  background: var(--off-white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow var(--transition), transform var(--transition);
  align-items: flex-start;
}
.pub-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.pub-badge {
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-top: 2px;
}

.pub-badge--journal  { background: #dbeafe; color: #1d4ed8; }
.pub-badge--conf     { background: #dcfce7; color: #15803d; }
.pub-badge--workshop { background: #fef9c3; color: #92400e; }

.pub-content { flex: 1; }

.pub-citation {
  font-size: .9rem;
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: 8px;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
}
.pub-link:hover { text-decoration: underline; }

/* =====================================================
   PATENT
   ===================================================== */
.patent-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--navy-mid);
  border: 1px solid var(--navy-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.patent-icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.patent-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.5;
}

.patent-meta {
  font-size: .85rem;
  color: var(--slate-200);
  margin-bottom: 6px;
}

/* =====================================================
   PROJECTS
   ===================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.project-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}

.project-period {
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(59,130,246,.08);
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.project-funder {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.project-full-name {
  font-size: .85rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* =====================================================
   SKILLS
   ===================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.skill-group-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-glow);
  margin-bottom: 12px;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 24px;
  background: var(--navy-mid);
  color: var(--slate-200);
  border: 1px solid var(--navy-light);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent-glow);
  background: rgba(59,130,246,.1);
}

/* =====================================================
   AWARDS
   ===================================================== */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.award-card {
  background: var(--off-white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: box-shadow var(--transition), transform var(--transition);
}
.award-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.award-icon { color: var(--accent); flex-shrink: 0; }

.award-content h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.award-org {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.award-content p:not(.award-org) {
  font-size: .85rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* =====================================================
   LEADERSHIP
   ===================================================== */
.leadership-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.leadership-card {
  background: var(--navy-mid);
  border: 1px solid var(--navy-light);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  transition: border-color var(--transition);
}
.leadership-card:hover { border-color: var(--accent); }

.leadership-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.leadership-role-badge {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(59,130,246,.15);
  color: var(--accent-glow);
  border: 1px solid rgba(59,130,246,.3);
}

.leadership-card h3 {
  font-size: .975rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.leadership-card p {
  font-size: .875rem;
  color: var(--slate-200);
}

/* =====================================================
   CONTACT
   ===================================================== */
.contact-container {
  text-align: center;
}

.contact-intro {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  color: var(--text-body);
  font-size: .92rem;
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition),
              color var(--transition), transform var(--transition);
  text-decoration: none;
}
.contact-link:hover {
  border-color: var(--accent);
  background: rgba(59,130,246,.05);
  color: var(--accent);
  transform: translateX(4px);
  text-decoration: none;
}
.contact-link svg { flex-shrink: 0; }

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 32px 0;
  text-align: center;
  color: var(--slate-400);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-inner p { font-size: .875rem; }
.footer-sub { font-size: .78rem; color: var(--slate-600); }

/* Tighten gap between About and Updates */
#about   { padding-bottom: 40px; }
#updates { padding-top:    40px; }

/* =====================================================
   LATEST UPDATES
   ===================================================== */
.updates-scroll-wrapper {
  position: relative;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  background: var(--off-white);
  box-shadow: var(--shadow-sm);
}

.updates-list {
  max-height: 318px; /* shows ~3 cards, rest scrollable */
  overflow-y: auto;
  padding: 8px 16px 8px 44px;
  margin-left: 20px;

  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--slate-200);
}
.updates-list::-webkit-scrollbar       { width: 5px; }
.updates-list::-webkit-scrollbar-track { background: var(--slate-200); border-radius: 4px; }
.updates-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* Gradient fade hinting more content below */
.updates-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 52px;
  background: linear-gradient(to bottom, transparent, var(--off-white));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  pointer-events: none;
  transition: opacity 300ms ease;
}

.update-card {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 18px 8px 18px 0;
  position: relative;
  border-bottom: 1px solid var(--slate-200);
}
.update-card:last-child { border-bottom: none; }

.update-card::before {
  content: "";
  position: absolute;
  left: -30px; top: 24px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--off-white);
  box-shadow: 0 0 0 2px var(--accent);
}

.update-meta {
  flex-shrink: 0;
  min-width: 76px;
  padding-top: 2px;
}

.update-date {
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(59,130,246,.08);
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
}

.update-body p {
  font-size: .92rem;
  color: var(--text-body);
  line-height: 1.65;
}

/* =====================================================
   PUBLICATION ACTION BUTTONS
   ===================================================== */
.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
}
.pub-btn:hover { transform: translateY(-1px); text-decoration: none; }

.pub-btn--paper {
  background: rgba(59,130,246,.1);
  color: var(--accent);
  border-color: rgba(59,130,246,.3);
}
.pub-btn--paper:hover {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.pub-btn--code {
  background: rgba(34,197,94,.08);
  color: #16a34a;
  border-color: rgba(34,197,94,.3);
}
.pub-btn--code:hover {
  background: #16a34a;
  color: var(--white);
  border-color: #16a34a;
}

.pub-btn--poster {
  background: rgba(168,85,247,.08);
  color: #7c3aed;
  border-color: rgba(168,85,247,.3);
}
.pub-btn--poster:hover {
  background: #7c3aed;
  color: var(--white);
  border-color: #7c3aed;
}

.pub-btn--ppt {
  background: rgba(217,119,6,.08);
  color: #d97706;
  border-color: rgba(217,119,6,.3);
}
.pub-btn--ppt:hover {
  background: #d97706;
  color: var(--white);
  border-color: #d97706;
}

.pub-loading {
  color: var(--text-muted);
  font-size: .9rem;
  padding: 12px 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Tablet */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .hero-inner {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }
  .hero-badge {
    align-self: auto;
  }
  .hero-photo {
    width: 170px;
    height: 170px;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --section-gap: 56px; }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: rgba(10,25,47,.98);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 16px 24px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 10px 8px; font-size: .9rem; }

  .site-header { position: sticky; }

  .hero { min-height: auto; padding: 60px 0 48px; }
  .hero-photo {
    width: 130px;
    height: 130px;
  }
  .hero-actions { gap: 10px; }
  .btn { padding: 9px 16px; font-size: .82rem; }

  .timeline { padding-left: 20px; }
  .timeline-marker { left: -19px; }

  .card-header { flex-direction: column; gap: 8px; }
  .card-period { align-self: flex-start; }

  .edu-grid { grid-template-columns: 1fr; }
  .interest-grid { grid-template-columns: 1fr; }
  .awards-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }

  .patent-card { flex-direction: column; }

  .pub-card { flex-direction: column; }
  .pub-badge { align-self: flex-start; }

  .contact-links { max-width: 100%; }
}

/* Desktop — larger base font */
@media (min-width: 641px) {
  html { font-size: 17.5px; }

  /* The bio collapses behind "More" so mobile isn't a wall of text. On desktop
     the About grid is two columns, and a collapsed bio leaves the left column
     ending ~160px above the taller meta card — an L-shaped void that reads as
     stray white space before Latest Updates. There is room here, so show the
     full bio and drop the toggle. (Visible text also beats hidden text for SEO.) */
  .bio-more-text[hidden] {
    display: block;     /* restores the original paragraph break */
    margin-top: 16px;
  }
  .bio-more-btn { display: none; }

  /* Keep nav and small badge elements compact */
  .nav-links a       { font-size: .76rem; }
  .tag               { font-size: .71rem; }
  .pub-badge         { font-size: .67rem; }
  .card-period,
  .project-period,
  .edu-period,
  .meta-label,
  .leadership-role-badge { font-size: .7rem; }
}

/* Back-to-top (mobile only) */
.back-to-top {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), background var(--transition);
}
.back-to-top:hover { background: var(--accent-dim); }
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 640px) {
  .back-to-top { display: flex; }
}

/* PDF pre-open notice */
.pdf-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10,25,47,.65);
  backdrop-filter: blur(2px);
}
.pdf-notice-overlay[hidden] { display: none; }

.pdf-notice-box {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px 24px;
}
.pdf-notice-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.pdf-notice-box p {
  font-size: .9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 22px;
}
.pdf-notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* CV download dialog */
.cv-box { max-width: 460px; }
.cv-box .pdf-notice-actions { margin-top: 4px; }
.cv-lang-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.cv-lang-opt {
  padding: 14px 8px;
  background: var(--off-white);
  color: var(--text-dark);
  border: 2px solid var(--slate-200);
  border-radius: var(--radius);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.cv-lang-opt:hover,
.cv-lang-opt:focus-visible { border-color: var(--accent); background: rgba(59,130,246,.08); color: var(--accent-dim); outline: none; }
.cv-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .9rem;
  color: var(--text-body);
}
.cv-status-row #cvPercent { font-weight: 700; color: var(--text-dark); font-variant-numeric: tabular-nums; }
.cv-progress {
  height: 8px;
  margin-bottom: 22px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
}
.cv-progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 300ms ease;
}
.cv-progress.is-error .cv-progress-bar { background: #dc2626; }
.cv-progress.is-done .cv-progress-bar { background: #16a34a; }

/* Print */
@media print {
  .site-header, .hero-actions, .hero-scroll-hint, .nav-toggle, .back-to-top { display: none; }
  body { color: #000; }
  .section-dark { background: #fff; color: #000; }
  a { color: #000; }
}
