@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500&family=Inter:wght@300&display=swap');

:root{
  --bg: #0b0b0b;
  --fg: #f2f2f2;
  --muted: rgba(255,255,255,0.75);
  --panel: rgba(0,0,0,0.62);
  --panel-strong: rgba(0,0,0,0.75);
}

* { box-sizing: border-box; }

body{
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  display: flex;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.wrap{
  width: 100%;
  max-width: 1100px;
}

/* Return */
.return-btn{
  position: fixed;
  top: 18px;
  left: 18px;

  text-decoration: none;
  color: var(--fg);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  padding: .6rem .9rem;
  border-radius: 999px;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.return-btn:hover{
  border-color: rgba(255,255,255,0.35);
}

/* Title box */
.titlebox{
  background: var(--panel);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  margin: 0 0 1.2rem 0;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.titlebox h1{
    margin: 0;
  font-family: 'Playfair Display', serif;
  letter-spacing: 0.02em;
  color: #c9b2ff;
  font-size: 3rem;
}

.titlebox p{
  margin: 0;
  color: #fff;
  line-height: 1.35;
}

/* Grid */
.friends-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

/* Card */
.friend-card{
  --card: #7aa7ff; /* fallback */
  --avatar: 100px;  /* collapsed avatar size (NEW) */

  position: relative;

  border-radius: 18px;
  border: 1px solid rgb(255, 255, 255);
  overflow: hidden;

  background: rgb(14, 14, 14);
  cursor: pointer;

  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  outline: none;
}


/* soft color wash */
.friend-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card);
  opacity: 0.16;
  pointer-events: none;
}

.friend-card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
}

.friend-card:focus-visible{
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

/* Inner layout */
.friend-inner{
  position: relative;
  padding: 1rem;
  display: grid;
  grid-template-columns: var(--avatar) 1fr; /* <-- key change */
  gap: .85rem;
  align-items: center;
}

.friend-avatar{
  width: var(--avatar);
  height: var(--avatar);
  border-radius: 18px;
  object-fit: cover;

  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.35);

  transition:
    width .25s ease,
    height .25s ease,
    border-radius .25s ease;
}
.friend-pronouns{
  margin: .1rem 0 0 0;
  color: rgba(255,255,255,0.72);
  font-size: .92rem;
}

.friend-card.expanded{
  --avatar: 150px; /* expanded avatar size (NEW) */
}

.friend-card.expanded .friend-avatar{
  border-radius: 22px;
}





.friend-name{
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .01em;
}


/* Icons row */
.friend-icons{
  grid-column: 1 / -1;
  display: flex;
  gap: .5rem;
  margin-top: .65rem;
}

.friend-icons a{
  width: 34px;
  height: 34px;
  border-radius: 10px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255, 255, 255, 0.144);
  text-decoration: none;

  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.friend-icons a:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--card) 70%, rgba(255,255,255,0.25));
  box-shadow: 0 0 18px color-mix(in srgb, var(--card) 45%, transparent);
}

.friend-icons img{
  width: 18px;
  height: 18px;
  opacity: 0.92;
}

/* Expandable details */
.friend-details{
  grid-column: 1 / -1;

  margin-top: .65rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255,255,255,0.14);

  max-height: 0;
  opacity: 0;
  overflow: hidden;

  transition: max-height .28s ease, opacity .22s ease;
}

.friend-details p{
  margin: 0;
  line-height: 1.4;
  color: rgba(255,255,255,0.88);
}

/* Close button (only when expanded) */
.friend-close{
  position: absolute;
  top: 10px;
  right: 10px;

  width: 32px;
  height: 32px;
  border-radius: 10px;

  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.9);

  display: grid;
  place-items: center;

  opacity: 0;
  pointer-events: none;

  transition: opacity .18s ease, border-color .18s ease;
}

.friend-close:hover{
  border-color: color-mix(in srgb, var(--card) 70%, rgba(255,255,255,0.25));
}

/* Expanded state */
.friend-card.expanded{
  border-color: color-mix(in srgb, var(--card) 65%, rgba(255,255,255,0.18));
  box-shadow: 0 0 34px color-mix(in srgb, var(--card) 45%, transparent);
}

.friend-card.expanded::before{
  opacity: 0.26;
}

.friend-card.expanded .friend-details{
  max-height: 260px; /* enough for a couple paragraphs */
  opacity: 1;
}

.friend-card.expanded .friend-close{
  opacity: 1;
  pointer-events: auto;
}

/* Mobile spacing */
@media (max-width: 520px){
  body { padding: 1.25rem 1rem; }
  .return-btn { top: 12px; left: 12px; }
}
