/* ── Reset & Root ──────────────────────────────────────– */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.5;
  background: #0a0a0a;
  color: #fff;
  overflow-x: hidden;
}

/* ── Main Page ─────────────────────────────────────────– */

.page {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
}

/* ── Hero Section (Photo + Profile) ────────────────────– */

.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 3rem;
  background: linear-gradient(135deg, #2d1b69 0%, #11001c 100%);
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Dark gradient overlay at bottom */

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.6) 70%,
    #0a0a0a 100%
  );
  pointer-events: none;
}

/* ── Profile info (below photo, on black) ──────────────── */

.profile {
  background: #0a0a0a;
  text-align: center;
  padding: 1.25rem 1.5rem 1.5rem;
  margin-top: -2px;
}

.profile__name {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: visible;
  /* font-size set dynamically by JS based on name length */
  font-size: 2.5rem;
}

.profile__title {
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.25rem;
}

/* ── Social Links ──────────────────────────────────────– */

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.social-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 200ms ease,
    transform 200ms ease;
  border: none;
  padding: 0;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.social-link svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
}

/* ── Sections (Tabs) ───────────────────────────────────– */

.sections {
  flex: 1;
  background: #0a0a0a;
  border-top: none;
  display: flex;
  flex-direction: column;
}

.sections__nav {
  display: flex;
  padding: 1rem 1.5rem;
  gap: 1.5rem;
  overflow-x: auto;
  border-bottom: none;
  scroll-behavior: smooth;
}

.sections__nav::-webkit-scrollbar {
  height: 2px;
}

.sections__nav::-webkit-scrollbar-track {
  background: transparent;
}

.sections__nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.section-tab {
  flex-shrink: 0;
  padding: 0.5rem 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.section-tab:hover {
  color: rgba(255, 255, 255, 0.8);
}

.section-tab.active {
  color: #fff;
  border-bottom-color: #fff;
}

.sections__content {
  flex: 1;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

.section-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-item {
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: all 200ms ease;
  display: block;
}

.section-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.section-item__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.section-item__description {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.section-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Footer ────────────────────────────────────────────– */

.footer {
  background: #0a0a0a;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
}

.footer__visits {
  margin-bottom: 0.4rem;
}

/* ── Animations ────────────────────────────────────────– */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.social-link:nth-child(1) {
  animation: fade-up 0.6s 0.3s ease both;
}

.social-link:nth-child(2) {
  animation: fade-up 0.6s 0.35s ease both;
}

.social-link:nth-child(3) {
  animation: fade-up 0.6s 0.4s ease both;
}

.social-link:nth-child(4) {
  animation: fade-up 0.6s 0.45s ease both;
}

.social-link:nth-child(5) {
  animation: fade-up 0.6s 0.5s ease both;
}

.social-link:nth-child(n + 6) {
  animation: fade-up 0.6s 0.55s ease both;
}

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

@media (max-width: 640px) {
  .hero {
    aspect-ratio: 1 / 1.1;
    padding-bottom: 2rem;
  }

  .hero__name {
    font-size: clamp(2rem, 6vw, 2.5rem);
  }

  .hero__title {
    font-size: 0.9rem;
  }

  .sections__nav {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .section-tab {
    font-size: 0.85rem;
  }

  .sections__content {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 380px) {
  .hero {
    aspect-ratio: 1 / 1;
    padding-bottom: 1.5rem;
  }

  .hero__content {
    padding: 0 1rem;
  }

  .hero__name {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }

  .hero__title {
    font-size: 0.85rem;
  }

  .social-links {
    gap: 1rem;
  }

  .social-link {
    width: 28px;
    height: 28px;
  }

  .section-tab {
    font-size: 0.8rem;
  }
}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
