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

:root {
  --bg: #0d0d18;
  --bg-card: #242434;
  --bg-card2: #12121e;
  --bg-card3: #1e1e2d;
  --text: #e9e6f7;
  --text2: #aba9b9;
  --text3: #94a3b8;
  --text4: #64748b;
  --text5: #475569;
  --grad: linear-gradient(45deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  --grad-42: linear-gradient(42.86deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  --accent: #ff8e80;
  --border: rgba(71,71,84,0.4);
  --font: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100vh; overflow-x: hidden; }

.hidden { display: none !important; }
.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px 0 rgba(131,58,180,0.08);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; gap: 32px;
}
.logo {
  font-size: 24px; font-weight: 900; letter-spacing: -0.5px;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; cursor: pointer; white-space: nowrap;
}
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-size: 14px; font-weight: 400; letter-spacing: -0.35px;
  color: var(--text); text-decoration: none; padding-bottom: 2px;
}
.nav-link.active { border-bottom: 2px solid #fd1d1d; }
.nav-link.muted { color: var(--text3); }
.nav-icons { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.05);
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); }
.cursor-pointer { cursor: pointer; }

.nav-search-form { margin-left: auto; position: relative; }
.nav-search-input {
  background: var(--bg-card); border: none; border-radius: 12px;
  padding: 8px 16px 8px 36px;
  width: 256px; font-size: 14px; font-family: var(--font);
  color: var(--text); outline: none;
}
.nav-search-input::placeholder { color: #6b7280; }

/* ── HERO ── */
.hero {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 96px 24px 64px; gap: 40px; text-align: center;
}
.hero-text { display: flex; flex-direction: column; gap: 20px; }
.hero-title {
  font-size: clamp(40px, 6vw, 72px); font-weight: 900;
  letter-spacing: -3.6px; color: var(--text); line-height: 1.1;
}
.gradient-text {
  background: var(--grad-42);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: 18px; color: var(--text2); line-height: 28px; max-width: 560px; }

/* ── SEARCH BOX ── */
.search-box { width: 100%; max-width: 640px; }
.search-inner {
  background: var(--bg-card); border-radius: 16px; padding: 8px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.search-icon { flex-shrink: 0; margin-left: 8px; color: var(--text3); }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 20px; font-weight: 500; font-family: var(--font);
  color: var(--text); padding: 8px 4px;
}
.search-input::placeholder { color: #757482; }
.search-btn {
  background: var(--grad); border: none; border-radius: 12px;
  padding: 16px 32px; font-size: 16px; font-weight: 700;
  font-family: var(--font); color: #fff; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  transition: opacity 0.2s, transform 0.1s;
}
.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.98); }

/* ── RECENT ── */
.recent-section { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.recent-label { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--text2); text-transform: uppercase; }
.recent-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.05); backdrop-filter: blur(10px);
  border: none; border-radius: 9999px; padding: 8px 16px;
  cursor: pointer; color: var(--text); font-size: 14px; font-family: var(--font);
  transition: background 0.2s;
}
.chip:hover { background: rgba(255,255,255,0.1); }
.chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* ── FOOTER ── */
.footer {
  padding: 48px 32px; display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-links { display: flex; gap: 32px; }
.footer-links a { font-size: 12px; font-weight: 300; color: var(--text5); text-decoration: none; }
.footer-links a:hover { color: var(--text3); }
.footer-copy { font-size: 12px; font-weight: 300; color: var(--text4); }

/* ── LOADER ── */
.loader-wrap {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; padding: 80px 24px;
}
.spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: #833ab4;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 16px; color: var(--text2); text-align: center; line-height: 1.6; }
.loader-text small { font-size: 13px; color: var(--text4); }

/* ── ERROR ── */
.error-box {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 80px 24px; text-align: center;
  color: var(--text2); font-size: 16px;
}

/* ── PROFILE ── */
.profile-wrap { flex: 1; max-width: 896px; width: 100%; margin: 0 auto; padding: 40px 24px 0; }
.profile-header { display: flex; gap: 40px; align-items: flex-start; padding-bottom: 32px; }
.avatar-ring {
  flex-shrink: 0; width: 176px; height: 176px; border-radius: 50%;
  padding: 3px; background: var(--grad);
  box-shadow: 0 0 20px 0 rgba(253,29,29,0.2);
}
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); display: block; }
.profile-info { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.profile-name-row { display: flex; align-items: center; gap: 8px; }
.profile-name { font-size: 24px; font-weight: 700; letter-spacing: -0.6px; color: var(--text); }
.profile-username { font-size: 14px; color: var(--text2); }
.stats-row { display: flex; gap: 32px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-val { font-size: 18px; font-weight: 700; color: var(--text); }
.stat-lbl { font-size: 14px; color: var(--text2); }
.profile-bio { font-size: 14px; color: var(--text2); line-height: 22px; }

/* ── HIGHLIGHTS ROW ── */
.highlights-wrap { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 20px 0; overflow-x: auto; }
.highlights-row { display: flex; gap: 20px; }
.highlight-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.highlight-circle { width: 80px; height: 80px; border-radius: 50%; border: 1px solid #474754; padding: 5px; flex-shrink: 0; }
.highlight-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.highlight-label { font-size: 12px; font-weight: 500; color: var(--text2); white-space: nowrap; }

/* ── TABS ── */
.tabs-bar { display: flex; border-top: 1px solid rgba(71,71,84,0.1); margin-top: 24px; }
.tab {
  flex: 1; padding: 16px 8px; background: none; border: none;
  border-top: 2px solid transparent; cursor: pointer;
  font-size: 14px; font-weight: 500; letter-spacing: 1.4px;
  color: var(--text2); font-family: var(--font); transition: color 0.2s, border-color 0.2s;
}
.tab.active { border-top-color: var(--accent); color: var(--text); font-weight: 700; }
.tab:hover:not(.active) { color: var(--text); }
.tab-content { padding: 24px 0; }

/* ── POSTS GRID ── */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.post-card { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-card2); border-radius: 4px; cursor: pointer; }
.post-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  display: flex; align-items: center; justify-content: center; gap: 20px;
  transition: background 0.2s;
}
.post-card:hover .post-overlay { background: rgba(0,0,0,0.4); }
.post-stat { color: #fff; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity 0.2s; }
.post-card:hover .post-stat { opacity: 1; }
.badge { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 4px; }

/* ── STORIES GRID ── */
.stories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.story-card { position: relative; aspect-ratio: 9/16; overflow: hidden; background: var(--bg-card2); border-radius: 12px; cursor: pointer; }
.story-card img, .story-card video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── HIGHLIGHTS GRID (tab) ── */
.highlights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px; }

/* ── EMPTY ── */
.empty-msg { color: var(--text2); text-align: center; padding: 40px; font-size: 15px; }

/* ── LIGHTBOX ── */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.9); }
.lightbox-box { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; }
.lb-content img, .lb-content video { max-width: 80vw; max-height: 85vh; border-radius: 12px; object-fit: contain; }
.lb-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  font-size: 20px; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.lb-close:hover { background: rgba(255,255,255,0.2); }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  font-size: 32px; width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.lb-nav:hover { background: rgba(255,255,255,0.2); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-download {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.1); color: #fff; padding: 10px 24px;
  border-radius: 9999px; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.2s; z-index: 2;
}
.lb-download:hover { background: rgba(255,255,255,0.2); }

/* ── FEATURES ROW ── */
.features-row {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-top: 32px;
}
.feature-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 50px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text2);
}

/* ── USERS LIST (followers / following) ── */
.users-list { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.users-list-preview { display: flex; flex-direction: column; gap: 2px; pointer-events: none; }

.user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--bg-card2);
  transition: background 0.15s;
}
.user-card:hover { background: var(--bg-card3); }
.user-card.blurred { filter: blur(5px); opacity: 0.5; }

.user-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-card);
}
.user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
}
.user-handle { font-size: 12px; color: var(--text2); }
.user-view-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; border: none;
  background: var(--bg-card); color: var(--text2);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.user-view-btn:hover { background: var(--accent); color: #fff; }

/* ── PAYWALL ── */
.paywall {
  position: relative; margin-top: -80px; padding-top: 80px;
  text-align: center;
}
.paywall-blur {
  position: absolute; top: 0; left: 0; right: 0; height: 80px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}
.paywall-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 400px; margin: 0 auto 32px;
}
.paywall-icon { font-size: 36px; }
.paywall-title { font-size: 20px; font-weight: 700; color: var(--text); }
.paywall-desc { font-size: 14px; color: var(--text2); text-align: center; }
.paywall-btn {
  margin-top: 8px; padding: 14px 32px; border-radius: 50px; border: none;
  background: var(--grad); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: opacity 0.2s; width: 100%;
}
.paywall-btn:hover { opacity: 0.9; }
.paywall-note { font-size: 12px; color: var(--text4); }

/* ── FAQ ── */
.faq-section { padding: 60px 24px 40px; background: var(--bg-card2); }
.faq-inner { max-width: 760px; margin: 0 auto; }
.faq-title { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 36px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: var(--bg-card3); }
.faq-q { padding: 18px 20px; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after { content: '+'; font-size: 20px; color: var(--accent); transition: transform 0.2s; }
details[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 20px 18px; font-size: 14px; color: var(--text2); line-height: 1.7; }

/* ── TABS scrollable on mobile ── */
.tabs-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs-bar::-webkit-scrollbar { display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .stats-row { justify-content: center; }
  .avatar-ring { width: 120px; height: 120px; }
  .posts-grid { gap: 2px; }
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 36px; letter-spacing: -1.5px; }
  .search-input { font-size: 16px; }
  .search-btn { padding: 12px 20px; font-size: 14px; }
  .navbar-inner { padding: 0 16px; }
  .nav-links { display: none; }
}
