/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --text-primary: #e4e4ed;
  --text-secondary: #9494a8;
  --text-muted: #5c5c75;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.25);
  --border: #2a2a3a;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1100px;
  --nav-height: 64px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

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

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.navbar.scrolled { background: rgba(10, 10, 15, 0.95); }
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-light);
  letter-spacing: -1px;
}
.nav-links { display: flex; gap: 32px; }
.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: calc(var(--nav-height) + 40px) 0 60px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(162, 155, 254, 0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(108, 92, 231, 0.08) 0%, transparent 40%);
  z-index: 0;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent-light);
  margin-bottom: 12px;
  font-weight: 500;
}
.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 0 32px var(--accent-glow);
  margin: 0 auto 24px;
  display: block;
}
.hero-name {
  font-size: clamp(3rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-title {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 12px;
}
.hero-subtitle {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta {
  margin-top: 36px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-top: 56px;
}
.stat-item { text-align: center; }
.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-light);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-indicator span {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}
.scroll-indicator span::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--accent-light);
  border-radius: 2px;
  animation: scrollBounce 2s infinite;
}
@keyframes scrollBounce {
  0%, 100% { top: 6px; opacity: 1; }
  50% { top: 18px; opacity: 0.3; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}
.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.btn-sm:hover {
  background: var(--accent-light);
}
.btn-disabled {
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
  position: relative;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(108, 92, 231, 0.1);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.5px;
}
.section-desc {
  color: var(--text-muted);
  margin-top: 12px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.about-text strong { color: var(--text-primary); }
.about-text em { color: var(--accent-light); font-style: normal; }
.about-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform var(--transition), border-color var(--transition);
}
.highlight-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.highlight-icon { font-size: 1.8rem; margin-bottom: 8px; }
.highlight-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.highlight-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Skills ===== */
.skills { background: var(--bg-secondary); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.skill-category h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.skill-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.skill-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 140px;
}
.skill-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.skill-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 1s ease;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.project-card-featured {
  border-color: rgba(162, 155, 254, 0.45);
  box-shadow: 0 16px 46px rgba(108, 92, 231, 0.14);
}
.project-card-featured .project-img {
  background:
    linear-gradient(135deg, rgba(108, 92, 231, 0.28), rgba(162, 155, 254, 0.08)),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.12), transparent 36%);
}
.project-img {
  height: 160px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(162, 155, 254, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-placeholder {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-light);
  opacity: 0.6;
}
.project-info {
  padding: 20px 24px 24px;
}
.project-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.project-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 8px 0 10px;
}
.project-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.project-tech {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.project-tech span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 6px;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
}
a.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.contact-icon { font-size: 2rem; margin-bottom: 12px; }
.contact-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.contact-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}
.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-motto {
  margin-top: 8px;
  font-style: italic;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 80px 32px 32px;
    transition: right var(--transition);
    border-left: 1px solid var(--border);
  }
  .nav-links.active { right: 0; }
  .nav-toggle { display: flex; z-index: 1001; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-highlights { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .stat-number { font-size: 1.5rem; }
  .section { padding: 64px 0; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .skill-name { min-width: 110px; font-size: 0.78rem; }
}

@media (max-width: 480px) {
  .hero-name { font-size: 2.4rem; }
  .hero-cta { flex-direction: column; align-items: center; width: 100%; }
  .hero-cta .btn { width: 100%; text-align: center; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ===== Print ===== */
@media print {
  .navbar, .scroll-indicator, .hero-bg { display: none; }
  body { background: #fff; color: #000; }
  .section { padding: 32px 0; }
}
