:root {
  color-scheme: dark;
  --bg: #050a15;
  --surface: rgba(11, 17, 32, 0.94);
  --text: #eef5ff;
  --muted: #9fc9ff;
  --accent: #7ec7ff;
  /* blue */
  --accent-soft: rgba(126, 199, 255, 0.14);
  --border: rgba(126, 199, 255, 0.12);
  --tile-bg: rgba(126, 199, 255, 0.08);
  --shadow: 0 40px 120px rgba(3, 12, 30, 0.7);
  --shadow-glow: 0 0 60px rgba(126, 199, 255, 0.15);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: rgba(255, 255, 255, 0.95);
  --text: #1e293b;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --border: rgba(59, 130, 246, 0.15);
  --tile-bg: rgba(59, 130, 246, 0.05);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Cairo', sans-serif;
  background: radial-gradient(circle at top, rgba(126, 199, 255, 0.2), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(95, 154, 255, 0.15), transparent 25%),
    radial-gradient(circle at 20% 80%, rgba(88, 172, 255, 0.12), transparent 25%),
    linear-gradient(180deg, #050a15 0%, #091728 50%, #0a1a30 100%);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="light"] body {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.1), transparent 25%),
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08), transparent 25%),
    linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
}

#particlesCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-visible {
  opacity: 1;
  transform: translateY(0);
}

.page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  overflow: hidden;
}

.page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 20%, rgba(126, 199, 255, 0.2), transparent 15%),
    radial-gradient(circle at 82% 8%, rgba(95, 154, 255, 0.18), transparent 20%),
    radial-gradient(circle at 65% 80%, rgba(88, 172, 255, 0.15), transparent 25%),
    radial-gradient(circle at 35% 60%, rgba(126, 199, 255, 0.1), transparent 18%);
  pointer-events: none;
  animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }
  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.profile-card {
  width: min(720px, 100%);
  background: rgba(18, 12, 6, 0.94);
  border: 1px solid rgba(255, 245, 200, 0.1);
  border-radius: 36px;
  padding: 32px;
  box-shadow: 0 40px 120px rgba(6, 4, 2, 0.7), 
    0 0 0 1px rgba(126, 199, 255, 0.08),
    0 20px 60px rgba(126, 199, 255, 0.05),
    var(--shadow-glow);
  backdrop-filter: blur(20px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

[data-theme="light"] .profile-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 
    0 0 0 1px rgba(59, 130, 246, 0.1),
    0 10px 30px rgba(59, 130, 246, 0.05);
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 50px 140px rgba(6, 4, 2, 0.8), 
    0 0 0 1px rgba(126, 199, 255, 0.15),
    0 25px 70px rgba(126, 199, 255, 0.1),
    0 0 80px rgba(126, 199, 255, 0.2);
}

.hero {
  display: grid;
  gap: 32px;
  text-align: center;
  padding: 16px 0 4px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

body.loaded .hero {
  opacity: 1;
  transform: translateY(0);
}

.photo-frame {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(212, 175, 55, 0.25);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 155, 55, 0.05));
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s ease;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
}

.photo-frame:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(126, 199, 255, 0.4), 0 0 30px rgba(212, 175, 55, 0.25);
  border-color: rgba(212, 175, 55, 0.4);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-frame:hover img {
  transform: scale(1.1);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.93rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-text h1 {
  margin: 8px 0 0;
  font-size: clamp(3rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
}

.hero-tagline {
  margin: 14px auto 0;
  max-width: 720px;
  font-size: 1.06rem;
  color: #f5e6b2;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.hero-actions {
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.skill-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0 auto;
  max-width: 100%;
}

.skill-badges span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 245, 200, 0.09);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.skill-badges span:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(255, 245, 200, 0.18);
  box-shadow: 0 8px 20px rgba(255, 245, 200, 0.15);
}

.hero-text h1,
.hero-tagline,
.hero-actions,
.skill-badges,
.link-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

body.loaded .hero-text h1,
body.loaded .hero-tagline,
body.loaded .hero-actions,
body.loaded .skill-badges,
body.loaded .link-card {
  opacity: 1;
  transform: translateY(0);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
  color: inherit;
  letter-spacing: 0.01em;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.button:active {
  transform: translateY(-1px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.button-primary {
  background: linear-gradient(135deg, #5bb7ff, #8bd3ff, #5bb7ff);
  background-size: 200% 200%;
  color: #081223;
  position: relative;
  overflow: hidden;
  animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.button-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.button-primary:hover::before {
  left: 100%;
}

.button-secondary {
  background: rgba(126, 199, 255, 0.14);
  color: #eef5ff;
  border: 1px solid rgba(126, 199, 255, 0.22);
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

.button-secondary:hover {
  background: rgba(126, 199, 255, 0.22);
  border-color: rgba(126, 199, 255, 0.35);
}

.section-label {
  display: inline-flex;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(126, 199, 255, 0.08);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.links-section {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 245, 200, 0.08);
}

.links-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.link-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 40px 100px rgba(3, 16, 45, 0.35), 0 16px 40px rgba(94, 170, 255, 0.2);
  border-color: rgba(126, 199, 255, 0.25);
  background: rgba(126, 199, 255, 0.12);
}

.link-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: visible;
  background: rgba(126, 199, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(126, 199, 255, 0.12);
}

.link-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border-radius: 6px;
  display: block;
}

.fallback-logo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 800;
}

.link-copy {
  min-width: 0;
}

.link-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.link-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.link-arrow {
  font-size: 1.3rem;
  color: var(--accent);
}

@keyframes revealCard {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

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

@media (max-width: 640px) {
  .profile-card {
    padding: 24px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .skill-badges {
    gap: 8px;
  }

  .links-grid {
    gap: 14px;
  }

  .link-card {
    grid-template-columns: 1fr auto;
    padding: 18px 18px;
  }

  .link-logo {
    width: 56px;
    height: 56px;
  }

  .link-arrow {
    font-size: 1.2rem;
  }
}