/* CSS file updated to center mobile menu items towards the top */

:root {
  --primary: #0F0F0F;
  --secondary: #1A1A1A;
  --accent: #FF6B6B;
  --accent2: #FF8E53;
  --text: #F0F0F0;
  --text-secondary: #888;
}

/* Fix iOS Safari rubber band background color */
html {
  background: var(--primary);
  height: 100%;
}

body {
  background: var(--primary);
  min-height: 100vh;
  /* Prevent elastic scrolling on iOS */
  overscroll-behavior: none;
  /* Ensure background color covers entire viewport */
  -webkit-tap-highlight-color: transparent;
}

/* Fix for mobile Safari 15+ which has new viewport units */
@supports (height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  background: rgba(15, 15, 15, 0.98);
  padding: 1.2rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  height: 70px;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  position: relative;
  padding: 0;
  margin: 0;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
  display: block;
  font-size: 1.1rem;
}

.nav-underline {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background-color: var(--accent);
  transition: all 0.3s ease;
  border-radius: 2px;
  z-index: 1;
}

.main-content {
  flex: 1;
  padding: 6rem 1rem 1rem;
}

.hero {
  text-align: center;
  padding: 0 1rem;
}

.hero-text {
  text-align: center;
  overflow: hidden;
  padding: 2rem;
}

.line {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s forwards;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.line:nth-child(1) {
  animation-delay: 0.2s;
  font-size: 3.8rem;
  background: linear-gradient(45deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.03em;
}

.line:nth-child(2) {
  animation-delay: 0.6s;
  font-size: 1.8rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.line:nth-child(3) {
  animation-delay: 1.0s;
  font-size: 1.8rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer {
  background: var(--secondary);
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0 1rem;
}

.social-icon {
  width: 42px;
  height: 42px;
  transition: transform 0.3s ease;
}

.social-icon:hover {
  transform: scale(1.1);
}

.mobile-menu-btn {
  display: none;
  position: absolute;
  right: 20px;
  top: 20px;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-btn .bar {
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.4s;
}

.project-card {
  transition: transform 0.4s ease;
  transform-style: preserve-3d;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.center-button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
}

/* Projects Page Specific Styles */
.projects-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.category-toggle {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.toggle-btn {
  padding: 0.8rem 1.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-weight: 500;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  font-size: 1rem;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-btn::before {
  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 ease;
}

.toggle-btn:hover::before {
  left: 100%;
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--primary);
  border-color: transparent;
  box-shadow: 
    0 4px 20px rgba(255, 107, 107, 0.3),
    0 0 0 1px rgba(255, 107, 107, 0.1);
  transform: translateY(-2px);
  font-weight: 600;
}

.toggle-btn.active::after {
  font-weight: bold;
  margin-left: 0.3rem;
}

.toggle-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Subtle pulse animation for active state */
@keyframes subtlePulse {
  0%, 100% { transform: translateY(-2px) scale(1); }
  50% { transform: translateY(-2px) scale(1.02); }
}

.toggle-btn.active {
  animation: subtlePulse 3s ease-in-out infinite;
}

/* Enhanced focus states for accessibility */
.toggle-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
}

.toggle-btn:focus:not(.active) {
  box-shadow: 
    0 0 0 3px rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.2);
}

.projects-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.mosaic-item {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 1;
  transform: scale(1);
}

.mosaic-item.hidden {
  display: none;
}

.mosaic-item.fading {
  opacity: 0;
  transform: scale(0.9);
}

.mosaic-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mosaic-content {
  padding: 1.5rem;
}

.mosaic-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.mosaic-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.mosaic-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.project-link:hover {
  background: var(--accent2);
  transform: translateY(-2px);
}

/* Large mosaic items */
.mosaic-item.large {
  grid-column: span 2;
}

.mosaic-item.large .mosaic-image {
  height: 300px;
}

@media (max-width: 768px) {
  /* Additional iOS-specific fixes for mobile */
  .header {
    position: fixed;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  
  /* Fix for mobile Safari address bar */
  .main-content {
    min-height: calc(100vh - 70px);
  }
  
  /* Fix for mobile Safari bottom bar */
  .footer {
    position: relative;
    z-index: 1;
  }

  .header {
    padding: 1rem 0;
    height: 60px;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 60px;
    left: -100%;
    flex-direction: column;
    background: var(--primary);
    width: 100%;
    padding: 2rem 1rem;
    transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    justify-content: flex-start;
    gap: 0;
    overflow-y: auto;
    align-items: center;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    width: auto;
    position: relative;
  }

  .nav-links a {
    padding: 1rem 0;
    font-size: 1.3rem;
    display: block;
    text-align: center;
    position: relative;
    width: max-content;
    margin: 0 auto;
  }

  .nav-links a::after {
    content: '';
    display: block;
    margin: 0.4rem auto 0;
    height: 3px;
    width: 0;
    background: var(--accent2);
    transition: width 0.3s ease;
  }

  .nav-links a.active::after {
    width: 60%;
  }

  .main-content {
    padding: 7rem 1rem 2rem;
  }

  .line:nth-child(1) {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
  }

  .line:nth-child(2),
  .line:nth-child(3) {
    font-size: 1.5rem;
  }

  .social-links {
    gap: 1rem;
  }

  .social-icon {
    width: 38px;
    height: 38px;
  }

  .mobile-menu-btn.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
  }

  .mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
  }

  .about-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 1rem !important;
  }

  .profile-image {
    order: -1;
    margin-bottom: 1.5rem;
  }

  .project-grid {
    grid-template-columns: 1fr !important;
    padding: 0 !important;
  }

  .contact-form {
    padding: 1.5rem !important;
  }

  /* Projects page mobile styles */
  .projects-mosaic {
    grid-template-columns: 1fr;
  }
  
  .mosaic-item.large {
    grid-column: span 1;
  }
  
  .mosaic-item.large .mosaic-image {
    height: 200px;
  }
  
  .category-toggle {
    gap: 0.5rem;
  }
  
  .toggle-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

.social-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  padding: 8px;
  transition: background 0.3s ease, transform 0.3s ease, fill 0.3s ease;
  fill: #0F0F0F;
}

.social-icon:hover {
  background: var(--accent);
  transform: scale(1.1);
  fill: #fff;
}

@media (min-width: 769px) and (max-width: 1024px) {
  .nav-links {
    gap: 1.5rem;
  }

  .line:nth-child(1) {
    font-size: 4.5rem;
  }

  .line:nth-child(2),
  .line:nth-child(3) {
    font-size: 2rem;
  }

  .main-content {
    padding: 9rem 2rem 2rem;
  }
  
  .projects-mosaic {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}