/* ==========================================================================
   1. VARIABLES & GLOBAL STYLES
   ========================================================================== */
:root {
    --bg-color: #0c0a09;
    --glass-bg: rgba(23, 23, 23, 0.6);
    --border-color: rgba(250, 250, 250, 0.1);
    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --accent-primary: #2563eb;
    --accent-secondary: #4f46e5;
    --font-family: 'Inter', sans-serif;
    --header-height: 70px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   2. BACKGROUND & HEADER
   ========================================================================== */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, var(--accent-primary) 0%, transparent 25%),
                radial-gradient(circle at 90% 80%, var(--accent-secondary) 0%, transparent 25%);
    filter: blur(100px);
    opacity: 0.2;
    z-index: -1;
    animation: pulse 15s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}
.logo span { color: var(--accent-primary); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}
.nav-item:hover, .nav-item.active { color: var(--text-primary); }


/* ==========================================================================
   3. HERO SECTION (BENTO GRID)
   ========================================================================== */
#home {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    padding: 4rem 1.5rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 1rem;
    width: 100%;
}

.bento-item {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.bento-item:hover {
    transform: translateY(-5px);
    border-color: rgba(250, 250, 250, 0.3);
}

.bento-main {
    grid-column: 1 / 4;
    grid-row: 1 / 2;
}

.main-card-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.main-card-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 80%;
    margin-bottom: 2rem;
}

.bento-profile {
    grid-column: 4 / 5;
    grid-row: 1 / 3;
    padding: 0;
    overflow: hidden;
}
.bento-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    scale: 1.1;
}

.bento-social {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.bento-social a {
    color: var(--text-secondary);
    transition: color 0.3s, transform 0.3s;
}
.bento-social a:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}
.bento-social svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.bento-cv {
    grid-column: 2 / 4;
    grid-row: 2 / 3;
}
.cv-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
}
.cv-link span svg { width: 24px; height: 24px; }


/* ==========================================================================
   4. GENERAL SECTIONS & COMPONENTS
   ========================================================================== */
section {
    padding: 6rem 0;
}
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}
.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.section-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--accent-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.3s, box-shadow 0.3s;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}
.cta-button svg { width: 20px; height: 20px; }
.cta-button.large { font-size: 1.25rem; padding: 1rem 2rem; }

/* ==========================================================================
   5. SKILLS & PORTFOLIO
   ========================================================================== */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}
.skill-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    flex-grow: 1;
    min-width: 180px;
}
.skill-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}
.skill-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}
.portfolio-item {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}
.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 1rem;
    border: 2px solid transparent;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}
.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.portfolio-item:hover::before { opacity: 1; }

.card-image-wrapper {
    height: 200px;
    overflow: hidden;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease-out;
}
.portfolio-item:hover .card-image-wrapper img { transform: scale(1.05); }

.card-content { padding: 1.5rem; }
.card-content h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.card-content p { color: var(--text-secondary); margin-bottom: 1rem; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.tech-tags span {
    font-size: 0.75rem;
    background: var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-weight: 500;
}
.card-links { display: flex; gap: 1rem; }
.card-links a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}
.card-links a:hover { text-decoration: underline; }

/* ==========================================================================
   6. CONTACT & FOOTER
   ========================================================================== */
#contact { text-align: center; }
.main-footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}


/* ==========================================================================
   7. ANIMATIONS
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1),
                transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: var(--delay, 0s);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   8. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    .bento-item,
    .bento-main,
    .bento-profile,
    .bento-social,
    .bento-cv {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .bento-profile {
        height: 300px;
    }
    .main-card-content h1 { font-size: 2.5rem; }
    .main-card-content p { max-width: 100%; }
    .nav-links { display: none; } /* Simpler nav for mobile, could add a burger menu */
    .section-header h2 { font-size: 2rem; }
}