/* =============================================
   CKtrace Portfolio — Main Stylesheet
   ============================================= */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #080b14;
  --bg-alt: #0d1120;
  --surface: #111827;
  --surface-2: #1a2235;
  --border: rgba(255, 255, 255, 0.07);

  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --cyan: #06b6d4;
  --cyan-light: #22d3ee;
  --pink: #ec4899;

  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Image Sizes (adjust here to resize) ── */
  --img-profile-w: 280px;       /* About 프로필 사진 너비 */
  --img-profile-h: 340px;       /* About 프로필 사진 높이 */
  --img-research-h: 210px;      /* Research 카드 썸네일 높이 */
  --img-competition-h: 160px;   /* Competition 카드 배너 높이 */
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-dark); border-radius: 3px; }

/* ---------- Selection ---------- */
::selection { background: rgba(99, 102, 241, 0.3); color: #fff; }

/* =============================================
   Layout
   ============================================= */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   Navigation
   ============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--transition), backdrop-filter var(--transition), border-bottom var(--transition);
}

.nav.scrolled {
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: color var(--transition);
}
.nav__logo span { color: var(--primary-light); }
.nav__logo:hover { color: var(--primary-light); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-subtle);
  transition: color var(--transition);
  position: relative;
}

.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-light);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
  border-radius: 1px;
}

.nav__links a:hover,
.nav__links a.active { color: var(--text); }
.nav__links a:hover::after,
.nav__links a.active::after { transform: scaleX(1); transform-origin: left; }

.nav__cta {
  padding: 8px 20px !important;
  background: var(--primary) !important;
  border-radius: var(--radius-sm) !important;
  color: #fff !important;
  font-weight: 600 !important;
  transition: background var(--transition), transform var(--transition) !important;
}
.nav__cta:hover { background: var(--primary-light) !important; transform: translateY(-1px); }
.nav__cta::after { display: none !important; }

/* Hamburger */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: var(--transition);
}

/* Mobile menu */
.nav__mobile {
  display: none;
  background: rgba(13, 17, 32, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 16px 24px 24px;
}
.nav__mobile ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.nav__mobile a {
  display: block;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-subtle);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.nav__mobile a:hover {
  background: var(--surface);
  color: var(--text);
}

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.btn--primary:hover {
  background: var(--primary-light);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5);
}

.btn--outline {
  background: transparent;
  color: var(--primary-light);
  border: 1.5px solid var(--primary);
}
.btn--outline:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-light);
}

/* =============================================
   Hero
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Background */
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 8s ease-in-out infinite;
}

.hero__orb--1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: -120px;
  right: -60px;
  animation-delay: 0s;
}

.hero__orb--2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: 60px;
  left: -80px;
  animation-delay: -3s;
}

.hero__orb--3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  top: 40%;
  left: 45%;
  animation-delay: -6s;
  opacity: 0.18;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

/* Content */
.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
  max-width: 780px;
}

.hero__greeting {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero__name {
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.4s forwards;
}

.hero__role {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-subtle);
  margin-bottom: 24px;
  font-weight: 400;
  height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.6s forwards;
}

.hero__role-prefix { color: var(--text-muted); }

.hero__role-text {
  font-family: var(--font-mono);
  font-size: 1em;
  color: var(--primary-light);
  font-weight: 500;
}

.hero__cursor {
  color: var(--primary-light);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero__desc {
  color: var(--text-subtle);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.8s forwards;
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.6s ease 1s forwards;
}

.hero__socials {
  display: flex;
  gap: 16px;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.6s ease 1.2s forwards;
}

.hero__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-subtle);
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}

.hero__socials a svg { width: 18px; height: 18px; }

.hero__socials a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

/* 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(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.6s ease 1.5s forwards;
}

.hero__scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--primary), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.5); opacity: 0.4; }
}

/* =============================================
   Sections
   ============================================= */
.section {
  padding: 100px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__header {
  margin-bottom: 60px;
}

.section__tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary-light);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  font-weight: 500;
}

.section__title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 2px;
}

/* =============================================
   Reveal Animations
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   About
   ============================================= */
.about__grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}

.about__photo {
  display: flex;
  justify-content: center;
}

.about__photo-wrap {
  width: var(--img-profile-w);
  height: var(--img-profile-h);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(99, 102, 241, 0.1);
  position: relative;
}

.about__photo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(99,102,241,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.about__photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.about__text p {
  color: var(--text-subtle);
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.85;
}

.about__text strong {
  color: var(--primary-light);
  font-weight: 600;
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.tag {
  padding: 6px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.tag:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* Stats */
.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
}

.stat-card:hover::before { opacity: 1; }

.stat-card__num {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  font-family: var(--font-mono);
}

.stat-card__num::after { content: '+'; }

.stat-card__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* =============================================
   Skills
   ============================================= */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.skill-category:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

.skill-category__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.skill-category__icon {
  font-size: 1.1rem;
}

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

.skill-tag {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  transition: transform var(--transition);
  cursor: default;
}
.skill-tag:hover { transform: translateY(-2px); }

.skill-tag--primary {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.skill-tag--secondary {
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.skill-tag--tertiary {
  background: rgba(236, 72, 153, 0.1);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.2);
}
.skill-tag--quaternary {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

/* =============================================
   Projects
   ============================================= */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-card__icon {
  font-size: 2rem;
  line-height: 1;
}

.project-card__links {
  display: flex;
  gap: 8px;
}

.project-card__links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.project-card__links a svg { width: 16px; height: 16px; }

.project-card__links a:hover {
  background: var(--primary);
  color: #fff;
}

.project-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-card__desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.75;
  flex: 1;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.project-card__tags span {
  padding: 3px 10px;
  background: var(--surface-2);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-weight: 500;
}

/* CTA card */
.project-card--cta {
  background: transparent;
  border: 1.5px dashed rgba(99, 102, 241, 0.25);
  justify-content: center;
  align-items: center;
  cursor: default;
}

.project-card--cta:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
}

.project-card--cta::before { display: none; }

.project-card__cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.project-card__cta-inner span {
  font-size: 2rem;
  margin-bottom: 4px;
}

.project-card__cta-inner p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.project-card__cta-inner .btn {
  margin-top: 12px;
}

/* =============================================
   Timeline
   ============================================= */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--cyan), transparent);
  border-radius: 1px;
}

.timeline__item {
  position: relative;
  padding-bottom: 48px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -29px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.timeline__item:hover .timeline__dot {
  border-color: var(--cyan);
  box-shadow: 0 0 0 6px rgba(6, 182, 212, 0.15);
}

.timeline__content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: border-color var(--transition), transform var(--transition);
}

.timeline__item:hover .timeline__content {
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateX(4px);
}

.timeline__period {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary-light);
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 8px;
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
}

.timeline__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.timeline__company {
  font-size: 0.85rem;
  color: var(--cyan);
  font-weight: 500;
  margin-bottom: 12px;
}

.timeline__desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.75;
}

/* =============================================
   Contact
   ============================================= */
.contact__wrapper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px 60px;
  position: relative;
  overflow: hidden;
}

.contact__wrapper::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12), transparent 70%);
  pointer-events: none;
}

.contact__lead {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-subtle);
  margin-bottom: 28px;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-subtle);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.contact__link svg {
  width: 18px;
  height: 18px;
  color: var(--primary-light);
  flex-shrink: 0;
}

.contact__link:hover { color: var(--primary-light); }

.contact__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.contact__btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}

.contact__btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.55);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.contact__btn:hover svg { transform: translateX(4px); }

/* =============================================
   Footer
   ============================================= */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer__copy {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.5;
  font-family: var(--font-mono);
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }

  .about__grid { grid-template-columns: 1fr; gap: 36px; }
  .about__photo-wrap { width: 200px; height: 240px; }
  .about__photo { justify-content: flex-start; }
  .skills__grid { grid-template-columns: 1fr; }
  .projects__grid { grid-template-columns: 1fr; }

  .contact__wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 36px 32px;
  }
}

@media (max-width: 600px) {
  .section { padding: 72px 0; }

  .hero__name { font-size: clamp(2.8rem, 14vw, 4rem); }

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

  .nav__inner { padding: 16px 20px; }

  .contact__wrapper { padding: 28px 24px; border-radius: var(--radius-lg); }
  .contact__btn { padding: 14px 24px; font-size: 0.875rem; }
}

/* =============================================
   Profile Photo (Hero)
   ============================================= */
.hero__profile-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 20px;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero__profile {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--bg);
}

/* =============================================
   Timeline List
   ============================================= */
.timeline__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.timeline__list li {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.75;
  padding-left: 16px;
  position: relative;
}

.timeline__list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary-light);
  font-size: 0.75rem;
  top: 2px;
}

.timeline__list strong {
  color: var(--text-subtle);
  font-weight: 600;
}

.timeline__dot--active {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2), 0 0 12px rgba(6, 182, 212, 0.4) !important;
  background: var(--cyan) !important;
}

/* =============================================
   Badges
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 6px;
}

.badge--award {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge--kci {
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* =============================================
   Research Cards
   ============================================= */
.research__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.research-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 36px rgba(99, 102, 241, 0.12);
}

.research-card:hover::before { transform: scaleX(1); }

.research-card--ongoing {
  border-color: rgba(6, 182, 212, 0.25);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(6, 182, 212, 0.04) 100%);
}

.research-card--ongoing::before {
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  transform: scaleX(1);
}

.research-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.research-card__status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
}

.status--ongoing {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.status--done {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.research-card__area {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.research-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.research-card__desc {
  color: var(--text-muted);
  font-size: 0.835rem;
  line-height: 1.75;
  flex: 1;
}

.research-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.research-card__conf {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* =============================================
   Competition Cards
   ============================================= */
.comp__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.comp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.comp-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 36px rgba(99, 102, 241, 0.12);
}

.comp-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comp-card__rank {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
}

.comp-card__rank--2nd {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.comp-card__rank--special {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.comp-card__rank--award {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.comp-card__type {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 4px;
  font-weight: 500;
}

.comp-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.comp-card__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -4px;
}

.comp-card__host {
  font-size: 0.8rem;
  color: var(--primary-light);
  font-weight: 600;
  font-family: var(--font-mono);
}

.comp-card__desc {
  font-size: 0.835rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.comp-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  gap: 8px;
  flex-wrap: wrap;
}

.comp-card__period {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.comp-card__contrib {
  font-size: 0.72rem;
  color: var(--cyan-light);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* =============================================
   Responsive — new sections
   ============================================= */
@media (max-width: 900px) {
  .research__grid { grid-template-columns: 1fr; }
  .comp__grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero__profile-wrap { width: 90px; height: 90px; }
}

/* =============================================
   Card Thumbnails (Research & Competition)
   ============================================= */
.card__thumb {
  margin: -24px -24px 0;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--surface-2);
  line-height: 0;
}

.card__thumb img {
  width: 100%;
  height: var(--img-research-h);
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.4s ease;
  border-radius: var(--radius) var(--radius) 0 0;
}

.card__thumb--banner img {
  height: var(--img-competition-h);
  object-position: center;
}

.research-card:hover .card__thumb img,
.comp-card:hover .card__thumb img {
  transform: scale(1.03);
}

/* =============================================
   Modal / Popup
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  z-index: 2001;
  width: min(700px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(99, 102, 241, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-dark) transparent;
}
.modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%);
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.modal__close:hover { background: var(--primary-dark); border-color: var(--primary); }

.modal__img {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  line-height: 0;
}
.modal__img img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.modal__body { padding: 28px 32px 36px; }

.modal__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.modal__title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal__desc {
  font-size: 0.91rem;
  color: var(--text-subtle);
  line-height: 1.9;
  margin-bottom: 24px;
}

.modal__info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.modal__info-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.modal__info-label {
  font-size: 0.67rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.modal__info-value {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 600;
}

.modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.modal__tag {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: var(--primary-light);
}

/* Clickable cards */
.research-card[data-modal],
.comp-card[data-modal] {
  cursor: pointer;
}
.research-card[data-modal]:active,
.comp-card[data-modal]:active {
  transform: scale(0.985);
}

@media (max-width: 600px) {
  .modal__body { padding: 20px 20px 28px; }
  .modal__img img { height: 180px; }
  .modal__info-grid { grid-template-columns: 1fr; }
  .modal__title { font-size: 1.05rem; }
}
