/* ══════════════════════════════════════════
   Profile page
   Requires: site.css (base variables)
   ══════════════════════════════════════════ */

/* ── Profile-specific tokens ─────────────
   Only values that genuinely differ from
   the base palette in site.css.
   Everything else uses --bg, --text, etc.
   ──────────────────────────────────────── */

:root {
  --prof-accent-soft: rgba(196, 69, 54, 0.12);
  --prof-accent-glow: rgba(196, 69, 54, 0.25);
  --prof-divider: rgba(44, 37, 32, 0.08);

  /* stat card colors (from mobile app colors.ts) */
  --stat-books: #e08b6d;
  --stat-artworks: #e67e22;
  --stat-followers: #daa520;
  --stat-following: #c44536;
  --stat-likes: #ff5f6d;
}

/* ── Hero ─────────────────────────────────── */

.prof-hero {
  position: relative;
  padding: 56px 0 48px;
  overflow: hidden;
  background: var(--bg);
}

.prof-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 340px;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 0%,
      var(--prof-accent-soft) 0%,
      transparent 70%
    ),
    linear-gradient(180deg, var(--bg-subtle) 0%, var(--bg) 100%);
  z-index: 0;
}

.prof-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 340px;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C44536' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: 0;
}

.prof-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* ── Profile card ─────────────────────────── */

.prof-card {
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow:
    0 1px 2px rgba(44, 37, 32, 0.04),
    0 4px 12px rgba(44, 37, 32, 0.04),
    0 16px 40px rgba(44, 37, 32, 0.06);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: prof-fade 0.6s ease-out 0.05s both;
}

/* ── Avatar ────────────────────────────────── */

.prof-avatar {
  margin-bottom: 24px;
  animation: prof-zoom 0.8s var(--bounce) both;
}

.prof-avatar__ring {
  display: block;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--accent),
    var(--primary)
  );
  box-shadow:
    0 8px 32px var(--prof-accent-glow),
    0 0 0 6px rgba(255, 255, 255, 0.7);
  animation: prof-pulse 4s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.prof-avatar__ring:hover {
  transform: scale(1.03);
}

.prof-avatar__ring:active {
  transform: scale(0.96);
}

.prof-avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--bg-subtle);
}

.prof-avatar__ph {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0e6dd, #e8ddd3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Lora", Georgia, serif;
  font-size: 56px;
  color: var(--primary);
  user-select: none;
}

/* ── Name ──────────────────────────────────── */

.prof-name {
  font-family: "Lora", Georgia, serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.5px;
  margin: 0 0 12px;
  animation: prof-fade 0.6s ease-out 0.25s both;
}

/* ── Bio + location ───────────────────────── */

.prof-bio {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 520px;
  margin: 0 auto 28px;
  animation: prof-fade 0.6s ease-out 0.4s both;
}

.prof-bio__sep {
  margin: 0 4px;
  color: var(--text-4);
}

.prof-bio__location {
  white-space: nowrap;
}

/* ── Stats — colored cards ────────────────── */

.prof-stats {
  display: flex;
  gap: 8px;
  width: 100%;
}

.prof-stat {
  flex: 1;
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-bottom-width: 3px;
  border-bottom-color: rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  animation: prof-slideRight 0.5s ease-out both;
  overflow: hidden;
}

.prof-stat:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.08);
}

.prof-stat:nth-child(1) {
  animation-delay: 0.3s;
}
.prof-stat:nth-child(2) {
  animation-delay: 0.38s;
}
.prof-stat:nth-child(3) {
  animation-delay: 0.46s;
}
.prof-stat:nth-child(4) {
  animation-delay: 0.54s;
}
.prof-stat:nth-child(5) {
  animation-delay: 0.62s;
}

.prof-stat--books {
  background: var(--stat-books);
}
.prof-stat--artworks {
  background: var(--stat-artworks);
}
.prof-stat--followers {
  background: var(--stat-followers);
}
.prof-stat--following {
  background: var(--stat-following);
}
.prof-stat--likes {
  background: var(--stat-likes);
}

.prof-stat__value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  display: block;
  line-height: 1.1;
  margin-bottom: 3px;
}

.prof-stat__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.92);
}

/* ── Gallery section ──────────────────────── */

.prof-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
  background: var(--bg);
}

.prof-gallery__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--prof-divider);
  animation: prof-fade 0.6s ease-out 0.65s both;
}

.prof-gallery__title {
  font-family: "Lora", Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prof-gallery__count {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: var(--prof-accent-soft);
  padding: 4px 12px;
  border-radius: 100px;
}

/* ── Grid stagger ─────────────────────────── */

.prof-gallery .grid__item {
  animation: prof-up 0.6s ease-out both;
}
.prof-gallery .grid__item:nth-child(2) {
  animation-delay: 0.7s;
}
.prof-gallery .grid__item:nth-child(3) {
  animation-delay: 0.75s;
}
.prof-gallery .grid__item:nth-child(4) {
  animation-delay: 0.8s;
}
.prof-gallery .grid__item:nth-child(5) {
  animation-delay: 0.85s;
}
.prof-gallery .grid__item:nth-child(6) {
  animation-delay: 0.9s;
}
.prof-gallery .grid__item:nth-child(n + 7) {
  animation-delay: 0.95s;
}

/* ── Empty state ──────────────────────────── */

.prof-empty {
  text-align: center;
  padding: 80px 24px;
  animation: prof-fade 0.8s ease-out 0.4s both;
}

.prof-empty__icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--prof-accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}

.prof-empty__title {
  font-family: "Lora", Georgia, serif;
  font-size: 22px;
  color: var(--text);
  margin: 0 0 8px;
}

.prof-empty__text {
  font-size: 15px;
  color: var(--text-4);
}

/* ── Keyframes ────────────────────────────── */

@keyframes prof-zoom {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes prof-fade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes prof-slideRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes prof-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes prof-pulse {
  0%,
  100% {
    box-shadow:
      0 8px 32px var(--prof-accent-glow),
      0 0 0 6px rgba(255, 255, 255, 0.7);
  }
  50% {
    box-shadow:
      0 8px 40px rgba(196, 69, 54, 0.35),
      0 0 0 6px rgba(255, 255, 255, 0.8);
  }
}

/* ── Responsive ───────────────────────────── */

@media (max-width: 768px) {
  .prof-hero {
    padding-top: 40px;
    padding-bottom: 36px;
  }
  .prof-name {
    font-size: 28px;
  }
  .prof-card {
    padding: 36px 24px 32px;
    border-radius: 20px;
  }
  .prof-stats {
    flex-wrap: wrap;
    justify-content: center;
  }
  .prof-stat {
    min-width: 72px;
  }
  .prof-gallery {
    padding: 0 16px 60px;
  }
  .prof-gallery__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .prof-avatar__ring {
    width: 132px;
    height: 132px;
  }
  .prof-avatar__ph {
    font-size: 44px;
  }
}

@media (max-width: 480px) {
  .prof-card {
    padding: 28px 16px 24px;
    border-radius: 16px;
    margin: 0 -8px;
  }
  .prof-stat {
    padding: 10px 6px;
    min-height: 64px;
  }
  .prof-stat__value {
    font-size: 18px;
  }
  .prof-stat__label {
    font-size: 9px;
  }
}
