/* Reset / base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8f8f8;
  color: #8b4513;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* New styles for the outer wrapper */
.card-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin: 1rem;
}

.container {
  background-color: #ede0d4; /* Light brown for top part */
  border-bottom-left-radius: 0; /* Square bottom corners */
  border-bottom-right-radius: 0;
  border-top-left-radius: 16px; /* Keep top rounding */
  border-top-right-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  position: relative; /* Keep for Ace positioning */
  z-index: 0; /* Explicitly set stacking level below .links */
}

/* New styles for profile header */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem; /* Add bottom margin like the old profile image had */
}

/* Optional image */
.profile {
  width: 80px; /* Slightly smaller to fit better */
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 1rem; /* Add space between image and name */
}

/* Style for profile name */
.profile-name {
  font-size: 1.75rem; /* Adjust as needed */
  font-weight: 600;
  /* Color inherits from body, which is dark brown */
}

/* Intro paragraph */
.intro {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  text-align: left;
}

/* Adjust styles for the actual links container */
.links {
  /* Keep flex properties for the links themselves */
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem; /* Add space above the links */
  width: 100%; /* Ensure links container takes available width for centering */
}

.section-dropped {
  background-color: rgba(255, 255, 255, 0.1); /* Apply glass background */
  backdrop-filter: blur(10px); /* Apply blur */
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.15); /* Apply top border */
  position: relative; /* Apply position for z-index */
  z-index: 1; /* Apply z-index */

  padding: 1.5rem 2rem; /* Keep padding */
  display: flex;
  flex-direction: column; /* Stack paragraph and links vertically */
  align-items: center; /* Center items horizontally */

  gap: 1rem; /* Adjust gap for vertical spacing */
  flex-wrap: wrap;
  border-bottom-left-radius: 16px; /* Keep bottom rounding */
  border-bottom-right-radius: 16px;
  border-top-left-radius: 0; /* Square top corners */
  border-top-right-radius: 0;
  border-radius: 10px; /* Keep border-radius for shape */
}

.links a {
  color: #8b4513;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
  padding: 0.75rem 1.5rem; /* Keep padding */
  border-radius: 10px; /* Keep border-radius for shape */
}

.links a:hover {
  color: #a0522d; /* Keep color change */
  transform: scale(1.05); /* Keep scaling */
}

/* Style for Ace's photo */
.ace-photo {
  width: 80px; /* Adjust size as needed */
  height: 80px; /* Adjust size as needed */
  object-fit: cover;
  border-radius: 50%; /* Make it circular */
  position: absolute;
  top: -40px; /* Position top edge above container (half of height 80px) */
  left: 50%; /* Position left edge at center */
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 2; /* Make Ace stack above other positioned elements */
  cursor: grab; /* Indicate draggable */
  user-select: none; /* Prevent text selection */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
  transform: translateX(-50%); /* Base transform for centering only */
  /* Add transition for the pop effect */
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Class to trigger the scale down for the pop effect */
.ace-photo.ace-pop {
  transform: scale(0);
}

.ace-photo:active {
  cursor: grabbing; /* Indicate dragging */
}

/* Media Query for smaller screens */
@media (max-width: 480px) {
  .ace-photo {
    top: -30px; /* Half of the mobile height (60px) to maintain overlap */
    width: 60px;
    height: 60px;
  }

  body {
    padding: 0.5rem;
    align-items: flex-start;
  }

  .container {
    padding: 1.5rem; /* Reduce padding on mobile */
  }

  .profile-name {
    font-size: 1.5rem; /* Smaller heading on mobile */
  }

  .intro {
    font-size: 1rem; /* Smaller body text on mobile */
    line-height: 1.5;
    margin-bottom: 1.5rem;
  }

  .section-dropped {
    padding: 1rem 1.5rem;
  }

  .links {
    gap: 1rem;
  }

  .links a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .card-wrapper {
    margin: 0.5rem;
  }
}
