/* Values taken from the reference page's theme: dark "lake" theme, black
   filled buttons, 8px radius, small shadow, white text, 14px link gap,
   580px desktop frame on a #1f1f1f surround, blurred-photo background. */
:root {
  --bg: #000000;
  --frame-surround: color-mix(in srgb, #000000 88%, white 12%);
  --text: #ffffff;
  --button-bg: #000000;
  --button-bg-hover: color-mix(in srgb, #000000 93%, #ffffff);
  --button-text: #ffffff;
  --radius: 8px;
  --inner-radius: 4px;
  --gap: 14px;
  --shadow: 0.3px 0.5px 0.7px hsl(0deg 0% 6.7% / 0.021),
    0.9px 1.8px 2.5px -0.6px hsl(0deg 0% 6.7% / 0.04),
    2.2px 4.4px 6.2px -1.2px hsl(0deg 0% 6.7% / 0.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---- frame ------------------------------------------------------------ */
.page {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

/* The background: the whole photo, sharp and uncropped, over a blurred and
   darkened copy of itself that fills whatever the screen has left over --
   top and bottom on a tall phone, the sides on anything wider. */
.bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #000;
}
.bg { container-type: size; }
.bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bg__fill {
  filter: blur(40px) brightness(0.55) saturate(1.1);
  transform: scale(1.15); /* hides the blur's soft edge */
}
/* Exactly the photo's shape (9:16), as large as fits, pinned to the top. Sized
   to the photo rather than the screen so the fade below lands on the same
   part of her body on every screen. */
.bg__frame {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100cqw, 100cqh * 9 / 16);
  aspect-ratio: 9 / 16;
  transform: translateX(-50%);
  overflow: hidden;
}
/* The same photo blurred, faded in from halfway down: the face and top stay
   sharp, the waist and shorts are soft. */
.bg__soft {
  filter: blur(18px);
  transform: scale(1.04); /* keeps the blur's soft edge off the sides */
  -webkit-mask-image: linear-gradient(to bottom, transparent 66%, #000 80%);
  mask-image: linear-gradient(to bottom, transparent 66%, #000 80%);
}
/* A light shade at the top for the name and at the bottom for the end of the
   page, leaving the photo itself untouched in between. */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35),
    rgba(0, 0, 0, 0) 30%,
    rgba(0, 0, 0, 0) 75%,
    rgba(0, 0, 0, 0.45)
  );
}
.handle,
.name { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }

.profile {
  position: relative;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  padding: 0 var(--gap) 48px;
  animation: rise 520ms var(--ease) both;
}

@media (min-width: 768px) {
  body { background: var(--frame-surround); }
  .page {
    width: 580px;
    margin: 40px auto;
    min-height: calc(100dvh - 40px);
    border-radius: 24px 24px 0 0;
  }
}

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  padding-top: var(--gap);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: color-mix(in srgb, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 12%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.10); }
.icon-btn:active { transform: scale(0.94); }

/* ---- header ----------------------------------------------------------- */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 0 32px;
}
.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.handle {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

/* ---- links ------------------------------------------------------------ */
.links {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.link {
  border-radius: var(--radius);
  background: var(--button-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  animation: rise 460ms var(--ease) forwards;
}
.link:nth-child(1) { animation-delay: 90ms; }
.link:nth-child(2) { animation-delay: 150ms; }
.link:nth-child(3) { animation-delay: 210ms; }
.link:nth-child(4) { animation-delay: 270ms; }
.link:nth-child(5) { animation-delay: 330ms; }

.link__btn {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  width: 100%;
  min-height: 64px;
  padding: 8px;
  color: var(--button-text);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.link__btn:hover { background: var(--button-bg-hover); }
.link__btn:active { transform: scale(0.985); }

.link__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--inner-radius);
  object-fit: cover;
  display: block;
}
.link__spacer { width: 48px; }
.link__title { padding: 0 8px; line-height: 1.5; }
.link__end {
  justify-self: center;
  display: grid;
  place-items: center;
  opacity: 0.9;
}
.link__dots { opacity: 0.7; }

/* ---- sensitive-content gate (expands in place) ------------------------ */
.gate {
  display: grid;
  gap: 6px;
  padding: 4px 20px 20px;
  text-align: center;
  animation: unfold 260ms var(--ease);
}
.gate[hidden] { display: none; }
.gate__title { font-size: 16px; font-weight: 700; }
.gate__text { font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.75); }
.gate__actions { display: grid; gap: 8px; margin-top: 10px; }
.gate__continue,
.gate__back {
  display: block;
  height: 44px;
  line-height: 44px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}
.gate__continue { background: #ffffff; color: #000000; }
.gate__continue:hover { background: #ececec; }
.gate__back { border: 1px solid rgba(255, 255, 255, 0.3); }
.gate__back:hover { background: rgba(255, 255, 255, 0.08); }
.gate__continue:active,
.gate__back:active { transform: scale(0.97); }

/* ---- share toast ------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  translate: -50% 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease), translate 220ms var(--ease);
}
.toast.show { opacity: 1; translate: -50% 0; }

/* ---- motion ----------------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .link { opacity: 1; }
}
