/* Fonts loaded asynchronously via <link> in HTML for zero render-blocking delay */

/* ==========================================================================
   THEME VARIABLES - DEFAULT: LIGHT THEME
   ========================================================================== */

/* LIGHT THEME (Default) */
:root,
[data-theme="light"] {
    --bg-page: #eaedf2;
    --bg-grid-color: rgba(15, 23, 42, 0.05);
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-card: #d2d8e2;
    --border-card-hover: #b8c2d1;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --text-primary: #090d16;
    --text-secondary: #334155;
    --text-muted: #526071;
    --icon-bg: #f1f4f8;
    --icon-border: #d2d8e2;
    --card-shadow: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
    --card-shadow-hover: 0 6px 18px rgba(15, 23, 42, 0.09);
    --btn-open-bg: #edf1f6;
    --btn-open-text: #1e293b;
    --btn-open-border: #cbd5e1;
    --btn-open-hover: #e2e8f0;
}

/* DARK THEME */
[data-theme="dark"] {
    --bg-page: #0a0d14;
    --bg-grid-color: rgba(255, 255, 255, 0.035);
    --bg-card: #19202d;
    --bg-card-hover: #202838;
    --border-card: #2d384c;
    --border-card-hover: #43516c;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --icon-bg: #222b3d;
    --icon-border: #323e54;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
    --btn-open-bg: #263143;
    --btn-open-text: #e2e8f0;
    --btn-open-border: #3b4961;
    --btn-open-hover: #313e54;
}

/* GLOBAL RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    color-scheme: light dark;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    background-image: 
        linear-gradient(to right, var(--bg-grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--bg-grid-color) 1px, transparent 1px);
    background-size: 32px 32px;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* APP WRAPPER */
.app-wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* TOP TOOLBAR */
.top-nav {
    width: 100%;
    max-width: 540px;
    padding: 1.25rem 1.15rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.nav-brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--card-shadow);
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    flex-shrink: 0;
}

/* THEME TOGGLE BUTTON */
.theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    padding: 0;
}

.theme-toggle-btn:hover {
    transform: scale(1.08);
    border-color: var(--border-card-hover);
    background: var(--bg-card-hover);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
}

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* CONTAINER */
.container {
    width: 100%;
    max-width: 540px;
    padding: 0.25rem 1.15rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* PROFILE HEADER */
.profile-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* HERO BANNER (16:9 ASPECT RATIO) */
.banner-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    box-shadow: var(--card-shadow);
    background: var(--bg-card);
    position: relative;
}

.hero-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* AVATAR OVERLAPPING BANNER */
.avatar-wrap {
    position: relative;
    width: 112px;
    height: 112px;
    margin-top: -56px;
    margin-bottom: 0.85rem;
    z-index: 2;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-page);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: var(--bg-card);
    display: block;
    transition: border-color 0.25s ease;
}

.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.35rem;
}

.profile-name {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.verified-icon {
    width: 18px;
    height: 18px;
    fill: #3b82f6;
    flex-shrink: 0;
}

.profile-tagline {
    font-size: 0.88rem;
    color: var(--text-secondary);
    max-width: 420px;
    line-height: 1.45;
    margin-bottom: 0.95rem;
}

/* STATS PILL */
.stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    box-shadow: var(--card-shadow);
}

.stats-pill strong {
    color: var(--text-primary);
    font-weight: 600;
}

.stats-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
}

/* ==========================================================================
   LINKS WRAPPER & REFINED BENTO CARDS
   ========================================================================== */
.links-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

/* LINK ROW CARD - TITLE ONLY, NO SUBTITLE, NO BADGES */
.link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.2s ease,
                border-color 0.2s ease,
                background-color 0.2s ease;
    user-select: none;
    position: relative;
}

.link-row:hover {
    border-color: var(--border-card-hover);
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-1.5px);
}

/* Tactile Click Animation when clicking anywhere on the card */
.link-row.card-press-anim {
    animation: cardTactileBounce 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardTactileBounce {
    0% { transform: scale(1); }
    35% { transform: scale(0.965); }
    70% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

.link-left {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
    flex: 1;
}

.link-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--icon-bg);
    border: 1px solid var(--icon-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.link-row:hover .link-icon-box {
    transform: scale(1.05);
}

.link-icon-box svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

.link-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    text-align: left;
}

/* ONLY TITLE - CLEAN & CRISP */
.link-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.15px;
}

.link-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* SUBTLE, ELEGANT 'BUKA' PILL BUTTON */
.btn-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--btn-open-bg);
    color: var(--btn-open-text);
    border: 1px solid var(--btn-open-border);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.16s ease;
    cursor: pointer;
    flex-shrink: 0;
    letter-spacing: 0.15px;
}

.btn-open:hover {
    background: var(--btn-open-hover);
    color: var(--text-primary);
    border-color: var(--border-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-open:active {
    transform: translateY(0);
}

.btn-open-icon {
    width: 12px;
    height: 12px;
    display: block;
}

/* Pulse animation when card is tapped */
.btn-open.btn-highlight-pulse {
    animation: btnHighlight 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes btnHighlight {
    0% { transform: scale(1); }
    40% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35); }
    100% { transform: scale(1); }
}

/* MINIMAL SITE FOOTER */
.site-footer {
    margin-top: 2.25rem;
    text-align: center;
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

/* ==========================================================================
   FLOATING MUSIC BUTTON - PERMANENT OVAL PILL WITH RICH FLOATING SHADOW
   ========================================================================== */
.floating-music-btn {
    position: fixed;
    bottom: 22px;
    right: 22px;
    height: 38px;
    padding: 0 13px 0 11px;
    border-radius: 999px;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.22), 
                0 4px 10px -2px rgba(15, 23, 42, 0.14),
                0 0 0 1px rgba(255, 255, 255, 0.85) inset !important;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    z-index: 9999;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.2s ease;
    outline: none;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 220px;
    user-select: none;
}

.floating-music-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -4px rgba(15, 23, 42, 0.28), 
                0 6px 14px -2px rgba(15, 23, 42, 0.18),
                0 0 0 1px rgba(255, 255, 255, 0.9) inset !important;
}

.floating-music-btn:active {
    transform: translateY(0) scale(0.98);
}

/* State: PLAYING (EQUALIZER & ACCENT RING) */
.floating-music-btn.playing {
    border-color: rgba(34, 197, 94, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2), 
                0 10px 25px -4px rgba(15, 23, 42, 0.24),
                0 4px 10px -2px rgba(15, 23, 42, 0.14) !important;
}

/* Equalizer inside Playing Oval */
.music-eq {
    display: none;
    align-items: center;
    gap: 2px;
    height: 14px;
    flex-shrink: 0;
}

.floating-music-btn.playing .music-eq {
    display: flex;
}

.music-eq-bar {
    width: 2.5px;
    background: #0f172a;
    border-radius: 2px;
    animation: eqWave 0.85s ease-in-out infinite alternate;
}

.music-eq-bar:nth-child(1) { height: 5px; animation-delay: 0.1s; }
.music-eq-bar:nth-child(2) { height: 13px; animation-delay: 0.35s; }
.music-eq-bar:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.music-eq-bar:nth-child(4) { height: 11px; animation-delay: 0.45s; }

@keyframes eqWave {
    0% { height: 4px; }
    50% { height: 14px; }
    100% { height: 5px; }
}

/* Oval Title Text */
.music-title-text {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.1px;
}

/* Music Icon when Paused */
.music-icon-svg {
    width: 15px;
    height: 15px;
    fill: #0f172a !important;
    display: block;
    flex-shrink: 0;
}

.floating-music-btn.playing .music-icon-svg {
    display: none;
}

/* Mini Action Icon (Play / Pause indicator) */
.music-action-svg {
    width: 12px;
    height: 12px;
    fill: #0f172a;
    flex-shrink: 0;
    display: block;
    margin-left: 2px;
}

.floating-music-btn .music-action-pause { display: none; }
.floating-music-btn .music-action-play { display: block; }

.floating-music-btn.playing .music-action-pause { display: block; }
.floating-music-btn.playing .music-action-play { display: none; }

/* ==========================================================================
   ACTION NOTIFICATION - SLICK COMPACT CHIP SLIDING FROM THE SIDE
   ========================================================================== */
.toast {
    position: fixed;
    top: 76px;
    right: 20px;
    transform: translateX(calc(100% + 30px));
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.42rem 0.9rem;
    height: 34px;
    border-radius: 999px;
    background: var(--bg-card);
    border: 1px solid var(--border-card-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none !important;
    z-index: 10000;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    width: 14px;
    height: 14px;
    fill: #22c55e;
    flex-shrink: 0;
}

.toast-text {
    line-height: 1;
    letter-spacing: 0.1px;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 540px) {
    .top-nav {
        padding: 0.85rem 1rem 0.25rem;
    }
    .container {
        padding: 0.25rem 1rem 3.5rem;
    }
    .banner-wrap {
        border-radius: 14px;
    }
    .avatar-wrap {
        width: 96px;
        height: 96px;
        margin-top: -48px;
        margin-bottom: 0.75rem;
    }
    .profile-name {
        font-size: 1.25rem;
    }
    .profile-tagline {
        font-size: 0.82rem;
    }
    .link-row {
        padding: 0.75rem 0.9rem;
    }
    .link-icon-box {
        width: 38px;
        height: 38px;
    }
    .link-title {
        font-size: 0.9rem;
    }
    .btn-open {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    .floating-music-btn {
        bottom: 16px;
        right: 16px;
    }
    .toast {
        top: 70px;
        right: 16px;
    }
}
