/* ===== CSS Variables ===== */
:root {
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --accent: #2563eb;
  --accent-dim: rgba(37, 99, 235, 0.1);
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-hover: #d1d5db;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 50px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
  --nav-height: 60px;
}

[data-theme="dark"] {
  --bg: #111827;
  --bg-card: #1f2937;
  --bg-card-hover: #273549;
  --accent: #38bdf8;
  --accent-dim: rgba(56, 189, 248, 0.12);
  --text: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border: #374151;
  --border-hover: #4b5563;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Hide decorative elements from old theme */
.cursor-glow, .hero-bg, .theme-options { display: none !important; }

/* ===== Theme Toggle ===== */
.theme-switcher {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 101;
}

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle-btn:hover { border-color: var(--accent); }
.theme-toggle-btn svg { width: 16px; height: 16px; color: var(--text-secondary); }

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

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

.section-header {
  text-align: center;
  margin-bottom: 44px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.14s; }
.reveal-delay-3 { transition-delay: 0.2s; }
.reveal-delay-4 { transition-delay: 0.26s; }

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.nav-links a.active {
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: 4px; }
.hamburger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--transition); }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-nav {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav a { font-size: 1.2rem; font-weight: 600; color: var(--text-secondary); }
.mobile-nav a:hover { color: var(--accent); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 48px;
  width: 100%;
}

.hero-text { flex: 1; }

.hero-greeting {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.hero-name {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-name .gradient-text {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  background: none;
}

.hero-role {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  min-height: 2em;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-bio {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 500px;
  margin-bottom: 24px;
  line-height: 1.7;
}

.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Hero photo */
.hero-photo-wrapper { flex-shrink: 0; }
.hero-photo-wrapper::before { display: none; }

.hero-photo {
  width: 240px;
  height: 300px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid var(--border);
}

/* ===== About / Bento ===== */
.about-content { display: flex; flex-direction: column; gap: 36px; }

.about-text {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
}
.bento-card::before { display: none; }
.bento-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.bento-card.span-2 { grid-column: span 2; }

.bento-icon { font-size: 1.6rem; margin-bottom: 8px; }
.bento-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.bento-value { font-size: 1.05rem; font-weight: 600; }
.bento-value .highlight { color: var(--accent); -webkit-text-fill-color: var(--accent); background: none; }

/* ===== Domain Journey ===== */
.domain-journey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.domain-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.domain-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.domain-chip-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.domain-arrow { color: var(--text-muted); font-size: 0.8rem; }

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 32px;
  padding-bottom: 36px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -4px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-date { font-size: 0.78rem; color: var(--accent); font-weight: 600; margin-bottom: 3px; }
.timeline-role { font-size: 1.05rem; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.timeline-company { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 8px; }

.timeline-desc { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.timeline-desc li {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.6;
  padding-left: 12px;
  position: relative;
}
.timeline-desc li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.timeline-tech { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.tech-pill {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  border: none;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.project-icon { font-size: 1.3rem; margin-bottom: 12px; }
.project-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.project-desc { color: var(--text-secondary); font-size: 0.84rem; line-height: 1.6; flex: 1; margin-bottom: 12px; }
.project-tech { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }

.project-links { display: flex; gap: 14px; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  transition: color var(--transition);
}
.project-link svg { width: 13px; height: 13px; }
.project-link:hover { color: var(--text); }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.skill-group:hover { border-color: var(--border-hover); }

.skill-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 600;
}

.skill-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-pill {
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.skill-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Education ===== */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.education-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
}
.education-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.education-icon { font-size: 1.8rem; margin-bottom: 10px; }
.education-degree { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.education-school { color: var(--accent); font-size: 0.85rem; font-weight: 500; margin-bottom: 2px; }
.education-year { color: var(--text-muted); font-size: 0.78rem; }
.education-detail { color: var(--text-secondary); font-size: 0.78rem; margin-top: 4px; }

/* ===== Contact ===== */
.contact-content { text-align: center; max-width: 520px; margin: 0 auto; }
.contact-text { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 28px; line-height: 1.7; }

.contact-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.contact-card svg { width: 18px; height: 18px; color: var(--accent); }
.contact-card-label { font-size: 0.68rem; color: var(--text-muted); }
.contact-card-value { font-weight: 600; font-size: 0.84rem; }

/* ===== Footer ===== */
.footer { padding: 28px 0; text-align: center; border-top: 1px solid var(--border); }
.footer-text { color: var(--text-muted); font-size: 0.78rem; }
.footer-text span { color: var(--text-secondary); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .section-title { font-size: 1.5rem; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }

  .hero-content { flex-direction: column-reverse; text-align: center; gap: 28px; padding-top: 80px; }
  .hero-name { font-size: 2rem; }
  .hero-role { font-size: 1rem; }
  .hero-bio { margin: 0 auto 24px; }
  .hero-cta { justify-content: center; }
  .hero-photo { width: 160px; height: 200px; }

  .bento-grid { grid-template-columns: 1fr 1fr; }
  .bento-card.span-2 { grid-column: span 1; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .domain-arrow { display: none; }
  .domain-journey { gap: 5px; }
  .education-grid { grid-template-columns: 1fr; }
  .contact-links { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-name { font-size: 1.7rem; }
  .bento-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .btn { padding: 8px 16px; font-size: 0.82rem; }
}
