/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== Reading Progress Bar ========== */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-primary), #6ec1e4, #8b5cf6);
  z-index: 10001;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(0, 112, 243, 0.5);
}

/* ========== Quick Contact Widget ========== */
#contact-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
}

#contact-bubble {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

#contact-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

#contact-panel {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 300px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  display: none;
  overflow: hidden;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#contact-panel.open {
  display: block;
}

.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}

.contact-header strong {
  font-size: 0.95rem;
}

#contact-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
  line-height: 1;
}

#contact-close:hover {
  opacity: 1;
}

.contact-items {
  padding: 8px 0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-item:hover {
  background: var(--bg-primary);
}

.contact-icon {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: 10px;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 2px;
}

.contact-value {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn-small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.copy-btn-small:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.copy-btn-small.copied {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-primary);
}

@media (max-width: 480px) {
  #contact-widget {
    bottom: 80px;
    right: 16px;
  }

  #contact-panel {
    width: calc(100vw - 80px);
    right: -8px;
  }
}

:root {
  --blue-primary: #0070f3;
  --blue-light: #e8f4ff;
  --blue-dark: #0051a8;
  --blue-glow: rgba(0, 112, 243, 0.35);
  --bg-primary: #f8fafd;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a6178;
  --text-light: #8b92a5;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark Mode */
body.dark {
  --bg-primary: #0d1117;
  --bg-card: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-light: #6e7681;
  --border: #30363d;
  --blue-light: #1a2332;
}

body.dark #navbar {
  background: rgba(13, 17, 23, 0.85);
}

body.dark .nav-links {
  background: rgba(13, 17, 23, 0.98);
}

body.dark #loading-screen {
  background: #0d1117;
}

body.dark .loading-terminal {
  background: #161b22;
  border-color: #30363d;
}

body.dark .terminal-box {
  background: #161b22;
  border-color: #30363d;
}

body.dark .terminal-header {
  background: #21262d;
}

body.dark .chat-input-area {
  background: #161b22;
}

body.dark #chat-input {
  background: #0d1117;
  border-color: #30363d;
  color: #e6edf3;
}


html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a {
  color: var(--blue-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--blue-dark);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Loading Screen ========== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0a0f1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}

#loading-screen.hide {
  opacity: 0;
  pointer-events: none;
}

.loading-terminal {
  background: #1a1f2e;
  border: 1px solid #2a3040;
  border-radius: 12px;
  padding: 32px 40px;
  min-width: 400px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #8b949e;
}

.loading-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.loading-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.loading-bar span:nth-child(1) { background: #ff5f56; }
.loading-bar span:nth-child(2) { background: #ffbd2e; }
.loading-bar span:nth-child(3) { background: #27c93f; }

.loading-lines p {
  margin-bottom: 6px;
  opacity: 0;
  animation: fadeInLine 0.3s forwards;
}

.loading-lines p:nth-child(1) { animation-delay: 0.2s; }
.loading-lines p:nth-child(2) { animation-delay: 0.6s; }
.loading-lines p:nth-child(3) { animation-delay: 1.0s; }
.loading-lines p:nth-child(4) { animation-delay: 1.4s; }

@keyframes fadeInLine {
  to { opacity: 1; }
}

.t-green { color: #27c93f; }
.t-cyan { color: #58a6ff; }

.loading-progress {
  margin-top: 20px;
  height: 3px;
  background: #2a3040;
  border-radius: 3px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0;
  background: #27c93f;
  border-radius: 3px;
  animation: loadProgress 2s ease-in-out forwards;
  animation-delay: 0.5s;
}

@keyframes loadProgress {
  to { width: 100%; }
}

/* ========== Particle Canvas ========== */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ========== Navigation ========== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(248, 250, 253, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s, background 0.3s;
}

#navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-logo:hover {
  color: var(--blue-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue-primary);
  transition: width 0.3s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

#theme-toggle:hover {
  border-color: var(--blue-primary);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: 0.3s;
}

/* ========== Hero Section ========== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 0 60px;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 112, 243, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 112, 243, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-avatar-wrapper {
  margin-bottom: 24px;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--blue-primary);
  box-shadow: 0 0 30px var(--blue-glow);
  display: block;
  margin: 0 auto;
}

.hero-name {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-slogan {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--blue-primary);
  margin-bottom: 24px;
  min-height: 1.8em;
}

.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ========== Terminal Box ========== */
.terminal-box {
  max-width: 560px;
  margin: 0 auto 24px;
  text-align: left;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f0f2f5;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: 8px;
}

.terminal-body {
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  min-height: 160px;
}

.terminal-body p {
  margin-bottom: 4px;
}

.terminal-cursor-line {
  margin-top: 8px;
}

.terminal-cursor {
  animation: blink 1s step-end infinite;
  color: var(--blue-primary);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 4px 14px;
  background: var(--blue-light);
  color: var(--blue-primary);
  border-radius: 20px;
  border: 1px solid rgba(0, 112, 243, 0.15);
}

.hero-cta {
  display: inline-block;
  padding: 12px 32px;
  background: var(--blue-primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-shadow: 0 4px 15px var(--blue-glow);
}

.hero-cta:hover {
  background: var(--blue-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--blue-glow);
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--blue-primary);
  border: 2px solid var(--blue-primary);
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-btn-secondary:hover {
  background: var(--blue-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--blue-glow);
}

.hero-btn-secondary svg {
  flex-shrink: 0;
}

.hero-btn-secondary.downloaded {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

/* ========== Section Common ========== */
.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-icon {
  font-family: var(--font-mono);
  color: var(--blue-primary);
  font-size: 1.4rem;
}

/* ========== Project Filters ========== */
.project-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 6px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-primary);
}

/* ========== Projects Section ========== */
#projects {
  padding: 100px 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 800px;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-primary), #6ec1e4);
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 112, 243, 0.2);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card.hidden {
  display: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-icon {
  font-size: 1.8rem;
}

.card-award {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 3px 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
}

.card-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-light);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.2s;
}

.card-links a:hover {
  color: var(--blue-primary);
  border-color: var(--blue-primary);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.card-tech span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 10px;
  background: var(--bg-primary);
  color: var(--text-light);
  border-radius: 4px;
}

.card-detail-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--blue-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.card-detail-btn:hover {
  opacity: 0.7;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-content h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section h4 {
  font-size: 0.95rem;
  color: var(--blue-primary);
  margin-bottom: 8px;
}

.modal-section p,
.modal-section li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.modal-section ul {
  padding-left: 20px;
}

.modal-section li {
  margin-bottom: 4px;
}

/* ========== Skills Section ========== */
#skills {
  padding: 100px 0;
  background: #fff;
}

body.dark #skills {
  background: var(--bg-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-item {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.skill-percent {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--blue-primary);
}

.skill-bar {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue-primary), #6ec1e4);
  border-radius: 3px;
  transition: width 1.2s ease;
}

/* ========== Timeline ========== */
#timeline {
  padding: 100px 0;
}

.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 40px 40px;
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.right {
  left: 50%;
}

.timeline-dot {
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  background: var(--blue-primary);
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  z-index: 1;
}

.timeline-item.left .timeline-dot {
  right: -7px;
}

.timeline-item.right .timeline-dot {
  left: -7px;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.3s;
}

.timeline-card:hover {
  box-shadow: var(--shadow-sm);
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue-primary);
  display: block;
  margin-bottom: 6px;
}

.timeline-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.timeline-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========== Guestbook ========== */
#guestbook {
  padding: 100px 0;
  background: #fff;
}

body.dark #guestbook {
  background: var(--bg-primary);
}

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row input {
  flex: 1;
}

.guestbook-form input,
.guestbook-form textarea {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  background: var(--bg-card);
  color: var(--text-primary);
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
  border-color: var(--blue-primary);
}

.btn-primary {
  align-self: flex-end;
  padding: 10px 24px;
  background: var(--blue-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-item {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.3s;
}

.msg-item:hover {
  box-shadow: var(--shadow-sm);
}

.msg-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.msg-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--blue-primary);
}

.msg-item-email {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: 8px;
}

.msg-item-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-light);
}

.msg-item-content {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg-item-actions {
  display: flex;
  gap: 8px;
}

.msg-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}

.msg-btn:hover {
  color: var(--blue-primary);
  border-color: var(--blue-primary);
}

.msg-btn.delete:hover {
  color: #e74c3c;
  border-color: #e74c3c;
}

.msg-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ========== Life Section ========== */
#life {
  padding: 100px 0;
}

.life-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.life-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: all 0.3s;
}

.life-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.life-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.life-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.life-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ========== Footer ========== */
#footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer-contact {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.footer-contact a {
  color: var(--text-secondary);
}

.footer-contact a:hover {
  color: var(--blue-primary);
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  color: var(--text-light);
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s;
}

.copy-btn:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}

.copy-btn.copied {
  background: var(--blue-primary);
  color: #fff;
  border-color: var(--blue-primary);
}

.footer-visitors {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.footer-quote {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light);
  font-style: italic;
}

/* ========== Chat Widget ========== */
#chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

#chat-bubble {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  position: relative;
  transition: transform 0.3s;
  box-shadow: 0 4px 20px var(--blue-glow);
}

#chat-bubble:hover {
  transform: scale(1.1);
}

.bubble-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--blue-primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

#chat-window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#chat-window.open {
  display: flex;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
  color: #fff;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.chat-header strong {
  display: block;
  font-size: 0.9rem;
}

.chat-header small {
  font-size: 0.72rem;
  opacity: 0.8;
}

#chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 4px 8px;
  line-height: 1;
}

#chat-close:hover {
  opacity: 1;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.msg {
  display: flex;
}

.msg.user {
  justify-content: flex-end;
}

.msg-bubble {
  max-width: 82%;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-word;
}

.msg-bubble code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

.msg.bot .msg-bubble {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.msg.user .msg-bubble {
  background: var(--blue-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}

#chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: var(--text-primary);
}

#chat-input:focus {
  border-color: var(--blue-primary);
}

#chat-send {
  width: 40px;
  height: 40px;
  background: var(--blue-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

#chat-send:hover {
  background: var(--blue-dark);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(248, 250, 253, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-slogan {
    font-size: 1rem;
  }

  .terminal-box {
    max-width: 100%;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .life-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 32px;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    left: 0 !important;
    padding: 0 0 32px 50px;
    text-align: left !important;
  }

  .timeline-dot {
    left: 13px !important;
    right: auto !important;
  }

  .form-row {
    flex-direction: column;
  }

  .footer-contact {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  #chat-window {
    width: calc(100vw - 32px);
    right: -8px;
    height: 70vh;
  }

  .loading-terminal {
    min-width: auto;
    width: 90vw;
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .hero-avatar {
    width: 90px;
    height: 90px;
  }

  .hero-name {
    font-size: 1.6rem;
  }

  .hero-tags {
    gap: 6px;
  }

  .tag {
    font-size: 0.7rem;
    padding: 3px 10px;
  }

  #chat-bubble {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  #chat-window {
    bottom: 60px;
    height: 65vh;
  }

  .hero-actions {
    flex-direction: column;
  }
}

/* ========== Easter Egg Animations ========== */
@keyframes rainbow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

.easter-egg-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, var(--blue-primary), #8b5cf6);
  color: #fff;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  z-index: 99999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  max-width: 90vw;
}

.easter-egg-notification.show {
  transform: translateX(-50%) translateY(0);
}

.easter-egg-notification br {
  margin-top: 4px;
}

/* ========== Click Ripple Effect ========== */
.click-ripple {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue-primary);
  pointer-events: none;
  z-index: 99997;
  opacity: 0.6;
  transform: scale(0);
  animation: rippleExpand 0.6s ease-out forwards;
}

@keyframes rippleExpand {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ========== Message Reactions ========== */
.msg-reactions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.reaction-btn:hover {
  border-color: var(--blue-primary);
  background: var(--blue-light);
}

.reaction-btn.active {
  border-color: var(--blue-primary);
  background: var(--blue-light);
  color: var(--blue-primary);
}

.reaction-btn .emoji {
  font-size: 0.9rem;
}

.reaction-btn .count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-light);
  min-width: 10px;
  text-align: center;
}

.reaction-btn.active .count {
  color: var(--blue-primary);
}
