/* ─── RESET & BASE ──────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body,
html {
  height: 100%;
}

/* ─── SKIP LINK (Accessibility) ─────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #1A237E;
  color: white;
  padding: 0.75rem 1.5rem;
  z-index: 9999;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  top: 0;
}

/* ─── FADE-IN ANIMATION ────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.project-card,
.cert-row {
  animation: fadeInUp 0.4s ease-out both;
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }

.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.15s; }
.project-card:nth-child(3) { animation-delay: 0.25s; }

.cert-row:nth-child(1) { animation-delay: 0.05s; }
.cert-row:nth-child(2) { animation-delay: 0.15s; }
.cert-row:nth-child(3) { animation-delay: 0.25s; }
.cert-row:nth-child(4) { animation-delay: 0.35s; }

/* ─── SIDEBAR ─────────────────────────────────── */
.container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 38%;
  background: linear-gradient(160deg, #1A237E 0%, #0D1452 100%);
  color: white;
  padding: 2rem 1.8rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.avatar {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5C6BC0, #9575CD);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.8rem;
  border: 4px solid rgba(255, 255, 255, 0.25);
  letter-spacing: 2px;
  flex-shrink: 0;
  object-fit: cover;
}

.sidebar h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.sidebar h2 {
  font-size: 0.9rem;
  font-weight: 400;
  color: #B0BEC5;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.sidebar .tagline {
  font-size: 0.88rem;
  color: #CFD8DC;
  line-height: 1.65;
  text-align: left;
  margin-bottom: 1.5rem;
}

.contact-info {
  width: 100%;
  text-align: left;
  margin-bottom: 1.5rem;
  font-size: 0.83rem;
  color: #B0BEC5;
}

.contact-info div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.contact-info i {
  color: #7986CB;
  width: 16px;
}

.links {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.btn-link {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s;
}

.btn-link:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ─── MAIN PANEL ──────────────────────────────── */
.main {
  margin-left: 38%;
  width: 62%;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.menu {
  background: #283593;
  color: white;
  display: flex;
  padding: 0;
  flex-shrink: 0;
  overflow-x: auto;
}

.menu-item {
  padding: 1rem 1.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  background: none;
  color: white;
  font-family: inherit;
}

.menu-item:hover,
.menu-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-bottom-color: #7986CB;
  color: #C5CAE9;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background-color: #F5F7FA;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ─── TYPOGRAPHY ─────────────────────────────── */
.content h2 {
  font-size: 1.35rem;
  color: #1A237E;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #E3E8FF;
}

.content h3 {
  font-size: 1.05rem;
  color: #283593;
  margin: 1rem 0 0.5rem;
}

.content p {
  font-size: 0.92rem;
  color: #455A64;
  line-height: 1.7;
  margin-bottom: 0.7rem;
}

/* ─── SECTION CARD ───────────────────────────── */
.card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ─── EDUCATION ROWS ─────────────────────────── */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.edu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  background: #F8F9FF;
  border: 1px solid #E3E8FF;
  border-radius: 8px;
  padding: 0.9rem;
}

.org-badge {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: white;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.edu-text .degree {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1A237E;
  margin-bottom: 0.2rem;
}

.edu-text .school {
  font-size: 0.82rem;
  color: #607D8B;
  font-style: italic;
}

.edu-text .year {
  font-size: 0.78rem;
  color: #90A4AE;
  margin-top: 0.2rem;
}

/* ─── TIMELINE ───────────────────────────────── */
.timeline {
  position: relative;
  margin: 1.5rem 0;
  --line-height: 0%;
}

.timeline::after {
  content: "";
  position: absolute;
  width: 4px;
  background: #C5CAE9;
  top: 0;
  left: 50%;
  margin-left: -2px;
  z-index: 1;
  border-radius: 2px;
  height: var(--line-height);
}

.tl-item {
  padding: 0 45px;
  position: relative;
  width: 50%;
  margin-bottom: 1.5rem;
}

.tl-left {
  left: 0;
}

.tl-right {
  left: 50%;
}

.tl-icon {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  right: -22px;
  top: 14px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.6rem;
  color: white;
  text-align: center;
  line-height: 1.2;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tl-right .tl-icon {
  left: -22px;
  right: auto;
}

.tl-box {
  background: white;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 1px solid #E3E8FF;
  position: relative;
  font-size: 0.88rem;
}

.tl-box h3 {
  font-size: 0.95rem;
  color: #1A237E;
  margin-bottom: 0.2rem;
}

.tl-box small {
  color: #7986CB;
  font-size: 0.78rem;
  display: block;
  margin-bottom: 0.6rem;
}

.tl-box ul {
  padding-left: 1.1rem;
}

.tl-box li {
  color: #546E7A;
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.tl-arrow-left {
  position: absolute;
  top: 18px;
  right: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 10px solid white;
  z-index: 2;
}

.tl-arrow-right {
  position: absolute;
  top: 18px;
  left: -10px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 10px solid white;
  z-index: 2;
}

/* ─── SKILLS GRID ────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}

.skill-chip {
  background: linear-gradient(160deg, #1A237E 0%, #0D1452 100%);
  color: white;
  border-radius: 8px;
  padding: 0.8rem;
  text-align: center;
  font-size: 0.8rem;
}

.skill-chip strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* ─── PROJECTS ───────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 6rem;
}

.project-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #E3E8FF;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(26, 35, 126, 0.15);
}

.project-banner {
  height: 120px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.project-banner::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
}

.project-banner i.project-icon {
  position: absolute;
  bottom: -15px;
  right: 15px;
  font-size: 5rem;
  color: rgba(255, 255, 255, 0.15);
  z-index: 0;
  transform: rotate(-15deg);
}

.project-banner h3 {
  position: relative;
  color: white;
  font-size: 1.15rem;
  text-align: left;
  font-weight: 700;
  z-index: 1;
  margin: 0;
  line-height: 1.3;
}

.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-body .tools {
  font-size: 0.82rem;
  color: #7986CB;
  margin-bottom: 0.8rem;
}

.project-body p {
  font-size: 0.88rem;
  color: #455A64;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-body ul {
  padding-left: 1.2rem;
  flex: 1;
  margin-bottom: 1.5rem;
}

.project-body li {
  font-size: 0.86rem;
  color: #546E7A;
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.learn-more {
  display: inline-block;
  margin-top: auto;
  color: #3949AB;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: #EDEEF7;
  padding: 8px 16px;
  border-radius: 6px;
  text-align: center;
  transition: background 0.2s;
}

.learn-more:hover {
  background: #DFE2F2;
  text-decoration: none;
}

/* ─── INTERESTS CHIPS ────────────────────────── */
.interest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.interest-chip {
  background: #E8EAF6;
  color: #3949AB;
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
}

/* ─── CERT CARDS ─────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.cert-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #E3E8FF;
  transition: box-shadow 0.2s;
  gap: 1.5rem;
}

.cert-row:hover {
  box-shadow: 0 6px 18px rgba(26, 35, 126, 0.1);
}

.cert-badge {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-details {
  flex: 1;
  text-align: left;
}

.cert-details h3 {
  font-size: 1rem;
  color: #1A237E;
  margin-bottom: 0.3rem;
  line-height: 1.4;
  font-weight: 700;
}

.cert-details .meta-line {
  font-size: 0.85rem;
  color: #1A237E;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.cert-details .meta-line span {
  color: #546E7A;
  font-weight: 400;
  margin-left: 4px;
  display: inline-block;
}

.cert-details p {
  font-size: 0.85rem;
  color: #546E7A;
  line-height: 1.5;
  margin-top: 0.8rem;
  margin-bottom: 0.35rem;
}

.cert-details ul {
  padding-left: 1.1rem;
  text-align: left;
  margin-top: 0.5rem;
}

.cert-details li {
  font-size: 0.8rem;
  color: #546E7A;
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.cert-details a {
  color: #3949AB;
  font-size: 0.8rem;
}

/* ─── LOGO IMAGES ───────────────────────────── */
.org-badge.logo-img,
.cert-badge.logo-img {
  background: white;
  padding: 5px;
  border: 1px solid #E3E8FF;
}

.org-badge.logo-img img,
.cert-badge.logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tl-icon.logo-img {
  background: white;
  padding: 4px;
}

.tl-icon.logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

/* ─── RESPONSIVE (≤900px — tablet/mobile stack) ── */
@media (max-width: 900px) {
  body, html {
    height: auto;
  }

  .container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  .avatar {
    width: 160px;
    height: 160px;
  }

  .sidebar .tagline {
    text-align: center;
  }

  .main {
    margin-left: 0;
    width: 100%;
    height: auto;
  }

  .content {
    overflow-y: visible;
    height: auto;
    flex: none;
  }

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

  .tl-item {
    width: 100%;
    left: 0 !important;
    padding: 0 0 0 50px;
  }

  .tl-icon {
    left: 0 !important;
    right: auto !important;
  }

  .timeline::after {
    left: 22px;
  }

  .tl-arrow-left,
  .tl-arrow-right {
    left: -10px;
    right: auto;
    border-right: 10px solid white;
    border-left: none;
  }
}

/* ─── RESPONSIVE (≤600px — small phones) ──────── */
@media (max-width: 600px) {
  .avatar {
    width: 120px;
    height: 120px;
  }

  .sidebar {
    padding: 1.5rem 1rem;
  }

  .sidebar h1 {
    font-size: 1.2rem;
  }

  .sidebar h2 {
    font-size: 0.82rem;
  }

  .sidebar .tagline {
    font-size: 0.83rem;
  }

  .content {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  .menu-item {
    padding: 0.8rem 1rem;
    font-size: 0.82rem;
  }

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

  .tl-box {
    padding: 0.8rem;
  }

  .cert-badge {
    width: 100px;
    height: 100px;
  }

  .cert-row {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }

  .cert-details {
    text-align: left;
    width: 100%;
  }

  .cert-details h3 {
    text-align: left;
  }

  .cert-details p,
  .cert-details ul,
  .cert-details li {
    text-align: left;
  }

  .cert-details .meta-line {
    display: flex;
    justify-content: flex-start;
  }

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

/* ─── CONTACT FORM ───────────────────────────────────── */
.contact-form-card {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #283593;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #C5CAE9;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #37474F;
  background: #FAFBFF;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #3949AB;
  box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.12);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-submit {
  background: linear-gradient(135deg, #1A237E, #283593);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #283593, #3949AB);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(26, 35, 126, 0.3);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  display: none;
}

.form-status.success {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
  display: block;
}

.form-status.error {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #FFCDD2;
  display: block;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.contact-info-tile {
  background: #F0F2FF;
  border: 1px solid #C5CAE9;
  border-radius: 10px;
  padding: 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #283593;
  font-weight: 500;
  text-align: center;
  word-break: break-word;
  min-width: 0;
}

.contact-info-tile i {
  font-size: 1.2rem;
  color: #3949AB;
}

@media (max-width: 700px) {
  .contact-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── EXPLORE MORE POPUP ──────────────────────── */
.nav-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(26, 35, 126, 0.2);
  padding: 1rem 1.2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 1.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 1.6s ease;
  pointer-events: none;
  border: 1px solid #E3E8FF;
}

.nav-popup.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.nav-popup-label {
  font-size: 0.72rem;
  color: #90A4AE;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin: 0;
}

.nav-popup-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.nav-popup-btns.home-row {
  justify-content: flex-start;
}

.nav-popup-btns.grid-row {
  flex-wrap: wrap;
}

.nav-popup-btn.desktop-home {
  display: none;
}

.nav-popup-btn {
  background: linear-gradient(135deg, #1A237E, #283593);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
  font-family: inherit;
  opacity: 0;
  transform: translateY(10px);
  animation-fill-mode: forwards;
  animation-duration: 0.75s;
  animation-timing-function: ease-out;
}

.nav-popup-btn:hover {
  background: linear-gradient(135deg, #283593, #3949AB);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 35, 126, 0.25);
}

.nav-popup-btn.certs-btn {
  background: linear-gradient(135deg, #4A148C, #6A1B9A);
}

.nav-popup-btn.certs-btn:hover {
  background: linear-gradient(135deg, #6A1B9A, #7B1FA2);
  box-shadow: 0 4px 12px rgba(74, 20, 140, 0.25);
}

.nav-popup-btn.resume-btn {
  background: linear-gradient(135deg, #00695C, #00897B);
}

.nav-popup-btn.resume-btn:hover {
  background: linear-gradient(135deg, #00897B, #00ACC1);
  box-shadow: 0 4px 12px rgba(0, 105, 92, 0.25);
}

.nav-popup-btn.contact-btn {
  background: linear-gradient(135deg, #BF360C, #E64A19);
}

.nav-popup-btn.contact-btn:hover {
  background: linear-gradient(135deg, #E64A19, #F4511E);
  box-shadow: 0 4px 12px rgba(191, 54, 12, 0.25);
}

.nav-popup-btn.home-btn {
  background: linear-gradient(135deg, #006064, #00838F);
}

.nav-popup-btn.home-btn:hover {
  background: linear-gradient(135deg, #00838F, #0097A7);
  box-shadow: 0 4px 12px rgba(0, 96, 100, 0.25);
}

/* Popup button entry animation */
@keyframes popup-fade-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-popup:not(.visible) .nav-popup-btn {
  opacity: 0;
  transform: translateY(10px);
  animation: none;
}

.nav-popup.visible .home-row .nav-popup-btn {
  animation: popup-fade-rise 0.9s ease-out forwards;
  animation-delay: 0s;
}

.nav-popup.visible .grid-row .nav-popup-btn:nth-child(1) {
  animation: popup-fade-rise 0.9s ease-out forwards;
  animation-delay: 0.12s;
}

.nav-popup.visible .grid-row .nav-popup-btn:nth-child(2) {
  animation: popup-fade-rise 0.9s ease-out forwards;
  animation-delay: 0.24s;
}

.nav-popup.visible .grid-row .nav-popup-btn:nth-child(3) {
  animation: popup-fade-rise 0.9s ease-out forwards;
  animation-delay: 0.36s;
}

.nav-popup.visible .grid-row .nav-popup-btn:nth-child(4) {
  animation: popup-fade-rise 0.9s ease-out forwards;
  animation-delay: 0.48s;
}

.nav-popup.visible .grid-row .nav-popup-btn:nth-child(5) {
  animation: popup-fade-rise 0.9s ease-out forwards;
  animation-delay: 0.6s;
}

/* ─── MOBILE POPUP (≤768px) ──────────────────── */
@media (max-width: 768px) {
  .nav-popup {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    transition: transform 2.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 2.4s ease;
  }

  .nav-popup-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nav-popup-btn {
    justify-content: center;
  }

  .nav-popup-btns.home-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.4rem;
  }

  .nav-popup-btn.home-btn {
    width: 50%;
    max-width: 240px;
    justify-content: center;
  }

  .nav-popup-btns.grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .nav-popup-btn.desktop-home {
    display: none !important;
  }

  /* Mobile popup animation: slide in right to left */
  @keyframes popup-slide-left-mobile {
    from {
      opacity: 0;
      transform: translateX(40px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .nav-popup:not(.visible) .nav-popup-btn {
    opacity: 0;
    transform: translateX(40px);
    animation: none;
  }

  .nav-popup.visible .home-row .nav-popup-btn {
    animation: popup-slide-left-mobile 2.4s ease-out forwards;
    animation-delay: 0s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(1) {
    animation: popup-slide-left-mobile 2.4s ease-out forwards;
    animation-delay: 0.35s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(2) {
    animation: popup-slide-left-mobile 2.4s ease-out forwards;
    animation-delay: 0.7s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(3) {
    animation: popup-slide-left-mobile 2.4s ease-out forwards;
    animation-delay: 1.05s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(4) {
    animation: popup-slide-left-mobile 2.4s ease-out forwards;
    animation-delay: 1.4s;
  }

  /* Certifications: mobile layout adjustments */
  .cert-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cert-badge {
    margin: 0.4rem auto 0.35rem;
  }

  .cert-details {
    width: 100%;
    text-align: left;
  }

  .cert-details h3 {
    text-align: center;
  }

  .cert-details .meta-line,
  .cert-details p,
  .cert-details ul {
    text-align: left;
  }

  .cert-details p {
    text-align: justify;
  }
}

/* ─── DESKTOP POPUP (≥769px) ─────────────────── */
@media (min-width: 769px) {
  .home-row {
    display: none !important;
  }

  .grid-row {
    display: flex;
    flex-wrap: wrap;
  }

  .nav-popup-btns {
    display: flex;
    flex-wrap: wrap;
  }

  .nav-popup-btn.desktop-home {
    display: flex !important;
  }

  /* Desktop animation: ribbon slides in right to left */
  @keyframes popup-slide-left {
    from {
      opacity: 0;
      transform: translateX(60px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .nav-popup:not(.visible) .nav-popup-btn {
    opacity: 0;
    transform: translateX(60px);
    animation: none;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(1) {
    animation: popup-slide-left 1.6s ease-out forwards;
    animation-delay: 0s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(2) {
    animation: popup-slide-left 1.6s ease-out forwards;
    animation-delay: 0.2s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(3) {
    animation: popup-slide-left 1.6s ease-out forwards;
    animation-delay: 0.4s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(4) {
    animation: popup-slide-left 1.6s ease-out forwards;
    animation-delay: 0.6s;
  }

  .nav-popup.visible .grid-row .nav-popup-btn:nth-child(5) {
    animation: popup-slide-left 1.6s ease-out forwards;
    animation-delay: 0.8s;
  }
}
