/* ============================================
   MODERN PORTFOLIO STYLESHEET
   - Smooth scroll effects
   - Animated falling stars background
   - Glassmorphism design
   - Responsive & accessible
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --bg: #081018;
  --bg-dark: #050710;
  --card-bg: rgba(255, 255, 255, 0.04);
  --glass: rgba(255, 255, 255, 0.06);
  --accent: #00f5ff;
  --accent2: #7b61ff;
  --text: #e6eef8;
  --muted: #b9c6d8;
  --radius: 14px;
  --duration: 0.3s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* ============================================
   BACKGROUND & STAR ANIMATION
   ============================================ */

#star-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #081018 0%, #0a0f1a 50%, #081018 100%);
}

/* Starfield with animated falling stars */
@keyframes fall {
  0% {
    transform: translateY(-10vh) translateX(0px) rotateZ(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) translateX(100px) rotateZ(720deg);
    opacity: 0;
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* Star style for canvas elements */
.star {
  position: fixed;
  width: 2px;
  height: 2px;
  background: #00f5ff;
  border-radius: 50%;
  pointer-events: none;
}

.star::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: inherit;
  border-radius: inherit;
  animation: twinkle 3s infinite;
}

/* Radial gradient overlays for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle 400px at 20% 30%, rgba(123, 97, 255, 0.15), transparent 40%),
    radial-gradient(circle 400px at 80% 70%, rgba(0, 245, 255, 0.1), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   HERO HEADER SECTION
   ============================================ */

.hero-header {
  text-align: center;
  padding: clamp(40px, 8vh, 80px) 20px 30px;
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  animation: slideDown 0.8s var(--ease);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-pic {
  width: clamp(100px, 20vw, 140px);
  height: clamp(100px, 20vw, 140px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.3), inset 0 0 20px rgba(0, 245, 255, 0.1);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  animation: fadeIn 0.8s var(--ease) 0.2s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.profile-pic:hover {
  transform: scale(1.08) rotate(2deg);
  box-shadow: 0 0 60px rgba(0, 245, 255, 0.5), inset 0 0 30px rgba(123, 97, 255, 0.2);
}

.hero-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -1px;
  animation: slideDown 0.8s var(--ease) 0.1s both;
}

.tagline {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--muted);
  margin-bottom: 12px;
  animation: slideDown 0.8s var(--ease) 0.15s both;
}

.subtitle {
  color: var(--muted);
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
  animation: slideDown 0.8s var(--ease) 0.2s both;
}

/* ============================================
   SOCIAL ICONS ROW
   ============================================ */

.social-row {
  display: flex;
  gap: clamp(8px, 2vw, 16px);
  align-items: center;
  justify-content: center;
  margin: 30px auto;
  width: 92%;
  max-width: 900px;
  flex-wrap: wrap;
  animation: slideUp 0.8s var(--ease) 0.3s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.social {
  width: clamp(44px, 10vw, 56px);
  height: clamp(44px, 10vw, 56px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.social::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.1), rgba(0, 245, 255, 0.1));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.social svg {
  width: 50%;
  height: 50%;
  display: block;
  position: relative;
  z-index: 1;
  fill: currentColor;
  stroke: currentColor;
  transition: transform var(--duration) var(--ease);
}

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

.social:hover {
  transform: translateY(-8px) scale(1.1) rotate(5deg);
  box-shadow: 0 16px 48px rgba(0, 245, 255, 0.2);
  border-color: rgba(0, 245, 255, 0.3);
}

.social:hover svg {
  transform: scale(1.15);
}

.social:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Social icon colors */
.github { color: #ffffff; }
.youtube { color: #ff0000; }
.instagram { color: #e1306c; }
.twitter { color: #1da1f2; }
.telegram { color: #0088cc; }
.discord { color: #5865f2; }
.facebook { color: #4267b2; }
.linkedin { color: #0a66c2; }
.opensea { color: #2081e4; }
.kick { color: #00e701; }

/* ============================================
   LINKS SECTION
   ============================================ */

.links {
  width: 92%;
  max-width: 900px;
  margin: 40px auto;
  display: grid;
  gap: clamp(12px, 3vw, 20px);
  grid-auto-flow: row;
  animation: slideUp 0.8s var(--ease) 0.4s both;
}

.link-item {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  backdrop-filter: blur(12px);
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.05), rgba(123, 97, 255, 0.05));
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
  z-index: 0;
}

.link-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s var(--ease);
  z-index: 1;
}

.link-item:hover::before {
  opacity: 1;
}

.link-item:hover::after {
  left: 100%;
}

.link-item:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(0, 245, 255, 0.15), 0 0 40px rgba(123, 97, 255, 0.1);
  border-color: rgba(0, 245, 255, 0.2);
}

.link-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.link-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: calc(var(--radius) - 4px);
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.1), rgba(123, 97, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.link-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.2);
}

.link-meta {
  flex: 1;
}

.link-btn {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 6px;
  word-wrap: break-word;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  transition: all var(--duration) var(--ease);
  position: relative;
}

.link-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width var(--duration) var(--ease);
}

.link-item:hover .link-btn::after {
  width: 100%;
}

.link-cta {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  transition: all var(--duration) var(--ease);
  margin-right: 12px;
}

.link-cta .arrow {
  display: inline-block;
  transition: transform var(--duration) var(--ease);
}

.link-item:hover .link-cta {
  color: var(--accent);
  margin-left: 4px;
}

.link-item:hover .link-cta .arrow {
  transform: translateX(4px);
}

.link-desc {
  color: var(--muted);
  font-size: clamp(0.85rem, 1.5vw, 0.95rem);
  line-height: 1.5;
  position: relative;
  z-index: 2;
}

/* ============================================
   ANIMATIONS & SMOOTH TRANSITIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Link items fade in on scroll */
.link-item.in {
  animation: fadeInUp 0.6s var(--ease) forwards;
}

/* ============================================
   ACCESSIBILITY & REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081018;
    --text: #e6eef8;
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .hero-header {
    padding: clamp(30px, 5vh, 50px) 16px 20px;
  }

  .profile-pic {
    margin-bottom: 16px;
  }

  .social-row {
    margin: 24px auto;
    gap: 10px;
  }

  .links {
    width: 95%;
    margin: 30px auto;
    gap: 12px;
  }

  .link-item {
    padding: 14px 16px;
  }

  .link-head {
    gap: 12px;
  }

  .link-icon {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .hero-header {
    padding: 24px 12px 16px;
  }

  .hero-header h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }

  .profile-pic {
    width: 90px;
    height: 90px;
    margin-bottom: 12px;
  }

  .tagline {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .social-row {
    margin: 18px auto;
    gap: 8px;
  }

  .social {
    width: 40px;
    height: 40px;
  }

  .links {
    width: 100%;
    margin: 24px auto;
    padding: 0 12px;
    gap: 10px;
  }

  .link-item {
    padding: 12px 12px;
    gap: 10px;
  }

  .link-head {
    flex-direction: column;
    gap: 8px;
  }

  .link-btn {
    font-size: 0.95rem;
  }

  .link-desc {
    font-size: 0.8rem;
  }

  .link-cta {
    font-size: 0.85rem;
  }
}

/* ============================================
   UTILITY CLASSES & ENHANCEMENTS
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 12px;
  text-decoration: none;
  z-index: 100;
  font-weight: 600;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Smooth page load */
body.loaded .hero-header,
body.loaded .social-row,
body.loaded .links {
  animation-play-state: running;
}

/* Performance optimization */
@supports (backdrop-filter: blur(1px)) {
  .social,
  .link-item {
    backdrop-filter: blur(12px);
  }
}

/* Print styles */
@media print {
  #star-bg,
  body::before {
    display: none;
  }
}
