/* =========================================================
   CSS Custom Properties — Light & Dark Themes
   ========================================================= */
:root {
  --bg: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent: #2d6a9f;
  --accent-hover: #1e4d7a;
  --accent-light: #e8f2fc;
  --border: #e2e8f0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --nav-bg: rgba(255, 255, 255, 0.95);
  --tag-bg: #edf2f7;
  --tag-text: #4a5568;
  --toggle-bg: #e2e8f0;
  --toggle-thumb: #ffffff;
  --toggle-icon: "☀️";
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-secondary: #1a1d2e;
  --bg-card: #1e2235;
  --text-primary: #e8eaf6;
  --text-secondary: #b0b8d0;
  --text-muted: #7986a8;
  --accent: #5b9bd5;
  --accent-hover: #7ab4e8;
  --accent-light: #1a2a3f;
  --border: #2d3454;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.5);
  --nav-bg: rgba(15, 17, 23, 0.97);
  --tag-bg: #252a3f;
  --tag-text: #b0b8d0;
  --toggle-bg: #3a4060;
  --toggle-thumb: #5b9bd5;
  --toggle-icon: "🌙";
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* =========================================================
   Navigation
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; color: var(--accent); }

.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin-left: auto;
  flex-wrap: nowrap;
}

.nav-links a {
  display: block;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.nav-linkedin {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.nav-linkedin svg {
  width: 16px;
  height: 16px;
}

/* Theme Toggle */
.theme-toggle {
  margin-left: 0.5rem;
  flex-shrink: 0;
  background: var(--toggle-bg);
  border: none;
  border-radius: 20px;
  width: 48px;
  height: 26px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .theme-toggle::after {
  transform: translateX(22px);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Page Fade-in Animation
   ========================================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-content {
  animation: fadeUp 0.5s ease both;
}

/* =========================================================
   Main Layout
   ========================================================= */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* =========================================================
   Page Header
   ========================================================= */
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--accent);
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.page-header .subtitle {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* =========================================================
   Home / Bio
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
  padding: 2rem 0;
}

.hero-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.avatar-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.hero-body h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.bio-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bio-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.bio-list li::before {
  content: '—';
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.05em;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Einstein quote on home */
.hero-quote {
  margin: 0 0 2.75rem;
  padding: 2.25rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hero-quote::before {
  content: '\201C';
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 6rem;
  line-height: 0;
  position: absolute;
  top: 2.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent);
  opacity: 0.15;
  pointer-events: none;
}
.hero-quote p {
  margin: 0 auto 0.75rem;
  max-width: 680px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.75;
  letter-spacing: 0.01em;
}
.hero-quote cite {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Quick-links section on home */
.section-divider {
  margin: 3rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.quick-link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.quick-link-card:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}
.quick-link-card .ql-icon {
  font-size: 1.2rem;
}

/* =========================================================
   Cards — Experience / Publications / Patents
   ========================================================= */
.cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.card-company {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.2rem;
}

.card-period {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-body {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0;
}
.card-body ul li {
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.6;
}
.card-body ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Publication / Patent numbered cards */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  counter-reset: pub-counter;
}

.pub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.pub-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.pub-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.35;
  flex-shrink: 0;
  min-width: 2rem;
  line-height: 1.3;
}

.pub-content {
  flex: 1;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.pub-title a {
  color: var(--text-primary);
}
.pub-title a:hover {
  color: var(--accent);
}

.pub-meta {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pub-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 500;
}

.pub-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}
.link-pill:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* =========================================================
   Softwares
   ========================================================= */
.software-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 2rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.software-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.software-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.software-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}
.software-desc {
  color: var(--text-secondary);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* =========================================================
   Conference Talks
   ========================================================= */
.talk-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.talk-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.talk-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(3px);
}

.talk-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.talk-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.talk-text a {
  color: var(--text-primary);
  font-weight: 500;
}
.talk-text a:hover {
  color: var(--accent);
}

/* =========================================================
   Placeholder / Empty State
   ========================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem;
  gap: 1.2rem;
}
.empty-state .empty-icon {
  font-size: 4rem;
  opacity: 0.5;
}
.empty-state h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 380px;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  transition: background 0.3s ease;
}
.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: var(--accent);
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.25rem;
    backdrop-filter: blur(12px);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.65rem 0.75rem; font-size: 0.9rem; }

  .theme-toggle { margin-left: 0; }

  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-avatar {
    flex-direction: row;
    align-items: center;
  }
  .avatar-circle { width: 80px; height: 80px; }
  .hero-name { font-size: 1.1rem; }

  .card { padding: 1.25rem 1.25rem; }
  .pub-card { flex-direction: column; gap: 0.75rem; }
  .software-card { flex-direction: column; gap: 1rem; text-align: center; }

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

  .page-header h1 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 1rem; }
  .main { padding: 2rem 1rem 3rem; }
}
