body {
  background-color: #1a1a1a;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  overflow-y: auto; /* Allow vertical scrolling when needed */
}

/* Main background image */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../img/bg.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: -2;
  opacity: 0.85;
}

/* Blurred edge extension effect (Apple-style) */
body::after {
  content: '';
  position: fixed;
  top: -20%;
  left: -20%;
  right: -20%;
  bottom: -20%;
  background-image: url('../img/bg.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(40px) brightness(0.8);
  z-index: -3;
  opacity: 0.6;
  transform: scale(1.2);
}

/* Container styling - allow scrolling when content exceeds viewport */
.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  /* Add this to ensure proper vertical centering */
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Profile card - adjust internal spacing for better visual balance */
.profile-card {
  width: 50%;
  max-width: 600px;
  background: rgba(24, 24, 24, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
  /* Add consistent vertical padding */
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.profile-card__avatar {
  width: 35%; /* Reduced from 50% for better balance */
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  border-radius: 50%;
}

.profile-card__title {
  font-size: 2.5rem;
  color: #fff;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.profile-card__social-icon {
  height: auto;
  width: auto;
  display: inline-block;
  margin-top: 0.75rem;
  margin-bottom: 0;
  padding: 0.75rem;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(180, 180, 180, 0.5);
  transition: all 0.3s ease;
}

.profile-card__social-icon:hover {
  background: rgba(200, 200, 200, 0.92);
  border-color: rgba(180, 180, 180, 1);
  box-shadow: 0 4px 12px rgba(200, 200, 200, 0.25);
  transform: translateY(-2px);
}

.profile-card__social-icon img {
  display: block;
  height: 48px;
  width: 48px;
}

/* Link cards */
.link-card {
  width: 50%;
  max-width: 600px;
  background: rgba(24, 24, 24, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.link-card:hover {
  background: rgba(200, 200, 200, 0.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-color: rgba(180, 180, 180, 1);
  box-shadow: 0 6px 20px rgba(200, 200, 200, 0.25);
  transform: translateY(-2px);
}

.link-card__content {
  display: flex;
  align-items: center;
  flex-grow: 1;
  justify-content: flex-start;
}

.link-card__avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  margin: 1rem;
}

.link-card__body {
  text-align: left;
  padding-left: 1rem;
}

.link-card__title {
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: 0;
  transition: color 0.3s ease;
  font-weight: 500;
}

.link-card:hover .link-card__title {
  color: #1a1a1a;
}

.link-card__arrow {
  margin-left: auto;
  margin-right: 1.5rem;
  font-size: 1.5rem;
  color: #fff;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.link-card:hover .link-card__arrow {
  color: #1a1a1a;
  transform: translateX(4px);
}

/* Responsive design */
@media (max-width: 768px) {
  body::before {
    background-position: 35% center;
    opacity: 0.72;
  }

  .container {
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1rem;
  }

  .profile-card {
    padding-top: 1.2rem;
    padding-bottom: 1.2rem;
  }

  .profile-card,
  .link-card {
    width: 88%;
  }

  .profile-card__avatar {
    width: 30%; /* Further reduced for smaller screens */
  }

  .profile-card__title {
    font-size: 1.8rem;
    margin-top: 0.8rem;
  }

  .profile-card__social-icon {
    margin-top: 0.6rem;
  }

  .link-card__avatar {
    width: 56px;
    height: 56px;
    margin: 0.75rem;
  }

  .link-card__title {
    font-size: 1.1rem;
  }

  .link-card__arrow {
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
  }
}

/* Landscape mode on phones - allow scrolling with reduced sizes */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  body::before {
    background-position: 40% center;
    opacity: 0.65;
  }

  .container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .profile-card,
  .link-card {
    width: 85%;
    border-radius: 8px;
  }

  .profile-card {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  .profile-card__avatar {
    width: 18%; /* Much smaller in landscape */
  }

  .profile-card__title {
    font-size: 1.1rem;
    margin-top: 0.4rem;
    margin-bottom: 0.3rem;
  }

  .profile-card__social-icon {
    padding: 0.4rem;
    margin-top: 0.3rem;
  }

  .profile-card__social-icon img {
    height: 32px;
    width: 32px;
  }

  .link-card__avatar {
    width: 38px;
    height: 38px;
    margin: 0.4rem;
  }

  .link-card__title {
    font-size: 0.85rem;
  }

  .link-card__arrow {
    width: 20px;
    height: 20px;
    font-size: 0.85rem;
    margin-right: 0.8rem;
  }
}

@media (max-width: 480px), (max-height: 700px) {
  body {
    background-attachment: scroll;
  }

  body::before {
    background-size: auto 100%;
    background-position: 40% center;
    opacity: 0.60;
  }

  .container {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    gap: 0.7rem;
  }

  .profile-card {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .profile-card,
  .link-card {
    width: 92%;
    border-radius: 10px;
  }

  .profile-card__avatar {
    width: 28%; /* Smaller for mobile portrait */
  }

  .profile-card__title {
    font-size: 1.5rem;
    margin-top: 0.7rem;
  }

  .profile-card__social-icon {
    padding: 0.6rem;
    margin-top: 0.5rem;
  }

  .profile-card__social-icon img {
    height: 42px;
    width: 42px;
  }

  .link-card__avatar {
    width: 48px;
    height: 48px;
    margin: 0.6rem;
  }

  .link-card__title {
    font-size: 1rem;
  }

  .link-card__arrow {
    width: 26px;
    height: 26px;
    font-size: 1rem;
  }
}

/* Aggressive scaling for very short screens (720p and below) */
@media (max-width: 1280px) and (max-height: 740px), (max-height: 720px) {
  .container {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    gap: 0.6rem;
  }

  .profile-card {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }

  .profile-card,
  .link-card {
    width: min(82%, 440px);
    max-width: 440px;
    border-radius: 10px;
  }

  .profile-card__avatar { 
    width: 24%; /* Smaller for 720p */
  }
  
  .profile-card__title { 
    font-size: 1.3rem;
    margin-top: 0.5rem;
  }

  .profile-card__social-icon {
    padding: 0.5rem;
    margin-top: 0.4rem;
  }

  .profile-card__social-icon img {
    height: 38px;
    width: 38px;
  }

  .link-card__avatar { 
    width: 42px; 
    height: 42px; 
    margin: 0.5rem; 
  }
  
  .link-card__title { 
    font-size: 0.95rem; 
  }
  
  .link-card__arrow { 
    width: 22px; 
    height: 22px; 
    font-size: 0.9rem;
    margin-right: 1rem;
  }

  body::after { 
    filter: blur(42px) brightness(0.78); 
    opacity: 0.55; 
    transform: scale(1.14); 
  }

  .link-card:hover,
  .profile-card:hover { 
    transform: translateY(-2px); 
  }
}

@media (prefers-reduced-motion: no-preference) {
  .link-card,
  .profile-card__social-icon,
  .link-card__arrow {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}