/* ===== Global Styles ===== */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  background: linear-gradient(180deg, #071021, #0f1724);
  color: #eaf1ff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  scroll-behavior: smooth;
}

/* typography */
h1 {
  font-size: 2.1rem;
}
h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.muted {
  color: rgba(234, 241, 255, 0.65);
}
.accent {
  background: linear-gradient(90deg, #1c99fe, #7644ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(7, 16, 33, 0.6);
  backdrop-filter: blur(6px);
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.04);
}
.brand h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}
.brand .muted {
  font-size: 0.78rem;
  color: rgba(234, 241, 255, 0.65);
}
/* nav links */
.nav-links {
  display: flex;
  gap: 18px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: inherit;
  text-decoration: none;
  padding: 8px 6px;
  border-radius: 6px;
  font-weight: 500;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.03);
}
/* nav actions */
.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.cta,
.btn {
  background: linear-gradient(90deg, #1c99fe, #7644ff);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.25s ease;
}
.cta:hover,
.btn:hover {
  background: linear-gradient(90deg, #1384ff, #5a38cc);
}
.cta.ghost,
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
}
.btn.small {
  padding: 6px 8px;
  font-size: 0.85rem;
}

/* hamburger/nav toggle (mobile) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: #eaf1ff;
  position: relative;
  transition: all 0.3s ease;
}
.hamburger:before,
.hamburger:after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #eaf1ff;
  transition: transform 0.3s ease;
}
.hamburger:before {
  top: -6px;
}
.hamburger:after {
  top: 6px;
}
.nav-toggle.active .hamburger {
  background: transparent;
}
.nav-toggle.active .hamburger:before {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active .hamburger:after {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* HERO */
.hero {
  display: flex;
  justify-content: center; /* center horizontally */
  padding: 110px 6% 60px;
  gap: 0;
}

.hero-left {
  max-width: 600px; /* limit width for better look */
  text-align: center; /* center text inside */
  margin: 0 auto; /* center block */
}

.hero-card {
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.profile {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.04);
}
.phone-preview {
  width: 220px;
  height: 420px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* sections */
.section {
  padding: 48px 6%;
}
.section.dark {
  background: rgba(255, 255, 255, 0.01);
}
.container {
  max-width: 1100px;
  margin: auto;
}

/* grids */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

/* cards */
.info-card,
.app-card,
.project-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: transform 0.18s;
}
.info-card:hover,
.app-card:hover,
.project-card:hover {
  transform: translateY(-6px);
}
.app-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  margin-right: 12px;
}

/* modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.6);
  z-index: 200;
  padding: 20px;
}
.modal[aria-hidden="false"] {
  display: flex;
}
.modal-card {
  background: #071021;
  padding: 18px;
  border-radius: 12px;
  width: min(920px, 95%);
  max-height: 85vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: fadeInModal 0.3s ease forwards;
  position: relative;
}
.modal-card .close {
  position: absolute;
  right: 14px;
  top: 12px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
}
.modal-screens {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.modal-screens img {
  width: 140px;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

/* small utilities */
.lead {
  color: rgba(234, 241, 255, 0.9);
  max-width: 700px;
}
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #9bd6ff;
  margin-bottom: 12px;
}
.skills span {
  display: inline-block;
  margin-right: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: 8px;
}

/* animations */
@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bounce on buttons */
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.btn:hover,
.btn:focus,
.cta:hover,
.cta:focus {
  animation: bounce 0.4s ease;
}

/* footer */
.footer {
  text-align: center;
  padding: 18px;
  background: rgba(7, 16, 33, 0.6);
  margin-top: 18px;
  color: rgba(234, 241, 255, 0.7);
}

/* =========== Responsive =========== */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(7, 16, 33, 0.9);
    flex-direction: column;
    padding: 12px 16px;
    gap: 8px;
  }
  .nav-links.show {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .nav {
    padding: 10px 14px;
  }
  .hero {
    flex-direction: column;
    padding: 100px 5% 40px;
  }
  .hero-card {
    width: 280px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .modal-card {
    width: 95%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6rem;
  }
  .hero-card {
    width: 220px;
  }
  .phone-preview {
    width: 180px;
    height: 360px;
  }
  .nav-avatar {
    width: 40px;
    height: 40px;
  }
}
/* Contact form styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.contact-form input,
.contact-form textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  color: #eaf1ff;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #7644ff;
  background: rgba(118, 68, 255, 0.1);
}

.contact-form button {
  align-self: flex-start;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}
.hero {
  display: flex !important;
  justify-content: center !important;
  padding: 110px 6% 60px;
  gap: 0;
  margin-bottom: 24px;
}

.hero-left {
  max-width: 600px;
  text-align: center;
  margin: 0 auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.skills {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section h2,
.section p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 700px;
}

.cards,
.app-grid,
.projects-grid {
  justify-content: center;
}
/* Dropdown container */
.nav-links li.dropdown {
  position: relative;
}

/* Dropdown button style */
.nav-links li.dropdown > a.dropbtn {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hide dropdown content by default */
.nav-links li.dropdown .dropdown-content {
  display: none;
  position: absolute;
  top: 110%;
  left: 0;
  background: rgba(7,16,33,0.9);
  border-radius: 8px;
  min-width: 140px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 1000;
  padding: 8px 0;
}

/* Dropdown links */
.nav-links li.dropdown .dropdown-content li {
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-links li.dropdown .dropdown-content li a {
  display: block;
  padding: 10px 16px;
  color: #eaf1ff;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.3s ease;
  border-radius: 6px;
}

.nav-links li.dropdown .dropdown-content li a:hover,
.nav-links li.dropdown .dropdown-content li a:focus {
  background: #7644ff;
  color: white;
}

/* Show dropdown on hover - desktop */
@media (hover: hover) and (pointer: fine) {
  .nav-links li.dropdown:hover .dropdown-content {
    display: block;
  }
}

/* Show dropdown on focus for accessibility */
.nav-links li.dropdown > a.dropbtn:focus + .dropdown-content,
.nav-links li.dropdown > a.dropbtn:active + .dropdown-content {
  display: block;
}

/* Mobile: dropdown toggle on click */
@media (max-width: 900px) {
  .nav-links li.dropdown .dropdown-content {
    position: relative;
    top: 0;
    left: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }
  .nav-links li.dropdown .dropdown-content li a {
    padding-left: 30px;
    background: rgba(255,255,255,0.05);
    margin: 4px 0;
    border-radius: 6px;
  }
}
.section {
  padding: 48px 6%;
  background: rgba(255, 255, 255, 0.01);
  color: #eaf1ff;
}

.lead {
  font-size: 1.1rem;
  color: rgba(234, 241, 255, 0.85);
  max-width: 600px;
  margin: 0 auto;
}

.resume-buttons .btn {
  background: linear-gradient(90deg, #1c99fe, #7644ff);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease;
  display: inline-block;
}

.resume-buttons .btn:hover {
  background: linear-gradient(90deg, #1384ff, #5a38cc);
}

.resume-buttons .btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
}
/* --- Menu underline + lift (works with your existing hover bg) --- */
.nav-links a {
  position: relative;              /* anchor point for ::after */
  display: inline-block;           /* predictable underline width */
  transition: transform .22s ease; /* lift animation */
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 6px;                       /* trim to ignore left padding */
  right: 6px;                      /* trim to ignore right padding */
  bottom: 4px;                     /* sits just above the bottom */
  height: 2px;
  background-color: currentColor;  /* matches link color */
  transform: scaleX(0);            /* hidden by default */
  transform-origin: left;
  transition: transform .25s ease;
  z-index: 1;                      /* draw over the hover background */
}

.nav-links a:hover {
  transform: translateY(-3px);     /* slight lift */
}

.nav-links a:hover::after {
  transform: scaleX(1);            /* slide underline in */
}
/* Dropdown container */
.nav-links li.dropdown { position: relative; }

/* Hidden by default but animatable (no display:none) */
.nav-links li.dropdown .dropdown-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  position: absolute;
  top: 110%;
  left: 0;
  background: rgba(7,16,33,0.9);
  border-radius: 8px;
  min-width: 140px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 1000;
  padding: 8px 0;
  transition: opacity .25s ease, transform .25s ease,
              visibility 0s linear .25s; /* delay visibility off so it can fade */
}

/* Links inside the dropdown (kept from your CSS) */
.nav-links li.dropdown .dropdown-content li { list-style: none; }
.nav-links li.dropdown .dropdown-content li a {
  display: block;
  padding: 10px 16px;
  color: #eaf1ff;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .3s ease;
  border-radius: 6px;
}
.nav-links li.dropdown .dropdown-content li a:hover,
.nav-links li.dropdown .dropdown-content li a:focus {
  background: #7644ff;
  color: white;
}

/* Desktop: animate on hover/focus */
@media (hover: hover) and (pointer: fine) {
  .nav-links li.dropdown:hover .dropdown-content,
  .nav-links li.dropdown:focus-within .dropdown-content {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s; /* show immediately */
  }
}

/* Keyboard/mobile support: when the button is focused or active, show it */
.nav-links li.dropdown > a.dropbtn:focus + .dropdown-content,
.nav-links li.dropdown > a.dropbtn:active + .dropdown-content {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

/* Mobile layout tweaks (keep your existing styles but remove display:none logic) */
@media (max-width: 900px) {
  .nav-links li.dropdown .dropdown-content {
    position: relative;
    top: 0; left: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
  }
  .nav-links li.dropdown .dropdown-content li a {
    padding-left: 30px;
    background: rgba(255,255,255,0.05);
    margin: 4px 0;
    border-radius: 6px;
  }
}
