/**
 * Fanlink Page — Dark Glass Neumorphism (black grid + lime glow)
 *
 * @package Bargtunes
 */

:root {
    --fl-bg: #0a0a09;
    --fl-ink: #f2f2ee;
    --fl-ink-soft: rgba(242, 242, 238, 0.55);
    --fl-lime: #d6ff4b;
    --fl-lime-soft: rgba(214, 255, 75, 0.14);
    --fl-glass: rgba(255, 255, 255, 0.045);
    --fl-glass-strong: rgba(255, 255, 255, 0.08);
    --fl-border: rgba(255, 255, 255, 0.1);
    --fl-border-strong: rgba(255, 255, 255, 0.16);
    --fl-radius: 16px;
    --fl-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Page shell (no scroll, no scrollbar) ---------- */

html:has(body.fanlink-body) {
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
    background: var(--fl-bg);
}

body.fanlink-body {
    margin: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--fl-bg);
    font-family: 'Poppins', 'Vazirmatn', sans-serif;
    color: var(--fl-ink);
    -webkit-font-smoothing: antialiased;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.fanlink-body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body.fanlink-body .main-header,
body.fanlink-body .fullscreen-menu,
body.fanlink-body .fn-dock,
body.fanlink-body .site-footer {
    display: none !important;
}

.fl-page {
    position: relative;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2vh, 24px) max(16px, env(safe-area-inset-left, 0px)) max(clamp(10px, 2vh, 24px), env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
    overflow: hidden;
}

.fl-page[dir="rtl"] {
    font-family: 'ModamWeb', 'Vazirmatn', 'Poppins', sans-serif;
}

/* ---------- Background: black checker grid + lime halos ---------- */

.fl-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--fl-bg);
}

.fl-bg__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

/* Flat dark base with a faint warm cast */
.fl-bg__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(130% 110% at 15% 100%, rgba(214, 255, 75, 0.035) 0%, transparent 55%),
        linear-gradient(180deg, #0a0a09 0%, #0b0b09 100%);
}

/* Thin grid lines (reference style) */
.fl-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 108px 108px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 108px 108px;
    pointer-events: none;
}

/* Lime halos — barely-there ambience */
.fl-bg__leaves {
    position: absolute;
    width: 56vmax;
    height: 56vmax;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(214, 255, 75, 0.03), transparent 70%);
    filter: blur(72px);
    animation: fl-drift 28s ease-in-out infinite alternate;
    pointer-events: none;
}

.fl-bg__leaves--1 {
    top: -26vmax;
    inset-inline-end: -16vmax;
}

.fl-bg__leaves--2 {
    bottom: -28vmax;
    inset-inline-start: -20vmax;
    width: 64vmax;
    height: 64vmax;
    background: radial-gradient(closest-side, rgba(214, 255, 75, 0.022), transparent 72%);
    animation-duration: 34s;
    animation-delay: -10s;
}

@keyframes fl-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-4vmax, 3vmax, 0) scale(1.1); }
}

/* Rays removed — flat reference look */
.fl-bg__rays {
    display: none;
}

.fl-bg__grain {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.04'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */

.fl-container {
    position: relative;
    z-index: 1;
    width: 100%;
    /* Width follows viewport height too, so the card never gets squashed */
    max-width: min(400px, 92vw, 62vh);
    max-height: 100%;
    display: flex;
    justify-content: center;
}

/* Arch-shaped glass panel — flat 2D */
.fl-arch {
    position: relative;
    width: 100%;
    max-height: calc(100dvh - clamp(20px, 4vh, 48px) - env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    padding: clamp(22px, 5vh, 56px) clamp(18px, 4.5vw, 30px) clamp(14px, 2.6vh, 26px);
    border-radius: 210px 210px 26px 26px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--fl-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

/* ---------- Profile ---------- */

.fl-profile {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: clamp(12px, 2.4vh, 24px);
}

.fl-profile__ring {
    position: relative;
    width: clamp(84px, 15vh, 132px);
    height: clamp(84px, 15vh, 132px);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fl-border-strong);
}

.fl-profile__avatar {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(214, 255, 75, 0.3);
    background: #161616;
}

.fl-profile__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fl-profile__signature {
    position: absolute;
    bottom: 0;
    inset-inline-end: -10%;
    width: 46%;
    height: auto;
    pointer-events: none;
    filter: invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    opacity: 0.9;
}

.fl-profile__name {
    margin: clamp(10px, 1.8vh, 18px) 0 0;
    font-size: clamp(16px, 2.6vh, 22px);
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--fl-ink);
}

.fl-page[dir="rtl"] .fl-profile__name {
    letter-spacing: 0.04em;
}

.fl-profile__tagline {
    margin: 5px 0 0;
    font-size: clamp(9px, 1.3vh, 11px);
    font-weight: 500;
    letter-spacing: 0.44em;
    text-transform: uppercase;
    color: var(--fl-lime);
    opacity: 0.85;
}

.fl-page[dir="rtl"] .fl-profile__tagline {
    letter-spacing: 0.12em;
}

/* ---------- Links (dark glass neumorphism) ---------- */

.fl-links {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: clamp(8px, 1.5vh, 14px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    scrollbar-width: thin;
    scrollbar-color: rgba(214, 255, 75, 0.35) transparent;
}

.fl-links::-webkit-scrollbar {
    width: 4px;
}

.fl-links::-webkit-scrollbar-thumb {
    background: rgba(214, 255, 75, 0.35);
    border-radius: 999px;
}

.fl-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.4vw, 14px);
    padding: clamp(9px, 1.6vh, 14px) clamp(12px, 3vw, 18px);
    border-radius: var(--fl-radius);
    text-decoration: none;
    color: var(--fl-ink);
    background: var(--fl-glass);
    border: 1px solid var(--fl-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
        border-color 0.28s var(--fl-ease),
        background 0.28s var(--fl-ease);
}

.fl-link:hover,
.fl-link:focus-visible {
    border-color: rgba(214, 255, 75, 0.4);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.fl-link:active {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(214, 255, 75, 0.55);
}

.fl-link__icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: clamp(32px, 4.6vh, 40px);
    height: clamp(32px, 4.6vh, 40px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--fl-lime);
    transition: background 0.28s var(--fl-ease);
}

.fl-link:hover .fl-link__icon {
    background: rgba(214, 255, 75, 0.1);
}

.fl-link__icon svg {
    width: clamp(16px, 2.4vh, 20px);
    height: clamp(16px, 2.4vh, 20px);
}

.fl-link__divider {
    flex-shrink: 0;
    width: 1px;
    align-self: stretch;
    margin-block: 5px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.14), transparent);
}

.fl-link__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.fl-link__title {
    font-size: clamp(11px, 1.55vh, 13px);
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fl-ink);
}

.fl-page[dir="rtl"] .fl-link__title {
    letter-spacing: 0.03em;
}

.fl-link__subtitle {
    font-size: clamp(9.5px, 1.25vh, 11px);
    font-weight: 400;
    color: var(--fl-ink-soft);
    letter-spacing: 0.07em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-link__chevron {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: clamp(26px, 3.8vh, 32px);
    height: clamp(26px, 3.8vh, 32px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--fl-ink);
    transition: transform 0.28s var(--fl-ease), color 0.28s var(--fl-ease);
}

.fl-link__chevron svg {
    width: 13px;
    height: 13px;
}

.fl-link:hover .fl-link__chevron {
    transform: translateX(3px);
    color: var(--fl-lime);
}

.fl-page[dir="rtl"] .fl-link:hover .fl-link__chevron {
    transform: translateX(-3px);
}

/* ---------- Footer ---------- */

.fl-footer {
    flex-shrink: 0;
    margin-top: clamp(12px, 2.4vh, 22px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(5px, 1vh, 9px);
    text-align: center;
}

.fl-footer__text {
    margin: 0;
    font-size: clamp(8px, 1.15vh, 10px);
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--fl-ink-soft);
}

.fl-page[dir="rtl"] .fl-footer__text {
    letter-spacing: 0.1em;
}

.fl-footer__heart {
    color: var(--fl-lime);
    opacity: 0.9;
    animation: fl-heartbeat 2.4s ease-in-out infinite;
}

.fl-footer__heart svg {
    width: 16px;
    height: 16px;
}

@keyframes fl-heartbeat {
    0%, 100% { transform: scale(1); }
    12%      { transform: scale(1.14); }
    24%      { transform: scale(1); }
    36%      { transform: scale(1.1); }
    48%      { transform: scale(1); }
}

/* ---------- Entrance animations ---------- */

@media (prefers-reduced-motion: no-preference) {
    .fl-arch {
        animation: fl-rise 0.9s var(--fl-ease) both;
    }

    .fl-profile__ring,
    .fl-profile__name,
    .fl-profile__tagline {
        animation: fl-rise 0.8s var(--fl-ease) both;
    }

    .fl-profile__name    { animation-delay: 0.12s; }
    .fl-profile__tagline { animation-delay: 0.2s; }

    .fl-link {
        animation: fl-rise 0.7s var(--fl-ease) both;
        animation-delay: calc(0.28s + var(--fl-i, 0) * 0.08s);
    }

    .fl-footer {
        animation: fl-rise 0.7s var(--fl-ease) both;
        animation-delay: 0.72s;
    }
}

@keyframes fl-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Responsive ---------- */

/* Tablets and small laptops: slightly larger card */
@media (min-width: 768px) and (min-height: 800px) {
    .fl-container {
        max-width: min(430px, 60vh);
    }
}

/* Large desktop */
@media (min-width: 1440px) and (min-height: 900px) {
    .fl-container {
        max-width: min(460px, 58vh);
    }
}

/* Phones */
@media (max-width: 640px) {
    .fl-page {
        padding: 10px 14px;
    }

    .fl-container {
        max-width: min(390px, 94vw, 64vh);
    }

    .fl-arch {
        border-radius: 170px 170px 22px 22px;
        padding-inline: 16px;
    }

    .fl-link {
        border-radius: 14px;
        gap: 10px;
    }
}

/* Narrow phones */
@media (max-width: 380px) {
    .fl-page {
        padding: 8px 10px;
    }

    .fl-arch {
        padding-inline: 12px;
        border-radius: 140px 140px 18px 18px;
    }

    .fl-link__divider {
        display: none;
    }

    .fl-link__title {
        letter-spacing: 0.12em;
    }

    .fl-link__chevron {
        display: none;
    }
}

/* Short viewports (landscape phones): compact layout */
@media (max-height: 600px) {
    .fl-container {
        max-width: min(420px, 92vw);
    }

    .fl-arch {
        border-radius: 96px 96px 18px 18px;
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .fl-profile__ring {
        width: 56px;
        height: 56px;
    }

    .fl-profile {
        margin-bottom: 8px;
    }

    .fl-profile__name {
        font-size: 14px;
        margin-top: 6px;
    }

    .fl-profile__tagline {
        display: none;
    }

    .fl-footer {
        margin-top: 8px;
    }

    .fl-footer__heart {
        display: none;
    }

    .fl-link__subtitle {
        display: none;
    }
}

/* Very short: hide footer text entirely */
@media (max-height: 460px) {
    .fl-footer {
        display: none;
    }

    .fl-arch {
        border-radius: 60px 60px 16px 16px;
    }
}

/* Fallback when backdrop-filter is unsupported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .fl-arch {
        background: rgba(14, 14, 14, 0.94);
    }

    .fl-link {
        background: rgba(20, 20, 20, 0.95);
    }
}
