/* ============================================
   CORE VARIABLES
============================================ */
:root {
    --bg-color:          #fafafa;
    --surface-color:     #ffffff;
    --text-main:         #111111;
    --text-muted:        #555555;
    --border-color:      #222222;
    --border-light:      #dddddd;
    --accent:            #fde047;
    --teal:              #4db89e;
    --font-sans:         'Inter', sans-serif;
    --font-mono:         'Space Mono', monospace;
    --font-script:       'Dancing Script', cursive;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);

    /* Social brand colours */
    --linkedin-blue: #0077B5;
    --github-dark:   #24292F;
    --hf-orange:     #FF9D00;
    --kaggle-cyan:   #20BEFF;
}

/* ============================================
   RESET & BASE
============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    /* Reduced padding-top so hero sits closer to the header */
    padding-top: 72px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 1rem;
}

/* ============================================
   CAPSULE / PILL FLOATING HEADER
============================================ */
header {
    all: unset;
    display: block;
}

.capsule-header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 48px);
    max-width: 1000px;
    background: var(--surface-color);
    border-radius: 60px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.08),
        0 1px 4px  rgba(0, 0, 0, 0.04);
    transition: border-radius 0.3s ease;
}

.capsule-header.menu-open {
    border-radius: 24px;
}

.capsule-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    gap: 16px;
}

/* ============================================
   SCRIPT LOGO — CHANGED TO BLACK
============================================ */
.brand-wrapper {
    flex-shrink: 0;
}

.logo-script {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
    text-shadow: none;
    transition: opacity 0.2s ease;
}

.logo-script:hover {
    opacity: 0.6;
}

/* ============================================
   NAV LINKS
============================================ */
.capsule-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.capsule-nav a {
    text-decoration: none;
    color: #444444;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
    position: relative;
    padding-bottom: 2px;
}

.capsule-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--text-main);
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.capsule-nav a:hover { color: #111111; }
.capsule-nav a:hover::after { width: 100%; }

/* ============================================
   CONTACT DROPDOWN
============================================ */
.contact-dropdown-wrapper {
    position: relative;
    flex-shrink: 0;
}

.capsule-contact-btn {
    background: var(--text-main);
    color: var(--surface-color);
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 60px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.capsule-contact-btn:hover {
    opacity: 0.85;
    transform: scale(1.04);
}

.contact-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 230px;
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.10),
        0 2px 8px  rgba(0, 0, 0, 0.06);
    overflow: hidden;
    z-index: 2000;
    animation: dropIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-dropdown-wrapper.open .contact-dropdown {
    display: block;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.cd-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 18px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    font-family: var(--font-sans);
    text-align: left;
    transition: background 0.15s ease;
}

.cd-item:last-child { border-bottom: none; }
.cd-item:hover      { background: #f5f5f5; }

.cd-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-mono);
    flex-shrink: 0;
    transition: background 0.15s;
}

.cd-item:hover .cd-icon { background: #e4e4e4; }

.cd-label {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    line-height: 1.3;
}

.cd-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.3;
    margin-top: 2px;
    font-family: var(--font-mono);
}

.cd-item.copied .cd-label::after {
    content: '  ✓ Copied!';
    color: #16a34a;
    font-size: 0.8rem;
    font-weight: 500;
}

.cd-item.copied .cd-icon {
    background: #dcfce7;
    color: #16a34a;
}

/* ============================================
   HAMBURGER
============================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px)  rotate(45deg);  }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0);           }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================
   MOBILE DROPDOWN MENU
============================================ */
.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 0 24px 16px;
    gap: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
    text-decoration: none;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: color 0.2s;
}

.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: #111; }

/* ============================================
   BUTTONS
============================================ */
.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    position: relative;
    top: 0;
    left: 0;
    color: var(--text-main);
}

.btn-primary {
    background-color: var(--accent);
    box-shadow: 4px 4px 0px var(--border-color);
}

.btn-outline {
    background-color: var(--surface-color);
    box-shadow: 4px 4px 0px var(--border-color);
}

.btn:hover  { top: -2px; left: -2px; box-shadow: 6px 6px 0px var(--border-color); }
.btn:active { top:  4px; left:  4px; box-shadow: 0px 0px 0px var(--border-color); transition: all 0.1s; }

/* ============================================
   HERO SECTION
============================================ */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1rem 0 4rem;
}

.hero-content { flex: 1.2; }

/* Title wrapper — inline-block to hug text closely */
.title-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0;
    border: none;
}

/* ============================================
   HERO ILLUSTRATION — Cropped Portrait (no pants)
============================================ */
.hero-image-container {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    position: relative;
    overflow: visible;
}

.clean-portrait {
    /* Larger HD portrait */
    width: 500px;
    max-width: 100%;
    position: relative;
    z-index: 10;
    margin-top: -130px; /* Pulls the image up into the empty space */
    /* Clip bottom ~22% to hide pants cleanly */
    clip-path: inset(0 0 22% 0);
    /* Pull up to compensate for clip so image fills the space */
    margin-bottom: -22%;
}

.clean-portrait img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: top center;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ============================================
   SECTIONS
============================================ */
.section {
    padding: 5rem 0;
    border-top: 1px solid var(--border-light);
}

/* ============================================
   EXPERIENCE
============================================ */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.exp-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.exp-item:hover {
    border-color: var(--border-color);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.02);
    transform: translateY(-2px);
}

.exp-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #666;
}

.exp-details h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0;
}

.exp-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 10px;
}

.company-link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
    background: #f4f4f5;
    padding: 4px 10px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
}

.company-link:hover {
    color: var(--text-main);
    border-color: var(--border-color);
    background: #e4e4e7;
}

.exp-details ul {
    margin-left: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.exp-details li { margin-bottom: 0.5rem; }

/* ============================================
   CERTIFICATIONS
============================================ */
.cert-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cert-info {
    flex: 1;
}

.cert-issuer {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.3rem;
}

.cert-image {
    flex-shrink: 0;
    width: 220px;
    height: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.02);
}

.cert-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

@media (max-width: 600px) {
    .cert-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .cert-image {
        width: 100%;
        max-width: 300px;
    }
}

/* ============================================
   WORKS GRID
============================================ */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

.work-card {
    border: 1px solid var(--border-light);
    background: var(--surface-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
    top: 0;
    height: 100%;
}

.work-card:hover {
    border-color: var(--border-color);
    top: -8px;
    box-shadow: 8px 8px 0px rgba(0,0,0,0.04);
}

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.work-title { font-weight: 600; font-size: 1.25rem; }

.work-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    background: #f4f4f5;
    padding: 4px 8px;
    border: 1px solid var(--border-light);
}

.work-desc {
    flex-grow: 1;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border: 1px dashed #ccc;
    padding: 4px 10px;
    border-radius: 20px;
}

.work-links {
    display: flex;
    gap: 1.5rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.work-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.work-links a:hover { color: #666; }

/* ============================================
   SKILLS GRID
============================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-group {
    border: 1px solid var(--border-light);
    padding: 2rem;
    background: var(--surface-color);
    transition: var(--transition-smooth);
}

.skill-group:hover {
    border-color: var(--border-color);
    transform: translateY(-4px);
}

.skill-group h3 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--border-light);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.skill-group ul { list-style: none; }

.skill-group li {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-group li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ============================================
   CONTACT SECTION
============================================ */
.contact-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
}

.contact-form {
    background: var(--surface-color);
    padding: 3rem;
    border: 1px solid var(--border-color);
    box-shadow: 8px 8px 0px rgba(0,0,0,0.03);
}

.form-group { margin-bottom: 1.5rem; }

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-light);
    font-family: var(--font-sans);
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-main);
    transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-color);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

/* ---- Social Links ---- */
.social-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
    transition: transform 0.3s;
}

.social-link:hover { transform: translateX(5px); }

.social-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: background 0.2s ease, color 0.2s ease,
                transform 0.2s ease, box-shadow 0.2s ease;
}

.si-linkedin {
    background: #E8F4FB;
    color: var(--linkedin-blue);
    border-color: var(--linkedin-blue);
    box-shadow: 3px 3px 0 var(--linkedin-blue);
}
.social-link:hover .si-linkedin {
    background: var(--linkedin-blue);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 #005885;
}

.si-github {
    background: #F0EFF9;
    color: var(--github-dark);
    border-color: var(--github-dark);
    box-shadow: 3px 3px 0 var(--github-dark);
}
.social-link:hover .si-github {
    background: var(--github-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 #000;
}

.si-hf {
    background: #FFF8E7;
    color: var(--hf-orange);
    border-color: var(--hf-orange);
    box-shadow: 3px 3px 0 var(--hf-orange);
}
.social-link:hover .si-hf {
    background: var(--hf-orange);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 #c97800;
}

.si-kaggle {
    background: #E8F7FA;
    color: var(--kaggle-cyan);
    border-color: var(--kaggle-cyan);
    box-shadow: 3px 3px 0 var(--kaggle-cyan);
}
.social-link:hover .si-kaggle {
    background: var(--kaggle-cyan);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 #0090c4;
}

/* ============================================
   FOOTER
============================================ */
footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px dashed var(--border-light);
    margin-top: 5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #888;
}

/* ============================================
   RESPONSIVE — TABLET ≤ 900px
============================================ */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 2rem 0 4rem;
    }

    .hero-image-container { justify-content: center; order: -1; }
    .btn-group             { justify-content: center; }
    .exp-item              { grid-template-columns: 1fr; gap: 0.5rem; }
    .contact-layout        { grid-template-columns: 1fr; }
}

/* ============================================
   RESPONSIVE — MOBILE ≤ 768px
============================================ */
@media (max-width: 768px) {
    .capsule-header {
        top: 16px;
        width: calc(100% - 32px);
        border-radius: 40px;
    }

    .capsule-header.menu-open { border-radius: 24px; }
    .capsule-inner             { padding: 10px 18px; }
    .capsule-nav               { display: none; }
    .hamburger                 { display: flex; }

    .logo-script { font-size: 1rem; }
}

/* ============================================
   RESPONSIVE — MOBILE ≤ 600px
============================================ */
@media (max-width: 600px) {
    h1            { font-size: 2.2rem; }
    .works-grid   { grid-template-columns: 1fr; }
    .skills-grid  { grid-template-columns: 1fr; }
    .contact-form { padding: 1.5rem; }

    .clean-portrait { 
        width: 320px; 
        margin-top: 1rem;
    }
}

/* ============================================
   RESPONSIVE — MOBILE ≤ 480px
============================================ */
@media (max-width: 480px) {
    body { padding-top: 68px; }
    .capsule-header { top: 12px; width: calc(100% - 24px); }
    .capsule-inner  { padding: 8px 16px; }
    .logo-script    { font-size: 0.95rem; }
}