/* ============================================================
   TEMPLATE 03 — LIQUID GLASS
   Frosted translucent panels floating over a slow aurora of
   blue, violet and cyan. Light mode = pastel daylight aurora.
   USE: load AFTER ledger-terminal.css
   NOTE: --amber is the main accent slot (electric blue), --teal is the second (aqua).
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap");

:root {
  --bg: #070b1a;
  --bg-alt: rgba(0, 0, 0, 0.28);
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.09);
  --surface-hover: rgba(255, 255, 255, 0.13);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.28);

  --text: #f1f4ff;
  --text-muted: #a9b4d6;
  --text-faint: #6f7ba3;

  --amber: #7aa7ff;
  --amber-dim: #5a86e0;
  --teal: #5ef0d0;
  --teal-dim: #34c2a6;
  --amber-soft: rgba(122, 167, 255, 0.16);
  --teal-soft: rgba(94, 240, 208, 0.16);

  --grid-line: transparent;
  --shadow-stamp: 0 20px 50px -24px rgba(0, 0, 0, 0.6);
  --shadow-stamp-accent: 0 20px 50px -24px var(--amber);

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --radius-pill: 999px;

  --font-en: "Outfit", "Inter", sans-serif;
  --font-mono: "Outfit", "Inter", sans-serif;
}

body.light-theme {
  --bg: #eaf0ff;
  --bg-alt: rgba(255, 255, 255, 0.5);
  --surface: rgba(255, 255, 255, 0.55);
  --surface-2: rgba(255, 255, 255, 0.7);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --border: rgba(255, 255, 255, 0.9);
  --border-strong: rgba(15, 21, 48, 0.18);

  --text: #0f1530;
  --text-muted: #46507a;
  --text-faint: #8a93b8;

  --amber: #3b5bff;
  --amber-dim: #2a45d6;
  --teal: #00a3b8;
  --teal-dim: #007f90;
  --amber-soft: rgba(59, 91, 255, 0.12);
  --teal-soft: rgba(0, 163, 184, 0.12);

  --shadow-stamp: 0 20px 50px -26px rgba(15, 21, 48, 0.25);
}

/* aurora background, fixed so the glass has something to blur */
body {
  background:
    radial-gradient(60vw 50vh at 12% 8%, rgba(43, 76, 255, 0.38), transparent 70%),
    radial-gradient(55vw 55vh at 88% 18%, rgba(138, 61, 255, 0.3), transparent 70%),
    radial-gradient(70vw 50vh at 50% 105%, rgba(0, 212, 255, 0.22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body.light-theme {
  background:
    radial-gradient(60vw 50vh at 12% 8%, rgba(122, 167, 255, 0.55), transparent 70%),
    radial-gradient(55vw 55vh at 88% 18%, rgba(196, 160, 255, 0.45), transparent 70%),
    radial-gradient(70vw 50vh at 50% 105%, rgba(120, 232, 255, 0.4), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  background: radial-gradient(
    520px circle at var(--mx, 50%) var(--my, 10%),
    rgba(255, 255, 255, 0.08),
    transparent 62%
  );
}

/* the glass itself */
.skill-card,
.about-card,
.education-card,
.service-card,
.experience-content,
.certificate-card,
.project-card,
.contact-box,
.modal-content,
.profile-modal-content,
.header {
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.skill-card,
.about-card,
.education-card,
.service-card,
.experience-content,
.certificate-card,
.project-card,
.contact-box,
.modal-content,
.profile-modal-content {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    var(--shadow-stamp);
}
.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 30px 60px -26px var(--amber);
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 20px 40px -24px var(--amber);
}

.section-label::before,
.section-label::after {
  content: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--teal));
  color: #06101f;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px -12px var(--amber);
}
.btn-outline {
  background: var(--surface);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}


/* ============================================================
   HORIZONTAL SCROLLERS (experience / certifications / projects)
   ============================================================ */
.hscroll {
  position: relative;
}

.hscroll-track {
  display: flex !important;
  flex-direction: row !important;
  gap: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 18px 14px 30px;
  margin-inline: -14px;
  cursor: grab;
  outline: none;
}
.hscroll-track::-webkit-scrollbar {
  display: none;
}
.hscroll-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}
.hscroll-track.is-dragging a,
.hscroll-track.is-dragging img {
  pointer-events: none;
}
.hscroll-track:focus-visible {
  box-shadow: 0 0 0 2px var(--amber-soft);
  border-radius: var(--radius-l);
}

/* each card becomes a snap slide */
.hscroll-track > * {
  flex: 0 0 min(380px, 86%);
  scroll-snap-align: start;
  scroll-margin-inline: 14px;
  margin: 0;
}
.hscroll-track.projects-grid > * {
  flex-basis: min(480px, 88%);
}
.hscroll-track.experience-timeline > * {
  flex-basis: min(440px, 88%);
}

/* experience: turn the vertical timeline into a horizontal row */
.hscroll-track.experience-timeline {
  padding-inline-start: 14px;
  gap: 22px;
}
.hscroll-track.experience-timeline::before {
  content: none;
}
.hscroll-track.experience-timeline .experience-marker {
  display: none;
}
.hscroll-track.experience-timeline .experience-item {
  align-items: stretch;
}
.hscroll-track.experience-timeline .experience-item:hover .experience-content,
html[dir="rtl"]
  .hscroll-track.experience-timeline
  .experience-item:hover
  .experience-content {
  transform: translateY(-8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 26px 46px -26px var(--amber);
}

/* certificates: equal-height cards, footer pinned to the bottom */
.hscroll-track.certifications-grid .certificate-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.hscroll-track.certifications-grid .certificate-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.hscroll-track.certifications-grid .certificate-footer {
  margin-top: auto;
}

/* controls bar */
.hscroll-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}
.hscroll-progress {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hscroll-thumb {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 30%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transition:
    inset-inline-start 0.15s linear,
    width 0.25s var(--ease);
}
.hscroll-buttons {
  display: flex;
  gap: 10px;
}
.hscroll-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--amber);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    var(--shadow-stamp);
  transition:
    transform 0.3s var(--ease-spring),
    background 0.25s var(--ease),
    color 0.25s var(--ease),
    opacity 0.25s var(--ease);
}
.hscroll-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--amber), var(--teal));
  color: #06101f;
}
.hscroll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
html[dir="rtl"] .hscroll-btn i {
  transform: scaleX(-1);
}

@media (max-width: 640px) {
  .hscroll-track {
    gap: 14px;
  }
  .hscroll-btn {
    width: 40px;
    height: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hscroll-track {
    scroll-behavior: auto;
  }
}

/* ============================================================
   PROFILE PHOTO — keep the head in frame inside the round crops
   (object-fit: cover centers the photo and cuts the top; anchor it
   to the top instead. Adjust the 2nd value: 0% = top, 100% = bottom)
   ============================================================ */
.nav-profile-pic,
.profile-modal-image img {
  object-fit: cover;
  object-position: 50% 0%;
}

/* ============================================================
   ABOUT — heading lives in the left column, cards sit beside it
   ============================================================ */
.about-text .section-heading {
  margin-bottom: 28px;
}

/* ============================================================
   ABOUT CARDS — horizontal swipe on mobile
   ============================================================ */
@media (max-width: 640px) {
  .about-cards {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* bleed to the screen edges so the next card peeks in */
    margin-inline: -24px;
    padding: 12px 24px 24px;
    scroll-padding-inline: 24px;
  }
  .about-cards::-webkit-scrollbar {
    display: none;
  }
  .about-card {
    flex: 0 0 76%;
    min-width: 230px;
    scroll-snap-align: start;
  }
  .about-card:hover {
    transform: none;
  }
}
@media (max-width: 380px) {
  .about-cards {
    margin-inline: -14px;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
  }
}

/* ============================================================
   SERVICES — horizontal swipe on mobile
   ============================================================ */
@media (max-width: 640px) {
  .services-grid {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -24px;
    padding: 12px 24px 24px;
    scroll-padding-inline: 24px;
  }
  .services-grid::-webkit-scrollbar {
    display: none;
  }
  .service-card {
    flex: 0 0 76%;
    min-width: 230px;
    scroll-snap-align: start;
  }
  /* cards beyond the screen edge must already be visible */
  .services-grid .service-card.reveal {
    opacity: 1;
    transform: none;
  }
  .service-card:hover,
  .service-card:hover > i {
    transform: none;
  }
}
@media (max-width: 380px) {
  .services-grid {
    margin-inline: -14px;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
  }
}

/* ============================================================
   Mobile-only scroll controls (About cards, Services)
   ============================================================ */
@media (min-width: 641px) {
  .hscroll-mobile .hscroll-controls {
    display: none !important;
  }
}
@media (max-width: 640px) {
  .hscroll-mobile .hscroll-controls {
    margin-top: 0;
  }
}
.hscroll {
  min-width: 0;
  max-width: 100%;
}

/* ============================================================
   ABOUT — vertically center the cards next to the text (desktop)
   ============================================================ */
@media (min-width: 901px) {
  .about-grid {
    align-items: center;
  }
  .about-cards {
    gap: 20px;
  }
}

/* ============================================================
   HERO VISUAL — portrait + rotating project dashboard
   ============================================================ */
.hv {
  position: relative;
  width: 100%;
  height: 520px;
}

/* dashboard card */
.hv-dash {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  width: 82%;
  padding: 20px 20px 16px;
  border-radius: var(--radius-l);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    var(--shadow-stamp);
  transform: rotate(3deg);
  transform-origin: top right;
  z-index: 1;
  cursor: pointer;
  outline: none;
  transition:
    transform 0.45s var(--ease-spring),
    border-color 0.3s var(--ease);
}
.hv-dash:hover,
.hv-dash:focus-visible {
  border-color: var(--amber);
  transform: rotate(1.5deg) translateY(-4px);
}
html[dir="rtl"] .hv-dash {
  transform: rotate(-3deg);
  transform-origin: top left;
}
html[dir="rtl"] .hv-dash:hover,
html[dir="rtl"] .hv-dash:focus-visible {
  transform: rotate(-1.5deg) translateY(-4px);
}
.hv-body {
  transition:
    opacity 0.26s var(--ease),
    transform 0.26s var(--ease);
}
.hv-body.is-out {
  opacity: 0;
  transform: translateY(8px);
}
.hv-dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.hv-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv-tag {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: #06101f;
  background: linear-gradient(135deg, var(--amber), var(--teal));
}
.hv-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hv-kpi {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}
.hv-kpi b {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--amber);
  white-space: nowrap;
}
.hv-kpi span {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hv-cap {
  margin: 12px 0 6px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* chart area keeps a fixed height so the card never jumps */
.hv-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 150px;
}
.hv-line {
  flex: 0 0 62px;
  display: block;
  width: 100%;
  height: 62px;
}
.hv-chart.no-line .hv-line {
  display: none;
}
.hv-line path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: hv-draw 1.4s var(--ease) 0.15s forwards;
}
@keyframes hv-draw {
  to { stroke-dashoffset: 0; }
}
.hv-bars {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
}
.hv-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hv-col {
  position: relative;
  flex: 1;
  min-height: 0;
}
.hv-col i {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: var(--h);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(var(--amber), var(--teal));
  transform-origin: bottom;
  animation: hv-grow 0.9s var(--ease-snap) both;
  animation-delay: calc(var(--n) * 0.07s);
}
.hv-col em {
  position: absolute;
  inset-inline: -6px;
  bottom: calc(var(--h) + 3px);
  text-align: center;
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  animation: hv-fade 0.5s ease 0.5s both;
}
.hv-bar small {
  font-size: 0.58rem;
  text-align: center;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes hv-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes hv-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* progress dots */
.hv-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.hv-dots button {
  position: relative;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  overflow: hidden;
  cursor: pointer;
  transition: width 0.35s var(--ease);
}
.hv-dots button.active {
  width: 30px;
}
.hv-dots button.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transform-origin: left;
  animation: hv-fill var(--hv-int, 6s) linear forwards;
}
html[dir="rtl"] .hv-dots button.active::after {
  transform-origin: right;
}
.hv-dots.paused button.active::after {
  animation-play-state: paused;
}
@keyframes hv-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* portrait in front */
.hv-photo {
  position: absolute;
  bottom: 0;
  inset-inline-start: 2%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  z-index: 2;
  box-shadow:
    0 0 0 6px var(--surface-2),
    0 0 60px -6px var(--amber);
}
.hv-photo::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--amber), var(--teal), #b48cff, var(--amber));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: hv-spin 8s linear infinite;
}
@keyframes hv-spin {
  to { transform: rotate(360deg); }
}
.hv-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 0%;
  background: var(--surface-2);
}

/* floating chip */
.hv-chip {
  position: absolute;
  bottom: 9%;
  inset-inline-end: 2%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-stamp);
  animation: hv-bob 5s ease-in-out infinite;
}
.hv-chip div {
  display: flex;
  flex-direction: column;
}
.hv-chip strong {
  font-size: 0.85rem;
  color: var(--text);
}
.hv-chip div span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.hv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}
@keyframes hv-bob {
  50% { transform: translateY(-10px); }
}

@media (max-width: 480px) {
  .hv { height: 480px; }
  .hv-dash { width: 90%; padding: 16px 16px 14px; }
  .hv-kpi { padding: 8px 9px; }
  .hv-kpi b { font-size: 1.05rem; }
  .hv-chart { height: 132px; }
  .hv-line { flex-basis: 52px; height: 52px; }
  .hv-photo { width: 150px; height: 150px; }
  .hv-chip { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hv-line path, .hv-col i, .hv-col em, .hv-photo::before, .hv-chip,
  .hv-dots button.active::after {
    animation: none;
  }
  .hv-line path { stroke-dashoffset: 0; }
  .hv-dots button.active::after { transform: scaleX(1); }
  .hv-body { transition: none; }
}

/* ============================================================
   FIXES — hero width, hero top spacing, equal certificate cards
   ============================================================ */

/* The hero visual only contains absolutely positioned children, so with
   margin-inline:auto it collapsed to zero width on tablets/phones. */
.hero-visual {
  width: 100%;
}

/* less empty space between the navbar and the hero */
.hero.section {
  padding-block: 56px 90px;
}
@media (max-width: 960px) {
  .hero.section {
    padding-block: 28px 64px;
  }
}
@media (max-width: 480px) {
  .hero.section {
    padding-block: 18px 48px;
  }
  .availability-badge {
    margin-bottom: 20px;
  }
}
@media (max-width: 380px) {
  .hv-kpis { gap: 8px; }
  .hv-kpi b { font-size: 0.98rem; }
  .hv-dash { width: 94%; }
}

/* certificate cards: identical size.
   (height:100% stopped the flex row from stretching them equally) */
.hscroll-track.certifications-grid > .certificate-card {
  height: auto;
  align-self: stretch;
  flex: 0 0 min(380px, 86%);
}
.hscroll-track.certifications-grid .certificate-card .certificate-content {
  flex: 1;
}

/* ============================================================
   SKILLS — grouped tools & technologies (liquid glass)
   ============================================================ */
.skill-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
}
.skill-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    var(--shadow-stamp);
  overflow: hidden;
  transition:
    transform 0.4s var(--ease-spring),
    border-color 0.3s var(--ease),
    box-shadow 0.35s var(--ease);
}
.skill-group::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 14%;
  height: 2px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, transparent, var(--amber), var(--teal), transparent);
  opacity: 0.75;
}
.skill-group::after {
  content: "";
  position: absolute;
  inset-inline-end: -60px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--amber-soft), transparent 70%);
  pointer-events: none;
}
.skill-group:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 26px 50px -26px var(--amber);
}

.skill-group-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.skill-group-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.15rem;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid var(--border);
}
.skill-group-title {
  min-width: 0;
}
.skill-group-title h3 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin: 0;
}
.skill-group-title small {
  display: block;
  margin-top: 3px;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.skill-group-num {
  margin-inline-start: auto;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-faint);
  opacity: 0.55;
}

.skill-list {
  position: relative;
  z-index: 1;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-auto-rows: minmax(58px, 1fr);
}
.skill-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition:
    transform 0.3s var(--ease-spring),
    border-color 0.25s var(--ease),
    box-shadow 0.3s var(--ease);
}
.skill-item:hover {
  transform: translateX(5px);
  border-color: var(--icon-c, var(--amber));
  box-shadow: 0 14px 28px -18px var(--icon-c, var(--amber));
}
html[dir="rtl"] .skill-item:hover {
  transform: translateX(-5px);
}
.skill-item .skill-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 12px;
  font-size: 1.05rem;
}
.skill-item:hover .skill-icon {
  transform: scale(1.08);
}
.skill-name {
  min-width: 0;
  font-weight: 600;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

/* tablet: panels stack, tools sit in a row inside each panel */
@media (max-width: 1024px) {
  .skill-groups {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .skill-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    grid-auto-rows: auto;
  }
}
/* phone: compact two-column tools */
@media (max-width: 640px) {
  .skill-group {
    padding: 20px 16px;
    gap: 16px;
  }
  .skill-group-icon {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
  .skill-group-num {
    font-size: 1.35rem;
  }
  .skill-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .skill-item {
    gap: 10px;
    padding: 10px 12px;
  }
  .skill-item .skill-icon {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
  .skill-name {
    font-size: 0.9rem;
  }
  .skill-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .skill-item:hover,
  html[dir="rtl"] .skill-item:hover,
  .skill-group:hover {
    transform: none;
  }
}

/* ============================================================
   TRAINING CARDS — fixed header, centered content, tags at the bottom
   ============================================================ */
.experience-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: stretch;
}
/* header always starts at the same place and takes the same room */
.experience-top {
  flex: 0 0 auto;
  margin-bottom: 0;
  min-height: 92px;
  align-content: flex-start;
}
/* the two auto margins share the leftover space equally, so the
   description + bullet list sit centered between header and tags */
.experience-description {
  margin: auto 0 0;
}
.experience-list {
  margin: 0;
}
/* tags are pinned to the bottom of every card */
.experience-tools {
  margin-top: auto;
  padding-top: 4px;
}
@media (max-width: 640px) {
  .experience-top {
    min-height: 0;
  }
}

/* ============================================================
   PROJECT IMAGES — show every dashboard in full (no cropping)
   The old 16:10 frame + object-fit: cover cut the sides off wide
   screenshots (Superstore, Bean Cafe). The frame is now 2:1, close
   to the screenshots, and the image is fitted inside it.
   ============================================================ */
.project-image {
  aspect-ratio: 2 / 1;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 20% 0%, var(--amber-soft), transparent 60%),
    var(--surface-2);
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project-card:hover .project-image img {
  transform: scale(1.04);
}

/* ============================================================
   PROJECT POPUP — show the whole screenshot (no cropping)
   Single-image projects (Superstore, Bean Cafe) were forced into a
   16:9 frame with object-fit: cover. They now keep their own shape,
   like the multi-image galleries already did.
   ============================================================ */
.modal-image {
  aspect-ratio: auto;
}
.modal-image > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.modal-image-placeholder {
  min-height: 220px;
}

/* ============================================================
   PROJECT CARDS — tags on top, title below them, description centered,
   button at the bottom (same on every card)
   ============================================================ */
.project-card {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.project-image {
  flex: 0 0 auto;
}
.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* tags stay above the title */
.project-tags {
  order: 0;
  margin: 0;
}
/* title: same spot and same room in every card */
.project-content h3 {
  order: 1;
  margin: 0;
  line-height: 1.3;
  min-height: 2.6em;
}
/* description: equal auto margins above and below, so it sits centered
   between the title and the button */
.project-content > p {
  order: 2;
  margin: auto 0;
}
/* button: always the last item, at the bottom */
.project-content .project-details-btn {
  order: 3;
  align-self: flex-start;
  margin: 0;
}
@media (max-width: 640px) {
  .project-content {
    padding: 20px;
  }
}

/* ============================================================
   LANDING-PAGE POLISH — skip link, hero hierarchy, tagline reveal
   ============================================================ */

/* skip to content: hidden until focused with the keyboard */
.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 10000;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: #06101f;
  background: linear-gradient(135deg, var(--amber), var(--teal));
  transform: translateY(-160%);
  transition: transform 0.4s var(--ease-snap);
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* one main action in the hero; the rest are quieter */
.hero-buttons {
  align-items: center;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition:
    color 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.hero-link:hover,
.hero-link:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
}
.hero-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.hero-proof-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

/* tagline reveal */
.tagline.section {
  padding-block: 96px;
}
.tagline-text {
  max-width: 880px;
  margin-inline: auto;
  text-align: center;
  font-size: clamp(1.75rem, 4.6vw, 3.5rem);
  line-height: 1.2;
  font-weight: 600;
  color: var(--text);
}
.tagline-text .tw {
  opacity: 0.28;
  transition: opacity 0.6s var(--ease-snap);
}
.tagline-text .tw.on {
  opacity: 1;
}
@media (max-width: 640px) {
  .tagline.section {
    padding-block: 64px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tagline-text .tw {
    transition: none;
    opacity: 1;
  }
}

/* copy rules: no lonely last word */
h1, h2, h3 {
  text-wrap: balance;
}
p, li {
  text-wrap: pretty;
}

/* ============================================================
   PROJECT CARDS (mobile) — tags | title | description (centered) | button
   Grid rows: the description row takes all free space and centers its
   text vertically; the button is always the last row at the bottom.
   ============================================================ */
@media (max-width: 640px) {
  .project-content {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 14px;
    align-content: stretch;
  }
  .project-tags {
    margin: 0;
  }
  .project-content h3 {
    margin: 0;
  }
  .project-content > p {
    margin: 0;
    align-self: center;
  }
  .project-content .project-details-btn {
    margin: 0;
    align-self: end;
    justify-self: start;
  }
}

/* ============================================================
   MOBILE MENU — show every link (Projects and Contact were cut off)
   The panel was capped at 520px with overflow hidden, but 9 links need
   more room. It now uses the available screen height and scrolls if the
   phone is short.
   ============================================================ */
@media (max-width: 960px) {
  .nav-menu.active {
    max-height: calc(100vh - 76px);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav-menu .nav-link {
    padding-block: 13px;
  }
}

/* hero buttons on phones: main button on its own row, the other two
   side by side underneath (instead of three stacked buttons) */
@media (max-width: 480px) {
  .hero-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
  }
  .hero-buttons > :first-child {
    grid-column: 1 / -1;
  }
  .hero-buttons > * {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }
  .hero-buttons > :not(:first-child) {
    padding-inline: 10px;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

/* ============================================================
   TRAININGS — less text, more motion and depth
   ============================================================ */
@property --a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.experience-timeline {
  counter-reset: exp;
}
.experience-item {
  counter-increment: exp;
}
.experience-content {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  /* two soft color blobs that drift slowly behind the text */
  background-image:
    radial-gradient(circle at 20% 25%, var(--amber-soft), transparent 45%),
    radial-gradient(circle at 85% 80%, var(--teal-soft), transparent 45%);
  background-size: 160% 160%;
  animation: exp-drift 14s ease-in-out infinite alternate;
}
@keyframes exp-drift {
  to { background-position: 100% 100%; }
}
/* spinning gradient border */
.experience-content::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--a), transparent 0 62%, var(--amber), var(--teal), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: exp-spin 7s linear infinite;
  opacity: 0.55;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.experience-item:hover .experience-content::before {
  opacity: 1;
  animation-duration: 3s;
}
@keyframes exp-spin {
  to { --a: 360deg; }
}
/* big faint number */
.experience-content::after {
  content: counter(exp, decimal-leading-zero);
  position: absolute;
  inset-inline-end: 18px;
  bottom: 62px;
  font-size: 6.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  opacity: 0.045;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-spring);
}
.experience-item:hover .experience-content::after {
  opacity: 0.1;
  transform: translateY(-8px) scale(1.06);
}
/* type label with a pulsing dot */
.experience-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.experience-type::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 var(--teal);
  animation: exp-pulse 2.4s ease-out infinite;
}
@keyframes exp-pulse {
  70%, 100% { box-shadow: 0 0 0 9px transparent; }
}
/* date as a glass pill */
.experience-date {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
/* bullets: glowing markers that slide on hover, staggered */
.experience-list {
  margin: auto 0;
}
.experience-list li {
  transition: transform 0.45s var(--ease-spring);
}
.experience-item:hover .experience-list li {
  transform: translateX(8px);
}
html[dir="rtl"] .experience-item:hover .experience-list li {
  transform: translateX(-8px);
}
.experience-list li:nth-child(2) { transition-delay: 0.06s; }
.experience-list li:nth-child(3) { transition-delay: 0.12s; }
.experience-list li::marker,
.experience-list li::before {
  color: var(--teal);
  text-shadow: 0 0 10px var(--teal);
}
.experience-tools {
  margin-top: 0;
}
/* tags pop with a shimmer */
.experience-tools > span {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), border-color 0.25s var(--ease);
}
.experience-tools > span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
}
.experience-item:hover .experience-tools > span::after {
  transition: transform 0.9s var(--ease);
  transform: translateX(120%);
}
.experience-tools > span:hover {
  transform: translateY(-3px) scale(1.06);
  border-color: var(--amber);
}
@media (prefers-reduced-motion: reduce) {
  .experience-content,
  .experience-content::before,
  .experience-type::before {
    animation: none;
  }
  .experience-list li,
  .experience-item:hover .experience-list li {
    transition: none;
    transform: none;
  }
}

/* ============================================================
   MOTION + DESIGN PACK (CSS only)
   Everything below is wrapped so it switches off for visitors who
   prefer reduced motion. Pieces that use scroll timelines only run
   in browsers that support them; others simply skip them.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* 1. living aurora behind the page ------------------------- */
  body::after {
    content: "";
    position: fixed;
    inset: -25%;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(38vw 38vw at 20% 25%, rgba(94, 240, 208, 0.16), transparent 70%),
      radial-gradient(34vw 34vw at 80% 20%, rgba(138, 61, 255, 0.2), transparent 70%),
      radial-gradient(40vw 40vw at 60% 85%, rgba(59, 91, 255, 0.18), transparent 70%);
    filter: blur(30px);
    animation: aurora-drift 26s ease-in-out infinite alternate;
  }
  @keyframes aurora-drift {
    0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate3d(4%, -3%, 0) scale(1.08) rotate(6deg); }
    100% { transform: translate3d(-4%, 3%, 0) scale(1.02) rotate(-5deg); }
  }

  /* 2. section headings: pulsing dot + flowing gradient word -- */
  .section-label::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-inline-end: 10px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 0 var(--teal-soft);
    animation: dot-pulse 2.2s ease-out infinite;
  }
  @keyframes dot-pulse {
    0%   { box-shadow: 0 0 0 0 var(--teal-soft); }
    80%, 100% { box-shadow: 0 0 0 12px transparent; }
  }
  .section-heading h2 > span:last-child {
    background: linear-gradient(90deg, var(--amber), var(--teal), #b48cff, var(--amber));
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-flow 7s linear infinite;
  }
  @keyframes text-flow {
    to { background-position: 250% center; }
  }

  /* 3. buttons: moving light across the main button ---------- */
  .btn-primary {
    background-image:
      linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%),
      linear-gradient(135deg, var(--amber), var(--teal));
    background-size: 250% 100%, 100% 100%;
    background-repeat: no-repeat;
    background-position: 160% 0, 0 0;
    animation: btn-shine 4s ease-in-out infinite;
  }
  @keyframes btn-shine {
    0%, 55% { background-position: 160% 0, 0 0; }
    100%    { background-position: -60% 0, 0 0; }
  }
  .btn-outline:hover {
    border-color: var(--amber);
    box-shadow: 0 0 0 4px var(--amber-soft);
  }

  /* 4. icons float gently (uses `translate`, so hover scale still works) */
  .skill-icon,
  .skill-group-icon,
  .about-card > i,
  .service-card > i {
    animation: icon-float 5s ease-in-out infinite;
  }
  .skill-item:nth-child(2) .skill-icon { animation-delay: -1.2s; }
  .skill-item:nth-child(3) .skill-icon { animation-delay: -2.4s; }
  .skill-item:nth-child(4) .skill-icon { animation-delay: -3.6s; }
  .skill-group:nth-child(2) .skill-group-icon { animation-delay: -1.6s; }
  .skill-group:nth-child(3) .skill-group-icon { animation-delay: -3.2s; }
  .about-card:nth-child(even) > i,
  .service-card:nth-child(even) > i { animation-delay: -2.5s; }
  @keyframes icon-float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -5px; }
  }

  /* 5. timeline marker: soft radar ping ---------------------- */
  .experience-marker span {
    animation: marker-ping 2.6s ease-out infinite;
  }
  @keyframes marker-ping {
    0%   { box-shadow: 0 0 0 0 var(--amber-soft); }
    80%, 100% { box-shadow: 0 0 0 14px transparent; }
  }

  /* 6. tags and chips react to the pointer ------------------- */
  .experience-tools span,
  .project-tags span {
    transition:
      transform 0.3s var(--ease-spring),
      border-color 0.25s var(--ease),
      box-shadow 0.25s var(--ease);
  }
  .experience-tools span:hover,
  .project-tags span:hover {
    transform: translateY(-3px);
    border-color: var(--teal);
    box-shadow: 0 8px 18px -10px var(--teal);
  }

  /* 7. contact card breathes --------------------------------- */
  .contact-box {
    animation: box-breathe 5s ease-in-out infinite;
  }
  @keyframes box-breathe {
    0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 20px 50px -28px var(--amber); }
    50%      { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 28px 70px -22px var(--teal); }
  }

  /* 8. glass cards: light sweep across on hover -------------- */
  .project-card,
  .certificate-card,
  .about-card,
  .service-card,
  .skill-item {
    background-image: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.09) 50%, transparent 65%);
    background-size: 260% 100%;
    background-repeat: no-repeat;
    background-position: 170% 0;
    transition:
      background-position 0.9s var(--ease),
      transform 0.4s var(--ease-spring),
      border-color 0.3s var(--ease),
      box-shadow 0.35s var(--ease);
  }
  .project-card:hover,
  .certificate-card:hover,
  .about-card:hover,
  .service-card:hover,
  .skill-item:hover {
    background-position: -70% 0;
  }

  /* 9. scroll progress bar + scroll-driven entrances (supported browsers only) */
  @supports (animation-timeline: scroll()) {
    html::before {
      content: "";
      position: fixed;
      top: 0;
      inset-inline: 0;
      height: 3px;
      z-index: 10001;
      background: linear-gradient(90deg, var(--amber), var(--teal), #b48cff);
      transform-origin: left;
      transform: scaleX(0);
      animation: scroll-progress linear both;
      animation-timeline: scroll(root block);
      pointer-events: none;
    }
    html[dir="rtl"]::before {
      transform-origin: right;
    }
    @keyframes scroll-progress {
      to { transform: scaleX(1); }
    }
  }
  @supports (animation-timeline: view()) {
    /* only items that sit in normal grids (not the swipe rows) */
    .skill-group,
    .education-card,
    .contact-box,
    .tagline-text {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .contact-box {
      /* keep the breathing glow too */
      animation: rise-in linear both, box-breathe 5s ease-in-out infinite;
      animation-timeline: view(), auto;
      animation-range: entry 0% entry 55%, normal;
    }
    @keyframes rise-in {
      from { opacity: 0; translate: 0 36px; scale: 0.96; }
      to   { opacity: 1; translate: 0 0; scale: 1; }
    }
  }
}

/* ============================================================
   FIX: training card date pill was stretching into a big circle
   (the header row has a minimum height, so the pill grew with it)
   ============================================================ */
.experience-top {
  align-items: flex-start;
}
.experience-date {
  align-self: flex-start;
  height: fit-content;
}

/* ============================================================
   SKILLS (phones): swipe row like the other sections
   ============================================================ */
@media (max-width: 640px) {
  .skill-groups {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -24px;
    padding: 12px 24px 24px;
    scroll-padding-inline: 24px;
  }
  .skill-groups::-webkit-scrollbar {
    display: none;
  }
  .skill-group {
    flex: 0 0 84%;
    min-width: 260px;
    scroll-snap-align: start;
    /* scroll-timeline entrances don't work inside a swipe row */
    animation: none;
    opacity: 1;
    translate: none;
    scale: none;
  }
  .skill-group .skill-list {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(54px, 1fr);
  }
}
@media (max-width: 380px) {
  .skill-groups {
    margin-inline: -14px;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
  }
}

/* ============================================================
   MOTION PACK 2 — richer entrances, stars, glow, micro interactions
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* 1. page-load entrance for the hero, one piece after another */
  .hero-text > * {
    animation: hero-in 0.9s var(--ease-snap) both;
  }
  .hero-text > :nth-child(1) { animation-delay: 0.05s; }
  .hero-text > :nth-child(2) { animation-delay: 0.15s; }
  .hero-text > :nth-child(3) { animation-delay: 0.25s; }
  .hero-text > :nth-child(4) { animation-delay: 0.35s; }
  .hero-text > :nth-child(5) { animation-delay: 0.45s; }
  .hero-text > :nth-child(6) { animation-delay: 0.55s; }
  .hero-text > :nth-child(7) { animation-delay: 0.65s; }
  .hero-text > :nth-child(8) { animation-delay: 0.75s; }
  @keyframes hero-in {
    from { opacity: 0; translate: 0 28px; filter: blur(10px); }
    to   { opacity: 1; translate: 0 0;   filter: blur(0); }
  }
  .hero-visual {
    animation: visual-in 1.2s var(--ease-snap) 0.3s both;
  }
  @keyframes visual-in {
    from { opacity: 0; translate: 0 40px; scale: 0.9; filter: blur(12px); }
    to   { opacity: 1; translate: 0 0;   scale: 1;   filter: blur(0); }
  }

  /* 2. scroll reveals fade in from a soft blur */
  .reveal {
    filter: blur(8px);
    transition:
      opacity 0.8s var(--ease-snap),
      transform 0.8s var(--ease-snap),
      filter 0.8s var(--ease-snap);
  }
  .reveal.visible {
    filter: none;
  }

  /* 3. twinkling stars drifting behind everything */
  html::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
      radial-gradient(1.5px 1.5px at 20px 30px, rgba(255, 255, 255, 0.85), transparent),
      radial-gradient(1px 1px at 90px 120px, rgba(255, 255, 255, 0.6), transparent),
      radial-gradient(2px 2px at 160px 60px, rgba(122, 167, 255, 0.9), transparent),
      radial-gradient(1.5px 1.5px at 230px 200px, rgba(94, 240, 208, 0.8), transparent);
    background-size: 280px 260px, 340px 300px, 420px 380px, 500px 440px;
    opacity: 0.55;
    animation:
      stars-twinkle 5s ease-in-out infinite alternate,
      stars-drift 140s linear infinite;
  }
  html:has(body.light-theme)::after {
    opacity: 0;
    animation: none;
  }
  @keyframes stars-twinkle {
    from { opacity: 0.25; }
    to   { opacity: 0.7; }
  }
  @keyframes stars-drift {
    to { background-position: 280px -260px, -340px -300px, 420px -380px, -500px -440px; }
  }

  /* 4. skills panels: flowing top line + drifting corner glow */
  .skill-group::before {
    background-size: 200% 100%;
    animation: line-flow 5s linear infinite;
  }
  .skill-group::after {
    animation: glow-orbit 12s ease-in-out infinite alternate;
  }
  @keyframes line-flow {
    to { background-position: 200% 0; }
  }
  @keyframes glow-orbit {
    from { translate: 0 0; scale: 1; }
    to   { translate: -50px 40px; scale: 1.35; }
  }

  /* 5. hero visual: floating dashboard card + breathing portrait glow */
  .hv-dash {
    animation: dash-float 7s ease-in-out infinite;
  }
  @keyframes dash-float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -8px; }
  }
  .hv-photo {
    animation: photo-glow 4.5s ease-in-out infinite;
  }
  @keyframes photo-glow {
    0%, 100% { box-shadow: 0 0 0 6px var(--surface-2), 0 0 50px -8px var(--amber); }
    50%      { box-shadow: 0 0 0 6px var(--surface-2), 0 0 90px -4px var(--teal); }
  }

  /* 6. tagline words glow as they light up */
  .tagline-text .tw.on {
    text-shadow: 0 0 28px var(--amber-soft);
  }

  /* 7. micro interactions */
  .btn i {
    transition: translate 0.3s var(--ease-spring);
  }
  .btn:hover i.fa-arrow-right {
    translate: 6px 0;
  }
  html[dir="rtl"] .btn:hover i.fa-arrow-right {
    translate: -6px 0;
  }
  .social-links a {
    transition:
      translate 0.35s var(--ease-spring),
      rotate 0.35s var(--ease-spring),
      border-color 0.25s var(--ease),
      box-shadow 0.3s var(--ease);
  }
  .social-links a:hover {
    translate: 0 -5px;
    rotate: -8deg;
    box-shadow: 0 14px 28px -14px var(--amber);
  }
  .project-card:hover .project-image img {
    filter: saturate(1.15) brightness(1.06);
  }
  .project-image img {
    transition:
      transform 0.8s var(--ease),
      filter 0.6s var(--ease);
  }

  /* 8. phone menu: links slide in one after another */
  @media (max-width: 960px) {
    .nav-menu.active > * {
      animation: menu-in 0.5s var(--ease-snap) both;
    }
    .nav-menu.active > :nth-child(1) { animation-delay: 0.03s; }
    .nav-menu.active > :nth-child(2) { animation-delay: 0.07s; }
    .nav-menu.active > :nth-child(3) { animation-delay: 0.11s; }
    .nav-menu.active > :nth-child(4) { animation-delay: 0.15s; }
    .nav-menu.active > :nth-child(5) { animation-delay: 0.19s; }
    .nav-menu.active > :nth-child(6) { animation-delay: 0.23s; }
    .nav-menu.active > :nth-child(7) { animation-delay: 0.27s; }
    .nav-menu.active > :nth-child(8) { animation-delay: 0.31s; }
    .nav-menu.active > :nth-child(9) { animation-delay: 0.35s; }
    @keyframes menu-in {
      from { opacity: 0; translate: -16px 0; }
      to   { opacity: 1; translate: 0 0; }
    }
    html[dir="rtl"] .nav-menu.active > * {
      animation-name: menu-in-rtl;
    }
    @keyframes menu-in-rtl {
      from { opacity: 0; translate: 16px 0; }
      to   { opacity: 1; translate: 0 0; }
    }
  }
}

/* ============================================================
   SKILLS on phones — swipe row for BOTH layouts
   .skills-grid  = the original 8 separate skill cards
   .skill-groups = the grouped panels (needs the newer HTML)
   The original cards scroll sideways in two rows.
   ============================================================ */
@media (max-width: 640px) {
  .skills-grid {
    display: grid !important;
    grid-template-columns: none !important;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 42%);
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-inline: -24px;
    padding: 12px 24px 24px;
    scroll-padding-inline: 24px;
  }
  .skills-grid::-webkit-scrollbar {
    display: none;
  }
  .skills-grid .skill-card {
    scroll-snap-align: start;
    min-width: 0;
  }
  /* cards off the screen edge must already be visible */
  .skills-grid .skill-card.reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .skills-grid .skill-card:hover {
    transform: none;
  }
}
@media (max-width: 380px) {
  .skills-grid {
    margin-inline: -14px;
    padding-inline: 14px;
    scroll-padding-inline: 14px;
  }
}

/* progress bar under the skills row (CSS only, follows the sideways scroll).
   Works in browsers with scroll-driven animations (current Chrome and Edge);
   elsewhere the bar is simply not shown. */
@supports (timeline-scope: --skills-x) and (animation-timeline: scroll()) {
  @media (max-width: 640px) {
    #skills .container {
      timeline-scope: --skills-x;
    }
    .skills-grid,
    .skill-groups {
      scroll-timeline: --skills-x x;
    }
    #skills .container::after {
      content: "";
      display: block;
      height: 4px;
      margin-top: 4px;
      border-radius: var(--radius-pill);
      background-color: var(--surface-2);
      background-image: linear-gradient(90deg, var(--amber), var(--teal));
      background-repeat: no-repeat;
      background-size: 25% 100%;
      box-shadow: inset 0 0 0 1px var(--border);
      animation: skills-bar linear both;
      animation-timeline: --skills-x;
    }
    html[dir="rtl"] #skills .container::after {
      background-position: right;
    }
    @keyframes skills-bar {
      from { background-size: 25% 100%; }
      to   { background-size: 100% 100%; }
    }
  }
}

/* the JS arrows + bar replace the CSS-only bar when they are present */
#skills .container:has(.hscroll-mobile)::after {
  display: none;
}

/* ============================================================
   MOTION PACK 3 — glowing borders, 3D tilt, hero shapes, light sweeps
   (CSS only, switches off for reduced motion)
   ============================================================ */
@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@media (prefers-reduced-motion: no-preference) {

  /* 1. a light travels around the border of glass cards on hover */
  .project-card,
  .certificate-card,
  .about-card,
  .service-card,
  .education-card,
  .hv-dash {
    position: relative;
  }
  .hv-dash {
    position: absolute; /* it is placed inside the hero visual */
  }
  .project-card::before,
  .certificate-card::before,
  .about-card::before,
  .service-card::before,
  .education-card::before,
  .hv-dash::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(
      from var(--ang),
      transparent 0 55%,
      var(--amber) 75%,
      var(--teal) 90%,
      transparent
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
    animation: ring-spin 3.6s linear infinite;
  }
  .project-card:hover::before,
  .certificate-card:hover::before,
  .about-card:hover::before,
  .service-card:hover::before,
  .education-card:hover::before {
    opacity: 1;
  }
  .hv-dash::before {
    opacity: 0.9; /* the hero card always glows */
  }
  @keyframes ring-spin {
    to { --ang: 360deg; }
  }

  /* 2. light sweep across project screenshots on hover */
  .project-image {
    position: relative;
  }
  .project-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
    translate: -120% 0;
    transition: translate 0.9s var(--ease);
    pointer-events: none;
  }
  .project-card:hover .project-image::after {
    translate: 120% 0;
  }

  /* 3. 3D tilt on mouse devices */
  @media (hover: hover) and (pointer: fine) {
    .project-card:hover,
    .certificate-card:hover {
      transform: perspective(900px) rotateX(2deg) rotateY(-3deg) translateY(-8px);
    }
    html[dir="rtl"] .project-card:hover,
    html[dir="rtl"] .certificate-card:hover {
      transform: perspective(900px) rotateX(2deg) rotateY(3deg) translateY(-8px);
    }
  }

  /* 4. hero: flowing gradient surname + drifting shapes */
  .hero h1 > span:last-child {
    background: linear-gradient(90deg, var(--amber), var(--teal), #b48cff, var(--amber));
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-flow 7s linear infinite;
  }
  .hero {
    position: relative;
    overflow: clip;
  }
  .hero::before,
  .hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
  }
  .hero::before {
    width: 360px;
    height: 360px;
    top: 8%;
    inset-inline-end: -140px;
    border: 1px dashed var(--border-strong);
    opacity: 0.55;
    animation: shape-spin 45s linear infinite;
  }
  .hero::after {
    width: 220px;
    height: 220px;
    bottom: 6%;
    inset-inline-start: -80px;
    background: radial-gradient(circle at 30% 30%, var(--teal-soft), transparent 70%);
    filter: blur(6px);
    animation: shape-float 11s ease-in-out infinite alternate;
  }
  @keyframes shape-spin {
    to { rotate: 360deg; }
  }
  @keyframes shape-float {
    from { translate: 0 0; scale: 1; }
    to   { translate: 50px -40px; scale: 1.25; }
  }

  /* 5. a thin glowing line opens every section */
  .section:not(.hero) {
    position: relative;
  }
  .section:not(.hero)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: min(520px, 60%);
    height: 1px;
    translate: -50% 0;
    background: linear-gradient(90deg, transparent, var(--amber), var(--teal), transparent);
    background-size: 200% 100%;
    opacity: 0.55;
    animation: line-flow 6s linear infinite;
    pointer-events: none;
  }

  /* 6. back-to-top: pulsing ring and a bouncing arrow */
  .back-to-top {
    animation: btt-ring 2.8s ease-out infinite;
  }
  .back-to-top i {
    animation: arrow-bounce 1.8s ease-in-out infinite;
  }
  @keyframes btt-ring {
    0%   { box-shadow: 0 0 0 0 var(--amber-soft); }
    70%, 100% { box-shadow: 0 0 0 16px transparent; }
  }
  @keyframes arrow-bounce {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -3px; }
  }

  /* 7. swipe arrows hint that there is more to the side */
  .hscroll-next:not(:disabled) {
    animation: nudge-x 2.4s ease-in-out infinite;
  }
  html[dir="rtl"] .hscroll-next:not(:disabled) {
    animation-name: nudge-x-rtl;
  }
  @keyframes nudge-x {
    0%, 100% { translate: 0 0; }
    50%      { translate: 5px 0; }
  }
  @keyframes nudge-x-rtl {
    0%, 100% { translate: 0 0; }
    50%      { translate: -5px 0; }
  }

  /* 8. press feedback + footer icons */
  .btn:active,
  .hscroll-btn:active,
  .back-to-top:active,
  .social-links a:active {
    scale: 0.94;
  }
  .footer-socials a {
    transition:
      translate 0.35s var(--ease-spring),
      rotate 0.35s var(--ease-spring),
      box-shadow 0.3s var(--ease);
  }
  .footer-socials a:hover {
    translate: 0 -4px;
    rotate: -8deg;
    box-shadow: 0 12px 24px -12px var(--amber);
  }

  /* 9. header picks up a soft glow once you scroll (supported browsers) */
  @supports (animation-timeline: scroll()) {
    .header {
      animation: header-glow linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 140px;
    }
    @keyframes header-glow {
      to { box-shadow: 0 16px 44px -26px var(--amber); }
    }
  }
}
