/**
 * FebryWesker Portfolio Stylesheet
 * Theme: Elegant Blue Night, Purple & Pink
 * Mobile-First Design
 */

/* ============================================ */
/* RESET & BASE */
/* ============================================ */

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

:root {
  --primary: #8b5cf6;
  --secondary: #ec4899;
  --dark: #0f172a;
  --darker: #020617;
  --accent: #6366f1;
  --purple-light: #a855f7;
  --pink-light: #f472b6;
  --blue-dark: #1e1b4b;
  --slate: #1e293b;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--darker) 0%, var(--blue-dark) 50%, var(--slate) 100%);
  color: #e2e8f0;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
}

::selection {
  background: var(--primary);
  color: white;
}

/* ============================================ */
/* ANIMATED BACKGROUND */
/* ============================================ */

.bg-animated {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: float 20s infinite ease-in-out;
  will-change: transform;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary), transparent);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--secondary), transparent);
  bottom: -150px;
  right: -150px;
  animation-delay: -5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent), transparent);
  top: 50%;
  right: 10%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { 
    transform: translate(0, 0) scale(1); 
  }
  33% { 
    transform: translate(100px, -100px) scale(1.1); 
  }
  66% { 
    transform: translate(-50px, 100px) scale(0.9); 
  }
}

/* ============================================ */
/* STARS BACKGROUND */
/* ============================================ */

.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s infinite ease-in-out;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

@keyframes twinkle {
  0%, 100% { 
    opacity: 0.2;
    transform: scale(1);
  }
  50% { 
    opacity: 1;
    transform: scale(1.3);
  }
}

/* ============================================ */
/* NAVIGATION */
/* ============================================ */

nav {
  backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
  color: #cbd5e1;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
  display: inline-block;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: white;
}

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

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

#home {
  transition: all 0.3s ease-out;
}

.hero-content {
  animation: fadeInUp 1s ease-out;
}

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

.gradient-text {
  background: linear-gradient(135deg, #8b5cf6, #ec4899, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  display: inline-block;
}

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

/* ============================================ */
/* TYPING EFFECT */
/* ============================================ */

#typing {
  position: relative;
  display: inline-block;
}

#typing::after {
  content: '|';
  position: absolute;
  right: -12px;
  animation: blink 0.7s step-end infinite;
  color: var(--primary);
  font-weight: 300;
}

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

/* ============================================ */
/* CARDS */
/* ============================================ */

.card {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
  transform: scale(0);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.35),
              0 0 40px rgba(236, 72, 153, 0.2);
  border-color: rgba(236, 72, 153, 0.5);
}

.card:hover::before {
  transform: scale(1);
}

/* ============================================ */
/* SKILL CARDS */
/* ============================================ */

.skill-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1rem;
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.skill-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.card:hover .skill-icon {
  transform: rotateY(360deg) scale(1.1);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.5);
}

.card:hover .skill-icon::after {
  opacity: 0.3;
}

/* ============================================ */
/* PROJECT CARDS */
/* ============================================ */

.project-image {
  height: 240px;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  position: relative;
  background: var(--slate);
}

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

.project-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(139, 92, 246, 0.3), 
    rgba(236, 72, 153, 0.3));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover .project-image img {
  transform: scale(1.15) rotate(2deg);
}

.card:hover .project-image::after {
  opacity: 1;
}

/* ============================================ */
/* BUTTONS */
/* ============================================ */

.btn {
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  z-index: -1;
  transition: transform 0.3s ease;
}

.btn:hover::before {
  transform: scale(1.05);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline::before {
  transform: scale(0);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.btn-outline:hover::before {
  transform: scale(1);
}

/* ============================================ */
/* PROFILE IMAGE */
/* ============================================ */

.profile-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 2rem;
}

.profile-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(135deg, 
    var(--primary), 
    var(--secondary), 
    var(--accent),
    var(--primary));
  background-size: 300% 300%;
  animation: rotateGradient 4s linear infinite;
  padding: 4px;
}

.profile-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: var(--dark);
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.profile-wrapper:hover .profile-img img {
  transform: scale(1.1);
}

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

/* ============================================ */
/* MOBILE MENU */
/* ============================================ */

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
}

.mobile-menu.open {
  max-height: 400px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

/* ============================================ */
/* BACK TO TOP BUTTON */
/* ============================================ */

#back-to-top {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
  border: none;
}

#back-to-top::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0.5;
  filter: blur(10px);
  animation: pulse 2s ease-in-out infinite;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.7);
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 0.5;
  }
  50% { 
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ============================================ */
/* REVEAL ANIMATIONS */
/* ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================ */
/* FORM INPUTS */
/* ============================================ */

input,
textarea {
  transition: all 0.3s ease;
  font-family: inherit;
}

input:focus,
textarea:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

/* ============================================ */
/* SCROLLBAR */
/* ============================================ */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--darker);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}

/* ============================================ */
/* LOADING ANIMATION */
/* ============================================ */

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ============================================ */
/* RESPONSIVE DESIGN - MOBILE FIRST */
/* ============================================ */

/* Mobile (Default - 320px+) */
@media (max-width: 640px) {
  h1 { 
    font-size: 2.5rem !important; 
    line-height: 1.2;
  }
  
  h2 { 
    font-size: 1.75rem !important; 
  }
  
  h3 {
    font-size: 1.5rem !important;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .skill-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }
  
  .project-image {
    height: 180px;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .profile-wrapper {
    width: 200px;
    height: 200px;
  }
  
  #back-to-top {
    width: 48px;
    height: 48px;
    bottom: 1rem;
    right: 1rem;
  }
  
  .orb-1,
  .orb-2,
  .orb-3 {
    width: 250px;
    height: 250px;
  }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
  .card {
    padding: 2rem;
  }
  
  .skill-icon {
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
  }
  
  .project-image {
    height: 220px;
  }
  
  .profile-wrapper {
    width: 240px;
    height: 240px;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .skill-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }
  
  .project-image {
    height: 240px;
  }
  
  .profile-wrapper {
    width: 280px;
    height: 280px;
  }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
  .card:hover {
    transform: translateY(-15px) scale(1.02);
  }
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.blur-bg {
  backdrop-filter: blur(20px);
}

/* ============================================ */
/* ACCESSIBILITY */
/* ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================ */
/* PRINT STYLES */
/* ============================================ */

@media print {
  .bg-animated,
  .stars,
  nav,
  #back-to-top,
  footer {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}
