/* ================= Easy-to-tweak sizes ================= */
:root {
    --r-min: 215px;    /* smallest circle radius (grows if you add more bubbles) */
    --bubble: 80px;    /* bubble diameter */
    --gap: 44px;       /* space between bubbles */
    --logo: 112px;     /* center logo size */
    --title: 26px;     /* name size */
    --tag: 12px;       /* tagline size */
    --bio: 14px;       /* bio size */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    overflow-x: hidden;
}

/* ================= Background canvases ================= */
#terrain {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 48vh;
    min-height: 260px;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 55%);
            mask-image: linear-gradient(to top, transparent 0%, #000 55%);
}

#particles {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ================= Layout ================= */
main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.orbit {
    --count: 9;  /* set automatically by the script */
    --radius: max(var(--r-min), calc(var(--count) * (var(--bubble) + var(--gap)) / 6.2832));
    position: relative;
    width: calc(var(--radius) * 2 + var(--bubble));
    height: calc(var(--radius) * 2 + var(--bubble));
    max-width: 100%;
}

/* ================= Center: logo, name, tagline, bio ================= */
.center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.8s ease both;
}

.logo {
    position: relative;
    width: var(--logo);
    height: var(--logo);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

/* Shown only if the logo image is missing */
.logo .fallback {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-family: 'Audiowide', 'Segoe UI', sans-serif;
    font-size: calc(var(--logo) * 0.42);
    place-items: center;
}
.logo.no-img .fallback { display: grid; }

.name {
    margin-top: 6px;
    font-family: 'Audiowide', 'Segoe UI', Tahoma, sans-serif;
    font-size: var(--title);
    font-weight: 400;
    color: #4a4a4a;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    line-height: 1.2;
}

.tagline {
    margin-top: 2px;
    font-family: 'Audiowide', 'Segoe UI', Tahoma, sans-serif;
    font-size: var(--tag);
    color: #6b7280;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ================= Bubbles ================= */
.slot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--bubble);
    height: var(--bubble);
    margin: calc(var(--bubble) / -2) 0 0 calc(var(--bubble) / -2);
    /* even spacing, first bubble just left of the top (same as the example) */
    --angle: calc(var(--i) * 360deg / var(--count) - 90deg - 90deg / var(--count));
    transform: rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle)));
}

.bubble {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    background: #111;
    text-decoration: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
    animation: pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
    animation-delay: calc(var(--i) * 70ms + 150ms);
    -webkit-tap-highlight-color: transparent;
}

.bubble:hover,
.bubble:focus-visible,
.bubble.active {
    transform: scale(1.12);
    filter: brightness(1.12);
    outline: none;
}

.bubble i { font-size: calc(var(--bubble) * 0.44); line-height: 1; }

.bubble .initials {
    font-family: 'Audiowide', 'Segoe UI', sans-serif;
    font-size: calc(var(--bubble) * 0.34);
    line-height: 1;
}

/* GitHub: the icon itself is the black circle, like the example */
.bubble.github { background: transparent; color: #111; }
.bubble.github i { font-size: var(--bubble); }
.bubble.github:hover, .bubble.github.active { filter: brightness(1.6); }

.bubble.discord { background: #5865F2; }
.bubble.email   { background: #111; }
.bubble.email i { font-size: calc(var(--bubble) * 0.4); }

/* ================= Hover card ================= */
.tip {
    position: fixed;
    z-index: 20;
    max-width: 240px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.92);
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.tip.show { opacity: 1; transform: none; }
.tip strong { display: block; font-size: 14px; margin-bottom: 2px; }
.tip small { display: block; margin-top: 5px; color: #9ca3af; font-size: 11px; }

@keyframes pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ================= Phones ================= */
@media (max-width: 600px) {
    :root {
        --r-min: 148px;
        --bubble: 54px;
        --gap: 26px;
        --logo: 78px;
        --title: 18px;
        --tag: 10px;
        --bio: 11px;
    }
    #terrain { height: 38vh; }
}

@media (max-width: 360px) {
    :root {
        --r-min: 128px;
        --bubble: 46px;
        --gap: 22px;
        --logo: 66px;
        --title: 16px;
        --tag: 9px;
        --bio: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bubble, .center { animation: none; }
}
