:root {
  --facebook-blue: #0866ff;
  --background: #f0f2f5;
  --surface: #ffffff;
  --text: #080809;
  --muted: #65676b;
  --line: #dfe1e5;
  --control: #e4e6eb;
  --placeholder-dark: #b8c1cc;
  --placeholder-light: #dde3e9;
  color-scheme: light;
  font-family: "Public Sans", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
  color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; stroke-width: 2.25; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(180px, 280px) 1fr;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 16px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 14%);
}

.facebook-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: end center;
  border-radius: 50%;
  background: var(--facebook-blue);
  color: white;
  font-size: 36px;
  font-weight: 800;
  line-height: 34px;
  text-decoration: none;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--background);
  color: var(--muted);
}

.search svg { width: 17px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.top-actions { display: flex; justify-content: flex-end; gap: 8px; }
.icon-button, .mini-avatar {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--control);
  color: var(--text);
}

.mini-avatar { background: linear-gradient(135deg, #1f4d3f 0 50%, #e3b873 50%); }
.profile-shell { background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }
.profile-shell > * { width: min(100%, 1100px); margin-inline: auto; }
.placeholder {
  position: relative;
  overflow: hidden;
  border: 0;
  background: linear-gradient(135deg, var(--placeholder-dark), var(--placeholder-light));
  color: #3f4b57;
}
.placeholder::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / 26%) 50%, transparent 60%);
  content: "";
  transform: translateX(-100%);
  animation: sheen 1.2s ease-out 0.25s 1;
}
.placeholder span { position: relative; z-index: 1; font-weight: 700; }
@keyframes sheen { to { transform: translateX(100%); } }

.cover {
  display: grid;
  width: min(100%, 1100px);
  aspect-ratio: 2.7 / 1;
  min-height: 230px;
  max-height: 410px;
  place-items: center;
  border-radius: 0 0 8px 8px;
  font-size: 18px;
}

.profile-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 18px;
  min-height: 126px;
  padding: 0 28px 18px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 168px;
  height: 168px;
  margin-top: -76px;
  border: 5px solid white;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.identity { align-self: center; min-width: 0; }
.identity h1 { margin: 0 0 5px; font-size: clamp(26px, 4vw, 34px); line-height: 1.1; overflow-wrap: anywhere; }
.identity p { margin: 0; color: var(--muted); }
.profile-actions { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
}
.button-primary { background: var(--facebook-blue); color: white; }
.button-secondary { background: var(--control); color: var(--text); }

.tabs { display: flex; gap: 4px; padding: 4px 20px 0; overflow-x: auto; }
.tabs button {
  position: relative;
  min-width: max-content;
  height: 56px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.tabs button[aria-selected="true"] { color: var(--facebook-blue); }
.tabs button[aria-selected="true"]::after { position: absolute; right: 8px; bottom: 0; left: 8px; height: 3px; background: var(--facebook-blue); content: ""; }

.page-content { width: min(calc(100% - 32px), 1020px); margin: 16px auto 60px; }
.content-grid { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(360px, 3fr); gap: 16px; align-items: start; }
.side-column { display: grid; gap: 16px; }
.card { border-radius: 8px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 10%); }
.intro-card, .photos-card, .detail-panel { padding: 20px; }
.card h2 { margin: 0 0 14px; font-size: 21px; }
.intro-card > p { margin: 0 0 18px; line-height: 1.45; text-align: center; }
.details { display: grid; gap: 14px; margin: 0; }
.details div { display: grid; grid-template-columns: 22px 1fr; gap: 9px; align-items: start; }
.details dt { color: var(--muted); }
.details dd { margin: 0; line-height: 1.35; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; }
.text-button { padding: 6px; border: 0; background: transparent; color: var(--facebook-blue); }
.photo-grid, .all-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; overflow: hidden; border-radius: 7px; }
.photo-tile { display: grid; min-width: 0; aspect-ratio: 1; place-items: center; border: 0; font-size: 12px; }
.post-card { overflow: hidden; }
.post-author { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 14px 16px 8px; }
.post-avatar { width: 42px; height: 42px; border-radius: 50%; }
.post-author p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.plain-icon { padding: 8px; border: 0; background: transparent; color: var(--muted); }
.post-copy { margin: 8px 16px 14px; line-height: 1.45; }
.post-media { display: grid; width: 100%; aspect-ratio: 4 / 3; place-items: center; border-radius: 0; font-size: 18px; }
.post-stats { display: flex; justify-content: space-between; margin: 0 16px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.post-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px 10px; }
.post-actions button { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 700; }
.post-actions button:hover { background: var(--background); }
.detail-panel { max-width: 760px; margin: 0 auto; }
.detail-row, .review { padding: 16px 0; border-top: 1px solid var(--line); }
.detail-row:first-child, .review:first-child { border-top: 0; }
.detail-row p, .review p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }
.stars { color: #e8a100; letter-spacing: 0; }
.all-photos { grid-template-columns: repeat(4, 1fr); gap: 8px; }

.gallery-dialog {
  width: min(900px, calc(100% - 32px));
  padding: 52px 70px 24px;
  border: 0;
  border-radius: 8px;
  background: #151515;
  color: white;
}
.gallery-dialog::backdrop { background: rgb(0 0 0 / 78%); }
.dialog-close { position: absolute; top: 10px; right: 10px; background: #333; color: white; }
.gallery-image { display: grid; width: 100%; aspect-ratio: 16 / 10; place-items: center; border-radius: 4px; }
.gallery-dialog > p { margin: 14px 0 0; text-align: center; }
.gallery-arrow { position: absolute; top: 50%; display: grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 50%; background: #333; color: white; transform: translateY(-50%); }
.gallery-previous { left: 14px; }
.gallery-next { right: 14px; }

@media (max-width: 760px) {
  .topbar { grid-template-columns: auto 1fr; padding-inline: 10px; }
  .search { width: 40px; padding: 0; justify-content: center; justify-self: start; }
  .search input { display: none; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .top-actions .icon-button:first-child { display: none; }
  .cover { min-height: 190px; border-radius: 0; }
  .profile-heading { grid-template-columns: 1fr; justify-items: center; gap: 8px; padding: 0 16px 18px; text-align: center; }
  .avatar { width: 144px; height: 144px; margin-top: -70px; }
  .profile-actions { width: 100%; padding: 6px 0 0; }
  .profile-actions .button { flex: 1; }
  .tabs { padding-inline: 8px; }
  .page-content { width: min(100%, 680px); margin-top: 10px; }
  .content-grid { grid-template-columns: 1fr; }
  .side-column { padding: 0 10px; }
  .feed .card { border-radius: 0; }
  .all-photos { grid-template-columns: repeat(3, 1fr); }
  .detail-panel { border-radius: 0; }
  .gallery-dialog { padding: 58px 14px 22px; }
  .gallery-arrow { top: auto; bottom: 18px; }
  .gallery-image { margin-bottom: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}