/* =========================================================
   COSMIC PHARMACY — dark starfield theme.
   Nearly-black sky, stars doing the work, a saturated pink/purple
   nebula pooled low at the bottom, and a faint logo watermark
   sitting deep in the background. Render-only: relies on
   $user / $platformLinks / $sections.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --background-color: #030106;
    --text-color: #f6f2ff;
    --text-color-secondary: rgb(206, 198, 224);
    --text-color-body: rgb(160, 150, 184);
    --text-muted: rgb(132, 122, 160);

    --accent: #ff3fd6;
    --accent-2: #9b3bff;
    --accent-3: #3fa8ff;
    --accent-4: #3fe0ff;
    --accent-5: #c026ff;

    --glass: rgba(28, 12, 42, 0.24);
    --glass-border: rgba(255, 90, 220, 0.18);
    --glass-border-strong: rgba(255, 90, 220, 0.4);
}

body {
    background-color: var(--background-color);
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
    color: var(--text-color);
}

/* =========================================================
   Cosmos backdrop — dark sky first, color only at the bottom
   ========================================================= */
.cosmos {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--background-color);
}

/* faint logo watermark, deep in the background */
.cosmos .bg-logo {
    position: absolute;
    top: 42%;
    left: 50%;
    width: min(560px, 78vw);
    height: min(560px, 78vw);
    transform: translate(-50%, -50%);
    background-image: url('logo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.16;
    filter: grayscale(45%) brightness(0.85);
    animation: logo-breathe 22s ease-in-out infinite;
}

@keyframes logo-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.16; }
    50%      { transform: translate(-50%, -50%) scale(1.02); opacity: 0.2; }
}

/* ---- Stars — the main event, so they stay crisp against near-black ---- */
.cosmos .stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.3px 1.3px at 20px 30px, #ffffff 50%, transparent 100%),
        radial-gradient(1px 1px at 80px 90px, #efe6ff 50%, transparent 100%),
        radial-gradient(1.6px 1.6px at 140px 60px, #ffffff 50%, transparent 100%),
        radial-gradient(1px 1px at 200px 150px, #e7d8ff 50%, transparent 100%),
        radial-gradient(1.3px 1.3px at 260px 40px, #ffffff 50%, transparent 100%),
        radial-gradient(1px 1px at 320px 180px, #efe6ff 50%, transparent 100%),
        radial-gradient(1.2px 1.2px at 100px 200px, #ffffff 50%, transparent 100%);
    background-size: 360px 220px;
    opacity: .8;
    animation: stars-drift 130s linear infinite;
}

@keyframes stars-drift {
    from { background-position: 0 0; }
    to   { background-position: -360px -220px; }
}

.cosmos .stars-2 {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1.8px 1.8px at 50px 80px, #ffffff 50%, transparent 100%),
        radial-gradient(2px 2px at 180px 30px, #ffffff 50%, transparent 100%),
        radial-gradient(1.5px 1.5px at 280px 200px, #e9dcff 50%, transparent 100%),
        radial-gradient(1.8px 1.8px at 380px 120px, #ffffff 50%, transparent 100%);
    background-size: 480px 280px;
    opacity: .6;
    animation: stars-drift-2 180s linear infinite reverse, twinkle 5.5s ease-in-out infinite;
}

@keyframes stars-drift-2 {
    from { background-position: 0 0; }
    to   { background-position: -480px -280px; }
}

@keyframes twinkle {
    0%, 100% { opacity: .6; }
    50%      { opacity: .4; }
}

/* ---- Shooting stars — rare, faint ---- */
.cosmos .shooting-star {
    position: absolute;
    width: 90px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255, 170, 235, 0.35), rgba(255, 255, 255, 0.8));
    border-radius: 99px;
    opacity: 0;
}

.cosmos .s1 {
    top: 14%;
    left: -10%;
    transform: rotate(13deg);
    animation: shoot-1 15s linear infinite;
    animation-delay: 3s;
}

.cosmos .s2 {
    top: 52%;
    right: -10%;
    width: 75px;
    height: 1px;
    transform: rotate(167deg);
    animation: shoot-2 19s linear infinite;
    animation-delay: 9s;
}

@keyframes shoot-1 {
    0%   { transform: translate(0, 0) rotate(13deg); opacity: 0; }
    1%   { opacity: .5; }
    8%   { transform: translate(68vw, 16vw) rotate(13deg); opacity: 0; }
    100% { transform: translate(68vw, 16vw) rotate(13deg); opacity: 0; }
}

@keyframes shoot-2 {
    0%   { transform: translate(0, 0) rotate(167deg); opacity: 0; }
    1%   { opacity: .38; }
    8%   { transform: translate(-72vw, 14vw) rotate(167deg); opacity: 0; }
    100% { transform: translate(-72vw, 14vw) rotate(167deg); opacity: 0; }
}

/* ---- Nebula — pooled low, saturated, the only real color in the sky ---- */
.cosmos .nebula-bottom {
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -15%;
    height: 55%;
    background:
        radial-gradient(ellipse 60% 80% at 30% 100%, rgba(255, 15, 208, 0.55), transparent 65%),
        radial-gradient(ellipse 55% 75% at 72% 100%, rgba(122, 18, 255, 0.55), transparent 65%),
        radial-gradient(ellipse 45% 60% at 50% 100%, rgba(255, 60, 190, 0.4), transparent 70%);
    filter: blur(30px);
    animation: nebula-glow 14s ease-in-out infinite;
}

@keyframes nebula-glow {
    0%, 100% { opacity: .85; transform: translate3d(0, 0, 0) scale(1); }
    50%      { opacity: 1;   transform: translate3d(0, -1.5%, 0) scale(1.04); }
}

.cosmos .vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 140% 60% at 50% -10%, rgba(0, 0, 0, 0.6), transparent 55%);
}

@media (prefers-reduced-motion: reduce) {
    .cosmos .shooting-star { animation: none; opacity: 0; }
    .cosmos .stars, .cosmos .stars-2, .cosmos .nebula-bottom, .cosmos .bg-logo {
        animation: none;
    }
}

/* =========================================================
   Premium rotating glow ring — a registered custom property
   drives a conic-gradient that spins behind the avatar.
   ========================================================= */
@property --angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@keyframes spin-angle {
    to { --angle: 360deg; }
}

.profile > .picture-container {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    /* slight ambient glow — box-shadow bleeds outward naturally with no
       square-clipping quirks, so this stays a soft, subtle halo */
    box-shadow: 0 0 10px rgba(255, 63, 214, 0.28), 0 0 18px rgba(155, 59, 255, 0.18);
}

/* crisp rotating ring — the actual "cool border effect" */
.profile > .picture-container::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from var(--angle), var(--accent), var(--accent-5), var(--accent-2), var(--accent-3), var(--accent-4), var(--accent));
    animation: spin-angle 3.2s linear infinite;
    z-index: 1;
}

.profile > .picture-container > .profile-picture {
    position: relative;
    z-index: 2;
    display: block;
    height: 92px;
    width: 92px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--background-color);
}

@media (prefers-reduced-motion: reduce) {
    .profile > .picture-container::after {
        animation: none;
    }
}

.profile > .picture-container > .active-container {
    background-color: var(--background-color);
    padding: 4px;
    position: absolute;
    z-index: 3;
    bottom: 4%;
    right: 4%;
    border-radius: 50%;
}

.profile > .picture-container > .active-container > .active-bubble {
    height: 7px;
    width: 7px;
    background-color: rgb(0, 206, 0);
    border-radius: 50%;
}

.profile > .picture-container > .active-container > .active-bubble::after {
    content: "";
    height: 7px;
    width: 7px;
    background-color: rgb(0, 206, 0);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* =========================================================
   Profile
   ========================================================= */
.profile {
    width: 100%;
    margin-top: var(--spacing-deadzone-y);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

.profile > h1 {
    max-width: calc(100% - (var(--spacing-md) * 2));
    margin-top: 6px;
    font-size: var(--font-size-2xl);
    font-weight: 500;
    text-align: center;
    overflow-wrap: break-word;
}

.profile > .pill {
    background-color: rgba(10, 4, 16, 0.4);
    padding: 5px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    color: var(--text-color-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 1000px;
}

.profile > .pill > span {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: 1px;
}

.profile > .pill > .bubble {
    height: 5px;
    width: 5px;
    background-color: rgba(255, 90, 220, 0.5);
    border-radius: 50%;
}

a.location,
a.location:visited {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: var(--spacing-xs);
    padding: 5px 14px;
    background-color: rgba(10, 4, 16, 0.4);
    font-size: var(--font-size-sm);
    color: var(--text-color-secondary) !important;
    text-decoration: none !important;
    border: 1px solid var(--glass-border);
    border-radius: 1000px;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

a.location > i.bi-geo-alt-fill {
    color: var(--text-color-secondary);
    font-size: var(--font-size-sm);
}

a.location > i.bi-arrow-up-right {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

a.location:hover {
    color: var(--text-color) !important;
    border-color: var(--glass-border-strong);
    transform: translateY(-1px);
}

a.location:hover > i.bi-arrow-up-right {
    color: var(--text-color);
    transform: translate(1px, -1px);
}

.profile > .socials {
    margin-top: var(--spacing-xs);
    display: flex;
    gap: var(--spacing-sm);
}

.profile > .socials > a > i {
    font-size: 18.7px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.profile > .socials > a:hover > i {
    color: var(--icon-color);
}

.profile > .bio {
    max-width: min(400px, calc(100% - (var(--spacing-md) * 2)));
    margin-top: var(--spacing-sm);
    text-align: center;
    color: var(--text-color-body);
    overflow-wrap: break-word;
}

/* =========================================================
   Links
   ========================================================= */
.links {
    width: clamp(300px, 80%, 500px);
    margin: var(--spacing-page-y) auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.links > a {
    background: var(--glass);
    backdrop-filter: blur(8px) saturate(140%);
    padding: 10px 20px;
    position: relative;
    color: var(--text-color-secondary);
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--glass-border);
    border-radius: 1000px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.links > a:hover {
    background-color: rgba(255, 90, 220, 0.12);
    color: var(--text-color);
    transform: scale(1.03) translateY(-2px);
    border-color: var(--glass-border-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 0 16px rgba(255, 63, 214, 0.35),
        0 0 32px rgba(155, 59, 255, 0.28),
        0 8px 18px -14px rgba(155, 59, 255, 0.45);
}

.links > a > i {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

/* =========================================================
   Footer
   ========================================================= */
footer {
    margin-top: calc(var(--spacing-page-y) * 2);
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-color-secondary);
    border-top: 1px solid rgba(255, 90, 220, 0.1);
}

footer > h2 {
    font-size: var(--font-size-lg);
    text-transform: uppercase;
}

footer > p {
    margin-top: var(--spacing-xs);
}

footer a {
    color: var(--accent);
}

/* ============================================================
   Sections — shared layout for grouped links.
   ============================================================ */
.sections {
    width: clamp(300px, 80%, 500px);
    margin: var(--spacing-page-y) auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}
.sections .links {
    width: 100%;
    margin: 0;
}
.link-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}
.section-title {
    margin: 0 auto;
    text-align: center;
    font-weight: 500;
    font-size: var(--font-size-lg);
    color: var(--text-color-secondary, inherit);
}
.links.links-icons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
}
.links.links-icons > a {
    background: none;
    border: 1px solid transparent;
    padding: 6px;
    font-size: 1.4rem;
    border-radius: 50%;
}
.links.links-icons > a > i {
    position: static;
    transform: none;
    left: auto;
}

/* Connect: Save-contact button matches this theme's glass pill buttons */
.connect .connect-save {
    background: var(--glass);
    backdrop-filter: blur(8px) saturate(140%);
    color: var(--text-color-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 1000px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.connect .connect-save:hover {
    background-color: rgba(255, 90, 220, 0.12);
    color: var(--text-color);
    border-color: var(--glass-border-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 0 16px rgba(255, 63, 214, 0.35),
        0 0 32px rgba(155, 59, 255, 0.28),
        0 8px 18px -14px rgba(155, 59, 255, 0.45);
    transform: translateY(-2px);
}
