/* ====================================================================
   🍎 macOS SYSTEM FONT & DESIGN TOKENS
   ==================================================================== */

:root,
[data-theme="dark"] {
  --bg-primary:    #090d16;
  --bg-secondary:  #0d1526;
  --bg-card:       rgba(15, 23, 42, 0.80);
  --bg-glass:      rgba(9, 13, 22, 0.82);
  --bg-hover:      rgba(30, 41, 59, 0.85);
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --accent-indigo: #6366f1;
  --accent-cyan:   #06b6d4;
  --accent-emerald:#10b981;
  --border-color:  rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(99, 102, 241, 0.45);
  --card-shadow:   0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --badge-bg:      rgba(99, 102, 241, 0.12);
  --badge-border:  rgba(99, 102, 241, 0.30);
  --badge-text:    #818cf8;
  --modal-bg:      #0f172a;
  --input-bg:      rgba(30, 41, 59, 0.6);
  --opt-bg:        rgba(16, 185, 129, 0.08);
  --opt-border:    rgba(16, 185, 129, 0.25);
  --opt-text:      #34d399;
  --section-alt:   #0d1526;
}

[data-theme="light"] {
  --bg-primary:    #f5f7fa;
  --bg-secondary:  #edf0f5;
  --bg-card:       #ffffff;
  --bg-glass:      rgba(245, 247, 250, 0.90);
  --bg-hover:      #e8ecf2;
  --text-primary:  #0f172a;
  --text-secondary:#374151;
  --text-muted:    #6b7280;
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
  --accent-indigo: #4f46e5;
  --accent-cyan:   #0284c7;
  --accent-emerald:#059669;
  --border-color:  rgba(15, 23, 42, 0.10);
  --border-hover:  rgba(79, 70, 229, 0.35);
  --card-shadow:   0 4px 20px -4px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15,23,42,0.06);
  --badge-bg:      rgba(79, 70, 229, 0.08);
  --badge-border:  rgba(79, 70, 229, 0.20);
  --badge-text:    #4338ca;
  --modal-bg:      #ffffff;
  --input-bg:      #edf0f5;
  --opt-bg:        rgba(5, 150, 105, 0.07);
  --opt-border:    rgba(5, 150, 105, 0.22);
  --opt-text:      #065f46;
  --section-alt:   #edf0f5;
}

/* ====================================================================
   BASE RESETS
   ==================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Respect reduced motion preference */
  @media (prefers-reduced-motion: reduce) {
    scroll-behavior: auto;
  }
}

body {
  /* macOS-first font stack */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

/* ====================================================================
   LAYOUT UTILITIES
   ==================================================================== */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ====================================================================
   NAVBAR
   ==================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.logo-badge {
  background: var(--accent-gradient);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
  padding-top: 2px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-gradient);
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  transform: rotate(20deg) scale(1.08);
  border-color: var(--accent-indigo);
}

/* ====================================================================
   BUTTONS
   ==================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.55);
}

.btn-secondary {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  transform: translateY(-2px);
}

.btn-outline {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-resume-btn {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}

.lang-toggle-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.lang-toggle-btn:hover {
  color: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

.lang-toggle-btn-full {
  width: 100%;
  padding: 0.65rem;
  font-size: 0.9rem;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease;
}

.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-overlay.open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.mobile-nav-close {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.mobile-nav-links a {
  display: block;
  padding: 0.85rem 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ====================================================================
   HERO
   ==================================================================== */

.hero {
  padding: 9rem 0 5rem;
  position: relative;
  overflow: hidden;
}

/* Ambient glow background */
.hero-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 40%, rgba(99,102,241,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(6,182,212,0.05) 0%, transparent 70%);
  pointer-events: none;
}

[data-theme="light"] .hero-bg-glow {
  background:
    radial-gradient(ellipse 70% 60% at 20% 40%, rgba(99,102,241,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 60%, rgba(6,182,212,0.04) 0%, transparent 70%);
}

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

.hero-text {
  max-width: 640px;
}

/* Auth badge */
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  padding: 0.38rem 1rem;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

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

/* OPT statement */
.opt-statement {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: var(--opt-bg);
  border: 1px solid var(--opt-border);
  color: var(--opt-text);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1.8rem;
}

.opt-statement svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.opt-statement-centered {
  max-width: 600px;
  margin: 2.5rem auto 0;
  justify-content: center;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.4rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.4;
}

/* ====================================================================
   SECTIONS
   ==================================================================== */

.section {
  padding: 5rem 0;
}

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

.section-header {
  margin-bottom: 2.5rem;
}

.section-title-wrap h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  margin-bottom: 0.45rem;
  letter-spacing: -0.025em;
}

.section-title-wrap p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.section-title-centered {
  text-align: center;
  margin-bottom: 2.5rem;
}

.timeline-section-exp { color: var(--accent-indigo); }
.timeline-section-edu { color: var(--accent-cyan); }

/* ====================================================================
   FILTER BAR & SEARCH
   ==================================================================== */

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.38rem 0.9rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.filter-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.search-box {
  position: relative;
  min-width: 230px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem 0.5rem 2.2rem;
  border-radius: 20px;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ====================================================================
   PROJECT CARDS
   ==================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-7px);
  border-color: var(--border-hover);
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .project-card:hover {
  box-shadow: 0 12px 36px -8px rgba(15, 23, 42, 0.15);
}

.project-image-wrap {
  width: 100%;
  height: 195px;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.project-card:hover .project-image {
  transform: scale(1.06);
}

.project-status-tag {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent-cyan);
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(6, 182, 212, 0.3);
  letter-spacing: 0.02em;
}

[data-theme="light"] .project-status-tag {
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-indigo);
  border-color: var(--border-hover);
}

.project-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.6;
}

.project-metric {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-bottom: 1.2rem;
}

.tag-pill {
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 500;
}

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

.project-links {
  display: flex;
  gap: 0.75rem;
}

.project-link-icon {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.project-link-icon:hover {
  color: var(--accent-indigo);
}

/* Add New Project card */
.add-project-card {
  border: 2px dashed var(--border-color);
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  cursor: pointer;
  min-height: 380px;
  border-radius: 18px;
}

.add-project-card:hover {
  border-color: var(--accent-indigo);
  background: var(--badge-bg);
}

.add-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent-indigo);
  margin: 0 auto 1rem;
  transition: background 0.2s ease;
}

.add-project-card:hover .add-icon-circle {
  background: var(--badge-bg);
}

.add-project-card h3 {
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.add-project-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ====================================================================
   SKILLS SECTION
   ==================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
}

.skill-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color 0.25s ease;
}

.skill-category-card:hover {
  border-color: var(--border-hover);
}

.skill-category-card h3 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent-cyan);
  letter-spacing: 0;
}

.skill-badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-item-pill {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.3rem 0.75rem;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Certifications */
.certs-section {
  margin-top: 0.5rem;
}

.certs-heading {
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s ease;
}

.cert-card:hover {
  border-color: var(--border-hover);
}

.cert-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.cert-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.cert-issuer {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Clickable cert card with link */
a.cert-card-link {
  text-decoration: none;
  cursor: pointer;
}

a.cert-card-link:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-2px);
}

.cert-link-arrow {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--accent-indigo);
  opacity: 0.7;
  flex-shrink: 0;
}

/* Honors row */
.honors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.honor-pill {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.08));
  border: 1px solid rgba(99,102,241,0.2);
  color: var(--badge-text);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
}

/* ====================================================================
   EXPERIENCE & EDUCATION TIMELINE
   ==================================================================== */

.timeline-container-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.timeline-section-title {
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.timeline {
  position: relative;
  padding-left: 1.8rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(to bottom, var(--accent-indigo), var(--border-color));
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-node {
  position: absolute;
  left: -1.8rem;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-indigo);
  border: 2.5px solid var(--bg-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.timeline-node-cyan {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.3rem;
  transition: border-color 0.25s ease;
}

.timeline-card:hover {
  border-color: var(--border-hover);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.timeline-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.timeline-company {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 0.1rem;
}

.timeline-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.timeline-list {
  list-style: none;
  padding-left: 0;
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.55;
  margin-top: 0.5rem;
}

.timeline-list li {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.timeline-list li::before {
  content: '·';
  color: var(--accent-indigo);
  font-weight: 900;
  flex-shrink: 0;
  margin-top: -0.05em;
}

.timeline-honors {
  color: var(--accent-emerald);
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ====================================================================
   CONTACT SECTION
   ==================================================================== */

.contact-section {
  text-align: center;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 0;
  text-align: left;
}

#contact-calendly-slot {
  display: contents;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  transition: border-color 0.22s ease, transform 0.22s ease;
}

.contact-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.contact-card-location {
  cursor: default;
}

.contact-card-location:hover {
  transform: none;
  border-color: var(--border-color);
}

.contact-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.1rem;
}

.contact-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-value-link {
  color: var(--accent-indigo);
  font-weight: 600;
}

.contact-card:hover .contact-value-link {
  color: var(--accent-cyan);
}

/* ====================================================================
   FOOTER
   ==================================================================== */

.footer {
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0;
}

.footer-meta a {
  color: var(--accent-indigo);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-meta a:hover {
  color: var(--accent-cyan);
}

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

/* ====================================================================
   MODAL DIALOG
   ==================================================================== */

dialog.modal {
  margin: auto;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background: var(--modal-bg);
  color: var(--text-primary);
  max-width: 720px;
  width: 92%;
  max-height: 85vh;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  padding: 0;
  outline: none;
  overflow: hidden;
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.modal-header {
  padding: 1.4rem 1.8rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-title {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.close-btn {
  background: var(--bg-hover);
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
  font-family: inherit;
}

.close-btn:hover {
  background: var(--border-hover);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.modal-body h4 {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin: 1.1rem 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.65;
}

.modal-body ul {
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.91rem;
  line-height: 1.6;
}

.modal-body ul li {
  margin-bottom: 0.4rem;
}

.modal-title-zh {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.modal-metric {
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.modal-internal-note {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.modal-arch-note {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-indigo);
}

.modal-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Workflow diagrams in modal */
.workflow-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.workflow-col {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.workflow-col-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.workflow-before .workflow-col-label { color: var(--text-muted); }
.workflow-after  .workflow-col-label { color: var(--accent-emerald); }

.workflow-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.workflow-col li {
  margin-bottom: 0.35rem;
  padding-left: 0.75rem;
  position: relative;
}

.workflow-col li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent-indigo);
  font-weight: 900;
}

.workflow-arrow {
  align-self: center;
  color: var(--accent-cyan);
  font-size: 1.4rem;
  font-weight: 700;
  padding-top: 1.5rem;
}

.workflow-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.workflow-step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.workflow-step-num {
  background: var(--accent-gradient);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.workflow-connector {
  width: 20px;
  height: 2px;
  background: var(--accent-indigo);
  opacity: 0.5;
  flex-shrink: 0;
}

.modal-body pre {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.83rem;
  overflow-x: auto;
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
  line-height: 1.55;
}

/* ====================================================================
   RESPONSIVE BREAKPOINTS
   ==================================================================== */

@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .timeline-container-wrap {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 7rem 0 3.5rem;
  }

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

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

  .nav-desktop {
    display: none;
  }

  .nav-resume-btn {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .contact-cards {
    grid-template-columns: 1fr 1fr;
  }

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

  .workflow-arrow {
    display: none;
  }

  .workflow-pipeline {
    flex-direction: column;
    align-items: stretch;
  }

  .workflow-connector {
    width: 2px;
    height: 14px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .contact-cards {
    grid-template-columns: 1fr;
  }

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

  .hero-ctas {
    flex-direction: column;
  }

  .hero-ctas .btn {
    width: 100%;
  }
}

/* ====================================================================
   🖨️ PRINT RESUME CSS
   ==================================================================== */

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 11pt;
  }

  .navbar,
  .theme-toggle-btn,
  .hero-ctas,
  .filter-container,
  .add-project-card,
  .footer,
  #contact {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 1rem !important;
  }

  .hero {
    padding: 1rem 0 !important;
  }

  .hero-title {
    color: #000 !important;
    font-size: 22pt !important;
    -webkit-text-fill-color: initial !important;
    background: none !important;
  }

  .gradient-text {
    -webkit-text-fill-color: #000 !important;
    background: none !important;
  }

  .auth-badge, .opt-statement {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
  }

  .project-card, .stat-card, .timeline-card, .skill-category-card, .cert-card {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    color: #000 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  .hero-content {
    grid-template-columns: 1fr !important;
  }

  .timeline-container-wrap {
    grid-template-columns: 1fr !important;
  }
}
