:root {
    --bg-color: #0a0b10;
    --text-color: #e0e0e0;
    --primary-color: #226bf5;
    --primary-gradient: linear-gradient(135deg, #1748ff, #00c6ff);
    --secondary-color: #a3b9ef;
    --card-bg: rgba(24, 27, 36, 0.6);
    --card-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-main: 'Montserrat', sans-serif;
}

body {
    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Ambient Background */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(34, 107, 245, 0.15), transparent 50%);
    z-index: -1;
    animation: pulseBackground 15s ease-in-out infinite;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    z-index: -1;
    pointer-events: none;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #4da3ff;
}

.container {
    width: 100%;
    max-width: fit-content;
    margin: 0 auto;
    padding-top: 80px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.logo {
    width: 130px;
    margin: 0 auto 24px;
    display: block;
    animation: fadeIn 1.2s ease;
    filter: drop-shadow(0 0 20px rgba(23, 72, 255, 0.2));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 30px rgba(23, 72, 255, 0.4));
}

h1 {
    font-size: 4rem;
    font-weight: 800;
    margin: 10px 0 0;
    letter-spacing: -1.5px;
    background: linear-gradient(180deg, #fff 0%, #a3b9ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: slideUp 0.8s ease-out;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 50px 0 24px 0;
    color: #fff;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--secondary-color);
    margin-bottom: 50px;
    margin-top: 16px;
    letter-spacing: 0.5px;
    animation: slideUp 0.8s ease-out 0.2s backwards;
}

/* Modern Button Styles */
.buttons {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    animation: slideUp 0.8s ease-out 0.4s backwards;
}

.btn {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: 50px; /* Modern Pill Shape */
    padding: 16px 40px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(23, 72, 255, 0.3);
    outline: none;
    min-width: 180px;
    position: relative;
    z-index: 1;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.btn-link {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: none;
}

.btn:hover,
.btn:focus {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(23, 72, 255, 0.4);
}

.btn-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Email Panel */
.email-panel {
    margin: 0 auto;
    padding: 24px 30px;
    background: rgba(24, 27, 36, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 400px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px) scale(0.95);
    position: absolute; /* Changed to absolute so it doesn't push content until open */
    left: 0; 
    right: 0;
    margin-left: auto; 
    margin-right: auto;
    z-index: 10;
}

.email-panel.open {
    opacity: 1;
    transform: translateY(10px) scale(1);
    pointer-events: auto;
    position: relative; /* Revert to flow */
}

.panel-title {
    margin-bottom: 18px;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.email-form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.email-form input[type="email"] {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 18px;
    outline: none;
    font-size: 1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    width: 100%;
    flex: 1;
}

.email-form input[type="email"]:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
}

.email-form button {
    background: #23c272;
    border: none;
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.3s;
}

.email-form button:hover {
    background: #26ff72;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(35, 194, 114, 0.3);
}

.success {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.95rem;
    color: #23c272;
    margin-top: 15px;
    gap: 8px;
}

/* Sections & Modern Cards */
.about-section,
.contact-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 100px 20px;
    text-align: center;
}

.about-desc {
    color: var(--secondary-color);
    font-size: 1.3rem;
    line-height: 1.7;
    margin-bottom: 60px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}

.about-cards,
.contact-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.about-card,
.contact-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--card-border);
    border-radius: 24px;
    padding: 40px 30px;
    min-width: 280px;
    max-width: 380px;
    text-align: center;
    transition: all 0.4s ease;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient border effect on cards */
.about-card::before, .contact-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.about-card:hover,
.contact-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(30, 34, 45, 0.8);
}

.about-card:hover::before, .contact-card:hover::before {
    opacity: 1;
}

.about-icon,
.contact-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(34, 107, 245, 0.15), rgba(34, 107, 245, 0.05));
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(34, 107, 245, 0.2);
}

.about-title,
.contact-title {
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 16px;
}

.about-text,
.contact-desc {
    color: var(--secondary-color);
    font-size: 1.05rem;
    line-height: 1.6;
}

.linkedin-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.linkedin-icon:hover svg {
    transform: scale(1.15);
}

/* Footer */
footer {
    width: 100%;
    background: rgba(5, 6, 8, 0.8);
    backdrop-filter: blur(10px);
    padding: 40px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    text-align: center;
    color: #6b7a99;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.footer-linkedin svg {
    color: #6b7a99;
    transition: color 0.3s;
}

.footer-linkedin:hover svg {
    color: var(--primary-color);
}

/* Popup Styles - Modernized */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: rgba(24, 27, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.7);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.popup-overlay.show .popup-content {
    transform: scale(1) translateY(0);
}

.close-popup {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #666;
    font-size: 32px;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-popup:hover {
    color: #fff;
}

.popup-content h3 {
    margin-top: 10px;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #a3b9ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.popup-content p {
    color: var(--secondary-color);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 35px;
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popup-buttons .btn {
    width: 100%;
    box-sizing: border-box;
    margin: 0; /* Override default */
}

.btn-primary {
    background: var(--primary-gradient);
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(34, 107, 245, 0.5);
    color: #fff;
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(34, 107, 245, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Scroll Reveal Classes */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }
    .buttons { flex-direction: column; gap: 16px; }
    .btn { width: 100%; }
    .popup-content { padding: 30px 20px; }
}