/* ============================================================
   FX LAYER — 4D motion, morph & transition effects
   Shared across all pages of the Ghulam Mustafa portfolio.
   ============================================================ */

:root {
  --fx-cyan: #00f2ff;
  --fx-gold: #e9c400;
  --fx-bg: #0b0b0d;
  --fx-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; }

/* ---------- Page loader (morph reveal) ---------- */
#fx-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fx-bg);
  transition: opacity 0.8s var(--fx-ease), visibility 0.8s var(--fx-ease);
}
#fx-loader.fx-done {
  opacity: 0;
  visibility: hidden;
}
.fx-loader-orb {
  width: 84px;
  height: 84px;
  background: radial-gradient(circle at 30% 30%, var(--fx-cyan), #006a71 70%);
  box-shadow: 0 0 60px rgba(0, 242, 255, 0.55);
  animation: fx-morph 3s ease-in-out infinite, fx-spin 8s linear infinite;
}
.fx-loader-label {
  position: absolute;
  bottom: 32%;
  font-family: "Space Mono", monospace;
  letter-spacing: 0.4em;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--fx-cyan);
  opacity: 0.7;
  animation: fx-blink 1.4s steps(2) infinite;
}
@keyframes fx-blink { 50% { opacity: 0.2; } }

/* ---------- Morphing blob shape ---------- */
@keyframes fx-morph {
  0%,
  100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; }
  33%  { border-radius: 63% 37% 38% 62% / 63% 41% 59% 37%; }
  66%  { border-radius: 38% 62% 56% 44% / 31% 59% 41% 69%; }
}
@keyframes fx-spin { to { transform: rotate(360deg); } }

.fx-blob {
  position: absolute;
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.18;
  z-index: -1;
  animation: fx-morph 14s ease-in-out infinite, fx-drift 22s ease-in-out infinite alternate;
}
@keyframes fx-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(40px, -30px, 0) scale(1.15); }
}

/* ---------- Scroll reveal ---------- */
.fx-reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s var(--fx-ease), transform 0.9s var(--fx-ease);
  will-change: opacity, transform;
}
.fx-reveal.fx-in { opacity: 1; transform: none; }
.fx-reveal[data-fx="left"]  { transform: translateX(-44px); }
.fx-reveal[data-fx="right"] { transform: translateX(44px); }
.fx-reveal[data-fx="zoom"]  { transform: scale(0.9); }
.fx-reveal[data-fx="flip"]  { transform: perspective(1000px) rotateX(-22deg); transform-origin: top; }
.fx-reveal.fx-in[data-fx]   { transform: none; }
/* staggered children */
.fx-stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------- 3D tilt ---------- */
.fx-tilt {
  transform-style: preserve-3d;
  transition: transform 0.18s var(--fx-ease), box-shadow 0.3s ease;
  will-change: transform;
}
.fx-tilt .fx-tilt-layer { transform: translateZ(40px); }

/* ---------- Gradient shimmer text ---------- */
.fx-gradient-text {
  background: linear-gradient(110deg, var(--fx-cyan), #ffffff 35%, var(--fx-gold) 60%, var(--fx-cyan));
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fx-shine 6s linear infinite;
}
@keyframes fx-shine { to { background-position: 250% center; } }

/* ---------- Magnetic / glow buttons ---------- */
.fx-magnetic { transition: transform 0.25s var(--fx-ease); will-change: transform; }

/* ---------- Custom cursor glow ---------- */
#fx-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(0, 242, 255, 0.6);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
  mix-blend-mode: screen;
}
#fx-cursor.fx-hot {
  width: 54px;
  height: 54px;
  background: rgba(0, 242, 255, 0.12);
  border-color: var(--fx-gold);
}
@media (hover: none) { #fx-cursor { display: none; } }

/* ---------- Scroll progress bar ---------- */
#fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 9997;
  background: linear-gradient(90deg, var(--fx-cyan), var(--fx-gold));
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.6);
}

/* ---------- Marquee tech ticker ---------- */
.fx-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fx-marquee-track {
  display: inline-flex;
  gap: 3rem;
  white-space: nowrap;
  animation: fx-marquee 28s linear infinite;
}
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }
@keyframes fx-marquee { to { transform: translateX(-50%); } }

/* ============================================================
   LIVE GITHUB MODULES
   ============================================================ */

/* Generated project card (live) */
.gh-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  padding: 1.75rem;
  overflow: hidden;
  background: rgba(18, 20, 29, 0.45);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 242, 255, 0.12);
  transition: transform 0.4s var(--fx-ease), border-color 0.4s ease, box-shadow 0.4s ease;
  min-height: 270px;
}
.gh-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, var(--gh-accent, #00f2ff) 0%, transparent 45%);
  opacity: 0.12;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.gh-card:hover {
  transform: translateY(-10px);
  border-color: var(--gh-accent, #00f2ff);
  box-shadow: 0 24px 60px -22px var(--gh-accent, rgba(0, 242, 255, 0.5));
}
.gh-card:hover::before { opacity: 0.26; }
.gh-card__lang {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gh-accent, #00f2ff);
}
.gh-card__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gh-accent, #00f2ff);
  box-shadow: 0 0 10px var(--gh-accent, #00f2ff);
}
.gh-card__title {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  margin: 0.85rem 0 0.6rem;
  color: #f3f4f4;
}
.gh-card__desc {
  font-size: 14px;
  line-height: 1.6;
  color: #b9cacb;
  flex: 1;
}
.gh-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.1rem 0 1rem;
}
.gh-card__tag {
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 9999px;
  color: #cfe9eb;
  background: rgba(0, 242, 255, 0.06);
  border: 1px solid rgba(0, 242, 255, 0.18);
}
.gh-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 0.9rem;
  margin-top: auto;
}
.gh-card__stats {
  display: flex;
  gap: 1rem;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: #849495;
}
.gh-card__stats span { display: inline-flex; align-items: center; gap: 0.3rem; }
.gh-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gh-accent, #00f2ff);
  text-decoration: none;
  transition: gap 0.25s ease;
}
.gh-card__link:hover { gap: 0.75rem; }

/* Live badge */
.gh-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fx-cyan);
}
.gh-live__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
  animation: gh-pulse 1.8s infinite;
}
@keyframes gh-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
  70%  { box-shadow: 0 0 0 12px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* Live skill badge */
.gh-skill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: #cfe9eb;
  background: rgba(0, 242, 255, 0.05);
  border: 1px solid rgba(0, 242, 255, 0.2);
  transition: transform 0.3s var(--fx-ease), border-color 0.3s, background 0.3s;
}
.gh-skill:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--fx-cyan);
  background: rgba(0, 242, 255, 0.12);
}
.gh-skill .gh-card__dot { width: 8px; height: 8px; }

/* Skeleton shimmer while loading */
.gh-skeleton {
  border-radius: 1.25rem;
  min-height: 270px;
  background: linear-gradient(100deg, rgba(255,255,255,0.03) 30%, rgba(0,242,255,0.08) 50%, rgba(255,255,255,0.03) 70%);
  background-size: 200% 100%;
  animation: gh-shimmer 1.4s linear infinite;
}
@keyframes gh-shimmer { to { background-position: -200% 0; } }

/* ============================================================
   SOCIAL — brand-icon buttons + floating WhatsApp
   ============================================================ */
.social-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.social-btn {
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 20, 29, 0.5);
  border: 1px solid rgba(0, 242, 255, 0.18);
  color: #cfe9eb;
  transition: transform 0.3s var(--fx-ease), border-color 0.3s, background 0.3s, box-shadow 0.3s, color 0.3s;
}
.social-btn svg { width: 19px; height: 19px; fill: currentColor; }
.social-btn:hover { transform: translateY(-5px) scale(1.08); }
.social-btn[data-brand="github"]:hover   { color: #fff;     border-color: #fff;     box-shadow: 0 8px 24px -8px rgba(255,255,255,0.45); }
.social-btn[data-brand="linkedin"]:hover { color: #0A66C2;  border-color: #0A66C2;  box-shadow: 0 8px 24px -8px rgba(10,102,194,0.65); }
.social-btn[data-brand="whatsapp"]:hover { color: #25D366;  border-color: #25D366;  box-shadow: 0 8px 24px -8px rgba(37,211,102,0.65); }
.social-btn[data-brand="email"]:hover    { color: #00f2ff;  border-color: #00f2ff;  box-shadow: 0 8px 24px -8px rgba(0,242,255,0.65); }
.social-btn[data-brand="instagram"]:hover {
  color: #fff;
  border-color: transparent;
  background: radial-gradient(circle at 30% 110%, #feda75, #fa7e1e 25%, #d62976 55%, #962fbf 78%, #4f5bd5 100%);
  box-shadow: 0 8px 24px -8px rgba(214,41,118,0.75);
}

/* Floating WhatsApp call-to-action */
#fx-whatsapp {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9996;
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 30px -6px rgba(37, 211, 102, 0.6);
  transition: transform 0.3s var(--fx-ease), box-shadow 0.3s;
  animation: fx-wa-pop 0.6s var(--fx-ease) both;
}
#fx-whatsapp::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  animation: fx-wa-pulse 2.4s infinite;
}
#fx-whatsapp:hover { transform: scale(1.1); box-shadow: 0 14px 36px -6px rgba(37, 211, 102, 0.85); }
#fx-whatsapp svg { width: 30px; height: 30px; fill: currentColor; position: relative; }
#fx-whatsapp .fx-wa-tip {
  position: absolute;
  right: 70px;
  white-space: nowrap;
  background: rgba(18, 20, 29, 0.92);
  color: #e5e2e3;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(37, 211, 102, 0.45);
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#fx-whatsapp:hover .fx-wa-tip { opacity: 1; transform: translateX(0); }
@keyframes fx-wa-pulse { 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }
@keyframes fx-wa-pop { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 640px) { #fx-whatsapp { width: 52px; height: 52px; right: 16px; bottom: 16px; } #fx-whatsapp .fx-wa-tip { display: none; } }

/* ============================================================
   PROJECT DETAIL MODAL
   ============================================================ */
.gh-card { cursor: pointer; }
.gh-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--fx-ease), visibility 0.35s;
}
.gh-modal.gh-modal--open { opacity: 1; visibility: visible; }
.gh-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(6px);
}
.gh-modal__panel {
  position: relative;
  width: min(880px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.25rem;
  background: rgba(16, 18, 24, 0.97);
  border: 1px solid rgba(0, 242, 255, 0.25);
  box-shadow: 0 40px 120px -30px rgba(0, 242, 255, 0.35);
  transform: translateY(26px) scale(0.97);
  transition: transform 0.4s var(--fx-ease);
}
.gh-modal--open .gh-modal__panel { transform: none; }
.gh-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #e5e2e3;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.35s var(--fx-ease);
}
.gh-modal__close:hover { background: var(--fx-cyan); color: #00363a; transform: rotate(90deg); }
.gh-modal__hero {
  position: relative;
  aspect-ratio: 2 / 1;
  max-height: 300px;
  background: #0e0e0f;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 242, 255, 0.15);
  flex-shrink: 0;
}
.gh-modal__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gh-modal__body { padding: 1.6rem 1.8rem 2rem; overflow-y: auto; }
.gh-modal__lang {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: "Space Mono", monospace; font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gh-accent, #00f2ff);
}
.gh-modal__title {
  font-family: "Montserrat", sans-serif; font-weight: 800; font-size: 26px;
  color: #f3f4f4; margin: 0.5rem 0 0.5rem;
}
.gh-modal__desc { color: #b9cacb; font-size: 15px; line-height: 1.6; }
.gh-modal__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1.1rem 0 0.3rem; }
.gh-modal__btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.2rem; border-radius: 9999px;
  font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  transition: transform 0.25s var(--fx-ease), box-shadow 0.25s, background 0.25s;
}
.gh-modal__btn--primary { background: var(--fx-cyan); color: #00363a; }
.gh-modal__btn--ghost { border: 1px solid rgba(0, 242, 255, 0.4); color: var(--fx-cyan); }
.gh-modal__btn:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -10px rgba(0, 242, 255, 0.6); }

/* README rendered markdown */
.gh-readme {
  margin-top: 1.4rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #c8d3d4;
  font-size: 14px;
  line-height: 1.75;
  word-wrap: break-word;
}
.gh-readme h1, .gh-readme h2, .gh-readme h3, .gh-readme h4 {
  color: #f3f4f4; font-family: "Montserrat", sans-serif; line-height: 1.3;
  margin: 1.2em 0 0.5em;
}
.gh-readme h1 { font-size: 22px; } .gh-readme h2 { font-size: 18px; }
.gh-readme h3 { font-size: 15px; } .gh-readme h4 { font-size: 14px; }
.gh-readme p { margin: 0.6em 0; }
.gh-readme a { color: var(--fx-cyan); text-decoration: underline; text-underline-offset: 2px; }
.gh-readme ul, .gh-readme ol { padding-left: 1.4em; margin: 0.5em 0; }
.gh-readme li { margin: 0.25em 0; }
.gh-readme code {
  background: rgba(0, 242, 255, 0.08); padding: 0.1em 0.4em; border-radius: 4px;
  font-family: "Space Mono", monospace; font-size: 0.9em; color: #cfe9eb;
}
.gh-readme pre {
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 0.8em 0;
}
.gh-readme pre code { background: none; padding: 0; color: #d6e7e8; }
.gh-readme img { max-width: 100%; height: auto; border-radius: 6px; margin: 0.4em 0; }
.gh-readme blockquote {
  border-left: 3px solid var(--fx-cyan); margin: 0.8em 0; padding: 0.2em 1em;
  color: #9fb0b1; background: rgba(0, 242, 255, 0.04);
}
.gh-readme table { border-collapse: collapse; margin: 0.8em 0; width: 100%; }
.gh-readme th, .gh-readme td { border: 1px solid rgba(255, 255, 255, 0.12); padding: 6px 10px; text-align: left; }
.gh-readme hr { border: none; border-top: 1px solid rgba(255, 255, 255, 0.1); margin: 1.2em 0; }
.gh-readme__loading {
  display: flex; align-items: center; gap: 0.6rem; color: #849495;
  font-family: "Space Mono", monospace; font-size: 13px;
}
@media (max-width: 640px) {
  .gh-modal { padding: 0; }
  .gh-modal__panel { max-height: 100vh; border-radius: 0; width: 100%; }
  .gh-modal__body { padding: 1.2rem 1.2rem 2rem; }
}

/* ============================================================
   GITHUB ACTIVITY — contribution heatmap + recent feed
   ============================================================ */
.gh-heat-wrap { overflow-x: auto; padding-bottom: 6px; }
.gh-heat { display: inline-flex; gap: 3px; }
.gh-heat__col { display: flex; flex-direction: column; gap: 3px; }
.gh-heat__cell {
  width: 13px; height: 13px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.15s ease;
}
.gh-heat__cell:hover { transform: scale(1.35); outline: 1px solid rgba(0, 242, 255, 0.6); }
.gh-heat__cell[data-empty] { background: transparent; }
.gh-heat__cell[data-lvl="1"] { background: rgba(0, 242, 255, 0.22); }
.gh-heat__cell[data-lvl="2"] { background: rgba(0, 242, 255, 0.42); }
.gh-heat__cell[data-lvl="3"] { background: rgba(0, 242, 255, 0.65); }
.gh-heat__cell[data-lvl="4"] { background: rgba(0, 242, 255, 0.95); box-shadow: 0 0 8px rgba(0, 242, 255, 0.6); }
.gh-heat-legend {
  display: flex; align-items: center; gap: 6px; margin-top: 12px;
  font-family: "Space Mono", monospace; font-size: 11px; color: #849495;
}
.gh-heat-legend .gh-heat__cell { width: 11px; height: 11px; }

.gh-activity { display: flex; flex-direction: column; }
.gh-activity__item {
  display: flex; gap: 0.85rem; padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gh-activity__item:last-child { border-bottom: none; }
.gh-activity__icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 242, 255, 0.08); border: 1px solid rgba(0, 242, 255, 0.22);
  color: var(--fx-cyan);
}
.gh-activity__icon .material-symbols-outlined { font-size: 18px; }
.gh-activity__text { font-size: 13.5px; line-height: 1.5; color: #c8d3d4; min-width: 0; }
.gh-activity__text a { color: var(--fx-cyan); text-decoration: none; font-weight: 600; }
.gh-activity__text a:hover { text-decoration: underline; }
.gh-activity__msg {
  color: #849495; display: block; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%;
}
.gh-activity__time { color: #5d6b6c; font-family: "Space Mono", monospace; font-size: 11px; }
