/* ============================================
   Academic Site — Jin-Gyu Cheong
   Colors: Cornell Red + MSKCC Blue + SNU + Konkuk
   Mobile-first responsive design
   ============================================ */

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

:root {
  /* Cornell Carnelian Red — Primary */
  --color-primary: #B31B1B;
  --color-primary-dark: #8C1515;
  --color-primary-light: #D44040;

  /* MSKCC Blue — Accent */
  --color-accent: #006CB7;
  --color-accent-light: #1A8AD4;

  /* SNU Dark Blue — Secondary text / headings */
  --color-secondary: #003876;

  /* Konkuk Green — Tags / highlights */
  --color-highlight: #036B3F;
  --color-highlight-light: #e8f5ee;

  /* Neutrals */
  --color-text: #1e293b;
  --color-text-light: #4a5568;
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-border: #e2e8f0;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container-max: 960px;
  --spacing: 1.5rem;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary); }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

.content-narrow { max-width: 720px; }

/* --- Header / Navbar --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar { height: 56px; }

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: #ffffff; opacity: 0.9; }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  transition: color 0.2s;
}
.nav-link:hover { color: #ffffff; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  transition: all 0.3s;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* --- Hero Section --- */
.hero {
  padding: 3.5rem 0 3rem;
  background: linear-gradient(135deg, var(--color-bg) 0%, #fdf6f6 100%);
  border-bottom: 3px solid var(--color-primary);
}

.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.photo-wrapper {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--color-primary);
  background: var(--color-bg-alt);
  box-shadow: 0 4px 16px rgba(179, 27, 27, 0.15);
}

.photo-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}
.photo-placeholder svg { width: 64px; height: 64px; }

.hero-text h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 0.3rem;
}

.hero-title {
  font-size: 1.05rem;
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.hero-affiliation {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 1.2rem;
}

.hero-bio {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

/* Research Interests */
.research-interests h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  background: var(--color-highlight-light);
  border: 1px solid rgba(3, 107, 63, 0.2);
  border-radius: 9999px;
  color: var(--color-highlight);
  font-weight: 600;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 0.6rem;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
  transition: all 0.2s;
}
.social-icon:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.social-icon svg { width: 18px; height: 18px; }

/* --- Education Section (homepage) --- */
.education-section {
  padding: 2.5rem 0 1rem;
}

.education-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.edu-item {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  align-items: baseline;
}

.edu-year {
  font-size: 0.82rem;
  color: var(--color-text-light);
  font-weight: 500;
  min-width: 90px;
  flex-shrink: 0;
}

.edu-detail strong {
  font-size: 0.92rem;
  color: var(--color-text);
}

.edu-detail span {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* --- Research Section (homepage previews) --- */
.research-section {
  padding: 2.5rem 0 2rem;
}

.research-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.research-intro {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

/* Homepage preview list */
.research-preview-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.research-preview {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.research-preview:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 2px 12px rgba(179,27,27,0.08);
}

.preview-thumb {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  position: relative;
  display: block;
}
.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-thumb:not(.no-img) .thumb-placeholder { display: none; }
.preview-thumb.no-img img { display: none; }

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  opacity: 0.4;
}
.thumb-placeholder svg { width: 28px; height: 28px; }

.preview-body {
  flex: 1;
  min-width: 0;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.preview-tag {
  font-weight: 600;
  color: var(--color-accent);
}

.preview-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}
.preview-body h3 a { color: var(--color-text); }
.preview-body h3 a:hover { color: var(--color-primary); }

.preview-summary {
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-accent);
}
.read-more:hover { color: var(--color-primary); }

/* --- Research Grid Page (/research/) --- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.research-grid-item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-bg);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  text-decoration: none;
}
.research-grid-item:hover {
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 16px rgba(179,27,27,0.1);
  transform: translateY(-2px);
}

.grid-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--color-bg-alt);
  position: relative;
}
.grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.grid-thumb:not(.no-img) .thumb-placeholder { display: none; }
.grid-thumb.no-img img { display: none; }
.grid-thumb .thumb-placeholder svg { width: 48px; height: 48px; }

.grid-info {
  padding: 1rem;
}

.grid-info h3 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.research-grid-item:hover .grid-info h3 { color: var(--color-primary); }

.grid-tag {
  display: block;
  font-size: 0.75rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.grid-date {
  font-size: 0.72rem;
  color: var(--color-text-light);
}

/* --- Research Single Page --- */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--color-accent); }
.breadcrumb span { margin: 0 0.3rem; }

.research-single-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.research-single-tag {
  font-weight: 600;
  color: var(--color-accent);
}

.research-hero-img {
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.research-hero-img img {
  width: 100%;
  display: block;
}

.research-body {
  font-size: 0.95rem;
  line-height: 1.8;
}
.research-body p { margin-bottom: 1rem; }

.research-nav {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* Figure with caption (for research images) */
.research-figure {
  margin: 1.25rem 0;
  text-align: center;
}

.research-figure img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.research-figure figcaption {
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 0.5rem;
  font-style: italic;
  line-height: 1.5;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .research-preview { flex-direction: column; gap: 0.75rem; }
  .preview-thumb { width: 100%; height: 180px; }
  .research-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
}

@media (max-width: 480px) {
  .research-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .grid-info { padding: 0.75rem; }
  .grid-info h3 { font-size: 0.82rem; }
}

/* --- Page Sections --- */
.page-section {
  padding: 3rem 0;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--color-primary);
}

.page-content h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-secondary);
}

.page-content p { margin-bottom: 1rem; }

.page-content ul, .page-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

/* --- Publication Cards --- */
.post-card {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}
.post-card:last-child { border-bottom: none; }

.post-card h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.2rem;
}
.post-card h2 a { color: var(--color-text); }
.post-card h2 a:hover { color: var(--color-accent); }

.post-meta {
  font-size: 0.83rem;
  color: var(--color-text-light);
  margin-bottom: 0.15rem;
}

.pub-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.pub-badge.first { background: rgba(179,27,27,0.1); color: var(--color-primary); }
.pub-badge.cofirst { background: rgba(0,108,183,0.1); color: var(--color-accent); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 5px;
  background: var(--color-primary);
  color: #fff;
  transition: all 0.2s;
  margin-right: 0.4rem;
  margin-top: 0.4rem;
}
.btn:hover { background: var(--color-primary-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}
.btn-outline:hover { background: var(--color-accent); color: #fff; }

.pub-links { margin-top: 1rem; }

/* --- Contact --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-bg-alt);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.contact-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  margin-top: 2px;
}

.contact-item h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.contact-item p, .contact-item a { font-size: 0.92rem; }

/* --- Footer --- */
.site-footer {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-light);
  border-top: 2px solid var(--color-primary);
  background: var(--color-bg-alt);
  margin-top: 3rem;
}
.site-footer a { color: var(--color-text-light); }
.site-footer a:hover { color: var(--color-primary); }

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    flex-direction: column;
    padding: 0.75rem var(--spacing);
    gap: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

  .nav-menu.active { display: flex; }
  .nav-menu li { padding: 0.5rem 0; }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .hero-photo { justify-self: center; }
  .photo-wrapper { width: 160px; height: 160px; }
  .hero-text h1 { font-size: 1.6rem; }
  .interest-tags { justify-content: center; }
  .social-links { justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; }
  .edu-item { flex-direction: column; gap: 0.2rem; }
}

@media (max-width: 480px) {
  :root { --spacing: 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .photo-wrapper { width: 130px; height: 130px; }
  .hero-text h1 { font-size: 1.4rem; }
  .page-title { font-size: 1.3rem; }
}
