/* Public profile /u/{username} — attractive v2.
   The owner's cover photo blurred behind everything, a floating card, a turning colour ring on the photo,
   a shining Save contact button, coloured action tiles and link cards. Uses the owner's own colours (--p, --a),
   tint (--bg, --tint) and font (--font). Every pf-* class and id the page script uses is kept.
   The previous stylesheet is css/profile.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
:root {
  --ink: #17151a; --muted: #6b6570; --line: rgba(23,21,26,.08); --line2: rgba(23,21,26,.14);
  --card: rgba(255,255,255,.92); --soft: color-mix(in oklab, var(--p) 7%, #fff);
  --pp: color-mix(in oklab, var(--p) 78%, #000); --glow: color-mix(in oklab, var(--p) 45%, transparent);
  --r: 32px; --ease: cubic-bezier(.16,1,.3,1);
}
body { min-height: 100vh; background: var(--bg, #faf9f7); color: var(--ink); font: 400 16px/1.6 var(--font, system-ui), system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--p); outline-offset: 3px; }

/* ---------- the backdrop: the owner's cover, blurred, tinted with their colour ---------- */
.pf-backdrop { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: linear-gradient(160deg, color-mix(in oklab, var(--p) 22%, var(--bg, #fff)), var(--bg, #fff) 60%); }
.pf-backdrop img { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(60px) saturate(1.3); opacity: .55; transform: scale(1.1); animation: pfBreath 24s ease-in-out infinite alternate; }
.pf-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.25), color-mix(in oklab, var(--bg, #fff) 70%, transparent) 55%, var(--bg, #fff)); }
@keyframes pfBreath { to { transform: scale(1.2) translate(-2%, 1%); } }
.pf-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.pf-aurora span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(90px); opacity: .35; animation: pfFloat 18s ease-in-out infinite alternate; }
.pf-aurora span:nth-child(1) { background: var(--p); left: -14vmax; top: -12vmax; }
.pf-aurora span:nth-child(2) { background: var(--a); right: -16vmax; top: 20vh; opacity: .18; animation-duration: 22s; }
.pf-aurora span:nth-child(3) { background: color-mix(in oklab, var(--p) 50%, #fff); left: 20vw; bottom: -20vmax; opacity: .28; animation-duration: 26s; }
@keyframes pfFloat { to { transform: translate(6vmax, 4vmax) scale(1.12); } }

/* ---------- layout ---------- */
.pf-layout { display: grid; grid-template-columns: minmax(0, 470px); justify-content: center; gap: 36px; padding: 48px 16px 130px; }
@media (min-width: 980px) { .pf-layout { grid-template-columns: minmax(0, 470px) 310px; align-items: start; padding-top: 64px; } }

.pf-card { position: relative; background: var(--card); backdrop-filter: blur(20px) saturate(1.4); border-radius: var(--r); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset, 0 1px 0 1px var(--line), 0 40px 90px -40px color-mix(in oklab, var(--p) 55%, #000), 0 20px 50px -30px rgba(0,0,0,.25);
  animation: pfCardIn .9s var(--ease) both; }
@keyframes pfCardIn { from { opacity: 0; transform: translateY(30px) scale(.98); } }
@media (max-width: 520px) { .pf-layout { padding: 0 0 130px; } .pf-card { border-radius: 0 0 28px 28px; } }

/* ---------- cover ---------- */
.pf-cover { position: relative; aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--p), var(--pp) 60%, var(--a)); overflow: hidden; }
.pf-cover-img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); animation: pfCover 18s ease-in-out infinite alternate; }
@keyframes pfCover { to { transform: scale(1.12) translate(-1.5%, -1%); } }
.pf-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18), transparent 40%, rgba(0,0,0,.28)); pointer-events: none; }
.pf-cover-shine { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 45%, transparent 58%) -100% 0 / 250% 100% no-repeat; animation: pfShine 7s ease-in-out infinite; }
@keyframes pfShine { 0%, 20% { background-position: -100% 0; } 70%, 100% { background-position: 200% 0; } }
.pf-badge { position: absolute; z-index: 2; left: 16px; top: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.22); backdrop-filter: blur(12px); color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset; }
.pf-live { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.7); animation: pfLive 2s infinite; }
@keyframes pfLive { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.pf-icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.22); backdrop-filter: blur(12px); color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset; transition: transform .3s var(--ease), background .3s; }
.pf-icon-btn:hover { transform: translateY(-2px) scale(1.05); background: rgba(255,255,255,.35); }
.pf-share-top { position: absolute; z-index: 2; right: 14px; top: 12px; }

/* ---------- identity ---------- */
.pf-identity { position: relative; padding: 0 26px 26px; text-align: center; }
.pf-avatar-ring { position: relative; width: 132px; height: 132px; margin: -70px auto 0; padding: 5px; border-radius: 50%; transition: transform .6s var(--ease); }
.pf-avatar-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, var(--p), var(--a), color-mix(in oklab, var(--p) 40%, #fff), var(--p)); animation: pfSpin 6s linear infinite; }
.pf-avatar-ring::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); z-index: -1; filter: blur(8px); }
@keyframes pfSpin { to { transform: rotate(360deg); } }
.pf-avatar { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 4px solid #fff; background: var(--soft); overflow: hidden; display: grid; place-items: center; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-avatar span { font-size: 38px; font-weight: 800; color: var(--p); }
.pf-name { margin: 16px 0 0; font-size: clamp(26px, 6vw, 32px); line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.pf-verified { font-size: .6em; color: var(--p); vertical-align: .25em; margin-left: 2px; }
.pf-role { display: inline-block; margin: 8px 0 0; padding: 5px 14px; border-radius: 999px; background: var(--soft); color: var(--pp); font-size: 14.5px; font-weight: 600; }
.pf-loc { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); }
.pf-loc i { color: var(--p); margin-right: 4px; }
.pf-bio { margin: 16px auto 0; max-width: 38ch; font-size: 16px; color: #3d3842; }

/* entrance: each line rises in turn */
.pf-in { opacity: 0; animation: pfRise .8s var(--ease) both; animation-delay: calc(.15s + var(--i, 0) * .06s); }
@keyframes pfRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.pf-cta { display: flex; gap: 10px; margin-top: 24px; }
.pf-cta .pf-btn-main { flex: 1.6; } .pf-cta .pf-btn-soft { flex: 1; }
.pf-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; padding: 0 22px; border: 0; border-radius: 18px; overflow: hidden;
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s; }
.pf-btn:active { transform: scale(.97); }
.pf-btn-main { background: linear-gradient(135deg, var(--p), var(--pp)); color: #fff; box-shadow: 0 14px 30px -12px var(--glow), 0 0 0 1px rgba(255,255,255,.15) inset; }
.pf-btn-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 62%) -120% 0 / 250% 100% no-repeat; animation: pfShine 4.5s ease-in-out infinite; }
.pf-btn-main:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px var(--glow), 0 0 0 1px rgba(255,255,255,.2) inset; }
.pf-btn-soft { background: #fff; color: var(--ink); box-shadow: 0 0 0 1px var(--line2) inset, 0 6px 16px -10px rgba(0,0,0,.2); }
.pf-btn-soft:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px color-mix(in oklab, var(--p) 40%, transparent) inset, 0 12px 24px -14px rgba(0,0,0,.25); }
.pf-btn-soft i { color: var(--p); }
.pf-btn.loading { opacity: .65; pointer-events: none; }

/* ---------- quick actions: coloured tiles ---------- */
.pf-actions { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 10px; padding: 0 22px 24px; }
.pf-action { display: grid; justify-items: center; gap: 8px; padding: 14px 4px 12px; border-radius: 20px; background: #fff; text-decoration: none; font-size: 12.5px; font-weight: 700; color: var(--ink);
  box-shadow: 0 0 0 1px var(--line) inset, 0 8px 18px -14px rgba(0,0,0,.25); transition: transform .35s var(--ease), box-shadow .35s; }
.pf-action span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; font-size: 18px; color: #fff; background: var(--c); box-shadow: 0 8px 18px -8px var(--c); transition: transform .35s var(--ease); }
.pf-action:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px color-mix(in oklab, var(--c) 35%, transparent) inset, 0 16px 28px -16px var(--c); }
.pf-action:hover span { transform: scale(1.08) rotate(-4deg); }
@media (max-width: 400px) { .pf-actions { grid-template-columns: repeat(min(var(--n, 4), 3), minmax(0, 1fr)); } }

/* ---------- sections ---------- */
.pf-section { padding: 6px 22px 24px; }
.pf-h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-h2::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.pf-links { display: grid; gap: 10px; }
.pf-link { position: relative; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 16px 10px 12px; border-radius: 20px; background: #fff; text-decoration: none; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line) inset, 0 8px 18px -14px rgba(0,0,0,.25); transition: transform .35s var(--ease), box-shadow .35s; }
.pf-link::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--p); transform: scaleY(0); transition: transform .35s var(--ease); }
.pf-link:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px color-mix(in oklab, var(--p) 30%, transparent) inset, 0 16px 30px -18px var(--glow); }
.pf-link:hover::before { transform: scaleY(1); }
.pf-link-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; color: #fff; font-size: 18px; box-shadow: 0 8px 16px -10px rgba(0,0,0,.45); }
.pf-link-txt { display: grid; flex: 1; min-width: 0; }
.pf-link-txt b { font-weight: 700; }
.pf-link-txt small { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-link-go { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--p); font-size: 13px; transition: transform .35s var(--ease), background .3s, color .3s; }
.pf-link:hover .pf-link-go { transform: translateX(3px); background: var(--p); color: #fff; }

/* ---------- exchange form ---------- */
.pf-exchange { padding: 20px; border-radius: 24px; background: linear-gradient(160deg, var(--soft), #fff 70%); box-shadow: 0 0 0 1px color-mix(in oklab, var(--p) 18%, transparent) inset; }
.pf-exchange-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.pf-exchange-head .pf-h2 { text-transform: none; letter-spacing: -.01em; font-size: 18px; color: var(--ink); }
.pf-exchange-head .pf-h2::after { display: none; }
.pf-exchange-head p { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; }
.pf-exchange-ic { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--p); color: #fff; box-shadow: 0 10px 20px -10px var(--glow); }
#pf-lead { display: grid; gap: 12px; }
.pf-field { display: grid; gap: 6px; }
.pf-field > span { font-size: 13.5px; font-weight: 700; }
.pf-field em { font-style: normal; color: var(--muted); font-weight: 500; }
.pf-field input, .pf-field textarea { width: 100%; min-height: 50px; padding: 13px 15px; border: 0; border-radius: 14px; background: #fff; font: 16px var(--font, system-ui), system-ui, sans-serif; color: var(--ink);
  box-shadow: 0 0 0 1px var(--line2) inset; transition: box-shadow .25s; }
.pf-field textarea { resize: vertical; }
.pf-field input:focus, .pf-field textarea:focus { outline: 0; box-shadow: 0 0 0 2px var(--p) inset, 0 0 0 5px color-mix(in oklab, var(--p) 15%, transparent); }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .pf-row { grid-template-columns: 1fr; } }
.pf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pf-form-err { margin: 0; color: #c0262d; font-size: 14.5px; font-weight: 600; }
.pf-form-err:empty { display: none; }
.pf-fine { margin: 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.pf-fine i { color: var(--p); }
.pf-sent { text-align: center; padding: 10px 0 4px; }
.pf-sent-ic { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; background: #10b981; color: #fff; font-size: 24px; box-shadow: 0 12px 26px -12px #10b981; animation: pfPop .6s var(--ease); }
@keyframes pfPop { from { transform: scale(.4); opacity: 0; } }
.pf-sent h3 { margin: 0 0 6px; font-size: 21px; }
.pf-sent p { margin: 0 0 16px; color: var(--muted); }

/* ---------- card footer ---------- */
.pf-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 18px 22px 26px; border-top: 1px solid var(--line); }
.pf-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: #fff; font-size: 14.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line2) inset; transition: transform .3s var(--ease), box-shadow .3s; }
.pf-chip i { color: var(--p); }
.pf-chip:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px color-mix(in oklab, var(--p) 40%, transparent) inset, 0 10px 20px -14px var(--glow); }
.pf-made { flex-basis: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pf-made:hover { color: var(--ink); }
.pf-made i { font-size: 11px; transition: transform .3s var(--ease); }
.pf-made:hover i { transform: translateX(3px); }
.pf-made-mark { width: 18px; height: 18px; border-radius: 6px; background: #ea580c; }

/* ---------- desktop side panel ---------- */
.pf-side { display: none; }
@media (min-width: 980px) { .pf-side { display: block; position: sticky; top: 64px; animation: pfCardIn .9s var(--ease) .15s both; } }
.pf-side-card { padding: 26px; border-radius: 28px; background: var(--card); backdrop-filter: blur(20px) saturate(1.4); text-align: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset, 0 1px 0 1px var(--line), 0 30px 70px -40px color-mix(in oklab, var(--p) 55%, #000); }
.pf-side-card h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.pf-side-card p { margin: 6px 0 18px; color: var(--muted); font-size: 14.5px; }
.pf-qr-box { position: relative; display: grid; place-items: center; padding: 16px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px var(--line) inset, 0 14px 30px -20px var(--glow); }
.pf-qr-box::before, .pf-qr-box::after { content: ""; position: absolute; width: 26px; height: 26px; border: 3px solid var(--p); }
.pf-qr-box::before { left: 8px; top: 8px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.pf-qr-box::after { right: 8px; bottom: 8px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.pf-qr-box img, .pf-qr-box canvas { display: block; }
.pf-url { margin-top: 14px; font: 12.5px ui-monospace, monospace; color: var(--muted); word-break: break-all; }
.pf-share-row { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.pf-share-row > * { display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 16px; background: #fff; color: var(--c); text-decoration: none; cursor: pointer; font-size: 17px;
  box-shadow: 0 0 0 1px var(--line2) inset; transition: transform .3s var(--ease), background .3s, color .3s; }
.pf-share-row > *:hover { transform: translateY(-3px); background: var(--c); color: #fff; }

/* ---------- phone dock ---------- */
.pf-dock { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; display: flex; gap: 10px; padding: 10px; border-radius: 24px;
  background: rgba(255,255,255,.8); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 0 0 1px rgba(255,255,255,.7) inset, 0 20px 40px -20px rgba(0,0,0,.35);
  transform: translateY(140%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s; }
.pf-dock.show { transform: none; visibility: visible; transition: transform .45s var(--ease); }
.pf-dock .pf-btn { flex: 1; min-height: 52px; }
.pf-dock-ic { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border: 0; border-radius: 16px; background: #fff; color: var(--c, var(--p)); font-size: 20px; text-decoration: none; cursor: pointer; box-shadow: 0 0 0 1px var(--line2) inset; }
@media (min-width: 980px) { .pf-dock { display: none; } }

/* ---------- full-screen QR ---------- */
.pf-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: color-mix(in oklab, var(--p) 25%, rgba(10,10,14,.55)); backdrop-filter: blur(10px); opacity: 0; transition: opacity .3s; }
.pf-modal.open { opacity: 1; }
.pf-modal[hidden] { display: none; }
.pf-modal-box { position: relative; display: grid; justify-items: center; gap: 6px; width: min(370px, 100%); padding: 34px 24px 24px; border-radius: 30px; background: #fff; text-align: center;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.5); transform: scale(.94); transition: transform .4s var(--ease); }
.pf-modal.open .pf-modal-box { transform: none; }
.pf-modal-x { position: absolute; right: 12px; top: 12px; background: var(--soft); color: var(--ink); box-shadow: none; }
.pf-modal-x:hover { background: color-mix(in oklab, var(--p) 15%, #fff); }
.pf-modal-avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; background: var(--soft); display: grid; place-items: center; font-weight: 800; color: var(--p); box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--p); }
.pf-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pf-modal-box b { margin-top: 8px; font-size: 19px; }
.pf-modal-box small { color: var(--muted); font-size: 14px; }
.pf-qr-big { margin: 12px 0 14px; }

/* ---------- toast ---------- */
.pf-toast { position: fixed; left: 50%; bottom: 100px; z-index: 40; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 600;
  transform: translate(-50%, 20px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility 0s .25s; }
.pf-toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .25s, transform .25s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .pf-in { opacity: 1; }
}
