/* ===== CSS VARIABLES / THEMING ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #1a1a2e;
  --bg-card: #1a1a2e;
  --bg-card-hover: #252545;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b8;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --accent-purple: #7b2ffc;
  --highlight: #ff6b6b;
  --border-color: #2a2a4a;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 16px;
  --font-main:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Light Mode */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f2;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5e;
  --border-color: #d0d0d8;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --accent: #0066ff;
  --accent-glow: rgba(0, 102, 255, 0.1);
}

/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition:
    background 0.4s ease,
    color 0.4s ease;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-purple);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* ===== UTILITY ===== */
.section-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
}

/* ===== HEADER / NAV ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

[data-theme="light"] header {
  background: rgba(245, 245, 247, 0.85);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.logo span {
  color: var(--accent);
}

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

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

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}

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

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

/* Mobile Menu */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
  border-radius: 2px;
}

/* Close Menu Button */
.close-menu-item {
  display: none;
}

.close-menu {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 8px;
  transition: var(--transition);
  position: absolute;
  top: 20px;
  right: 24px;
}

.close-menu:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: floatGlow 8s ease-in-out infinite;
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-40px, 30px) scale(1.1);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text .badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.hero-text h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero-text h1 .highlight {
  color: var(--accent);
  position: relative;
}

.hero-text .typewriter {
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  min-height: 2.2rem;
}

.hero-text .typewriter .cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 4px;
  animation: blink 0.8s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.hero-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0f;
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--accent-glow);
  color: #0a0a0f;
}

.btn-secondary {
  border: 1px solid var(--border-color);
  background: transparent;
}

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

/* Hero Avatar */
.hero-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-wrapper {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  padding: 4px;
  box-shadow: 0 0 80px var(--accent-glow);
  animation: pulseBorder 4s ease-in-out infinite;
}

@keyframes pulseBorder {
  0%,
  100% {
    box-shadow: 0 0 40px var(--accent-glow);
  }
  50% {
    box-shadow:
      0 0 80px var(--accent-glow),
      0 0 120px rgba(123, 47, 252, 0.1);
  }
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-primary);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-weight: 700;
  color: var(--accent);
}

/* ===== SECTION COMMON ===== */
section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border-color);
}

section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 48px;
}

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.skill-card {
  background: var(--bg-card);
  padding: 24px 16px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: default;
}

.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.skill-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
  display: block;
}

.skill-name {
  font-weight: 600;
  font-size: 0.95rem;
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  background: var(--bg-card-hover);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.project-tech span {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-links a {
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-coming {
  background: var(--highlight);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
  margin-left: 8px;
  opacity: 0.8;
}

/* ===== EXPERIENCE ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  padding-left: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.timeline-item h3 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.timeline-item .company {
  color: var(--accent);
  font-weight: 500;
}

.timeline-item .date {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.timeline-item ul {
  list-style: none;
  padding: 0;
}

.timeline-item ul li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-left: 20px;
  position: relative;
  margin-bottom: 4px;
}

.timeline-item ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== CONTACT ===== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.contact-socials {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
}

.contact-socials a:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.form-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.form-status.error {
  display: block;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid var(--highlight);
  color: var(--highlight);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer a {
  color: var(--accent);
}

/* ===== ANIMATIONS ===== */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.stagger.visible > *:nth-child(1) {
  transition-delay: 0.05s;
  opacity: 1;
  transform: translateY(0);
}
.stagger.visible > *:nth-child(2) {
  transition-delay: 0.1s;
  opacity: 1;
  transform: translateY(0);
}
.stagger.visible > *:nth-child(3) {
  transition-delay: 0.15s;
  opacity: 1;
  transform: translateY(0);
}
.stagger.visible > *:nth-child(4) {
  transition-delay: 0.2s;
  opacity: 1;
  transform: translateY(0);
}
.stagger.visible > *:nth-child(5) {
  transition-delay: 0.25s;
  opacity: 1;
  transform: translateY(0);
}
.stagger.visible > *:nth-child(6) {
  transition-delay: 0.3s;
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .avatar-wrapper {
    width: 240px;
    height: 240px;
  }

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

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

  .section-title {
    font-size: 1.8rem;
  }

  .hero-text h1 {
    font-size: 2.4rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .close-menu-item {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 20px;
    transition: var(--transition);
    border-left: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
  }

  .theme-toggle {
    margin-left: auto;
  }

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

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

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

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 2rem;
  }
  .avatar-wrapper {
    width: 180px;
    height: 180px;
  }
  .section-title {
    font-size: 1.5rem;
  }
  .container {
    padding: 0 16px;
  }
}
