/*
 * ROOT VARIABLES
 * Define colors, fonts, and sizing variables for easy customization.
 */
:root {
    --bg-1: #0a0e27;
    --bg-2: #1a1f3a;
    --bg-3: #2d1b69;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-tertiary: #f093fb;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    --glass-blur: 20px;
    --radius: 20px;
    --max-width: 420px;
    --shadow-color: rgba(102, 126, 234, 0.15);
    --glow-color: rgba(102, 126, 234, 0.3);
}

/*
 * GLOBAL STYLES
 * Base styles for the entire page.
 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
    background-attachment: scroll; /* Safari-safe */
    background-color: var(--bg-1);
    position: relative;
    display: flex;
    flex-direction: column; /* This is a key change */
    align-items: center;
    justify-content: flex-start; /* This is a key change */
    padding-top: 5vh; /* This is the fix for the top margin */
    padding-bottom: 5vh;
}

/*
 * ANIMATED BACKGROUND
 * Creates the subtle, sparkling effect in the background.
 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(102, 126, 234, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(118, 75, 162, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(240, 147, 251, 0.2), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(102, 126, 234, 0.15), transparent);
    background-repeat: repeat;
    background-size: 150px 100px;
    animation: sparkle 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes sparkle {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
        opacity: 0.8;
    }
}

/*
 * MAIN CARD STYLES
 * The primary container for all content with a glassmorphism effect.
 */
main.card {
    width: 100%;
    max-width: var(--max-width);
    border-radius: var(--radius);
    padding: 3rem 2.5rem 2.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    text-align: center;
    position: relative;
    animation: slideInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/*
 * LOGO & PROFILE INFO
 */
.logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeInScale 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 4px;
    box-shadow:
        0 20px 40px var(--shadow-color),
        0 0 0 4px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-tertiary), var(--accent-secondary));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: xor;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.logo:hover { transform: scale(1.05) rotate(5deg); box-shadow: 0 25px 50px var(--glow-color), 0 0 0 4px rgba(255,255,255,0.1), inset 0 1px 0 rgba(255,255,255,0.3); }
.logo:hover::before { opacity: 1; }

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

p.bio {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

/*
 * LINK BUTTONS
 */
ul.links {
    list-style: none;
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

a.btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

a.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

a.btn:hover::before { left: 100%; }

a.btn .icon { width: 22px; height: 22px; flex: 0 0 22px; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

a.btn:hover, a.btn:focus { transform: translateY(-4px); background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%); border-color: rgba(255,255,255,0.12); box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.08); outline: none; }

a.btn:hover .icon { transform: scale(1.1); color: var(--accent-primary); }

/*
 * CO-FOUNDERS SECTION
 */
.cofounders {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }

.cofounders small { display: block; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }

/*
 * ACTION BUTTONS (Copy & Share)
 */
.actions { margin-top: 2rem; display: flex; gap: 0.75rem; justify-content: center; align-items: center; animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both; }

button.copy-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

button.copy-btn:hover { background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%); border-color: rgba(255,255,255,0.12); color: var(--text); transform: translateY(-2px); }

button.copy-btn:focus { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/*
 * FEEDBACK TOAST
 * The small pop-up message that appears after copying a link.
 */
.feedback {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
    color: var(--text);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    font-weight: 500;
    z-index: 1000;
}

.feedback.visible { opacity: 1; transform: translateY(0) scale(1); }

/*
 * FOOTER
 */
footer { margin-top: 2rem; font-size: 0.8rem; color: var(--text-muted); animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 1s both; }

/*
 * RESPONSIVE DESIGN
 * Adjusts layout for smaller screens.
 */
@media (max-width: 480px) {
    body { padding: 2rem 1.5rem; }
    main.card { padding: 2.5rem 2rem 2rem; }
    .logo { width: 100px; height: 100px; }
    h1 { font-size: 1.75rem; }
    a.btn { padding: 1rem; gap: 0.875rem; }
    .feedback { right: 1.5rem; bottom: 1.5rem; padding: 0.875rem 1.25rem; }
}

/*
 * STAGGERED LINK ANIMATIONS
 * Delays the animation for each link to create a cascading effect.
 */
ul.links li:nth-child(1) { animation: fadeInUp 1s cubic-bezier(0.16,1,0.3,1) 0.4s both; }
ul.links li:nth-child(2) { animation: fadeInUp 1s cubic-bezier(0.16,1,0.3,1) 0.5s both; }
ul.links li:nth-child(3) { animation: fadeInUp 1s cubic-bezier(0.16,1,0.3,1) 0.6s both; }
ul.links li:nth-child(4) { animation: fadeInUp 1s cubic-bezier(0.16,1,0.3,1) 0.7s both; }