#projects h2 {
  margin-bottom: 18px;
}

#about h2 {
  margin-bottom: 18px;
}

.projects-section {
  padding: 40px 0 24px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
  /* smooth enlarge */
  will-change: transform;
  position: relative;
  /* allow z-index on hover */
}

.project-card .thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card .content {
  padding: 14px 16px 18px;
}

/* Hover pan-to-reveal for tall images (enabled via .pan-reveal on .thumb) */
.project-card .thumb.pan-reveal {
  position: relative;
  overflow: hidden;
}

.project-card .thumb.pan-reveal img {
  width: 100%;
  height: auto;
  /* use intrinsic ratio so tall images can extend beyond container height */
  display: block;
  object-fit: contain;
  /* container masks overflow; avoids extra cropping */
  transform: translateY(0);
  will-change: transform;
  transition: transform var(--pan-duration, 4s) linear;
  /* smooth pan with dynamic duration */
}

.project-card:hover {
  transform: scale(1.02);
  /* base lift + subtle primary glow */
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.12),
    /* ambient */
    0 0 0 3px rgba(99, 102, 241, 0.10),
    /* primary ring */
    0 12px 28px rgba(99, 102, 241, 0.12);
  /* colored glow */
  z-index: 1;
}

.project-card:focus-within {
  transform: scale(1.02);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.12),
    0 0 0 3px rgba(99, 102, 241, 0.14),
    /* slightly stronger for focus */
    0 12px 28px rgba(99, 102, 241, 0.14);
  z-index: 1;
}

/* Dark mode: stronger colored glow for contrast */
:root.dark .project-card:hover {
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.42),
    0 0 0 3px rgba(129, 140, 248, 0.18),
    /* using primary-600 tone */
    0 12px 28px rgba(129, 140, 248, 0.22);
}

:root.dark .project-card:focus-within {
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.42),
    0 0 0 3px rgba(129, 140, 248, 0.22),
    0 12px 28px rgba(129, 140, 248, 0.26);
}

.project-card .thumb.pan-reveal:hover img {
  transform: translateY(calc(-1 * var(--pan-delta, 0px)));
}

.project-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.project-card p {
  margin: 0 0 10px 0;
  color: var(--muted);
}

.project-card .features {
  color: var(--text);
}

/* Technologies line at bottom of card */
.project-card .content .tech {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

.project-card .content .tech strong {
  color: var(--text);
}

/* Project actions as buttons (e.g., GitHub) */
.project-card .project-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

.project-card .github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  /* transparent by default */
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  transition: transform .18s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
}

.project-card .github-link:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  /* subtle tinted hover for visibility */
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10), 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.project-card .github-link:active {
  transform: translateY(0);
}

:root.dark .project-card .github-link:hover {
  background: rgba(129, 140, 248, 0.12);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26), 0 0 0 3px rgba(129, 140, 248, 0.12);
}

/* === Simple project card typography === */
#projects .project-card .content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#projects .project-card .content h3 {
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
}

#projects .project-card .content p {
  line-height: 1.6;
}

/* Remove fade on scrollable descriptions for a simpler look */
#projects .project-card .content p[data-i18n="projects.p1.desc"],
#projects .project-card .content p[data-i18n="projects.p2.desc"],
#projects .project-card .content p[data-i18n="projects.p3.desc"] {
  -webkit-mask-image: none;
  mask-image: none;
}

/* Technologies line: simple inline style */
#projects .project-card .content .tech {
  display: block;
}

#projects .project-card .content .tech strong::before {
  content: none;
}

/* Scrollable long description for Matlou7ch only */
#projects .project-card .content p[data-i18n="projects.p1.desc"] {
  max-height: 96px;
  /* around 4-5 lines */
  overflow: auto;
  padding-right: 6px;
  /* space for scrollbar */
}

/* Nice thin scrollbar (WebKit/Blink) */
#projects .project-card .content p[data-i18n="projects.p1.desc"]::-webkit-scrollbar {
  width: 6px;
}

#projects .project-card .content p[data-i18n="projects.p1.desc"]::-webkit-scrollbar-track {
  background: transparent;
}

#projects .project-card .content p[data-i18n="projects.p1.desc"]::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

:root.dark #projects .project-card .content p[data-i18n="projects.p1.desc"]::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox */
#projects .project-card .content p[data-i18n="projects.p1.desc"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

:root.dark #projects .project-card .content p[data-i18n="projects.p1.desc"] {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

/* Scrollable long description for Boss Luna (same height as Matlou7ch) */
#projects .project-card .content p[data-i18n="projects.p3.desc"] {
  max-height: 96px;
  /* keep same visual height */
  overflow: auto;
  padding-right: 6px;
  /* space for scrollbar */
}

/* Boss Luna scrollbar styling */
#projects .project-card .content p[data-i18n="projects.p3.desc"]::-webkit-scrollbar {
  width: 6px;
}

#projects .project-card .content p[data-i18n="projects.p3.desc"]::-webkit-scrollbar-track {
  background: transparent;
}

#projects .project-card .content p[data-i18n="projects.p3.desc"]::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

:root.dark #projects .project-card .content p[data-i18n="projects.p3.desc"]::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox */
#projects .project-card .content p[data-i18n="projects.p3.desc"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

:root.dark #projects .project-card .content p[data-i18n="projects.p3.desc"] {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

/* Scrollable long description for Weather (same height) */
#projects .project-card .content p[data-i18n="projects.p2.desc"] {
  max-height: 96px;
  overflow: auto;
  padding-right: 6px;
}

/* Weather scrollbar styling */
#projects .project-card .content p[data-i18n="projects.p2.desc"]::-webkit-scrollbar {
  width: 6px;
}

#projects .project-card .content p[data-i18n="projects.p2.desc"]::-webkit-scrollbar-track {
  background: transparent;
}

#projects .project-card .content p[data-i18n="projects.p2.desc"]::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}

:root.dark #projects .project-card .content p[data-i18n="projects.p2.desc"]::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox */
#projects .project-card .content p[data-i18n="projects.p2.desc"] {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

:root.dark #projects .project-card .content p[data-i18n="projects.p2.desc"] {
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.pager-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.pager-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform .25s ease, background .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.pager-dots .dot.active,
.pager-dots .dot[aria-current="true"] {
  background: var(--primary);
  border-color: var(--primary);
}

.pager-dots .dot:hover {
  transform: scale(1.3);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14), 0 0 0 3px rgba(99, 102, 241, 0.10);
}

.pager-dots .dot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

/* Contact */
#contact h2 {
  margin-bottom: 12px;
}

.contact-section {
  padding: 28px 0;
}

.contact-section .lede {
  color: var(--muted);
  max-width: 60ch;
}

/* ===== Title Brillance Animation (scoped to requested titles) ===== */
#contact h2,
#certifications .section-title,
#projects h2,
#specialize h2,
#about h2 {
  position: relative;
  display: inline-block;
  overflow: hidden;
  /* clip the shine to text box */
  max-width: 100%;
  /* Prevent horizontal overflow */
  word-wrap: break-word;
}

#contact h2::after,
#certifications .section-title::after,
#projects h2::after,
#specialize h2::after,
#about h2::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 120%;
  height: 100%;
  /* angled soft shine */
  background: linear-gradient(110deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.25) 45%,
      rgba(255, 255, 255, 0.7) 50%,
      rgba(255, 255, 255, 0.25) 55%,
      rgba(255, 255, 255, 0) 100%);
  transform: skewX(-12deg);
  pointer-events: none;
  mix-blend-mode: screen;
  /* makes shine visible on dark/light */
  animation: titleShine 3.6s ease-in-out infinite;
}

@keyframes titleShine {
  0% {
    left: -140%;
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  50% {
    left: 20%;
    opacity: .9;
  }

  100% {
    left: 140%;
    opacity: 0;
  }
}

/* Contact Section Enhanced */
.social-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.social-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.social-btn:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(99, 102, 241, 0.05);
}

.social-btn:hover::before {
  opacity: 1;
}

.social-btn:active {
  transform: translateY(-2px);
}

.social-btn .icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  /* slight shadow for the circle itself */
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-btn:hover .icon-circle {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.35);
}

.social-btn .icon-circle .icon-img {
  width: 26px;
  height: 26px;
  filter: invert(1) brightness(2) contrast(1.2);
}

.social-btn span {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}

:root.dark .social-btn {
  background: rgba(255, 255, 255, 0.03);
}

:root.dark .social-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

  .social-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

#certifications {
  padding: 40px 0;
}

.certs-slider {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  isolation: isolate;
  /* ensure z-index layering for children */
}

/* Formation slider (About section) */
.form-slider {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.form-list {
  display: grid;
  justify-content: center;
  justify-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 40px;
  /* keep height stable between items */
}

.form-list .badge {
  display: none;
}

.form-list .badge.active {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  /* simplified, no heavy shadow */
  box-shadow: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .2px;
  line-height: 1.5;
  text-align: center;
}

.form-list .badge.active .title {
  display: block;
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
}

.form-list .badge.active .meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.form-list .badge.active .meta::before {
  content: "\1F5D3\FE0F";
  /* 🗓️ */
  margin-right: 6px;
  font-size: 14px;
  vertical-align: -1px;
}

/* Topic chip (e.g., AI Workflow) */
.form-list .badge.active .meta.topic {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.06);
  color: var(--text);
  font-weight: 800;
  font-size: 12.5px;
}

.form-list .badge.active .meta.topic::before {
  content: "\1F916";
  /* 🤖 */
  margin-right: 6px;
  font-size: 14px;
  vertical-align: -1px;
}

/* Make arrows a bit tighter and aligned for the small slider */
#about .form-slider .certs-nav {
  width: 36px;
  height: 36px;
}

@media (max-width: 520px) {
  .form-list .badge.active {
    font-size: 14px;
    padding: 9px 12px;
  }

  .form-list .badge.active .meta {
    font-size: 12.5px;
  }

  .form-list .badge.active .meta::before {
    font-size: 13.5px;
  }

  .form-list .badge.active .meta.topic {
    font-size: 12px;
    padding: 3.5px 9px;
  }

  .form-list .badge.active .meta.topic::before {
    font-size: 13.5px;
  }
}

.certs-track {
  position: relative;
  height: 400px;
  /* smaller base height */
  perspective: 1200px;
  overflow: visible;
  /* show side cards */
}

.cert-slide {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(700px, 88%);
  /* smaller card */
  transform: translateX(-50%);
  padding: 0;
  /* image fills the card; content is overlay */
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform .45s ease, opacity .45s ease, filter .45s ease;
  overflow: hidden;
  height: 100%;
}

.cert-slide .cert-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* show entire image */
  background: transparent;
  /* no black bands around image */
}

.cert-slide .cert-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 100%);
  /* no overlay */
}

.cert-slide .cert-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px;
  color: #fff;
}

.cert-slide .cert-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.cert-slide .cert-issuer {
  margin: 0 0 12px;
  color: #e8ecf2;
  font-weight: 700;
}

.cert-slide .btn-link {
  display: inline-block;
  font-weight: 800;
  color: #111;
  background: #fff;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 16px;
  position: relative;
  /* for shine pseudo-element */
  overflow: hidden;
  /* clip shine */
  animation: pulseGlow 2.4s ease-in-out infinite;
  /* stronger + faster glow */
}

/* Brillance (shine) sweep across the button */
.cert-slide .btn-link::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 28%;
  height: 260%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .9) 50%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(25deg) translateX(-300%);
  pointer-events: none;
  filter: blur(0.5px);
  animation: shineSweep 2.2s linear infinite;
}

@keyframes shineSweep {
  0% {
    transform: rotate(25deg) translateX(-260%);
    opacity: .0;
  }

  10% {
    opacity: .85;
  }

  50% {
    opacity: .75;
  }

  100% {
    transform: rotate(25deg) translateX(360%);
    opacity: .0;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22), 0 0 0 0 rgba(99, 102, 241, 0.00);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32), 0 0 0 6px rgba(99, 102, 241, 0.20);
    transform: scale(1.04);
  }
}

/* Navigation arrows */
.certs-nav {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .25s ease;
  z-index: 10;
  /* always above slide cards */
}

.certs-nav:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

/* Coverflow positions applied via inline transforms from JS */
.certs-track .is-center {
  z-index: 3;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18), 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.certs-track .is-left,
.certs-track .is-right {
  z-index: 2;
  filter: brightness(0.92) saturate(0.96);
}

.certs-track .is-far {
  z-index: 1;
  opacity: .45;
  filter: blur(1px) saturate(0.9);
}

@media (max-width: 900px) {
  .certs-track {
    height: 320px;
  }

  .cert-slide {
    width: 88%;
  }
}

@media (max-width: 520px) {
  .certs-track {
    height: 280px;
    /* Reduced further to better fit phone height */
  }

  .cert-slide {
    width: 92%;
    /* Wider cards on very small screens */
    padding: 12px;
  }

  /* Improve info text on mobile */
  .cert-slide .cert-title {
    font-size: 16px;
  }

  .cert-slide .btn-link {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* ===== Services (replaces Specialize) ===== */
#specialize .title {
  margin-bottom: 0;
}

.services-section {
  padding: 56px 0;
}

.services-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 26px;
}

.services-header .overline {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  font-size: 12px;
  color: var(--primary);
  margin: 0 0 8px 0;
}

.services-header .title {
  margin: 0 0 10px 0;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 900;
}

.services-header .desc {
  margin: 0 auto 16px;
  color: var(--muted);
}

.services-header .divider {
  display: inline-block;
  width: 68px;
  height: 3px;
  background: var(--primary);
  border-radius: 4px;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.service-card {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 10px;
}

:root.dark .service-card {
  background: var(--surface);
}

.service-card .icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 70% 20%, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.06));
}

.service-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.service-card h3 {
  font-size: 17px;
  letter-spacing: .2px;
}

.service-card p {
  margin: 0;
  color: var(--muted);
}

.service-card .learn-more {
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

.service-card .learn-more .arrow {
  transition: transform .18s ease;
  display: inline-block;
}

.service-card:hover .learn-more .arrow {
  transform: translateX(3px);
}

/* ===== Glass banner (Conception Web) ===== */
.glass-section {
  margin: 10px auto 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.35));
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.10);
}

:root.dark .glass-section {
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(120deg, rgba(17, 24, 39, 0.55), rgba(17, 24, 39, 0.35));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.glass-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

.glass-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.glass-head .meta {
  margin: 4px 0 0 0;
  color: var(--muted);
  font-weight: 700;
}

.glass-body p {
  margin: 0 0 8px 0;
}

.glass-aside .meta {
  margin: 0;
}

@media (max-width: 900px) {
  .glass-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1000px) {
  .service-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .service-cards {
    grid-template-columns: 1fr;
  }
}

/* ===== Service details ===== */
.services-details {
  padding: 28px 0 8px;
}

.service-detail {
  border-top: 1px solid var(--border);
  padding: 0;
  /* for smooth collapse */
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .35s ease, opacity .25s ease, padding .25s ease;
}

.service-detail.open {
  padding: 22px 0;
  max-height: 800px;
  /* large enough for content */
  opacity: 1;
}

.service-detail:first-child {
  border-top: 0;
}

.service-detail header {
  margin-bottom: 10px;
}

.service-detail h3 {
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 900;
}

.service-detail .meta {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.feature-list {
  margin: 10px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 8px;
}

.feature-list li {
  color: var(--text);
}

.tag-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  font-size: 13px;
}

@media (max-width: 900px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card::before {
    transition: none;
  }

  .card .overlay {
    transition: none;
  }

  .btn,
  .icon-btn,
  .social-btn,
  .skills-tabs .tab,
  .pager-dots .dot {
    transition: none;
  }

  .project-card {
    transition: none;
  }
}

/* ===== Modal (centered capsule) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9998;
  pointer-events: none;
}

.modal-overlay.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.modal {
  width: min(780px, 92%);
  max-height: min(80vh, 760px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28), 0 0 0 6px rgba(99, 102, 241, 0.06);
  padding: 18px;
  position: relative;
}

:root.dark .modal {
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6), 0 0 0 6px rgba(129, 140, 248, 0.10);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.modal-content {
  color: var(--text);
}

.modal-content header {
  margin-bottom: 10px;
}

.modal-content h3 {
  margin: 0 0 6px 0;
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 900;
  position: relative;
  display: inline-block;
}

.modal-content h3::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), rgba(99, 102, 241, 0.25));
}

.modal-content .meta {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.modal-content header .meta {
  font-size: 14px;
  letter-spacing: .2px;
}

/* Polished service layout inside modal */
.modal-content .detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .modal-content .detail-grid {
    grid-template-columns: 1fr;
  }
}

.modal-content p {
  margin: 0 0 10px 0;
}

/* Fancy check bullets */
.modal-content .feature-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.modal-content .feature-list li {
  position: relative;
  padding-left: 28px;
}

.modal-content .feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.25);
  mask: none;
}

.modal-content .feature-list li::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

/* Tag chips in modal: slightly stronger */
.modal-content .tag-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-content .tag-list li {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 800;
  font-size: 13.5px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

:root.dark .modal-content .tag-list li {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

/* Subtle divider between header and body */
.modal-content header+.detail-grid {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .modal-overlay {
    transition: none;
  }
}

@media (max-width: 1000px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    grid-auto-rows: 220px;
  }

  .cards-grid .card {
    grid-column: auto;
    grid-row: auto;
  }

  .cards-grid .card:nth-child(1) {
    grid-column: 1 / span 2;
  }
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cards-grid .card:nth-child(1) {
    grid-column: auto;
  }
}

/* =============
   Base & Theme
   ============= */
:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #6366f1;
  /* Electric Indigo for a professional dev look */
  --primary-600: #4f46e5;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(99, 102, 241, 0.05);
}

/* Smooth scrolling for anchor navigation */
html {
  scroll-behavior: smooth;
}

/* Ensure anchored sections account for sticky header height */
[id] {
  scroll-margin-top: 90px;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}

.back-to-top[hidden] {
  display: block !important;
  opacity: 0;
  pointer-events: none;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

:root.dark .back-to-top {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}

/* ===== Cursor animation ===== */
.cursor-dot,
.cursor-ring {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  /* hidden until mouse moves */
}

.cursor-dot,
.cursor-ring {
  display: none !important;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12), inset 0 0 12px rgba(99, 102, 241, 0.12);
  transform: translate(-50%, -50%);
  transition: width .2s ease, height .2s ease, border-color .2s ease, opacity .2s ease;
}

.cursor-ring.press {
  width: 22px;
  height: 22px;
  border-color: var(--primary);
}

/* Hide on touch devices */
@media (pointer: coarse) {

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor-ring {
    transition: none;
  }
}

/* Fullscreen canvas for particle field */
.cursor-field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
  z-index: 0;
  /* behind regular content; other UI has higher z-index */
}

/* Full-screen transparent canvas for cursor particle trail */
#cursor-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
  z-index: 9999;
  /* above content, still passive */
}

/* Floating Chat Button (bottom-left) */
.chat-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
  z-index: 50;
}

/* Respect safe-area insets on iOS (and override inline bottom for linktree) */
@supports (bottom: max(0px)) {
  .chat-fab {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .linktree-fab {
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }
}

.chat-fab:hover {
  transform: translateY(-2px);
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.chat-fab:active {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .chat-fab {
    transition: none;
  }
}

/* Chat widget panel - Premium Look */
.chat-widget {
  position: fixed;
  left: 20px;
  bottom: 84px;
  width: min(360px, 90vw);
  background: rgba(255, 255, 255, 0.85);
  /* Glass base */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  z-index: 100;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  transform-origin: bottom left;
}

:root.dark .chat-widget {
  background: rgba(23, 26, 33, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.chat-widget.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.chat-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.5);
}

:root.dark .chat-header {
  border-bottom-color: rgba(255, 255, 255, 0.05);
  background: rgba(23, 26, 33, 0.5);
}

.chat-title {
  display: flex !important;
  align-items: center;
  gap: 14px;
  /* Increased gap */
  font-size: 16px;
  /* Larger base font */
  font-weight: 800;
  /* Extra bold */
  letter-spacing: -0.01em;
  color: var(--text);
}

.chat-title .avatar {
  width: 40px;
  /* Larger avatar */
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  color: #fff;
  font-size: 16px;
  /* Larger initial */
  font-weight: 800;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid #fff;
  /* White ring */
}

:root.dark .chat-title .avatar {
  border-color: var(--surface);
}

.chat-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 20px;
}

.chat-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
  transform: rotate(90deg);
}

:root.dark .chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Body */
/* Chat Body */
.chat-body {
  padding: 24px 20px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.chat-body::-webkit-scrollbar {
  width: 4px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 99px;
}

/* Bubble - Premium Message */
.bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  border-top-left-radius: 4px;
  /* classic chat look */
  padding: 18px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Typography for the typed message */
#chatTyped {
  font-family: 'Inter', system-ui, sans-serif;
  /* Enforce cleaner font */
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  font-weight: 600;
  /* Bolder text */
}

#chatTyped::first-line {
  font-weight: 800;
  color: var(--primary);
  font-size: 16px;
}

/* CTA Separator */
.bubble .cta.start-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}

.bubble .cta.start-line::before,
.bubble .cta.start-line::after {
  content: "";
  height: 1px;
  background: var(--border);
  flex: 1;
}

/* Social Icons in Chat */
.bubble .chat-social {
  margin-top: 16px;
  gap: 16px;
}

.chat-social a {
  width: 42px;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  /* soft square */
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-social a:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
  background: #fff;
}

:root.dark .chat-social a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chat-social a .icon-img {
  width: 20px;
  height: 20px;
  transition: filter 0.2s;
}

.chat-social a:hover .icon-img {
  /* Keep original brand color or tint to primary? Let's use primary tint */
  filter: invert(28%) sepia(39%) saturate(2256%) hue-rotate(338deg) brightness(94%) contrast(91%);
  /* approximation of #b23a35 filter generator, or simpler: just invert if black */
}

:root.dark .chat-social a .icon-img {
  filter: invert(1);
}

:root.dark .chat-social a:hover .icon-img {
  filter: invert(28%) sepia(39%) saturate(2256%) hue-rotate(338deg) brightness(120%) contrast(91%);
}

@media (max-width: 400px) {
  .chat-footer {
    gap: 8px;
  }

  .chat-social {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-widget {
    transition: none;
  }
}

:root.dark {
  --bg: #020617;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #818cf8;
  --primary-600: #6366f1;
  --surface: #0f172a;
  --border: #1e293b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ===== Scroll reveal (generic) ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .35s ease, transform .35s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Slightly different variants if needed */
.reveal.x {
  transform: translateX(24px);
}

.reveal.x.in {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {

  .reveal,
  .reveal.in,
  .reveal.x,
  .reveal.x.in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background-color: var(--bg);
  /* Rich Technical Mesh: Multiple Glow Points + Tinted Grid */
  background-image:
    radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}

:root.dark body {
  background-image:
    radial-gradient(circle at 0% 0%, rgba(129, 140, 248, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(129, 140, 248, 0.08) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Preloader overlay */
.preloader {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity .4s ease, visibility .4s ease;
}

:root.dark .preloader {
  background: linear-gradient(180deg, rgba(15, 17, 21, 0.98), rgba(15, 17, 21, 0.94));
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-inner {
  display: grid;
  gap: 24px;
  justify-items: center;
}

/* --- New Loader Styles (Uiverse.io by Li-Deheng) --- */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  --color: var(--primary);
  --animation: 2s ease-in-out infinite;
}

.loader .circle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 20px;
  height: 20px;
  border: solid 2px var(--color);
  border-radius: 50%;
  margin: 0 10px;
  background-color: transparent;
  animation: circle-keys var(--animation);
}

.loader .circle .dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color);
  animation: dot-keys var(--animation);
}

.loader .circle .outline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  animation: outline-keys var(--animation);
}

.loader .circle:nth-child(2) {
  animation-delay: 0.3s;
}

.loader .circle:nth-child(3) {
  animation-delay: 0.6s;
}

.loader .circle:nth-child(4) {
  animation-delay: 0.9s;
}

.loader .circle:nth-child(5) {
  animation-delay: 1.2s;
}

.loader .circle:nth-child(2) .dot {
  animation-delay: 0.3s;
}

.loader .circle:nth-child(3) .dot {
  animation-delay: 0.6s;
}

.loader .circle:nth-child(4) .dot {
  animation-delay: 0.9s;
}

.loader .circle:nth-child(5) .dot {
  animation-delay: 1.2s;
}

.loader .circle:nth-child(1) .outline {
  animation-delay: 0.9s;
}

.loader .circle:nth-child(2) .outline {
  animation-delay: 1.2s;
}

.loader .circle:nth-child(3) .outline {
  animation-delay: 1.5s;
}

.loader .circle:nth-child(4) .outline {
  animation-delay: 1.8s;
}

.loader .circle:nth-child(5) .outline {
  animation-delay: 2.1s;
}

@keyframes circle-keys {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes dot-keys {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes outline-keys {
  0% {
    transform: translate(-50%, -50%) scale(0);
    outline: solid 20px var(--color);
    outline-offset: 0;
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    outline: solid 0 transparent;
    outline-offset: 20px;
    opacity: 0;
  }
}

.loading-text {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 11px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* =======
   Header
   ======= */
.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  transition: background .2s ease, backdrop-filter .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.nav-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Language dropdown below the globe icon */
#langMenu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 25;
}

#langMenu .lang-option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
}

#langMenu .lang-option[aria-checked="true"],
#langMenu .lang-option:hover {
  background: rgba(99, 102, 241, 0.08);
}

/* Glass (verre) navbar on scroll */
.site-header.nav-glass {
  background: rgba(255, 255, 255, 0.6);
  border-bottom-color: transparent;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

:root.dark .site-header.nav-glass {
  background: rgba(17, 24, 39, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

.site-header.nav-glass .brand span {
  color: var(--primary);
}

.site-header.nav-glass .icon-btn {
  background: rgba(255, 255, 255, 0.7);
}

:root.dark .site-header.nav-glass .icon-btn {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Brand entrance animation */
@keyframes brand-pop {
  from {
    transform: translateY(6px) scale(0.98);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand {
    animation: none;
  }

  .brand span {
    transition: none;
  }
}

/* Colored (primary) navbar on scroll */
.site-header.nav-colored {
  background: rgba(99, 102, 241, 0.70);
  /* more transparent */
  border-bottom-color: transparent;
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.site-header.nav-colored .brand,
.site-header.nav-colored .nav-links a {
  color: #fff;
}

.site-header.nav-colored .brand span {
  color: #fff;
  opacity: 0.95;
}

.site-header.nav-colored .icon-btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.6);
}

.site-header.nav-colored .icon-img {
  filter: invert(1) brightness(2) contrast(1.1);
}

.site-header.nav-colored .btn.primary {
  background: #fff;
  color: var(--primary);
  border-color: #fff;
}

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  position: relative;
  /* anchor dropdowns (mobile nav) */
}

.brand {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: clamp(20px, 3.2vw, 28px);
  display: inline-block;
  transform-origin: left center;
  animation: brand-pop 700ms ease-out both;
  justify-self: start;
}

.brand .code-icon {
  margin-right: 8px;
  vertical-align: -3px;
}

.brand span {
  color: var(--primary);
}

/* Hover underline animation on the word "Codes" */
.brand span {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: background-size .4s ease;
}

.brand:hover span {
  background-size: 100% 2px;
}

.nav-links {
  display: none;
  /* Hidden by default on mobile */
  align-items: center;
  gap: 24px;
}

/* Darker, clearer nav link text */
.nav-links a {
  font-weight: 700;
  color: var(--text);
  opacity: 0.95;
  /* slightly darker */
  position: relative;
}

@media (max-width: 899px) {
  .nav-links {
    gap: 12px;
    margin-right: 8px;
  }

  .nav-links a {
    font-size: 13px;
    font-weight: 600;
  }
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}

.nav-actions #langToggle {
  order: 1;
}

.nav-actions .ui-switch {
  order: 2;
}

.nav-actions .menu-btn {
  order: 3;
  /* Hamburger rightmost */
}

/* Mobile layout overrides */
@media (max-width: 899px) {
  .nav {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
  }

  /* Full-width overlay mobile navigation panel */
  #primaryNav.nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 45vh;
    /* Covers top half */
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 100px 32px 48px;
    /* Room for header items */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--border);
    border-radius: 0 0 32px 32px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.1);
    z-index: 99;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    transform: translateY(-100%);
    opacity: 0;
  }

  :root.dark #primaryNav.nav-links {
    background: rgba(15, 23, 42, 0.85);
  }

  /* When open */
  #primaryNav.nav-links.open {
    display: flex !important;
    transform: translateY(0);
    opacity: 1;
  }

  #primaryNav.nav-links a {
    font-size: 28px;
    font-weight: 800;
    padding: 8px 16px;
    border: 0;
    opacity: 0;
    transform: translateY(20px);
  }

  #primaryNav.nav-links.open a {
    animation: navLinkFade 0.5s ease forwards;
  }

  #primaryNav.nav-links.open a:nth-child(1) {
    animation-delay: 0.1s;
  }

  #primaryNav.nav-links.open a:nth-child(2) {
    animation-delay: 0.2s;
  }

  #primaryNav.nav-links.open a:nth-child(3) {
    animation-delay: 0.3s;
  }

  @keyframes navLinkFade {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .menu-btn {
    display: inline-flex !important;
  }

  /* Blur effect for the rest of the page when menu is open */
  body.nav-open main,
  body.nav-open .site-footer,
  body.nav-open .hero,
  body.nav-open section:not(.site-header) {
    filter: blur(8px);
    transition: filter 0.4s ease;
    pointer-events: none;
    user-select: none;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* Desktop layout center links */
@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
}

/* Language dropdown */
.nav-actions {
  position: relative;
}

.lang-menu {
  position: absolute;
  top: 48px;
  /* show below the icon */
  right: 0;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 50;
}

.lang-option {
  display: flex !important;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background .22s ease, transform .18s ease;
}

.lang-option:hover {
  background: rgba(0, 0, 0, 0.04);
}

:root.dark .lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lang-option[aria-checked="true"] {
  background: rgba(99, 102, 241, 0.12);
}

:root.dark .lang-option[aria-checked="true"] {
  background: rgba(129, 140, 248, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  .lang-option {
    transition: none;
  }
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform .25s ease, background .28s ease, border-color .28s ease, box-shadow .28s ease, filter .28s ease;
}

.icon-btn:hover {
  filter: brightness(0.98);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.icon-btn:active {
  transform: translateY(0);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.icon-img {
  width: 20px;
  height: 20px;
  display: block;
  margin: 0 auto;
  /* Force black icons regardless of theme colors */
  filter: brightness(0) saturate(100%);
}

:root.dark .icon-img {
  /* Turn black SVGs into white in dark mode */
  filter: invert(1) brightness(2) contrast(1.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  transition: transform .22s ease, background .28s ease, color .28s ease, border .28s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

/* Generic button hover/focus animations */
.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), 0 0 0 3px rgba(99, 102, 241, 0.10);
}

:root.dark .btn:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), 0 0 0 3px rgba(129, 140, 248, 0.12);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

/* =====
   Hero
   ===== */
.hero {
  padding: 56px 0 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 899px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 24px;
    padding-top: 20px;
  }

  .hero-copy {
    order: 2;
  }

  .hero-figure {
    order: 1;
    width: min(240px, 70%);
    /* slightly smaller on move mobile */
    margin-bottom: 8px;
  }
}

.hero-copy h1 {
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
}

/* Big name style */
.hero-name {
  font-size: clamp(34px, 7.2vw, 60px);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--primary-600), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Typewriter line */
.type-line {
  margin: 0 0 10px 0;
  font-weight: 800;
  font-size: clamp(16px, 3.6vw, 22px);
  letter-spacing: 0.2px;
}

.type-line .caret {
  display: inline-block;
  width: 10px;
  height: 1.1em;
  margin-left: 2px;
  border-right: 3px solid var(--text);
  transform: translateY(2px);
  animation: caretBlink 1s step-end infinite;
}

@keyframes caretBlink {
  50% {
    border-color: transparent;
  }
}

.highlight {
  color: var(--primary);
  font-weight: 800;
}

.lede {
  color: var(--muted);
  max-width: 60ch;
}

.cta {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

@media (max-width: 899px) {
  .cta {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .cta {
    flex-direction: column;
    gap: 12px;
  }

  .cta .btn {
    width: 100%;
  }
}

/* Enlarge hero CTA buttons slightly */
.hero .cta .btn {
  padding: 14px 24px;
  /* larger than previous */
  font-size: 16px;
  /* larger text for emphasis */
}

.btn.ghost {
  background: transparent;
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--surface);
}

.btn.solid {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn.solid:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.hero-figure {
  justify-self: center;
  width: min(360px, 80%);
  aspect-ratio: 1 / 1;
  border-radius: 55% 45% 60% 40% / 45% 60% 40% 55%;
  /* forme organique/ovale */
  overflow: hidden;
  background: radial-gradient(120% 120% at 70% 20%, rgba(99, 102, 241, 0.15), transparent), var(--surface);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow);
  position: relative;
  animation: hero-blob 8s ease-in-out infinite;
  /* faster morphing border */
}

.hero-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Pulsing glow ring around the photo */
.hero-figure::after {
  content: '';
  position: absolute;
  inset: 0;
  /* align with the border */
  border-radius: inherit;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.15), 0 0 20px 0 rgba(99, 102, 241, 0.10);
  animation: hero-glow 2.2s ease-in-out infinite;
  /* faster glow */
}

@keyframes hero-blob {
  0% {
    border-radius: 55% 45% 60% 40% / 45% 60% 40% 55%;
  }

  25% {
    border-radius: 60% 40% 55% 45% / 40% 55% 45% 60%;
  }

  50% {
    border-radius: 50% 50% 45% 55% / 55% 45% 60% 40%;
  }

  75% {
    border-radius: 58% 42% 62% 38% / 42% 62% 38% 58%;
  }

  100% {
    border-radius: 55% 45% 60% 40% / 45% 60% 40% 55%;
  }
}

@keyframes hero-glow {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.14), 0 0 20px 0 rgba(99, 102, 241, 0.12);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.22), 0 0 32px 6px rgba(99, 102, 241, 0.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-figure {
    animation: none;
  }

  .hero-figure::after {
    animation: none;
  }
}

/* =======
   Sections
   ======= */
.quote-block {
  padding: 8px 0 24px;
  display: flex;
  justify-content: center;
}

.quote-block blockquote {
  margin: 0;
}

.quote-block blockquote p {
  margin: 16px auto 0;
  width: min(820px, 92%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
}

/* Scrolling ribbon */
.ribbon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--primary-600), var(--primary));
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 22px 0;
  /* plus grand */
  margin: 28px 0;
  /* donner de l'air autour de l'inclinaison */
  transform: skewY(-6deg);
  transform-origin: center;
  box-shadow: var(--shadow);
  /* Fade edges */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.ribbon-inner {
  /* Laisser le texte oblique comme le ruban */
  transform: none;
}

.ribbon-track {
  display: inline-flex;
  flex-wrap: nowrap;
  /* keep all items on a single row */
  gap: 64px;
  /* espacement légèrement plus grand */
  white-space: nowrap;
  padding-left: 24px;
  font-weight: 700;
  font-size: clamp(15px, 2.2vw, 20px);
  /* texte plus grand et responsive */
  letter-spacing: 0.2px;
  animation: ribbon-scroll 18s linear infinite;
  will-change: transform;
}

.ribbon-track span {
  opacity: 0.95;
  white-space: nowrap;
  /* force each label to stay on one line */
  display: inline-block;
  word-break: keep-all;
  /* avoid breaking words */
  hyphens: none;
  /* prevent automatic hyphenation */
}

.ribbon .ribbon-track+.ribbon-track {
  animation-delay: -9s;
}

@keyframes ribbon-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.placeholder-section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.placeholder-section h2 {
  margin: 0 0 12px 0;
}

.placeholder-section p {
  color: var(--muted);
}

/* Certifications */
#certifications {
  padding: 40px 0;
}

#certifications .section-title {
  margin: 0 0 18px 0;
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.cert-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: transform .22s ease, box-shadow .22s ease;
  will-change: transform;
  position: relative;
}

.cert-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.cert-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.cert-year {
  font-weight: 700;
  color: var(--primary);
}

.cert-issuer {
  margin: 10px 0 12px 0;
  color: var(--muted);
}

.cert-actions {
  margin-top: auto;
}

.btn-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.btn-link:hover {
  border-bottom-color: var(--primary);
}

/* Hover/focus effect with primary-tinted glow for certifications */
.cert-card:hover,
.cert-card:focus-within {
  transform: scale(1.02);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.12),
    0 0 0 3px rgba(99, 102, 241, 0.10),
    0 12px 28px rgba(99, 102, 241, 0.12);
  z-index: 1;
}

:root.dark .cert-card:hover,
:root.dark .cert-card:focus-within {
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.42),
    0 0 0 3px rgba(129, 140, 248, 0.18),
    0 12px 28px rgba(129, 140, 248, 0.22);
}

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

@media (max-width: 640px) {
  .certs-grid {
    grid-template-columns: 1fr;
  }
}

/* =======
   Skills
   ======= */
#skills h2 {
  margin-bottom: 18px;
}

.skills-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  /* colonne gauche plus large */
  gap: 36px;
  /* plus d'espace */
  align-items: start;
}

.skills-tabs {
  display: grid;
  gap: 10px;
}

.skills-tabs .tab {
  text-align: left;
  padding: 14px 18px;
  /* onglets plus grands */
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  transition: transform .25s ease, box-shadow .28s ease, background .28s ease, border-color .28s ease, color .28s ease;
}

.skills-tabs .tab:hover {
  filter: brightness(0.98);
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.skills-tabs .tab:active {
  transform: translateY(0);
}

.skills-tabs .tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.skills-tabs .tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.skills-content {
  background: transparent;
  border: none;
}

.skills-content .panel {
  display: none;
}

.skills-content .panel.active {
  display: block;
}

.skills-content p {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.8;
}

.skills-content p span {
  color: var(--muted);
}

.skills-content strong {
  font-weight: 700;
}

/* Designer six-line list */
.skills-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 10px;
}

.skills-list li {
  color: var(--text);
}

.skills-list li span {
  color: var(--muted);
}

/* ===== Services (Mes Services) ===== */
#specialize .services-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 16px;
}

#specialize .services-header .overline {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .2px;
  color: var(--muted);
  font-weight: 900;
}

#specialize .services-header .title {
  margin: 10px 0 10px;
  font-size: clamp(22px, 3.6vw, 30px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--text);
}

#specialize .services-header .desc {
  margin: 0 auto;
  color: var(--muted);
  max-width: 70ch;
  font-size: clamp(14px, 1.8vw, 16px);
}

#specialize .services-header .divider {
  display: block;
  width: 80px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--primary);
  border-radius: 999px;
  opacity: .85;
}

#specialize .service-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

#specialize .service-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

#specialize .service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .12);
  border-color: rgba(99, 102, 241, 0.25);
}

#specialize .service-card h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .2px;
}

#specialize .service-card p {
  margin: 0;
  color: var(--muted);
}

#specialize .service-card .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid var(--border);
}

/* Animated service icons (float + glow on card hover) */
#specialize .service-card .icon-circle {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

#specialize .service-card .icon-circle i {
  transition: transform .25s ease;
  will-change: transform;
}

#specialize .service-card:hover .icon-circle {
  transform: translateY(-2px);
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(99, 102, 241, 0.10);
}

#specialize .service-card:hover .icon-circle i {
  transform: scale(1.08) rotate(-3deg);
}

@keyframes serviceIconFloat {

  0%,
  100% {
    transform: translateY(-2px);
  }

  50% {
    transform: translateY(1px);
  }
}

#specialize .service-card:hover .icon-circle {
  animation: serviceIconFloat 2.4s ease-in-out infinite;
}

/* Animated underline for “En savoir plus” links */
#specialize .service-card .learn-more {
  position: relative;
  padding-bottom: 2px;
  font-weight: 800;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .08s ease;
}

#specialize .service-card .learn-more .arrow {
  transition: transform .18s ease;
}

#specialize .service-card .learn-more:hover .arrow {
  transform: translateX(2px);
}

#specialize .service-card .learn-more::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #06b6d4);
  border-radius: 2px;
  transition: width .28s ease;
}

#specialize .service-card .learn-more:hover::after {
  width: 100%;
}

#specialize .service-card .learn-more:active {
  transform: scale(0.98);
}

@media (max-width: 1000px) {
  #specialize .service-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #specialize .service-cards {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {

  #specialize .service-card .icon-circle,
  #specialize .service-card .icon-circle i,
  #specialize .service-card .learn-more,
  #specialize .service-card .learn-more::after {
    transition: none;
    animation: none;
  }
}

@media (max-width: 800px) {
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .skills-tabs {
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 6px;
  }
}

/* =======
   Footer
   ======= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 14px;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--text);
}

/* ============
   Responsive
   ============ */
@media (min-width: 900px) {
  .nav {
    grid-template-columns: 1fr auto 1fr;
  }

  .nav-links {
    display: flex;
    justify-self: center;
  }

  .hero {
    padding: 80px 0 48px;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
  }

  .hero-figure {
    width: 420px;
  }
}

/* Extra-small phones (e.g., 320–360px width) */
@media (max-width: 360px) {
  .social-grid {
    grid-template-columns: 1fr;
  }

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

  /* Make CTAs easy to tap and avoid wrapping glitches */
  .hero .cta .btn {
    width: 100%;
  }
}

/* Final Mobile Refinements */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  .tool-card {
    padding: 10px;
  }

  .tool-card span {
    font-size: 0.85rem;
  }
}

/* Scroll Fix */
body {
  overflow-x: hidden;
}

/* ===== Typing Indicator (3 bouncing dots) ===== */
.typing {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}

.typing .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.6;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* ===== Chat Socials Block (Premium) ===== */
.chat-socials-block {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  margin-top: 20px;
}

.chat-socials-block.visible {
  display: block;
  opacity: 1;
}

/* Divider with centered text */
.chat-socials-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.chat-socials-divider span {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.chat-socials-divider p {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

/* Social cards row */
.chat-socials-row {
  display: flex;
  gap: 10px;
}

.chat-social-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}

.chat-social-card .icon-img {
  width: 24px;
  height: 24px;
}

.chat-social-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.chat-social-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}

.chat-social-card:hover span {
  color: var(--primary);
}

:root.dark .chat-social-card:hover {
  box-shadow: 0 8px 20px rgba(129, 140, 248, 0.2);
}

/* Smaller typing dots */
.typing .dot {
  width: 6px;
  height: 6px;
}

/* Smaller social card icons */
.chat-social-card .icon-img {
  width: 18px;
  height: 18px;
}

.chat-social-card {
  padding: 10px 8px;
}

/* ===== About Cards (Formation / Education / Projets) ===== */
.about-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.12);
}

:root.dark .about-card:hover {
  box-shadow: 0 14px 32px rgba(129, 140, 248, 0.18);
}

.about-card .card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  margin-bottom: 12px;
}

.about-card .card-icon svg {
  width: 20px;
  height: 20px;
}

.about-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}

/* Formation slider */
.about-card .badge-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.about-card .badge {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.about-card .badge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.about-card .badge-header .title {
  font-weight: 700;
  font-size: 13px;
}

.about-card .year-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
}

.about-card .meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.about-card .form-slider {
  display: flex;
  align-items: center;
  gap: 6px;
}

.about-card .form-slider .certs-nav {
  width: 24px;
  height: 24px;
  font-size: 14px;
  flex-shrink: 0;
}

.about-card .form-list {
  flex: 1;
  overflow: hidden;
}

/* Education content */
.education-content .degree {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}

.education-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.education-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 600;
  color: var(--muted);
}

.education-meta .status.active {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

/* Projects content */
.projects-content .stat-number {
  font-size: 32px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
  margin-bottom: 4px;
}

.projects-content .stat-label {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.projects-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.projects-tags .tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Responsive */
@media (max-width: 900px) {
  .about-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ===== Education entries ===== */
.edu-entry {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}

.edu-entry:last-child {
  margin-bottom: 0;
}

.edu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.edu-header .degree {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

.year-badge.current {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.education-meta .duration {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-weight: 600;
  color: var(--muted);
}