/* Premium Soft Slate & Light Ash Palette Setup */
:root {
    --bg-main: #EAE8E4;        /* Soft Warm Ash - Eye Friendly Base */
    --slate-dark: #3F423E;     /* Elegant Charcoal-Slate for elements */
    --slate-medium: #4D504C;   /* Text color for extreme readability */
    --white-card: #FDFDFD;     /* Pure clean canvas layer for cards */
    --glass-border: rgba(63, 66, 62, 0.12);
    --white-pure: #ffffff;
}

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

body {
    background-color: var(--bg-main);
    color: var(--slate-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ==========================================================================
   FIXED CAPSULE HEADER
   ========================================================================== */
header {
    position: absolute;
    top: 25px;
    left: 0;
    right: 0;
    z-index: 1000;
    max-width: 950px;
    width: 90%;
    margin: 0 auto;
    background: rgba(63, 66, 62, 0.94); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 35px;
    border-radius: 50px;
    border: 1px solid rgba(234, 232, 228, 0.15);
    box-shadow: 0 12px 35px rgba(63, 66, 62, 0.15);
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--bg-main);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span { color: var(--white-pure); }

nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 28px; }
nav ul li a {
    color: var(--bg-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: all 0.3s ease;
    opacity: 0.85;
}
nav ul li a:hover { 
    color: var(--white-pure); 
    opacity: 1; 
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    min-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 5% 80px 5%;
    background: linear-gradient(135deg, var(--bg-main) 0%, #DCDAD5 100%);
}

.hero-wrapper {
    max-width: 1300px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.greeting-badge {
    background-color: var(--slate-dark);
    color: var(--bg-main);
    padding: 6px 18px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-text h1 {
    font-size: 64px;
    line-height: 1.15;
    color: var(--slate-dark);
    margin-bottom: 20px;
    font-weight: 800;
}

.hero-text .highlight { color: #5D625C; }
.subtitle { font-size: 22px; color: var(--slate-medium); margin-bottom: 45px; font-weight: 500; }

.cta-group { display: flex; gap: 15px; }
.cta-primary {
    background: var(--slate-dark);
    color: var(--bg-main);
    padding: 16px 38px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(63, 66, 62, 0.2);
}
.cta-primary:hover {
    background: #2E302D;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(63, 66, 62, 0.3);
}
.cta-secondary {
    border: 2px solid var(--slate-dark);
    color: var(--slate-dark);
    padding: 14px 38px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}
.cta-secondary:hover {
    background: rgba(63, 66, 62, 0.05);
    transform: translateY(-2px);
}

.hero-image-frame { position: relative; width: 340px; height: 340px; justify-self: center; }
.profile-img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 16px;
    border: 8px solid var(--white-pure); box-shadow: 0 20px 45px rgba(63, 66, 62, 0.15);
    position: relative; z-index: 2;
}
.image-border-decoration {
    position: absolute; width: 100%; height: 100%; border: 2px solid var(--slate-dark);
    top: -12px; left: 12px; border-radius: 16px; z-index: 1; opacity: 0.3;
}

/* ==========================================================================
   LAYOUT STRUCTURES
   ========================================================================== */
.section { padding: 120px 0; background: var(--white-pure); }
.glass-section { background: linear-gradient(180deg, var(--bg-main) 0%, var(--white-pure) 100%); }
.section-container { max-width: 1300px; width: 90%; margin: 0 auto; }
.section-title { margin-bottom: 60px; }
.section-title h2 { font-size: 36px; color: var(--slate-dark); font-weight: 700; letter-spacing: -0.5px; }
.title-line { width: 60px; height: 4px; background: var(--slate-dark); margin-top: 10px; }
.about-text { font-size: 19px; line-height: 1.9; color: var(--slate-medium); max-width: 950px; }

/* ==========================================================================
   SKILLS GRID
   ========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.skill-card {
    background: var(--white-card);
    border: 1px solid var(--glass-border);
    color: var(--slate-dark);
    padding: 25px 20px;
    text-align: center;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skill-icon { font-size: 32px; transition: transform 0.3s ease; }
.hover-lift:hover {
    transform: translateY(-8px);
    background: var(--slate-dark);
    color: var(--bg-main);
    box-shadow: 0 15px 30px rgba(63, 66, 62, 0.2);
    border-color: var(--slate-dark);
}
.hover-lift:hover .skill-icon { transform: scale(1.2); }

/* ==========================================================================
   PROJECTS & GENERAL CARDS GRID
   ========================================================================== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 35px; }
.glass-card {
    background: var(--white-card); 
    border: 1px solid var(--glass-border);
    padding: 40px; border-radius: 12px; 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.01);
    transition: all 0.4s ease;
}
.project-badge { font-size: 13px; font-weight: 700; color: var(--slate-dark); margin-bottom: 15px; opacity: 0.8; }
.project-badge i { margin-right: 6px; }
.glass-card h3 { font-size: 23px; margin-bottom: 15px; color: var(--slate-dark); }
.glass-card p { color: var(--slate-medium); font-size: 15.5px; line-height: 1.7; }

.tech-badge {
    background-color: var(--slate-dark);
    color: var(--bg-main);
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: bold;
    border-radius: 4px;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 15px;
}

.hover-slide:hover {
    transform: translateY(-8px);
    background: var(--white-pure);
    border-color: var(--slate-dark);
    box-shadow: 0 20px 40px rgba(63, 66, 62, 0.1);
}

/* ==========================================================================
   FIXED ASPECT RATIO CERTIFICATE CARDS (EQUALIZED HEIGHTS)
   ========================================================================== */
.cert-card {
    padding: 0 !important; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cert-image-container {
    width: 100%;
    height: 240px; /* Fixed proportional height */
    background-color: #F5F4F0; /* Soft canvas background for uneven spaces */
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px; /* Image borders breathing space */
    overflow: hidden;
}

.cert-img-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* CRITICAL FIX: Retains original boundaries flawlessly */
    transition: transform 0.5s ease;
}

.cert-card:hover .cert-img-preview {
    transform: scale(1.05); 
}

.cert-info {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cert-btn {
    align-self: flex-start;
    font-size: 13px !important;
    padding: 8px 18px !important;
    margin-top: auto; 
}

/* ==========================================================================
   CONTACT SECTION WITH FORM
   ========================================================================== */
.contact-section {
    padding: 140px 0;
    background: linear-gradient(180deg, var(--white-pure) 0%, var(--bg-main) 100%);
}

.premium-contact-card {
    background: var(--white-pure);
    border: 1px solid var(--glass-border);
    padding: 80px 50px;
    border-radius: 24px;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
    box-shadow: 0 25px 60px rgba(63, 66, 62, 0.06);
    position: relative;
    overflow: hidden;
}

.premium-contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--bg-main), var(--slate-dark), var(--bg-main));
}

.contact-badge-glow {
    background: rgba(63, 66, 62, 0.06);
    color: var(--slate-dark);
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 25px;
}

.premium-contact-card h2 {
    font-size: 42px;
    color: var(--slate-dark);
    font-weight: 800;
    line-height: 1.3;
    max-width: 800px;
    margin: 0 auto 15px auto;
}

.premium-contact-card > p {
    color: var(--slate-medium);
    max-width: 650px;
    margin: 0 auto 50px auto;
    font-size: 17.5px;
}

.contact-grid-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    text-align: left;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 16px;
    background: var(--bg-main);
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    color: var(--slate-dark);
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
    background: var(--white-pure);
    border-color: var(--slate-dark);
    box-shadow: 0 4px 12px rgba(63, 66, 62, 0.08);
}

.form-submit-btn {
    background: var(--slate-dark);
    color: var(--bg-main);
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.form-submit-btn:hover {
    background: #2E302D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(63, 66, 62, 0.2);
}

.contact-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
}

.btn-premium-action {
    padding: 16px 30px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mail-btn { background: var(--slate-dark); color: var(--bg-main); }
.mail-btn:hover {
    background: #2E302D;
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(63, 66, 62, 0.25);
}

.linkedin-btn, .github-btn {
    background: var(--bg-main);
    color: var(--slate-dark);
    border: 1px solid rgba(63, 66, 62, 0.2);
}

.linkedin-btn:hover {
    color: #0077B5; border-color: #0077B5; background: var(--white-pure);
    transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0, 119, 181, 0.1);
}

.github-btn:hover {
    color: #181717; border-color: #181717; background: var(--white-pure);
    transform: translateY(-4px); box-shadow: 0 10px 20px rgba(24, 23, 23, 0.1);
}

.icon-spacing { margin-right: 10px; font-size: 17px; }

/* ==========================================================================
   MINIMALIST SIGNATURE FOOTER
   ========================================================================== */
.modern-footer {
    background: var(--white-pure);
    padding: 60px 0;
    border-top: 1px solid var(--glass-border);
}

.footer-container {
    max-width: 1300px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand { display: flex; flex-direction: column; gap: 5px; }
.footer-logo { font-size: 24px; font-weight: 800; color: var(--slate-dark); }
.footer-logo span { color: #888888; }
.footer-brand p { font-size: 13px; color: var(--slate-medium); font-weight: 500; }

.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 15px; }
.footer-nav { display: flex; gap: 25px; }
.footer-nav a {
    color: var(--slate-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}
.footer-nav a:hover { color: #888888; }
.copyright { font-size: 13px; color: var(--slate-medium); }

.cursor {
    font-weight: bold;
    color: var(--slate-dark);
    animation: blink 0.7s infinite;
}

/* ==========================================================================
   ANIMATIONS CORE CONFIGS
   ========================================================================== */
.anim-fade-in { animation: fadeInGlobal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-left { animation: slideLeftGlobal 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-slide-right { animation: slideRightGlobal 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-grow { animation: growGlobal 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-float { animation: delicateFloat 5s ease-in-out infinite; }

@keyframes fadeInGlobal { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes slideLeftGlobal { 0% { opacity: 0; transform: translateX(-50px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes slideRightGlobal { 0% { opacity: 0; transform: translateX(50px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes growGlobal { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
@keyframes delicateFloat { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Mobile Structural Adaptations */
@media (max-width: 768px) {
    header { top: 10px; padding: 12px 20px; position: relative; }
    .hero-wrapper { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .hero-image-frame { order: -1; width: 240px; height: 240px; }
    .hero-text h1 { font-size: 42px; }
    .cta-group { justify-content: center; }
    nav ul { display: none; }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .contact-grid-layout { grid-template-columns: 1fr; gap: 30px; }
    .premium-contact-card { padding: 50px 20px; }
    .premium-contact-card h2 { font-size: 32px; }
    .btn-premium-action { width: 100%; justify-content: center; }
    .footer-container { flex-direction: column; text-align: center; gap: 30px; }
    .footer-right { align-items: center; }
}