/* =========================================================
   SAIL Lab Homepage - Main Stylesheet
   Design inspired by iodalab.lovable.app
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* --- CSS Variables --- */
:root {
  --teal-start: #003087;
  --teal-end: #0056b3;
  --teal: #003087;
  --cyan: #0056b3;
  --teal-light: #dbeafe;
  --navy: #001a4d;
  --dark: #1e293b;
  --mid: #334155;
  --muted: #64748b;
  --text-body: #334155;
  --text-muted: #64748b;
  --border: rgba(203, 213, 225, 0.6);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --light-bg: #f0f4ff;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
  --nav-height: 70px;
  font-size: 16px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  background: var(--white);
  color: var(--mid);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  width: auto;
  max-width: max-content;
  min-height: 28px;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}

.meta-badge i,
.meta-badge span {
  display: inline-block;
  line-height: 1;
}

.meta-badge.paper {
  background: #eff6ff;
  color: #1d4ed8;
}

.meta-badge.award {
  background: #fef3c7;
  color: #92400e;
}

.meta-badge.grant {
  background: #f0fdf4;
  color: #166534;
}

.meta-badge.activity {
  background: #fdf2f8;
  color: #9d174d;
}

.meta-badge.lab {
  background: #f5f3ff;
  color: #6d28d9;
}

.meta-badge.patent {
  background: #ffedd5;
  color: #9a3412;
}

/* --- Layout --- */
.container {
  width: 90%;
  max-width: 1140px;
  margin: 0 auto;
}

.section-pad {
  padding: 100px 0;
}

/* =========================================================
   NAVIGATION
   ========================================================= */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

#navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1220px;
  margin: 0 auto;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 36px;
  width: 36px;
  object-fit: contain;
}

.nav-logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--teal-start), var(--teal-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-logo-sub {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
  display: none;
}

/* Nav links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  align-items: center;
  margin-left: auto;
}

.nav-links li a {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--mid);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-links li a:hover {
  color: var(--teal-start);
  background: rgba(13, 148, 136, 0.08);
}

.nav-links li a.active {
  color: var(--teal-start);
  background: rgba(13, 148, 136, 0.1);
  font-weight: 600;
}

/* Mobile hamburger */
.nav-toggle,
.nav-mobile-btn {
  appearance: none;
  border: none;
  background: transparent;
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.nav-toggle span,
.nav-mobile-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--mid);
  border-radius: 2px;
  transition: all 0.3s;
}

/* =========================================================
   HERO SECTION
   ========================================================= */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg, #eef2ff 0%, #e8effe 40%, #f0f4ff 70%, #f8fafc 100%);
  padding-top: var(--nav-height);
}

/* Particle canvas */
#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

/* Radial glow */
#hero::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(0, 48, 135, 0.10) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Background photo overlay — very subtle */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('assets/common/lab_main.png');
  background-size: cover;
  background-position: center 60%;
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 20px;
  max-width: 860px;
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.80);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 32px;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a9eff, var(--teal-start));
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.85);
  }
}

/* Hero Title */
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1D2475, #4A9EFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-letter {
  font-weight: 900;
}

/* Hero Description */
.hero-desc {
  margin: 24px auto;
  max-width: 680px;
}

.hero-desc-ko {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 8px;
  word-break: keep-all;
}

.hero-desc-en {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.7;
}

/* Research area mini cards on hero */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 48px;
  max-width: 720px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.hero-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dark);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: left;
}

.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.hero-card-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.hero-card-label {
  line-height: 1.3;
}

.hero-card-sub {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
  display: block;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  animation: float-scroll 2.5s ease-in-out infinite;
  z-index: 1;
}

.hero-scroll svg {
  width: 20px;
  height: 20px;
  stroke: var(--teal-start);
}

@keyframes float-scroll {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

/* =========================================================
   SECTION HEADERS
   ========================================================= */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal-start);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Divider line under section label */
.section-header::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-start), var(--teal-end));
  border-radius: 3px;
  margin: 20px auto 0;
}

/* =========================================================
   RESEARCH AREAS SECTION
   ========================================================= */
#research-areas {
  background: var(--light-bg);
  padding: 100px 0;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.research-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: block;
}

.research-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13, 148, 136, 0.3);
}

.research-icon-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  overflow: hidden;
}

.research-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.research-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  text-transform: capitalize;
}

.research-card-tag {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--teal-start);
  background: rgba(13, 148, 136, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.research-more-btn {
  display: block;
  width: max-content;
  margin: 48px auto 0;
  background: linear-gradient(135deg, var(--teal-start), var(--teal-end));
  color: white;
  padding: 13px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.3);
}

.research-more-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.4);
}

/* =========================================================
   NEWS / ANNOUNCEMENT SECTION
   ========================================================= */
#news {
  background: var(--white);
  padding: 100px 0;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.news-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--teal-start), var(--teal-end));
  color: white;
}

.news-icon {
  font-size: 1.1rem;
  color: var(--teal-start);
}

.news-card-body {
  padding: 20px 22px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--mid);
  flex-grow: 1;
}

.news-card-body b {
  color: var(--navy);
  font-weight: 600;
}

.news-card-body .highlight-red {
  color: #dc2626;
  font-weight: 600;
}

.news-card-body .highlight-blue {
  color: #1d4ed8;
  font-weight: 600;
}

.news-card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-start);
  text-align: right;
}

.news-more-btn {
  display: block;
  width: max-content;
  margin: 48px auto 0;
  border: 2px solid var(--teal-start);
  color: var(--teal-start);
  padding: 11px 34px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.news-more-btn:hover {
  background: var(--teal-start);
  color: white;
}

/* =========================================================
   ABOUT SECTION (brief on homepage)
   ========================================================= */
#about-brief {
  background: linear-gradient(135deg, #001a4d 0%, #003087 50%, #0056b3 100%);
  padding: 100px 0;
  color: white;
}

.about-brief-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-brief-text {}

.about-brief-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5eead4;
  margin-bottom: 16px;
}

.about-brief-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.about-brief-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
  margin-bottom: 14px;
}

.about-brief-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}

.about-brief-cta:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.about-brief-image {
  position: relative;
}

.about-brief-image img {
  border-radius: var(--radius);
  width: 100%;
  object-fit: cover;
  max-height: 340px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.about-brief-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #7eb8ff;
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.55);
  padding: 60px 0 30px;
  font-size: 0.88rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #7eb8ff, #4a9eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-desc {
  line-height: 1.8;
  max-width: 300px;
}

.footer-col h4 {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s;
  font-size: 0.85rem;
}

.footer-col ul li a:hover {
  color: #7eb8ff;
}

.footer-copyright {
  margin-top: 30px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

.footer-copyright a {
  color: #5eead4;
  text-decoration: underline;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .hero-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-brief-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-brief-image {
    order: -1;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .container,
  #navbar .container {
    width: min(94%, 100%);
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    padding: 12px 18px;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--nav-height) - 24px);
    overflow-y: auto;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    display: block;
    width: 100%;
    padding: 14px 10px;
    border-radius: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
    font-weight: 700;
    text-align: left;
    letter-spacing: -0.2px;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-toggle,
  .nav-mobile-btn {
    display: flex;
  }
}

@media (max-width: 640px) {
  #hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 16px);
    padding-bottom: 88px;
  }

  #hero::after {
    opacity: 0.18;
    background-position: center top;
  }

  .hero-content {
    width: 100%;
    max-width: none;
    padding: 24px 10px 20px;
  }

  .hero-badge {
    max-width: 100%;
    white-space: normal;
    justify-content: center;
    text-align: center;
    line-height: 1.45;
    padding: 8px 14px;
    margin-bottom: 22px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 9vw, 2.4rem);
    line-height: 1.08;
    letter-spacing: -1px;
    word-break: keep-all;
  }

  .hero-desc-ko {
    font-size: 0.92rem;
    word-break: keep-all;
  }

  .hero-desc-en {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .hero-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 30px;
  }

  .hero-card-icon {
    display: none;
  }

  .hero-card {
    padding: 14px 12px;
  }

  .hero-scroll {
    display: none;
  }

  .about-brief-stats {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .research-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-grid {
    grid-template-columns: 1fr;
  }
}
