:root {
    --bg-color: #050505;
    --surface-color: #111111;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent: #ccff00;
    --accent-transparent: rgba(204, 255, 0, 0.2);
    --border-radius: 24px;
    --card-bg: rgba(255, 255, 255, 0.02);
    --border-color: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.4);
    --pill-bg: rgba(255, 255, 255, 0.03);
    --glow-color: rgba(204, 255, 0, 0.06);
    --overlay: linear-gradient(to top, rgba(5,5,5,0.95) 10%, rgba(5,5,5,0.4) 70%, transparent);
    --btn-border: rgba(255, 255, 255, 0.2);
}

body.light-mode {
    --bg-color: #f4f4f5;
    --surface-color: #ffffff;
    --text-primary: #111111;
    --text-secondary: #555555;
    --accent: #2563eb;
    --accent-transparent: rgba(37, 99, 235, 0.2);
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.2);
    --shadow: rgba(0, 0, 0, 0.05);
    --pill-bg: rgba(0, 0, 0, 0.04);
    --glow-color: rgba(37, 99, 235, 0.05);
    --overlay: linear-gradient(to top, rgba(255,255,255,0.95) 10%, rgba(255,255,255,0.6) 70%, transparent);
    --btn-border: rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Playfair Display', Georgia, serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 2rem 2rem 0 2rem;
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.theme-toggle {
    position: fixed;
    top: rem;
    right: 1.5rem;
    z-index: 1000;
    background-color: var(--accent);
    color: var(--bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 40px var(--accent-transparent);
    filter: brightness(1.1);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-grow: 1;
    padding-top: 2rem;
}

.bento-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    position: relative;
    border: 1px solid var(--border-color);
    overflow: hidden;
    opacity: 0; 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow);
    border-color: var(--border-hover);
    z-index: 2;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(40px) scale(0.98); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.bento-card.visible {
    animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bento-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), var(--glow-color), transparent 40%);
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bento-card > * {
    position: relative;
    z-index: 1;
}

.hero { grid-column: span 12; display: flex; flex-direction: row; align-items: stretch; justify-content: space-between; gap: 3rem; padding: 3rem; }
.hero-content { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hero-image-container { flex: 0 0 35%; max-width: 35%; border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); }

.about { grid-column: span 8; }
.tech { grid-column: span 4; }
.gallery { grid-column: span 12; }
.experience { grid-column: span 7; display: flex; flex-direction: column; }
.education-certs { grid-column: span 5; display: flex; flex-direction: column; gap: 1.5rem; height: 100%; }
.education, .certifications { width: 100%; background-color: var(--card-bg); border-radius: var(--border-radius); padding: 2.5rem; border: 1px solid var(--border-color); display: flex; flex-direction: column; }
.contact { grid-column: span 12; text-align: center; margin-bottom: 2rem; }

.profile-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.hero:hover .profile-img { transform: scale(1.03); }

.img-light { display: none; }
body.light-mode .img-dark { display: none; }
body.light-mode .img-light { display: block; }

h1 { font-size: clamp(3rem, 6vw, 5.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
h1 span { color: var(--accent); font-style: italic; transition: color 0.4s ease; }

.typewriter-wrapper { min-height: 4rem; margin-top: 0.5rem; }
.typewriter { font-size: clamp(1.1rem, 3vw, 1.6rem); color: var(--text-secondary); display: inline; }
.typewriter::after {
    content: '';
    display: inline-block;
    width: 3px;
    height: 1.1em;
    background-color: var(--accent);
    vertical-align: text-bottom;
    margin-left: 4px;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

h2 { font-size: 1.8rem; font-weight: 600; margin-bottom: 1.5rem; color: var(--text-primary); letter-spacing: -0.02em; transition: color 0.4s ease; }
p { color: var(--text-secondary); font-size: 1.15rem; margin-bottom: 1rem; transition: color 0.4s ease; }

.pill-container { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.pill { background-color: var(--pill-bg); color: var(--text-primary); padding: 0.6rem 1.2rem; border-radius: 50px; font-size: 0.95rem; font-weight: 400; border: 1px solid var(--border-color); transition: all 0.3s; font-family: system-ui, -apple-system, sans-serif; letter-spacing: 0.05em; }
.pill:hover { border-color: var(--accent); color: var(--accent); background-color: var(--accent-transparent); cursor: default; }
a.pill:hover { cursor: pointer; }

.btn-secondary { display: inline-block; background-color: transparent; color: var(--text-primary); padding: 0.8rem 2rem; border-radius: 50px; border: 1px solid var(--btn-border); font-family: system-ui, -apple-system, sans-serif; font-weight: 600; font-size: 0.95rem; text-transform: uppercase; transition: all 0.3s ease; cursor: pointer; text-align: center; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background-color: var(--accent-transparent); }
.btn-container { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.job { margin-bottom: 1.8rem; border-left: 2px solid var(--accent-transparent); padding-left: 1.2rem; transition: transform 0.3s ease, border-color 0.4s ease; }
.job:hover { transform: translateX(5px); border-color: var(--accent); }
.job:last-child { margin-bottom: 0; }
.job h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 0.2rem; color: var(--text-primary); transition: color 0.4s ease; }
.job .company { color: var(--accent); font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; display: block; font-family: system-ui, -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.05em; transition: color 0.4s ease; }
.job .date { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; display: block; font-family: system-ui, -apple-system, sans-serif; }
.job p { font-size: 1rem; line-height: 1.5; margin-bottom: 0; }

.cert-item { margin-bottom: 0.9rem; border-left: 2px solid var(--accent-transparent); padding-left: 1rem; transition: transform 0.3s ease, border-color 0.4s ease; }
.cert-item:hover { transform: translateX(5px); border-color: var(--accent); }
.cert-item:last-of-type { margin-bottom: 0; }
.cert-item h3 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; color: var(--text-primary); transition: color 0.4s ease; }
.cert-item span { font-size: 0.85rem; color: var(--text-secondary); font-family: system-ui, -apple-system, sans-serif; display: block; margin-top: 0.2rem; transition: color 0.4s ease; }

.extra-job, .extra-cert { display: none; }
.extra-job.show, .extra-cert.show { display: block; animation: expandDown 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes expandDown { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.gallery-item { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; background-color: var(--surface-color); border: 1px solid var(--border-color); cursor: pointer; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease; }
.gallery-item:hover { transform: scale(1.03); border-color: var(--accent); z-index: 2; box-shadow: 0 10px 30px var(--shadow); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: opacity 0.4s ease, transform 0.4s ease; }
.gallery-item:hover img { opacity: 1; transform: scale(1.05); }

.gallery-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 1.5rem; background: var(--overlay); transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; justify-content: flex-end; }
.gallery-item:hover .gallery-overlay { transform: translateY(0); }
.gallery-overlay h3 { font-family: system-ui, -apple-system, sans-serif; font-size: 1.2rem; color: var(--accent); margin-bottom: 0.2rem; }
.gallery-overlay p { font-size: 0.85rem; margin-bottom: 0; font-family: system-ui, -apple-system, sans-serif; color: var(--text-primary); }

footer { margin-top: auto; padding: 2rem 0; text-align: center; border-top: 1px solid var(--border-color); transition: border-color 0.4s ease; }
footer p { font-family: system-ui, -apple-system, sans-serif; font-size: 0.9rem; color: var(--text-secondary); margin: 0; }
footer span { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
    .theme-toggle {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
    }
    .hero { flex-direction: column-reverse; padding: 2.5rem; }
    .hero-image-container { flex: none; max-width: 100%; height: 300px; width: 100%; }
    .about, .tech, .experience, .education-certs { grid-column: span 12; }
    h1 { font-size: 3.2rem; }
    .btn-container { flex-direction: column; width: 100%; }
    .typewriter-wrapper { min-height: 2.5rem; }
}

.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: var(--accent);
    color: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    box-shadow: 0 10px 25px var(--shadow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
}

.whatsapp-float svg {
    fill: currentColor;
    width: 32px;
    height: 32px;
}

@media (max-width: 900px) {
    .whatsapp-float {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
    }
}

.download-btn-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    gap: 1.2rem;
    text-align: left;
}

.download-btn-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    background-color: var(--accent-transparent);
}

.download-icon {
    font-size: 2rem;
    background: var(--surface-color);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.download-text h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.download-text p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-secondary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}



@media (max-width: 960px) {
.theme-toggle {
position: relative;
top: 0;
right: 0;
left: 0;
transform: none;
margin: 0rem auto 0rem auto;
width: fit-content;
z-index: 10;
display: flex;
}   
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; }
    
}