/* public/css/style.css */
:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --text-muted: #6b7280;
  --accent-blue: #0095f6;
  --card-bg: #f5f5f5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* background-color: #000; */
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.app-container {
  max-width: 566px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 1px 10px 2px rgba(0, 0, 0, .5019607843) !important;
  border-radius: 30px 30px 0 0;
  position: relative;
  min-height: calc(100vh - 40px);
  background-color: #fff;
  z-index: 1;
  /* page-content flows inside — window handles scroll */
}

/* Hero Section */
.hero-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 320px;
  z-index: 1;
  overflow: hidden;
  border-radius: 30px 30px 0 0;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  /* Eased scrim — approximates a cubic curve so there's no visible
     hard line where a 2-stop linear gradient would peak. */
  background: linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.013) 8.1%,
      rgba(255, 255, 255, 0.049) 15.5%,
      rgba(255, 255, 255, 0.104) 22.5%,
      rgba(255, 255, 255, 0.175) 29%,
      rgba(255, 255, 255, 0.259) 35.3%,
      rgba(255, 255, 255, 0.352) 41.2%,
      rgba(255, 255, 255, 0.450) 47.1%,
      rgba(255, 255, 255, 0.550) 52.9%,
      rgba(255, 255, 255, 0.648) 58.8%,
      rgba(255, 255, 255, 0.741) 64.7%,
      rgba(255, 255, 255, 0.825) 71%,
      rgba(255, 255, 255, 0.896) 77.5%,
      rgba(255, 255, 255, 0.951) 84.5%,
      rgba(255, 255, 255, 0.987) 91.9%,
      rgba(255, 255, 255, 1) 100%);
  pointer-events: none;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* Content Flow Container (natural flow, window scrolls) */
.page-content {
  position: relative;
  z-index: 2;
  padding-top: 250px;
  /* space for the hero background */
  background: transparent;
}

/* Sticky Header — pinned at the top of the viewport, aligned to app-container */
.sticky-header {
  position: relative;
  left: 50%;
  transform: translate(-50%, -100%);
  width: 100%;
  max-width: 566px;
  height: 60px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.sticky-header.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.sticky-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sticky-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sticky-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sticky-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
}

.sticky-share {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sticky-share:hover {
  background: #e0e0e0;
}

.sticky-share svg {
  width: 20px;
  height: 20px;
  color: var(--text-color);
}

/* Profile Header */
.profile-header {
  padding: 0 20px 24px 20px;
  text-align: center;
  position: relative;
  background: #fff;
  z-index: 4;
}

/* When sticky-header is visible, hide the profile-header entirely. */
.profile-header.snapped {
  display: none;
}

.avatar-container {
  width: 100%;
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: var(--accent-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.avatar-badge svg {
  width: 12px;
  height: 12px;
  fill: white;
}

.profile-name {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-handle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Social Icons */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s;
}

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

.social-icon svg {
  width: 18px;
  height: 18px;
}

.social-icon.onlyfans {
  background: #00aff0;
}

.social-icon.x-twitter {
  background: #000;
}

/* Links Grid */
.links-grid {
  padding: 10px 16px 40px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

/* Image Card (Full-bleed image with overlay) */
.image-card {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
  border-radius: 12px;
}

.image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 aspect ratio */
  background: #f0f0f0;
}

.card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-icon {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.image-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 14px 14px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
}

.image-text span {
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Simple Text Link Card */
.text-card {
  position: relative;
  width: 100%;
  padding: 16px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  background: var(--card-bg);
  transition: background-color 0.2s;
}

.text-card:hover {
  background: #eaeaea;
}

.text-card:active {
  background: #e0e0e0;
}

.text-card-content {
  flex: 1;
  min-width: 0;
}

.text-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-color);
}

.text-card svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Redirect Page */
.redirect-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  width: 100%;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 2rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 400px) {
  .links-grid {
    border: 10px;
    padding: 0 12px 30px 12px;
    gap: 8px;
    margin-bottom: 50px;
  }

  .text-card {
    padding: 14px 16px;
  }
}