:root {
    --bg: #030303;
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.06);
    --text: #ffffff;
    --text-dim: #a1a1aa;
    --accent: #3b82f6;
    --font: 'Inter', sans-serif;
    --spotlight-size: 500px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Spotlight */
.spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(
        var(--spotlight-size) circle at var(--x, 50%) var(--y, 30%),
        rgba(59, 130, 246, 0.04),
        transparent 100%
    );
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, minmax(180px, auto));
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.05);
}

.bento-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.bento-item:nth-child(1) { animation-delay: 0.1s; }
.bento-item:nth-child(2) { animation-delay: 0.2s; }
.bento-item:nth-child(3) { animation-delay: 0.3s; }
.bento-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

.card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

/* Bio Content */
.bio-card p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* Stack Content */
.stack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.stack-tag {
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-dim);
}

/* Specific Card Placements */
.profile-card {
    grid-column: span 4;
    grid-row: span 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.profile-socials {
    display: flex;
    gap: 1rem;
    z-index: 10;
    pointer-events: auto;
}

@media (min-width: 769px) {
    .profile-socials {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
    }
}

.email-popdown {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-socials > a,
.email-popdown-trigger {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-dim);
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    pointer-events: auto;
    padding: 0.35rem;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
}

.profile-socials > a:hover,
.email-popdown-trigger:hover {
    color: var(--accent);
    transform: scale(1.25);
}

.email-popdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    background: rgba(10, 10, 10, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 14px;
    padding: 0.4rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
    z-index: 20;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    overflow: hidden;
}

.email-popdown[data-open="true"] .email-popdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.email-popdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
}

.email-popdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.email-popdown-feedback {
    padding: 0.25rem 0.7rem 0.35rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    min-height: 1.1rem;
}

.profile-socials i, .profile-socials svg,
.project-btn i, .project-btn svg {
    width: 18px;
    height: 18px;
}

.project-btn svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.profile-card .card-content {
    align-items: center;
    justify-content: center;
}

.bio-card {
    grid-column: span 4;
}

.projects-card {
    grid-column: span 2;
    grid-row: span 1;
}

.stack-card {
    grid-column: span 2;
    grid-row: span 1;
}

/* Internal Components */
.avatar-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 2px solid var(--accent);
}

.profile-card .avatar-wrapper {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-card h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
    background: linear-gradient(to bottom, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.role {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.profile-card .role {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.project-btn {
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    transform: translateX(4px);
    color: var(--accent);
}

.project-btn i {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.project-btn:hover svg {
    transform: translate(2px, -2px);
    opacity: 1;
}

/* Responsive */
@media (prefers-reduced-motion: reduce) {
    .bento-item {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .card,
    .profile-socials > a,
    .email-popdown-trigger,
    .project-btn {
        transition: none;
    }
}

@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 1.25rem;
        padding: 1.5rem;
        align-content: center;
    }
    .card { grid-column: span 2 !important; grid-row: auto !important; }
    .bio-card, .stack-card { grid-column: span 1 !important; }
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .card {
        grid-column: span 1 !important;
        padding: 1.25rem;
    }

    .profile-card {
        padding-top: 1.5rem;
    }

    .profile-card h1 {
        font-size: 2.25rem;
    }

    .profile-socials {
        margin-top: 1.5rem;
        justify-content: center;
    }

    .project-btn {
        padding: 1rem;
    }
}

@media (max-width: 500px) {
    .profile-card h1 {
        font-size: 1.8rem;
    }

    .avatar-wrapper {
        width: 60px;
        height: 60px;
    }
    
    .profile-card .avatar-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }
}
