*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --main:        #879AAC;
  --main-light:  #c2cdd7;
  --main-dim:    #dce4ea;
  --main-deep:   #5a7387;
  --bg:          #f6f8fa;
  --bg-2:        #edf0f3;
  --bg-3:        #e2e7ec;
  --border:      rgba(135,154,172,0.18);
  --border-mid:  rgba(135,154,172,0.32);
  --text:        #1e2428;
  --muted:       #6a7d8c;
  --dim:         #a4b4bf;
  --display:     'Playfair Display', Georgia, serif;
  --sans:        'DM Sans', sans-serif;
  --gsans:       'Google Sans', sans-serif;
  --mono:        'DM Mono', monospace;
}

html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--gsans);
  font-size: 15px;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(135,154,172,0.10) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ─── LAYOUT ─── */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── LEFT SIDEBAR ─── */
.sidebar-left {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 2rem;
  border-right: 0.5px solid var(--border-mid);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  border-radius: 99px;
  transition: background 0.14s;
}
.brand:hover { background: var(--bg-2); }
.brand-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--main);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0.8rem 1rem;
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--gsans);
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background 0.14s, color 0.14s;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active { color: var(--text); font-weight: 500; }
.nav-item.active .nav-icon { color: var(--main-deep); }

.nav-icon {
  width: 22px;
  font-size: 18px;
  color: var(--dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color 0.14s;
}
.nav-item:hover .nav-icon { color: var(--main); }

.nav-divider {
  height: 0.5px;
  background: var(--border);
  margin: 0.75rem 0;
}

.back-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1rem;
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  margin-top: auto;
}
.back-nav:hover { background: var(--bg-2); color: var(--muted); }

/* ─── CENTER ─── */
.center {
  border-right: 0.5px solid var(--border-mid);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── PROFILE HEADER ─── */
.profile-header { position: relative; }

.banner {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, var(--main-dim) 0%, var(--bg-3) 50%, var(--main-light) 100%);
  position: relative;
  overflow: hidden;
}
.banner img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.banner-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-info-row {
  padding: 0 1.25rem;
  margin-bottom: 0;
}

.avatar-wrap {
  margin-top: -38px;
  margin-bottom: 12px;
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--bg-2);
  overflow: hidden;
  position: relative;
}
.avatar-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.avatar-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 26px;
  font-style: italic;
  color: var(--main);
  background: var(--bg-2);
}

.profile-name {
  font-family: var(--gsans);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1px;
}
.profile-handle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.profile-bio {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 10px;
}
.profile-bio em { color: var(--main-deep); font-style: italic; }

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.profile-meta span { display: flex; align-items: center; gap: 5px; }
.profile-meta i { color: var(--main); }

.profile-stats {
  display: flex;
  gap: 18px;
  font-family: var(--gsans);
  font-size: 13px;
  color: var(--dim);
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--border);
}
.stat-n { font-weight: 700; color: var(--text); margin-right: 3px; }
.profile-stats a { text-decoration: none; color: inherit; transition: color 0.14s; }
.profile-stats a:hover { color: var(--text); text-decoration: underline; }

/* ─── SECTION TABS ─── */
.section-tabs {
  display: flex;
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(246,248,250,0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.tab-btn {
  flex: 1;
  padding: 1rem 0.5rem;
  font-family: var(--gsans);
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.14s, background 0.14s;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -0.5px;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 99px;
  background: var(--main-deep);
  opacity: 0;
  transition: opacity 0.18s;
}
.tab-btn:hover { background: var(--bg-2); color: var(--muted); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after { opacity: 1; }

/* ─── CONTENT SECTIONS ─── */
.section { display: none; padding: 1rem 0; }
.section.active { display: block; }

/* ─── TWEETS / POSTS ─── */
.post {
  display: flex;
  gap: 12px;
  padding: 1rem 1.25rem;
  border-bottom: 0.5px solid var(--border);
  transition: background 0.12s;
  cursor: default;
}
.post:hover { background: var(--bg-2); }
.post-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 0.5px solid var(--border-mid);
  flex-shrink: 0;
  overflow: hidden;
}
.post-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.post-body { flex: 1; min-width: 0; }
.post-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.post-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.post-handle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}
.post-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  margin-left: auto;
}
.post-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 10px;
}
.post-text em { color: var(--main-deep); font-style: italic; }
.post-text a { color: var(--main-deep); text-decoration: none; }
.post-text a:hover { text-decoration: underline; }
.post-img {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  margin-bottom: 10px;
  background: var(--bg-3);
}
.post-img img {
  width: 100%; height: auto;
  display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.post-img-ph {
  width: 100%; aspect-ratio: auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  gap: 8px;
}
.post-actions {
  display: flex;
  gap: 22px;
}
.post-action {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.14s;
  border: none;
  background: none;
  padding: 0;
}
.post-action:hover { color: var(--main-deep); }
.post-action i { font-size: 14px; }

/* featured post */
.post.featured {
  background: linear-gradient(135deg, rgba(135,154,172,0.04) 0%, transparent 100%);
  border-left: 2px solid var(--main);
}

/* ─── PINNED LABEL ─── */
.pinned-label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0.5rem 1.25rem 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ─── Q&A SECTION ─── */
.qa-item {
  padding: 1.1rem 1.25rem;
  border-bottom: 0.5px solid var(--border);
}
.qa-q {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.qa-badge {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.qa-badge.q { background: var(--main-dim); color: var(--main-deep); }
.qa-badge.a { background: var(--bg-3); color: var(--muted); }
.qa-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
}
.qa-a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding-left: 0;
}
.qa-a .qa-text { color: var(--muted); }
.qa-a em { color: var(--main-deep); font-style: italic; }
.qa-a a { color: var(--main-deep); text-decoration: none; }
.qa-a a:hover { text-decoration: underline; }

.qa-img {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 0.5px solid var(--border-mid);
  background: var(--bg-3);
  max-width: 360px;
}
.qa-img img {
  width: 100%; height: auto;
  display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.qa-img-ph {
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-direction: column;
  gap: 6px;
}

/* ─── GALLERY SECTION ─── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
}
.gallery-cell {
  aspect-ratio: 1;
  background: var(--bg-3);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}
.gallery-cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.18s, transform 0.22s;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.gallery-cell:hover img { opacity: 0.85; transform: scale(1.03); }
.gallery-ph {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gallery-ph i { font-size: 20px; }

/* ─── LIGHTBOX ─── */
#lb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
#lb-overlay.open { display: flex; }
#lb-img {
  max-width: min(90vw, 700px);
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
#lb-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 10px;
  transition: color 0.14s;
}
#lb-close:hover { color: #fff; }

/* ─── RIGHT SIDEBAR ─── */
.sidebar-right {
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-right::-webkit-scrollbar { width: 3px; }
.sidebar-right::-webkit-scrollbar-track { background: transparent; }
.sidebar-right::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 99px; }

.widget {
  background: var(--bg-2);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  padding-bottom: 0rem;
}
.widget-head {
  padding: 14px 16px 10px;
  font-family: var(--gsans);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 0.5px solid var(--border);
}

/* what's happening */
.happening-item {
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.happening-item:last-child { border-bottom: none; }
.happening-item:hover { background: var(--bg-3); }
.hap-cat {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 2px;
}
.hap-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.hap-count { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 2px; }

/* who to follow */
.follow-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
  transition: background 0.12s;
}
.follow-item:last-child { border-bottom: none; }
.follow-item:hover { background: var(--bg-3); }
.img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.follow-av {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 0.5px solid var(--border-mid);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
  color: var(--main);
}
.follow-info { flex: 1; min-width: 0; }
.follow-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.follow-handle { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.follow-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--main-deep);
  background: rgba(135,154,172,0.10);
  border: 0.5px solid var(--main-light);
  border-radius: 99px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.14s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.follow-btn:hover { background: rgba(135,154,172,0.20); }

/* trending */
.trend-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.trend-item:last-child { border-bottom: none; }
.trend-item:hover { background: var(--bg-3); }
.trend-left
.trend-cat { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }
.trend-tag { font-size: 13px; font-weight: 600; color: var(--text); }
.trend-count { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 2px; }
.trend-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  flex-shrink: 0;
}

.sidebar-foot {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-align: center;
  padding: 0.5rem 0 0.25rem;
  margin-top: auto;
}
.sidebar-foot a { color: var(--main); text-decoration: none; }

/* ─── EMPTY STATE ─── */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.empty-state i { font-size: 28px; display: block; margin-bottom: 10px; color: var(--main-dim); }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app { animation: fadeUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }
.post, .qa-item, .gallery-cell { animation: fadeUp 0.35s cubic-bezier(0.22,1,0.36,1) both; }

/* ─── MOBILE ─── */
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar-right { display: none; }
  .brand-name { display: none; }
  .nav-item span:not(.nav-icon) { display: none; }
  .back-nav span { display: none; }
  .nav-item { justify-content: center; padding: 0.9rem; }
  .sidebar-left { padding: 1rem 0.5rem; align-items: center; }
  .brand { justify-content: center; padding: 0.75rem; }
}

@media (max-width: 600px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .sidebar-left {
    display: none;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    border-right: none;
    border-top: 0.5px solid var(--border-mid);
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 100;
    background: rgba(246,248,250,0.97);
    backdrop-filter: blur(12px);
    overflow: visible;
    width: 100%;
  }
  .brand { display: none; }
  .nav-list { flex-direction: row; gap: 0; flex: unset; width: 100%; justify-content: space-around; }
  .nav-divider { display: none; }
  .back-nav { display: none; }
  .nav-item { justify-content: center; padding: 0.6rem; width: auto; flex: 1; }
  .nav-icon { font-size: 20px; }
  .center { padding-bottom: 80px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}