/* ---------- two-column layout ---------- */
.profile-layout{
  max-width:var(--maxw);margin:0 auto;padding:44px 24px 96px;
  display:grid;grid-template-columns:340px 1fr;gap:48px;align-items:start;
}

.sidebar-toggle{
  display:none;
  align-items:center;gap:8px;
  background:var(--surface);border:1px solid var(--line);
  color:var(--text);font-family:var(--font-body);font-weight:600;font-size:13.5px;
  padding:10px 16px;border-radius:999px;cursor:pointer;
  position:sticky;top:88px;z-index:40;margin-bottom:18px;
}
.sidebar-toggle svg{width:16px;height:16px;}

.sidebar-backdrop{
  display:none;
  position:fixed;inset:0;background:rgba(0,0,0,0.6);
  z-index:150;opacity:0;pointer-events:none;transition:opacity .25s ease;
}
.sidebar-backdrop.show{opacity:1;pointer-events:auto;}

.sidebar-close{display:none;}

/* ---------- profile sidebar (left) ---------- */
.profile-sidebar{
  position:relative;text-align:center;
  background:var(--surface);border:1px solid var(--line);
  border-radius:18px;padding:32px 26px 28px;
  overflow:hidden;
}
.profile-glow{
  position:absolute;top:-60px;left:50%;transform:translateX(-50%);
  width:280px;height:220px;
  background:radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events:none;filter:blur(4px);z-index:0;
}
.profile-sidebar > *:not(.profile-glow){position:relative;z-index:1;}

.avatar-lg{
  width:104px;height:104px;margin:6px auto 20px;
  clip-path:path('M16,0 L59,0 L104,45 L104,88 A16,16 0 0 1 88,104 L16,104 A16,16 0 0 1 0,88 L0,16 A16,16 0 0 1 16,0 Z');
  background:linear-gradient(135deg, var(--accent) 0%, #4D7FFF 45%, #B24BFF 100%);
  box-shadow:0 0 24px -6px var(--accent-glow);
  display:block;padding:0;border:0;cursor:pointer;
  transition:transform .15s ease;
}
.avatar-lg:hover{transform:scale(1.03);}
.avatar-lg img{
  position:absolute;top:4px;left:4px;width:96px;height:96px;
  object-fit:cover;display:block;
  clip-path:path('M15,0 L54,0 L96,42 L96,81 A15,15 0 0 1 81,96 L15,96 A15,15 0 0 1 0,81 L0,15 A15,15 0 0 1 15,0 Z');
}
.avatar-lg::after{
  content:"";position:absolute;top:4px;left:4px;width:96px;height:96px;
  clip-path:path('M15,0 L54,0 L96,42 L96,81 A15,15 0 0 1 81,96 L15,96 A15,15 0 0 1 0,81 L0,15 A15,15 0 0 1 15,0 Z');
  background:linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 68%, rgba(255,255,255,0.12) 100%);
  pointer-events:none;
}

.profile-name-row{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:6px;}
.profile-name-row h1{font-size:23px;}
.profile-handle{font-family:var(--font-mono);font-size:13px;color:var(--text-faint);margin-top:6px;}

.zf-badge{
  display:inline-flex;align-items:center;gap:7px;
  background:var(--accent);color:var(--bg);
  font-family:var(--font-mono);font-weight:700;font-size:12.5px;
  padding:8px 14px;border-radius:9px;
  margin-top:16px;
}
.zf-badge b{font-weight:700;}

.profile-meta{
  display:flex;align-items:center;justify-content:center;gap:8px;
  margin-top:15px;font-family:var(--font-mono);font-size:12px;color:var(--text-dim);
}
.profile-meta span{display:inline-flex;align-items:center;gap:5px;}
.profile-meta svg{width:13px;height:13px;color:var(--text-faint);}
.profile-meta .sep{color:var(--text-faint);}

.profile-bio{
  margin:18px auto 0;max-width:38ch;
  font-size:14px;line-height:1.6;color:var(--text-dim);
}

/* ---------- links (inside sidebar) ---------- */
.links{margin-top:26px;display:flex;flex-direction:column;gap:9px;text-align:left;}
.link-row{
  display:flex;align-items:center;gap:12px;
  background:var(--surface-2);border:1px solid var(--line);
  border-radius:12px;padding:13px 15px;
  font-size:13.5px;font-weight:500;text-decoration:none;
  transition:border-color .15s ease, transform .15s ease;
}
.link-row:hover{border-color:var(--accent);transform:translateX(2px);}
.link-row svg{width:17px;height:17px;flex:none;color:var(--text-dim);}
.link-row span{flex:1;text-align:left;}
.link-row .chev{width:13px;height:13px;color:var(--text-faint);}
.link-row.disabled{opacity:0.4;cursor:not-allowed;}
.link-row.disabled:hover{border-color:var(--line);transform:none;}

/* ---------- feed (right) ---------- */
.profile-feed{min-width:0;}
.feed-head{margin-bottom:20px;}
.feed-item{
  background:var(--surface);border:1px solid var(--line);
  border-radius:14px;padding:19px 21px;margin-bottom:14px;
}
.feed-time{font-family:var(--font-mono);font-size:11.5px;color:var(--text-faint);margin-bottom:10px;}
.feed-text{font-size:14.5px;color:var(--text);line-height:1.6;}
.feed-photo{
  margin-top:14px;border-radius:10px;overflow:hidden;
  aspect-ratio:16/9;border:1px solid var(--line);
  display:block;width:100%;padding:0;background:none;cursor:pointer;
  transition:opacity .15s ease;
}
.feed-photo:hover{opacity:0.9;}
.feed-photo img{width:100%;height:100%;object-fit:cover;display:block;}

/* ---------- mobile: stack + off-canvas sidebar ---------- */
@media (max-width:860px){
  .profile-layout{grid-template-columns:1fr;gap:0;padding-top:20px;}
  .sidebar-toggle{display:inline-flex;}
  .sidebar-backdrop{display:block;}

  .profile-sidebar{
    position:fixed;top:0;left:0;bottom:0;
    width:86vw;max-width:340px;
    margin:0;border-radius:0;border:0;border-right:1px solid var(--line);
    padding:24px 22px 32px;
    overflow-y:auto;overflow-x:hidden;
    transform:translateX(-100%);
    transition:transform .25s ease;
    z-index:200;text-align:left;
  }
  .profile-sidebar.open{transform:translateX(0);}
  .profile-sidebar .avatar-lg,
  .profile-sidebar .profile-name-row,
  .profile-sidebar .profile-handle,
  .profile-sidebar .zf-badge,
  .profile-sidebar .profile-meta{margin-left:auto;margin-right:auto;}
  .profile-sidebar .profile-name-row{width:fit-content;}

  .sidebar-close{
    display:flex;align-items:center;justify-content:center;
    width:32px;height:32px;margin-left:auto;margin-bottom:12px;
    background:var(--surface-2);border:1px solid var(--line);border-radius:50%;
    color:var(--text-dim);cursor:pointer;
  }
  .sidebar-close svg{width:15px;height:15px;}
}

/* ---------- lightbox viewer ---------- */
.lightbox{
  display:none;position:fixed;inset:0;z-index:500;
  background:rgba(6,6,6,0.96);
  align-items:center;justify-content:center;
}
.lightbox.open{display:flex;}
.lightbox-stage{
  width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;touch-action:none;cursor:zoom-out;
}
.lightbox-stage img{
  max-width:90vw;max-height:86vh;
  border-radius:10px;
  touch-action:none;user-select:none;-webkit-user-drag:none;
  cursor:grab;
  box-shadow:0 30px 80px -20px rgba(0,0,0,0.7);
}
.lightbox-close{
  position:fixed;top:18px;right:18px;z-index:510;
  width:40px;height:40px;border-radius:50%;
  background:var(--surface);border:1px solid var(--line);
  color:var(--text);display:flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.lightbox-close:hover{border-color:var(--accent);}
.lightbox-close svg{width:17px;height:17px;}
.lightbox-hint{
  position:fixed;bottom:22px;left:50%;transform:translateX(-50%);
  font-family:var(--font-mono);font-size:11.5px;color:var(--text-dim);
  background:var(--surface);border:1px solid var(--line);
  padding:7px 14px;border-radius:999px;
  pointer-events:none;opacity:0;transition:opacity .4s ease;
  z-index:510;white-space:nowrap;
}
@media (max-width:600px){
  .lightbox-hint{font-size:10.5px;padding:6px 12px;}
}
