/* =====================================================
   AHMED MOHAMED — Premium Links Page
   Aesthetic: Dark luxury / Editorial / Glass-morphism
   Fonts: Syne (display) + DM Sans (body)
   ===================================================== */

/* ---------- Variables ---------- */
:root {
  --bg: #080c14;
  --bg2: #0d1220;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #f0f4ff;
  --text-muted: #8896b0;
  --accent: #4f8ef7;
  --accent2: #06c8d8;
  --gold: #f5c842;
  --gradient: linear-gradient(135deg, #4f8ef7, #06c8d8);
  --glow: rgba(79, 142, 247, 0.25);
  --radius: 18px;
  --radius-lg: 24px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease;
}

.pre-inner {
  position: relative;
  width: 60px;
  height: 60px;
}

.pre-ring {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.pre-ring.delay {
  inset: 8px;
  border-top-color: var(--accent2);
  animation-delay: 0.25s;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Aurora Background ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#aurora {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025;
  mix-blend-mode: overlay;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.orb-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, rgba(79, 142, 247, 0.18) 0%, transparent 70%);
  animation: driftOrb 18s ease-in-out infinite;
}

.orb-2 {
  width: 400px;
  height: 400px;
  bottom: 0;
  right: -100px;
  background: radial-gradient(circle, rgba(6, 200, 216, 0.12) 0%, transparent 70%);
  animation: driftOrb 22s ease-in-out infinite reverse;
}

.orb-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(245, 200, 66, 0.04) 0%, transparent 70%);
  animation: driftOrb 30s ease-in-out infinite;
}

@keyframes driftOrb {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(40px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 40px) scale(0.95);
  }
}

/* ---------- Page Layout ---------- */
.page {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 3rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* ---------- Profile Section ---------- */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Avatar */
.avatar-ring {
  position: relative;
  width: 110px;
  height: 110px;
}

.avatar-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--gradient);
  opacity: 0.25;
  filter: blur(20px);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(1.08);
  }
}

.avatar {
  position: relative;
  z-index: 1;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(79, 142, 247, 0.15), 0 20px 50px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s ease;
}

.avatar:hover {
  transform: scale(1.04);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-status {
  position: absolute;
  z-index: 2;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid var(--bg);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  }

  50% {
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.9);
  }
}

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Name */
.name-heading {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 2.8rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  text-align: center;
  color: var(--text);
}

.name-heading span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Role pill */
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-top: 15px;
}

.role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 6px var(--accent2);
  animation: statusPulse 2s ease-in-out infinite;
}

/* Tags */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.tag i {
  font-size: 0.7em;
  color: var(--accent);
}

/* ---------- Links Section ---------- */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

/* ---------- Link Card ---------- */
.link-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(12px);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
}

.link-card:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-3px) scale(1.005);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.link-card:active {
  transform: translateY(-1px) scale(1.002);
}

/* Shimmer sweep on hover */
.lc-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.06) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.link-card:hover .lc-shimmer {
  transform: translateX(100%);
}

/* Featured card */
.link-card.featured {
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.1), rgba(6, 200, 216, 0.06));
  border-color: rgba(79, 142, 247, 0.3);
}

.link-card.featured:hover {
  border-color: rgba(79, 142, 247, 0.55);
  box-shadow: 0 16px 48px rgba(79, 142, 247, 0.2), 0 0 0 1px rgba(79, 142, 247, 0.2);
}

/* Icon wrapper */
.lc-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.link-card:hover .lc-icon {
  transform: scale(1.08) rotate(-3deg);
}

.lc-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 7px;
}

/* Per-brand icon colors */
.github-icon {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.linkedin-icon {
  background: rgba(0, 119, 181, 0.15);
  color: #0a8fd4;
}

.portfolio-icon {
  background: rgba(79, 142, 247, 0.12);
  color: var(--accent);
}

.contact-icon {
  background: rgba(245, 200, 66, 0.1);
  color: var(--gold);
}

.msg-icon {
  background: rgba(6, 200, 216, 0.1);
  color: var(--accent2);
}

.ig-icon {
  background: linear-gradient(135deg, rgba(225, 48, 108, 0.15), rgba(255, 140, 0, 0.1));
  color: #e1306c;
}

.fb-icon {
  background: rgba(24, 119, 242, 0.15);
  color: #1877f2;
}

.x-icon {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Text block */
.lc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lc-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lc-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badge */
.badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(245, 200, 66, 0.1);
  border: 1px solid rgba(245, 200, 66, 0.25);
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Arrow */
.lc-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}

.link-card:hover .lc-arrow {
  color: var(--text);
  transform: translateX(3px);
}

/* ---------- Mini cards row ---------- */
.links-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.link-card.mini {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.5rem;
  text-align: center;
}

.link-card.mini .lc-icon {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.link-card.mini .lc-title {
  font-size: 0.8rem;
  justify-content: center;
}

.instagram-card:hover {
  border-color: rgba(225, 48, 108, 0.4);
  box-shadow: 0 12px 36px rgba(225, 48, 108, 0.15);
}

.fb-card:hover {
  border-color: rgba(24, 119, 242, 0.4);
  box-shadow: 0 12px 36px rgba(24, 119, 242, 0.15);
}

.x-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 36px rgba(255, 255, 255, 0.05);
}

/* ---------- Contact Bar ---------- */
.contact-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  width: 100%;
  animation: fadeUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.cb-item {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.cb-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-3px);
}

/* Tooltip */
.cb-item::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: rgba(15, 20, 35, 0.95);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.cb-item:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Specific icon hover colors */
.cb-item:has(.fa-phone):hover {
  color: #19a3e9;
  border-color: rgba(25, 163, 233, 0.4);
}

.cb-item:has(.fa-whatsapp):hover {
  color: #25d366;
  border-color: rgba(37, 211, 102, 0.4);
}

.cb-item:has(.fa-telegram):hover {
  color: #2bb8ff;
  border-color: rgba(43, 184, 255, 0.4);
}

.cb-item:has(.fa-envelope):hover {
  color: #f5c842;
  border-color: rgba(245, 200, 66, 0.4);
}

.cb-item:has(.fa-pinterest):hover {
  color: #e60023;
  border-color: rgba(230, 0, 35, 0.4);
}

.cb-item:has(.fa-tiktok):hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---------- Footer ---------- */
footer {
  position: relative;
  z-index: 10;
  width: 100%;
  text-align: center;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s;
}

footer a:hover {
  opacity: 0.75;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .page {
    padding: 2.5rem 1rem 1.5rem;
    gap: 1.5rem;
  }

  .name-heading {
    font-size: 2rem;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  .avatar-ring {
    width: 96px;
    height: 96px;
  }

  .links-row {
    gap: 0.5rem;
  }

  .link-card {
    padding: 0.9rem 1rem;
  }

  .cb-item {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
