/* ==========================================================================
   Antigravity Pure Static Design System — Editorial & Modern Portfolio
   ========================================================================== */

:root {
  /* Typography */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme (Default) */
[data-theme="dark"] {
  --bg-primary: #090c13;
  --bg-secondary: #111622;
  --bg-card: #151c2c;
  --bg-card-hover: #1c263c;
  --bg-glass: rgba(17, 22, 34, 0.85);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(251, 191, 36, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.15);
  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(251, 191, 36, 0.12);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #faf9f6;
  --bg-secondary: #f3f0e8;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f6f0;
  --bg-glass: rgba(250, 249, 246, 0.9);
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(180, 83, 9, 0.4);
  
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  
  --accent-gold: #b45309;
  --accent-gold-glow: rgba(180, 83, 9, 0.1);
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px rgba(180, 83, 9, 0.08);
}

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

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

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

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Layout Container */
.container {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: max(1.5rem, calc((100vw - 1080px) / 2 - 4rem));
  padding: 0 1.5rem 0 2.5rem;
}

@media (max-width: 640px) {
  .container {
    margin-right: auto;
    padding: 0 1.25rem;
  }
}

/* Essay Page */
.essay-container {
  max-width: 760px;
}

.essay-back-link {
  display: inline-flex;
  margin-bottom: 2rem;
}

.essay-meta {
  margin-bottom: 1rem;
}

.essay-title {
  margin-bottom: 1rem;
}

.essay-tags {
  margin-bottom: 2.5rem;
}

.essay-body {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.essay-body p {
  margin-bottom: 1.25rem;
}

/* Typography Helpers */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.25rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 2.5rem;
}

/* Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-1px);
}

.icon-btn-square {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-gold);
  color: #090c13;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px var(--accent-gold-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3.5rem;
  align-items: center;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 30px;
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.hero-name {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 1.4rem;
  color: var(--accent-gold);
  font-family: var(--font-sans);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-bio {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: 12px;
}

.stat-item { text-align: center; }

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.stat-label {
  font-size: 0.775rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hero-portrait-card { position: relative; }

.hero-portrait-img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.cf-badge {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

/* Sections */
.page-section {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pill-btn:hover, .pill-btn.active {
  background: var(--accent-gold-glow);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.search-input-wrapper {
  position: relative;
  min-width: 240px;
}

.search-input-wrapper input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  outline: none;
}

.search-input-wrapper input:focus {
  border-color: var(--accent-gold);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.pub-card, .project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  transition: all var(--transition-normal);
}

.pub-card:hover, .project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.pub-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.pub-venue {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

.pub-year { font-size: 0.8rem; color: var(--text-muted); }

.pub-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.pub-authors { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.pub-abstract { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.25rem; }

.pub-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.tag-list { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.mini-tag {
  font-size: 0.725rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 3px solid var(--bg-primary);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.timeline-role { font-size: 1.15rem; }
.timeline-company { color: var(--accent-gold); font-weight: 600; }
.timeline-period { font-family: var(--font-mono); font-size: 0.825rem; color: var(--text-muted); }
.timeline-desc { font-size: 0.925rem; color: var(--text-secondary); margin-bottom: 0.75rem; }

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.skill-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 12px;
}

.category-title {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--accent-gold);
}

.skill-bar-item { margin-bottom: 1rem; }
.skill-info { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }

.skill-progress-bg {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.skill-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-cyan));
  border-radius: 3px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 14px;
}

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-secondary); }

.form-group input, .form-group textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.social-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.social-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 16px;
  padding: 2rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.bibtex-code {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-top: 1rem;
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-text { font-size: 0.85rem; color: var(--text-muted); }

@media (max-width: 868px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-portrait-card { max-width: 260px; margin: 0 auto; }
  .hero-name { font-size: 2.5rem; }
  .hero-cta { justify-content: center; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
