/* =============================================================
   Boingy — creator link pages (everything under /<username>/)
   Mobile-first, fluid from 320px up. Pages are generated by the
   dashboard; per-page settings arrive as CSS variables on <body>.
   ============================================================= */

:root {
  --page-bg: #000;
  --card-radius: 20px;
  --gutter: clamp(18px, 5vw, 40px);
  --grad: linear-gradient(100deg, #7c5cff 0%, #ff4d9d 60%, #ff8a5c 100%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Space Grotesk", var(--font);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  font-family: var(--font);
  color: #f4f4fb;
  background: var(--page-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #34e3ff; outline-offset: 3px; border-radius: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 52px; padding: 14px 26px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: .01em;
  transition: transform .18s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-block { width: 100%; }
.btn-light { background: #fff; color: #000; min-height: 48px; margin-top: 6px; }

/* ---- Layout ---- */
.creator { width: 100%; max-width: 480px; margin-inline: auto; min-height: 100dvh; background: var(--page-bg); }
.creator-hero { position: relative; aspect-ratio: var(--hero-ar, 10 / 11); max-height: 80vh; overflow: hidden; }
.creator-photo { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.creator-photo-empty { background: radial-gradient(120% 90% at 50% 0%, #3a2a5c, #15121f 70%); }
.creator-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 42%, rgba(0,0,0,.55) 72%, var(--page-bg) 100%); }
.creator-id { position: absolute; left: 0; right: 0; bottom: 12px; z-index: 1; text-align: center; padding-inline: var(--gutter); }
.creator-name { display: flex; align-items: center; justify-content: center; gap: .22em; font-size: clamp(1.9rem, 9vw, 2.6rem); text-shadow: 0 2px 18px rgba(0,0,0,.6); overflow-wrap: anywhere; }
.creator-name .verified { flex: none; width: .66em; height: .66em; margin-top: .06em; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
.creator-handle { color: rgba(255,255,255,.72); font-size: .95rem; margin-top: 2px; }
.creator-body { padding: 4px var(--gutter) calc(30px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; }

/* Up to 7 icons fit one row from 320px up: size scales with viewport width. */
.soc-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
.soc { width: clamp(34px, 10.4vw, 44px); height: clamp(34px, 10.4vw, 44px); border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .18s ease; box-shadow: 0 4px 14px -6px rgba(0,0,0,.8); }
.soc:hover { transform: translateY(-2px) scale(1.06); }
.soc svg { width: 48%; height: 48%; }
.soc-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.soc-snap { background: #fffc00; color: #000; }
.soc-fb { background: #1877f2; }
.soc-x, .soc-tt, .soc-plain { background: #121212; border: 1px solid rgba(255,255,255,.2); }
.soc-yt { background: #ff0033; }
.soc-tw { background: #9146ff; }
.soc-tg { background: #2aabee; }
.soc-sp { background: #1db954; color: #000; }
.soc-pat { background: #ff424d; }
.soc-in { background: #0a66c2; }
.soc-of { background: #00aff0; }
.soc-accent { background: var(--accent, #5b3df5); }

.creator-stat { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: none; color: rgba(255,255,255,.92); font-size: 1.02rem; transition: background .2s ease; }
button.creator-stat:hover { background: rgba(255,255,255,.07); }
.creator-stat b { font-family: var(--display); font-weight: 700; }
.creator-stat svg { width: 16px; height: 16px; transition: transform .2s ease; }
.creator-stat[aria-expanded="true"] svg { transform: rotate(180deg); }
.creator-bio { margin-top: 10px; color: rgba(255,255,255,.92); text-align: center; overflow-wrap: anywhere; }

/* ---- Cards ---- */
.card-stack { width: 100%; display: grid; gap: 12px; margin-top: 20px; }
.card-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-img { position: relative; display: block; border-radius: var(--card-radius); overflow: hidden; background: #111; aspect-ratio: var(--ar, 3 / 2); isolation: isolate; }
.card-img img, .card-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 30%); transition: transform .35s ease, filter .35s ease; }
.card-ph { background: repeating-linear-gradient(135deg, #17171d 0 14px, #1d1d25 14px 28px); }
.card-img:hover img { transform: scale(1.03); }
.card-hit { position: absolute; inset: 0; display: block; }
.card-img::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.78)); }
.card-img.no-label::after { display: none; }
.card-label { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 2; font-family: var(--display); font-weight: 700; color: #fff; text-align: center; font-size: clamp(.95rem, 4.2vw, 1.1rem); line-height: 1.25; text-shadow: 0 2px 10px rgba(0,0,0,.6); overflow-wrap: anywhere; }
.card-img.big .card-label { font-size: clamp(1.05rem, 5vw, 1.3rem); bottom: 16px; }
.card-badge { position: absolute; top: 10px; left: 10px; z-index: 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.card-badge svg { width: 15px; height: 15px; stroke-width: 2.4; }
.card-badge.soc-snap, .card-badge.soc-sp { color: #000; }
.card-chip { position: absolute; top: 12px; right: 12px; z-index: 2; font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: #fff; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.3); padding: 4px 9px; border-radius: 999px; }

/* Caption at the top, for photos whose subject sits low in the frame. */
.card-img.label-top::after { background: linear-gradient(0deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.78)); }
.card-img.label-top .card-label { top: 14px; bottom: auto; }
.card-img.label-top .card-chip { top: auto; bottom: 12px; }

/* Caption in its own dark band above the photo, so it never covers the image. */
.card-img.caption-top { aspect-ratio: auto; }
.card-img.caption-top::after { display: none; }
.caption-top .card-hit { position: relative; display: flex; flex-direction: column; }
.card-caption { display: block; padding: 14px 16px 12px; text-align: center; font-family: var(--display); font-weight: 700; font-size: clamp(1.05rem, 5vw, 1.3rem); line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.card-photo { position: relative; display: block; aspect-ratio: var(--ar, 1200 / 685); overflow: hidden; }
.caption-top .card-chip { top: auto; bottom: 10px; right: 10px; }

/* 18+ screen: shown on the first tap of a gated card or button. */
.is-gated img { filter: blur(16px) brightness(.8); transform: scale(1.1); }
.gate { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px; text-align: center; background: rgba(8,8,12,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gate svg { width: 26px; height: 26px; opacity: .9; }
.gate h3 { font-size: 1.05rem; }
.gate p { color: rgba(255,255,255,.8); font-size: .9rem; max-width: 260px; }
.gate-modal .btn { max-width: 320px; }
.gate-cancel { background: none; border: 0; color: rgba(255,255,255,.7); font-size: .88rem; padding: 6px 12px; }
.gate-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.gate-modal { position: fixed; z-index: 140; background: rgba(8,8,12,.82); padding: 28px; }

/* ---- Link buttons ---- */
.link-wrap { position: relative; }
.link-btn { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 16px; border-radius: var(--card-radius); font-family: var(--display); color: #fff; transition: transform .16s ease, background .2s ease; }
.link-btn:hover { transform: translateY(-2px); }
.link-glass { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); }
.link-solid { background: #fff; color: #000; }
.link-outline { border: 1.5px solid rgba(255,255,255,.7); }
.link-ico { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.link-ico.soc-snap, .link-ico.soc-sp { color: #000; }
.link-ico svg { width: 50%; height: 50%; }
.link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.link-ico + .link-text { text-align: left; }
.link-text b { font-weight: 600; font-size: 1.02rem; }
.link-text small { font-family: var(--font); font-size: .82rem; opacity: .7; }
.link-arrow { display: none; }
.link-chip { flex: none; font-family: var(--font); font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; border: 1px solid currentColor; opacity: .8; }

/* ---- Text ---- */
.text-block { text-align: center; padding: 6px 4px; overflow-wrap: anywhere; }
.text-block h2 { font-size: 1.2rem; }
.text-block p { color: rgba(255,255,255,.82); }
.text-block h2 + p { margin-top: 4px; }
.text-small h2 { font-size: 1rem; } .text-small p { font-size: .88rem; }
.text-large h2 { font-size: 1.55rem; } .text-large p { font-size: 1.08rem; }

/* ---- Simple layout: cover band, round profile picture, pill buttons ---- */
.page-simple { --page-fg: #f4f4fb; --soft: rgba(255,255,255,.7); --btn-bg: rgba(255,255,255,.07); --btn-line: rgba(255,255,255,.16); --av: clamp(128px, 42vw, 160px); color: var(--page-fg); }
.page-simple.is-light { --page-fg: #111; --soft: rgba(0,0,0,.62); --btn-bg: #fff; --btn-line: rgba(0,0,0,.1); }
.simple-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding-bottom: 2px; }
.simple-cover { width: 100%; height: var(--av); background: var(--accent, #4aa3e8); overflow: hidden; }
.simple-cover img { width: 100%; height: 100%; object-fit: cover; }
.simple-avatar { position: relative; width: var(--av); height: var(--av); margin-top: calc(var(--av) / -2); border-radius: 50%; overflow: hidden; border: 4px solid var(--page-bg); background: radial-gradient(120% 90% at 50% 0%, #cfd6e4, #8e98ad); box-shadow: 0 6px 18px -8px rgba(0,0,0,.45); }
.simple-avatar img { width: 100%; height: 100%; object-fit: cover; }
.page-simple .creator-name { margin-top: 18px; padding-inline: var(--gutter); font-size: clamp(1.5rem, 7.4vw, 1.9rem); text-shadow: none; }
.page-simple .creator-name .verified { filter: none; }
.page-simple .creator-handle { color: var(--soft); }
.page-simple .creator-body { padding-top: 0; }
.page-simple .creator-bio { margin-top: 8px; color: var(--page-fg); }
.page-simple .creator-stat { color: var(--page-fg); }
.page-simple .soc-row { margin-top: 14px; }
.page-simple .card-stack { gap: 14px; margin-top: 22px; }
.page-simple .text-block p { color: var(--soft); }
.page-simple .link-btn { min-height: 56px; padding: 8px 18px 8px 10px; border-radius: 999px; background: var(--btn-bg); border: 2px solid var(--btn-line); color: var(--page-fg); font-family: var(--font); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.page-simple .link-text { text-align: left; padding-left: 6px; }
.page-simple .link-text b { font-weight: 500; }
.page-simple .link-outline { border-color: var(--accent, #4aa3e8); }
.page-simple .link-outline .link-text b { font-weight: 700; }
.page-simple .link-solid { background: var(--accent, #4aa3e8); border-color: var(--accent, #4aa3e8); color: #fff; }
.page-simple .link-solid .link-text b { font-weight: 700; }
.page-simple .link-arrow { display: block; flex: none; width: 16px; height: 16px; opacity: .85; }
.page-simple .bio-foot a { color: var(--soft); border-color: var(--btn-line); background: var(--btn-bg); }
.page-simple .gate, .page-simple .sheet { color: #f4f4fb; }

/* Simple layout's link warning: the page blurs behind a big title and two buttons side by side. */
.page-simple .gate-modal { gap: 12px; background: rgba(8,8,12,.84); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.page-simple.is-light .gate-modal { background: rgba(255,255,255,.84); color: #2b2b2b; }
.page-simple .gate-modal > svg { display: none; }
.page-simple .gate-modal h3 { font-family: var(--font); font-weight: 800; font-size: clamp(1.6rem, 8vw, 2.1rem); letter-spacing: -.02em; }
.page-simple .gate-modal p { color: inherit; opacity: .92; font-size: 1rem; max-width: 310px; }
.page-simple .gate-modal .gate-actions { flex-direction: row-reverse; justify-content: center; gap: 10px; margin-top: 8px; }
.page-simple .gate-modal .btn, .page-simple .gate-modal .gate-cancel { width: auto; min-height: 50px; margin: 0; padding: 0 26px; border: 0; border-radius: 12px; font-family: var(--font); font-weight: 500; font-size: 1rem; }
.page-simple .gate-modal .btn { background: #fff; color: #111; }
.page-simple .gate-modal .gate-cancel { background: rgba(255,255,255,.2); color: #fff; }
.page-simple.is-light .gate-modal .btn { background: #222; color: #fff; }
.page-simple.is-light .gate-modal .gate-cancel { background: #555; color: #fff; }

/* ---- Footer ---- */
.bio-foot { text-align: center; margin-top: 26px; }
.bio-foot a { display: inline-flex; align-items: center; gap: 7px; color: #a2a2b8; font-size: .82rem; padding: 8px 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.045); }
.bio-foot .dot { width: 16px; height: 16px; border-radius: 50%; background: #d4ff4f; }

@media (min-width: 520px) {
  .creator { margin-block: 24px; border-radius: 28px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
}

/* ---- Bottom sheet (followers breakdown) ---- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .25s ease; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
  max-width: 480px; max-height: 80vh; margin-inline: auto; overflow-y: auto; overscroll-behavior: contain;
  background: #252525; border-radius: 24px 24px 0 0; outline: none;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.sheet.open { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 4px auto 14px; }
.sheet-title { font-family: var(--font); font-size: 1.05rem; font-weight: 500; text-align: center; margin-bottom: 8px; }
.sheet-title b { font-weight: 700; }
.sheet-row { display: flex; align-items: center; gap: 16px; padding: 10px 8px; border-radius: 14px; transition: background .15s ease; }
a.sheet-row:hover { background: rgba(255,255,255,.05); }
.sheet-av { position: relative; flex: none; width: 52px; height: 52px; border-radius: 50%; background: #3a3a3a; }
.sheet-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sheet-badge { position: absolute; right: -3px; bottom: -3px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid #252525; }
.sheet-badge svg { width: 11px; height: 11px; stroke-width: 2.6; }
.sheet-badge.soc-snap, .sheet-badge.soc-sp { color: #000; }
.sheet-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.sheet-text b { font-weight: 600; }
.sheet-text small { color: rgba(255,255,255,.55); font-size: .92rem; }
