/* ROOT */
:root {
  --bg-color:       #0b1120;
  --surface-color:  #111827;
  --surface-2:      #1a2235;
  --accent-color:   #38bdf8;
  --accent-dim:     rgba(56, 189, 248, 0.12);
  --accent-glow:    rgba(56, 189, 248, 0.22);
  --text-primary:   #f1f5f9;
  --text-muted:     #7d8fa8;
  --border:         rgba(255, 255, 255, 0.06);

  --font-heading: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;

  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  2rem;
  --space-xl:  5rem;
  --radius:    14px;
  --radius-sm: 8px;
}

/* RESET */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  line-height: 1.15;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* CONTAINER */
.container {
  width: 90%;
  max-width: 1100px;
  margin-inline: auto;
}

section {
  padding: var(--space-xl) 0;
  scroll-margin-top: 80px;
}

/* FADE-IN ANIMATION */
.fade-section {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.fade-section.visible {
  opacity: 1;
}

/* NAVBAR */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 5%;
  background-color: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.02em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.25s;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent-color);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Active nav link */
.nav-links a.active {
  color: var(--accent-color);
}
.nav-links a.active::after {
  width: 100%;
}

/* HAMBURGER */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 99px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger → X animation */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE MENU */
.mobile-menu {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border);
  padding: 1rem 5%;
}

.mobile-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mobile-menu a {
  display: block;
  padding: 0.85rem 0;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.mobile-menu a:hover { color: var(--accent-color); }
.mobile-menu ul li:last-child a { border-bottom: none; }

.hidden { display: none !important; }

/* HERO */
#hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 4rem 5%;
  position: relative;
  overflow: hidden;
}

/* Subtle background glow blob */
#hero::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(56,189,248,0.07) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero-container {
  display: flex;
  align-items: center;
  gap: 4rem;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

/* Photo */
.hero-photo-wrapper {
  position: relative;
  flex-shrink: 0;
}

.hero-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--accent-color);
  position: relative;
  z-index: 1;
}

.hero-photo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  animation: spin 20s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hero text */
.hero-text {
  flex: 1;
}

.hero-greeting {
  color: var(--accent-color);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

#hero h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.highlight {
  color: var(--accent-color);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin-bottom: 2rem;
  margin-left: 0;
  line-height: 1.75;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

 /* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.7rem;
  border-radius: var(--radius-sm);
  background-color: var(--accent-color);
  color: #0b1120;
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid var(--accent-color);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background-color 0.25s;
  font-family: var(--font-body);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent-color);
}

.btn-outline:hover {
  background: var(--accent-color);
  color: #0b1120;
}

/* SECTION HEADINGS */
section h2 {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  position: relative;
  display: inline-block;
  letter-spacing: -0.02em;
}

section h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent-color);
  margin-top: 8px;
  border-radius: 99px;
}

/* ABOUT */
#about { background: var(--surface-color); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  font-size: 0.97rem;
  max-width: 600px;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 120px;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* SKILLS */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: var(--space-md);
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem;
  background: var(--surface-color);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.25s, transform 0.25s;
  cursor: default;
}

.skill-item:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-3px);
}

.skill-item i {
  font-size: 2rem;
  color: var(--text-muted);
  transition: color 0.25s;
}

.skill-item svg {
  color: var(--text-muted);
  transition: color 0.25s;
}

.skill-item:hover i,
.skill-item:hover svg {
  color: var(--accent-color);
}

.skill-item span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.25s;
}

.skill-item:hover span {
  color: var(--text-primary);
}

/* PROJECTS  */
#projects { background: var(--bg-color); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.add-project-container {
  display: flex;
  justify-content: center;
  margin-top: var(--space-lg);
}

.project-card {
  background: var(--surface-color);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 189, 248, 0.2);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.project-content {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  margin-bottom: 1rem;
  flex: 1;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}

.tech-stack span {
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  background: var(--accent-dim);
  color: var(--accent-color);
  border-radius: 99px;
  border: 1px solid rgba(56, 189, 248, 0.15);
  font-weight: 500;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
}

.project-links a {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 600;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.project-links a:hover { color: #7dd3fc; }

/* CONTACT */
#contact { background: var(--surface-color); }

.contact-intro {
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 2rem;
  font-size: 0.97rem;
}

.contact-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
}

.contact-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-color);
  transform: translateY(-2px);
}

.contact-card svg { flex-shrink: 0; }

/* FOOTER */
footer {
  padding: 1.5rem 0;
  background: var(--bg-color);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 2000;
}

.modal {
  background: var(--surface-color);
  padding: 2rem;
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.form-group { width: 100%; }

.modal input,
.modal textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.modal input:focus,
.modal textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.modal textarea {
  resize: vertical;
  min-height: 90px;
}

.close-modal {
  position: absolute;
  top: 0.75rem; right: 1rem;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.close-modal:hover { color: var(--text-primary); }

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #0b1120;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
}

/* RESPONSIVE */
@media (max-width: 768px) {

  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero-container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
    padding-top: 3rem;
  }

  .hero-photo { width: 150px; height: 150px; }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons { justify-content: center; }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .stat-card { flex: 1; min-width: 90px; }

  .skills-container {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .contact-links { flex-direction: column; }
  .contact-card { justify-content: center; }

  .back-to-top { bottom: 1.2rem; right: 1.2rem; }
}

@media (max-width: 480px) {
  section { padding: 3.5rem 0; }
  #hero h1 { font-size: 2.4rem; }
  .hero-photo { width: 120px; height: 120px; }
}