/* Public profile page (/p/{token}). Standalone: no framework. Hex colours live ONLY in the two token blocks below. */
:root {
    color-scheme: light dark;
    --primary: #4338ca;
    --primary-2: #6d28d9;
    --primary-soft: #eef2ff;
    --accent: #e11d48;
    --accent-soft: #fff1f2;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-2: #475569;
    --border: #e2e8f0;
    --on-primary: #ffffff;
    --header-from: #eef2ff;
    --header-to: #e0e7ff;
    --header-text: #312e81;
    --shadow: 0 10px 30px rgba(30, 27, 75, .10);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
    --bar-bg: rgba(255, 255, 255, .92);
    --scrim: rgba(15, 23, 42, .72);
    --on-scrim: #ffffff;
    --focus: #4338ca;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #818cf8;
        --primary-2: #a78bfa;
        --primary-soft: #26274f;
        --accent: #fb7185;
        --accent-soft: #3b1523;
        --bg: #0b0c1d;
        --surface: #16172e;
        --surface-2: #1d1f3b;
        --text: #f1f5f9;
        --text-2: #b4bccd;
        --border: #2b2d52;
        --on-primary: #0b0c1d;
        --header-from: #1e1b4b;
        --header-to: #312e81;
        --header-text: #e0e7ff;
        --shadow: 0 10px 30px rgba(0, 0, 0, .45);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
        --bar-bg: rgba(11, 12, 29, .92);
        --scrim: rgba(0, 0, 0, .7);
        --focus: #a5b4fc;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

h1, h2, p, dl, dd, ul { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

.pp-shell { max-width: 880px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

/* Header strip */
.pp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    background: linear-gradient(120deg, var(--header-from), #767a87);
    color: var(--header-text);
}
.pp-brand { font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; font-family: Georgia, "Times New Roman", serif; }
.pp-private { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; opacity: .9; }

/* Layout */
.pp-main { flex: 1; padding: 16px; }
.pp-layout { display: flex; flex-direction: column; gap: 16px; }
.pp-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Hero */
.pp-hero { min-width: 0; }
.pp-photo-frame {
    position: relative; aspect-ratio: 4 / 5; width: 100%; max-height: 72vh;
    border-radius: 20px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow);
}
.pp-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-photo-frame.is-blurred .pp-photo { filter: blur(16px); transform: scale(1.15); }
.pp-pill {
    position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px;
    background: var(--scrim); color: var(--on-scrim); font-size: .8rem; font-weight: 600;
    backdrop-filter: blur(4px);
}
.pp-placeholder {
    height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    padding: 24px; text-align: center; color: var(--text-2);
    background: linear-gradient(160deg, var(--primary-soft), var(--accent-soft));
}
.pp-avatar {
    width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center;
    font-size: 2.6rem; font-weight: 700; color: var(--on-primary);
    background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow);
}
.pp-avatar-sm { width: 72px; height: 72px; font-size: 1.8rem; margin: 0 auto 12px; }

.pp-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pp-thumb {
    display: block; width: 64px; height: 80px; border-radius: 12px; overflow: hidden; position: relative;
    border: 2px solid transparent; box-shadow: var(--shadow-sm); background: var(--surface-2);
}
.pp-thumb.is-active { border-color: var(--accent); }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-thumbs.is-blurred .pp-thumb img { filter: blur(8px); transform: scale(1.2); }

/* Intro */
.pp-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 4px 2px 0; }
.pp-intro h1 { font-size: 1.85rem; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
.pp-sub { color: var(--text-2); font-size: 1.05rem; }
.pp-chip {
    display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600;
    border: 1px solid var(--accent);
}
.pp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.pp-btn {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; cursor: pointer;
    border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--primary);
    font: inherit; font-weight: 600; box-shadow: var(--shadow-sm);
}
.pp-btn[hidden] { display: none; }
.pp-btn:hover { background: var(--primary-soft); }
.pp-toast { font-size: .85rem; color: var(--text-2); min-height: 1.2em; }

/* Cards */
.pp-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 16px; box-shadow: var(--shadow-sm);
}
.pp-card h2 {
    font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--primary);
    font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.pp-card h2::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: #6138ca; }
.pp-rows { display: flex; flex-direction: column; }
.pp-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pp-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pp-row:first-child { padding-top: 0; }
.pp-row dt { color: var(--text-2); font-size: .92rem; flex: 0 0 auto; }
.pp-row dd { font-weight: 600; text-align: right; min-width: 0; }
.pp-rows.is-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pp-rows.is-grid .pp-row {
    flex-direction: column; justify-content: flex-start; gap: 2px; padding: 12px; border: 0;
    border-radius: 12px; background: var(--surface-2);
}
.pp-rows.is-grid .pp-row:first-child, .pp-rows.is-grid .pp-row:last-child { padding: 12px; }
.pp-rows.is-grid dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.pp-rows.is-grid dd { text-align: left; }
.pp-about { white-space: pre-line; color: var(--text); }

/* Call to action: sticky bar on phones */
.pp-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--bar-bg); border-top: 1px solid var(--border); backdrop-filter: blur(10px);
}
.pp-cta-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px;
    border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 1.02rem; color: var(--on-primary);
    background: linear-gradient(120deg, var(--primary), var(--accent)); box-shadow: var(--shadow);
}
.pp-cta-btn:hover { filter: brightness(1.06); }
.pp-cta-btn:active { transform: translateY(1px); }

/* Footer */
.pp-footer { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: var(--text-2); font-size: .85rem; }
.pp-footer-brand { margin-top: 6px; font-weight: 700; font-family: Georgia, "Times New Roman", serif; color: var(--primary); }

.pp-shell:has(.pp-cta) .pp-footer { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

/* Not found */
.pp-notfound { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.pp-nf-card { text-align: center; max-width: 420px; padding: 32px 24px; box-shadow: var(--shadow); }
.pp-nf-card h1 { font-size: 1.4rem; margin-bottom: 8px; }
.pp-nf-card p { color: var(--text-2); }

/* Tablet and desktop */
@media (min-width: 900px) {
    body { padding: 24px 0; }
    .pp-shell { min-height: 0; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: var(--bg); }
    .pp-main { padding: 28px; }
    .pp-layout { flex-direction: row; align-items: flex-start; gap: 28px; }
    .pp-hero { flex: 0 0 320px; position: sticky; top: 24px; }
    .pp-body { flex: 1; }
    .pp-intro h1 { font-size: 2.2rem; }
    .pp-cta { position: static; padding: 0; background: none; border: 0; backdrop-filter: none; }
    .pp-footer, .pp-shell:has(.pp-cta) .pp-footer { padding-bottom: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
    .pp-cta-btn:active { transform: none; }
}

/* Verified badge, long rows, gallery, videos */
.pp-verified { display: inline-flex; vertical-align: middle; margin-left: 8px; color: var(--primary); }
.pp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pp-row.is-long { flex-direction: column; gap: 2px; }
.pp-row.is-long dd { text-align: left; font-weight: 500; }
.pp-rows.is-grid .pp-row.is-long { flex-direction: column; }
.pp-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pp-gitem { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pp-gframe { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.pp-gframe img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-gallery.is-blurred .pp-gframe img { filter: blur(12px); transform: scale(1.15); }
.pp-gcap { font-size: .85rem; color: var(--text-2); font-weight: 600; }
.pp-note { margin-top: 12px; font-size: .85rem; color: var(--text-2); }
.pp-videos { display: flex; flex-direction: column; gap: 12px; }
.pp-videos video { width: 100%; max-height: 60vh; border-radius: 12px; background: var(--surface-2); }
.pp-videos.is-blurred video { filter: blur(12px); }
.pp-audio audio { width: 100%; height: 44px; }

/* Copyright / credit line under the brand name. */
.pp-footer-credit { margin: 10px 0 0; font-size: .75rem; line-height: 1.5; color: var(--text-2); }
.pp-footer-credit a { color: var(--primary); font-weight: 600; text-decoration: none; }
.pp-footer-credit a:hover { text-decoration: underline; }
.pp-footer-credit a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
