/* ============================================
   BROTHER LOUIE — LANDING PAGE PREMIUM
   Design System & Styles
   ============================================ */

/* --- Design Tokens --- */
:root {
    /* Core Palette */
    --bg-deep: #080b18;
    --bg-surface: #0d1129;
    --bg-elevated: #131836;

    /* Brand Gradient */
    --brand-purple: #8b5cf6;
    --brand-pink: #ec4899;
    --brand-blue: #6366f1;
    --brand-cyan: #22d3ee;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Card / Glass */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.18);
    --glass-blur: 16px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.15);
    --shadow-glow-pink: 0 0 40px rgba(236, 72, 153, 0.12);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 0.2s var(--ease-out-expo);
    --transition-normal: 0.35s var(--ease-out-expo);
    --transition-slow: 0.6s var(--ease-out-expo);

    /* Spacing */
    --container-max: 640px;
    --container-padding: 1.5rem;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* --- Skip to Content (Accessibility) --- */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand-purple);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 12px 12px;
    font-weight: 600;
    z-index: 100;
    transition: top var(--transition-fast);
    text-decoration: none;
}
.skip-to-content:focus {
    top: 0;
}

/* ============================================
   ANIMATED BACKGROUND — Aurora Borealis
   ============================================ */
.background-animation {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Blob 1 — Purple */
.background-animation::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 70vmax;
    height: 70vmax;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 60%);
    border-radius: 50%;
    animation: auroraBlob1 20s ease-in-out infinite alternate;
    filter: blur(40px);
}

/* Blob 2 — Pink */
.background-animation::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 65vmax;
    height: 65vmax;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 60%);
    border-radius: 50%;
    animation: auroraBlob2 25s ease-in-out infinite alternate;
    filter: blur(40px);
}

@keyframes auroraBlob1 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(15%, 10%) scale(1.1); }
    66%  { transform: translate(-5%, 20%) scale(0.95); }
    100% { transform: translate(10%, -5%) scale(1.05); }
}

@keyframes auroraBlob2 {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-15%, -10%) scale(1.05); }
    66%  { transform: translate(10%, -15%) scale(1.1); }
    100% { transform: translate(-10%, 5%) scale(0.95); }
}

/* Floating particles layer */
.bg-particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    animation: floatParticle linear infinite;
}

.bg-particle:nth-child(1) { left: 10%; top: 20%; animation-duration: 18s; animation-delay: 0s; width: 2px; height: 2px; }
.bg-particle:nth-child(2) { left: 25%; top: 60%; animation-duration: 22s; animation-delay: -3s; background: rgba(236, 72, 153, 0.25); }
.bg-particle:nth-child(3) { left: 50%; top: 35%; animation-duration: 15s; animation-delay: -7s; width: 4px; height: 4px; }
.bg-particle:nth-child(4) { left: 70%; top: 75%; animation-duration: 20s; animation-delay: -2s; background: rgba(34, 211, 238, 0.2); }
.bg-particle:nth-child(5) { left: 85%; top: 15%; animation-duration: 25s; animation-delay: -5s; width: 2px; height: 2px; }
.bg-particle:nth-child(6) { left: 40%; top: 85%; animation-duration: 17s; animation-delay: -8s; background: rgba(236, 72, 153, 0.2); }

@keyframes floatParticle {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.3; }
    25%      { transform: translateY(-30vh) translateX(15px) scale(1.2); opacity: 0.6; }
    50%      { transform: translateY(-60vh) translateX(-10px) scale(0.8); opacity: 0.4; }
    75%      { transform: translateY(-30vh) translateX(20px) scale(1.1); opacity: 0.5; }
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    padding: 3rem var(--container-padding) 2rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

/* ============================================
   PROFILE HEADER
   ============================================ */
.profile {
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
    animation: profileEntrance 0.8s var(--ease-out-expo) both;
}

/* Cover Photo */
.cover-photo {
    width: 100%;
    height: 180px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
    background-size: cover;
    background-position: center;
    margin-bottom: -60px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.cover-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-deep) 0%, transparent 50%);
    pointer-events: none;
}

/* Avatar with animated gradient ring */
.avatar-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    padding: 4px;
    background: conic-gradient(
        from 0deg,
        var(--brand-purple),
        var(--brand-pink),
        var(--brand-cyan),
        var(--brand-blue),
        var(--brand-purple)
    );
    box-shadow:
        var(--shadow-md),
        0 0 30px rgba(139, 92, 246, 0.2),
        0 0 60px rgba(236, 72, 153, 0.1);
    position: relative;
    z-index: 2;
    animation: avatarRingSpin 8s linear infinite;
}

@keyframes avatarRingSpin {
    to { background: conic-gradient(
        from 360deg,
        var(--brand-purple),
        var(--brand-pink),
        var(--brand-cyan),
        var(--brand-blue),
        var(--brand-purple)
    ); }
}

/* Pulsing glow behind avatar */
.avatar-container::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--brand-purple),
        var(--brand-pink),
        var(--brand-cyan),
        var(--brand-blue),
        var(--brand-purple)
    );
    z-index: -1;
    opacity: 0.3;
    filter: blur(16px);
    animation: avatarGlow 3s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
    0%   { opacity: 0.2; transform: scale(0.95); }
    100% { opacity: 0.4; transform: scale(1.05); }
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--bg-deep);
    display: block;
}

/* Profile Name — Gradient text */
.profile-name {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--brand-purple) 50%, var(--brand-pink) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.profile-bio {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================
   LINKS CONTAINER
   ============================================ */
.links-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* ============================================
   LINK CARD — Premium Glassmorphism
   ============================================ */
.link-card {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.625rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition:
        transform var(--transition-normal),
        background var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
    position: relative;
    overflow: hidden;
    /* Animation entrance */
    opacity: 0;
    animation: cardEntrance 0.6s var(--ease-out-expo) forwards;
    cursor: pointer;
}

/* Gradient border on hover (pseudo-element) */
.link-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, var(--brand-purple), var(--brand-pink), var(--brand-cyan));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

/* Shimmer sweep effect */
.link-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 60%,
        transparent 100%
    );
    transform: skewX(-20deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

/* Hover state */
.link-card:hover {
    transform: translateY(-4px) scale(1.015);
    background: var(--glass-bg-hover);
    border-color: transparent;
    box-shadow:
        var(--shadow-lg),
        var(--shadow-glow-purple);
}

.link-card:hover::before {
    opacity: 1;
}

.link-card:hover::after {
    left: 200%;
}

/* Active state (click) */
.link-card:active {
    transform: translateY(-2px) scale(0.99);
    transition-duration: 0.1s;
}

/* Focus state (keyboard nav) */
.link-card:focus-visible {
    outline: 2px solid var(--brand-purple);
    outline-offset: 3px;
    border-color: transparent;
}
.link-card:focus-visible::before {
    opacity: 1;
}

/* ============================================
   LINK AVATAR (Left icon)
   ============================================ */
.link-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 1rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.link-card:hover .link-avatar {
    transform: scale(1.05);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ============================================
   LINK TITLE & ARROW
   ============================================ */
.link-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.link-title {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    margin-left: 0.75rem;
    transition: transform var(--transition-normal), color var(--transition-normal);
}

.link-card:hover .link-arrow {
    transform: translateX(3px) translateY(-2px);
    color: var(--brand-purple);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 2rem;
    border: 1px dashed var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(8px);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.empty-state-text {
    font-size: 0.9rem;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--glass-bg) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        var(--glass-bg) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 16px;
}

.skeleton-card {
    height: 72px;
    border-radius: 16px;
    margin-bottom: 0.875rem;
}

.skeleton-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
}

.skeleton-text {
    height: 1.2em;
    border-radius: 8px;
    margin: 0 auto 0.5rem;
}

.skeleton-text.w-40 { width: 40%; }
.skeleton-text.w-60 { width: 60%; }

@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    width: 100%;
    max-width: var(--container-max);
    padding: 2rem var(--container-padding) 1.5rem;
    text-align: center;
    z-index: 1;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.footer-text a {
    color: var(--brand-purple);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-text a:hover {
    color: var(--brand-pink);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes profileEntrance {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet */
@media (max-width: 768px) {
    :root {
        --container-padding: 1.25rem;
    }

    .cover-photo {
        height: 150px;
        border-radius: 16px;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .link-avatar {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
    }

    .container {
        padding-top: 2rem;
    }

    .cover-photo {
        height: 120px;
        border-radius: 14px;
        margin-bottom: -50px;
    }

    .avatar-container {
        width: 100px;
        height: 100px;
    }

    .profile-name {
        font-size: 1.35rem;
    }

    .profile-bio {
        font-size: 0.9rem;
    }

    .link-card {
        padding: 0.5rem 0.625rem;
        border-radius: 14px;
    }

    .link-avatar {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        margin-right: 0.75rem;
    }

    .link-title {
        font-size: 0.925rem;
    }

    .link-arrow {
        width: 18px;
        height: 18px;
    }

    /* Splash Mobile */
    .splash-content {
        padding: 1rem;
    }
    .splash-image-wrapper {
        width: 130px;
        height: 130px;
        margin-bottom: 1.2rem;
    }
    .splash-welcome-text {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    .btn-splash {
        padding: 0.875rem 2rem;
        font-size: 1.05rem;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .profile-name {
        font-size: 1.2rem;
    }

    .profile-bio {
        font-size: 0.85rem;
    }

    .link-avatar {
        width: 40px;
        height: 40px;
    }

    .link-title {
        font-size: 0.875rem;
    }

    /* Splash Small Mobile */
    .splash-image-wrapper {
        width: 110px;
        height: 110px;
        margin-bottom: 1rem;
    }
    .splash-welcome-text {
        font-size: 0.9rem;
    }
    .btn-splash {
        padding: 0.8rem 1.8rem;
        font-size: 1rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   SPLASH SCREEN (CAPA)
   ============================================ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s var(--ease-spring), opacity 0.8s ease;
}

.splash-screen.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.splash-background {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.35);
    z-index: -1;
    animation: pulseBg 10s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0%   { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    animation: fadeUpSplash 1s var(--ease-out-expo) 0.2s both;
}

.splash-image-wrapper {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    padding: 6px;
    background: conic-gradient(from 0deg, var(--brand-purple), var(--brand-pink), var(--brand-cyan), var(--brand-blue), var(--brand-purple));
    box-shadow: var(--shadow-lg), var(--shadow-glow-purple);
    animation: avatarRingSpin 8s linear infinite;
    position: relative;
}

.splash-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: inherit;
    filter: blur(20px);
    opacity: 0.4;
    z-index: -1;
}

.splash-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--bg-deep);
}

.splash-welcome-text {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.btn-splash {
    background: linear-gradient(135deg, var(--brand-purple), var(--brand-pink));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 99px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 25px rgba(236, 72, 153, 0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-splash:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 35px rgba(236, 72, 153, 0.6);
}

.btn-splash svg {
    transition: transform var(--transition-fast);
}

.btn-splash:hover svg {
    transform: translateX(4px);
}

@keyframes fadeUpSplash {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   IN-APP BROWSER OVERLAY
   ============================================ */
.inapp-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(8, 11, 24, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
    color: white;
    text-align: center;
    transition: opacity 0.3s ease;
}

.inapp-message {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    margin-top: 20vh;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: fadeUpSplash 0.6s var(--ease-out-expo) both;
}

.inapp-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    color: var(--brand-pink);
    font-weight: bold;
    animation: bounceArrow 1.5s infinite;
}

@keyframes bounceArrow {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-10px) translateX(10px); }
}
