/* =========================================================
   BIBEK CHAUDHARY — MODERN BENTO PORTFOLIO CSS
   ========================================================= */

:root {
    --bg: #0a0a0d;
    --bg2: #10101a;
    --bg3: #16161f;
    --border: rgba(255,255,255,0.08);
    --border-hover: rgba(13,148,136,0.5);
    --text: #f0f0f5;
    --text-muted: #94a3b8;
    --text-soft: #cbd5e1;
    --text-dim: #64748b;
    --teal: #0d9488;
    --teal-bright: #2dd4bf;
    --teal-dim: rgba(13,148,136,0.12);
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', sans-serif;
    --radius: 12px;
    --transition: 0.25s ease;
}

body.light {
    --bg: #f8fafc;
    --bg2: #ffffff;
    --bg3: #f1f5f9;
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(15,118,110,0.4);
    --text: #0f172a;
    --text-muted: #475569;
    --text-soft: #334155;
    --text-dim: #94a3b8;
    --teal: #0f766e;
    --teal-bright: #0d9488;
    --teal-dim: rgba(15,118,110,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.75; }

/* NAV */
header { position: sticky; top: 0; z-index: 1000; background: var(--bg2); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 2rem; height: 68px; display: flex; align-items: center; justify-content: space-between; }
.logo-wrap { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--teal); }
.logo-text { font-family: var(--mono); font-size: 14px; color: var(--teal); font-weight: 500; }
.logo-text span { color: var(--text-dim); }
nav ul { list-style: none; display: flex; gap: 1.75rem; }
nav a { font-family: var(--mono); font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
nav a:hover { color: var(--teal-bright); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle { background: transparent; border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; border-radius: 6px; padding: 6px 12px; font-family: var(--mono); font-size: 11px; transition: all var(--transition); }
.theme-toggle:hover { border-color: var(--teal); color: var(--teal); }
#mobile-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 6px; cursor: pointer; }
#mobile-menu { display: none; flex-direction: column; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 1rem 2rem; }
#mobile-menu.open { display: flex; }
#mobile-menu a { font-family: var(--mono); font-size: 13px; color: var(--text-muted); text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--border); }

/* SECTIONS */
section { padding: 5rem 2rem; }
.container { max-width: 960px; margin: 0 auto; }
.section-label { font-family: var(--mono); font-size: 11px; color: var(--teal); letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.5rem; }
h2 { font-size: 2.2rem; font-weight: 700; color: var(--text); margin-bottom: 2.5rem; letter-spacing: -0.02em; }

/* HERO */
#hero { min-height: calc(100vh - 68px); display: flex; align-items: center; position: relative; padding-top: 2rem; padding-bottom: 2rem; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--teal-bright); background: var(--teal-dim); border: 1px solid rgba(13,148,136,0.3); padding: 5px 14px; border-radius: 20px; margin-bottom: 1.75rem; }
.hero-name-row { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.hero-profile-pic { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--teal); box-shadow: 0 8px 24px rgba(13,148,136,0.2); }
h1 { font-size: clamp(2.6rem, 5vw, 4.2rem); font-weight: 700; line-height: 1.1; color: var(--text); }
h1 em { color: var(--teal-bright); font-style: normal; }
.hero-role { font-family: var(--mono); font-size: 13px; color: var(--teal-bright); letter-spacing: 0.05em; margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.05rem; color: var(--text-soft); max-width: 620px; margin-bottom: 2.25rem; line-height: 1.8; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 3rem; }
.btn-primary { background: var(--teal); color: white; padding: 11px 24px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; font-family: var(--mono); transition: all var(--transition); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 6px 20px var(--teal-dim); }
.btn-ghost { background: transparent; color: var(--text-soft); padding: 11px 24px; border-radius: 8px; text-decoration: none; font-size: 13px; border: 1px solid var(--border); font-family: var(--mono); transition: all var(--transition); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-bright); }
.btn-cv { background: transparent; color: var(--teal-bright); padding: 11px 24px; border-radius: 8px; text-decoration: none; font-size: 13px; border: 1px solid var(--teal); font-family: var(--mono); transition: all var(--transition); }
.btn-cv:hover { background: var(--teal-dim); }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg2); max-width: 600px; }
.stat { padding: 16px 20px; border-right: 1px solid var(--border); text-align: center; }
.stat:last-child { border-right: none; }
.stat-val { font-family: var(--mono); font-size: 1.4rem; color: var(--teal-bright); font-weight: 600; }
.stat-lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* BENTO GRID */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.bento-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; transition: all var(--transition); }
.bento-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.bento-main { grid-column: span 2; }
.bento-tag { font-family: var(--mono); font-size: 11px; color: var(--teal); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.bento-card h3 { font-size: 1.2rem; font-weight: 600; color: var(--text); margin-bottom: 0.75rem; }
.bento-card p { font-size: 14.5px; color: var(--text-soft); line-height: 1.7; }
.client-grid { display: flex; flex-wrap: gap; gap: 8px; }
.client-chip { font-family: var(--mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; background: var(--bg3); }

/* EXPERIENCE & CARDS */
.timeline { display: flex; flex-direction: column; gap: 1.25rem; }
.job, .case-study, .skill-group, .cert { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; transition: all var(--transition); }
.job:hover, .case-study:hover, .skill-group:hover, .cert:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.job-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 4px; flex-wrap: wrap; }
.job-title { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.job-date { font-family: var(--mono); font-size: 11.5px; color: var(--teal-bright); background: var(--teal-dim); padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(13,148,136,0.2); }
.job-company { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-bottom: 1.25rem; }
.job-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.job-list li { position: relative; padding-left: 20px; font-size: 14px; color: var(--text-soft); }
.job-list li::before { content: '▸'; position: absolute; left: 0; color: var(--teal); }
.achievement { color: var(--teal-bright) !important; font-weight: 600; }

/* SKILLS */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.skill-group-label { font-family: var(--mono); font-size: 11.5px; color: var(--teal-bright); margin-bottom: 10px; text-transform: uppercase; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); background: var(--bg3); padding: 4px 10px; border-radius: 16px; }

/* CERTIFICATIONS */
.certs { display: flex; flex-direction: column; gap: 10px; }
.cert { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.5rem; }
.cert-name { font-size: 14px; font-weight: 600; color: var(--text); }
.cert-meta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.badge-inprogress { display: inline-block; font-family: var(--mono); font-size: 10px; color: #b45309; background: rgba(251,191,36,0.18); border: 1px solid rgba(180,83,9,0.35); padding: 2px 8px; border-radius: 12px; margin-top: 4px; }

/* PROJECTS */
.case-study-badge { font-family: var(--mono); font-size: 11px; color: var(--teal); margin-bottom: 0.5rem; text-transform: uppercase; }
.case-study-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.case-study-org { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-bottom: 1.25rem; }
.case-study-outcome { background: var(--teal-dim); border: 1px solid rgba(13,148,136,0.2); border-radius: 8px; padding: 1rem 1.25rem; }
.case-study-outcome-label { font-family: var(--mono); font-size: 11px; color: var(--teal-bright); margin-bottom: 4px; text-transform: uppercase; }
.case-study-outcome-text { font-size: 13.5px; color: var(--text-soft); }

/* CONTACT */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; }
.contact-links { display: flex; flex-direction: column; gap: 10px; }
.contact-link { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); text-decoration: none; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); transition: all var(--transition); }
.contact-link:hover { border-color: var(--teal); color: var(--teal-bright); }
.contact-link-icon { color: var(--teal-bright); }
form { display: flex; flex-direction: column; gap: 12px; }
input, textarea { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; color: var(--text); font-family: var(--sans); font-size: 14px; outline: none; transition: border-color var(--transition); }
input:focus, textarea:focus { border-color: var(--teal); }
button[type=submit] { background: var(--teal); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; cursor: pointer; transition: opacity var(--transition); }
button[type=submit]:hover { opacity: 0.9; }

/* FOOTER */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 2.5rem 2rem; text-align: center; }
.footer-inner { max-width: 960px; margin: 0 auto; }
.footer-name { font-family: var(--mono); font-size: 13px; color: var(--teal-bright); margin-bottom: 4px; }
.footer-meta { font-size: 12px; color: var(--text-dim); }
.footer-meta a { color: var(--text-muted); text-decoration: none; }

/* RESPONSIVE MEDIA QUERIES */
@media (max-width: 900px) {
    .bento-grid, .skill-groups, .contact-layout { grid-template-columns: 1fr; }
    .bento-main { grid-column: span 1; }
    nav { display: none; }
    #mobile-toggle { display: block; }
}

@media (max-width: 600px) {
    section { padding: 3.5rem 1.25rem; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
    .stat { border-bottom: 1px solid var(--border); }
}


/* EXPERIENCE — authentic client wordmarks ticker */
.client-logo-ticker {
    display: flex;
    width: 100%;
    overflow: hidden;
    gap: 2.5rem;
    padding: 1.15rem 0;
    margin: 0 0 .45rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.client-logo-track {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: clamp(2.5rem, 5vw, 4.5rem);
    min-width: max-content;
    animation: client-logo-marquee 38s linear infinite;
}
.client-logo-item {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    min-width: 112px;
    height: 58px;
    color: var(--text-muted);
}
.client-logo-item img {
    display: block;
    width: auto;
    max-width: 142px;
    height: auto;
    max-height: 34px;
    object-fit: contain;
    filter: none;
    opacity: .88;
    transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}
.client-logo-item:hover img {
    filter: none;
    opacity: 1;
    transform: translateY(-2px);
}
.client-logo-item > span:not(.client-wordmark):not(.client-name-only) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.client-wordmark {
    font-family: Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: .08em;
    color: #e2231a;
}
.client-logo-caption { display: none; }
.client-logo-note {
    margin: 0 0 1.7rem;
    color: var(--text-muted);
    font-size: .72rem;
    letter-spacing: .025em;
}
@keyframes client-logo-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-100% - 2.5rem)); }
}
.client-logo-ticker:hover .client-logo-track,
.client-logo-ticker:focus-within .client-logo-track { animation-play-state: paused; }
.client-logo-item img:not([src]) { display: none; }
@media (max-width: 680px) {
    .client-logo-ticker { gap: 1.75rem; }
    .client-logo-track { gap: 2.5rem; animation-duration: 32s; }
    .client-logo-item { min-width: 96px; }
    .client-logo-item img { max-width: 116px; max-height: 29px; }
}
@media (prefers-reduced-motion: reduce) {
    .client-logo-ticker { overflow-x: auto; mask-image: none; }
    .client-logo-track { animation: none !important; }
    .client-logo-track[aria-hidden="true"] { display: none; }
}

.client-name-only {
    font-family: var(--sans, Arial, sans-serif);
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: .02em;
    color: var(--text-soft);
}
.client-logo-item.logo-fallback img { display: none; }
.client-logo-item.logo-fallback > span:not(.client-name-only) {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    border: 0;
    font: 600 1rem/1.2 var(--sans, Arial, sans-serif);
    color: var(--text-soft);
}
.section-label { text-transform: none; }


/* About section: clean, readable single-column layout */
#about .about-grid.about-grid-text-only {
    display: block;
    max-width: 900px;
    margin-inline: auto;
}
#about .about-text {
    max-width: 820px;
    margin: 0 auto;
    text-align: left;
}
#about .about-text p {
    max-width: 78ch;
    margin: 0 0 1.15rem;
    line-height: 1.85;
    text-align: left;
}
#about .about-grid-text-only .reveal-left {
    width: 100%;
}
#about .about-grid-text-only .client-logo-ticker {
    margin-top: .8rem;
}
#about .about-grid-text-only .client-logo-note {
    max-width: 820px;
    margin: .65rem auto 1.7rem;
    line-height: 1.6;
}


/* Enterprise ticker: make every brand recognisable, not just a faint icon */
.client-logo-ticker {
    align-items: center;
    padding: 1.35rem 0;
    border-color: var(--border);
}
.client-logo-track {
    align-items: stretch;
    gap: clamp(1.5rem, 3.2vw, 3rem);
}
.client-logo-item {
    flex-direction: column;
    justify-content: center;
    gap: .55rem;
    min-width: 132px;
    height: 88px;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg3, rgba(255,255,255,.035));
}
.client-logo-item img {
    display: block;
    width: 116px;
    height: 40px;
    max-width: 116px;
    max-height: 40px;
    object-fit: contain;
    opacity: 1;
    filter: none;
}
.client-logo-item > span:not(.client-wordmark):not(.client-name-only) {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    border: 0;
    font: 600 .76rem/1.2 var(--sans, Arial, sans-serif);
    color: var(--text-soft, var(--text));
}
.client-logo-item .client-name-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: .04em;
    color: #e2231a;
}
.client-logo-caption {
    display: inline !important;
    font: 600 .76rem/1.2 var(--sans, Arial, sans-serif);
    color: var(--text-soft, var(--text));
}
.client-logo-item.logo-fallback img { display: none; }
.client-logo-item.logo-fallback > span:not(.client-name-only) {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    border: 0;
    font: 700 .9rem/1.2 var(--sans, Arial, sans-serif);
    color: var(--text-soft, var(--text));
}
@media (max-width: 680px) {
    .client-logo-item { min-width: 116px; height: 82px; }
    .client-logo-item img { width: 100px; height: 34px; max-width: 100px; max-height: 34px; }
}




/* CONTINUOUS CLIENT LOGO TICKER */
.client-logo-ticker {
    --logo-gap: 2.25rem;
    width: 100%;
    overflow: hidden;
    position: relative;
    margin: 1.2rem 0 .9rem;
    padding: 1.15rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
.client-logo-track {
    display: flex;
    align-items: center;
    width: max-content;
    gap: var(--logo-gap);
    animation: client-logo-scroll 48s linear infinite;
    will-change: transform;
}
.client-logo-ticker:hover .client-logo-track { animation-play-state: paused; }
.client-logo-item {
    flex: 0 0 164px;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    text-align: center;
}
.client-logo-item img {
    display: block;
    width: auto;
    max-width: 148px;
    height: 39px;
    object-fit: contain;
    opacity: .95;
    filter: none;
    transition: transform .25s ease;
}
.client-logo-item:hover img { transform: scale(1.08); }
.client-logo-item span {
    color: var(--text-muted);
    font: 600 .72rem/1.25 var(--sans, Arial, sans-serif);
    white-space: nowrap;
}
@keyframes client-logo-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (max-width: 680px) {
    .client-logo-track { animation-duration: 38s; }
    .client-logo-item { flex-basis: 132px; }
    .client-logo-item img { max-width: 118px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
    .client-logo-ticker { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
    .client-logo-track { animation: none; }
}



/* Fixed teal section navigation — preserve the original portfolio styling. */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}
body {
    padding-top: 68px;
}
html {
    scroll-padding-top: 88px;
}
section[id] {
    scroll-margin-top: 88px;
}
.nav-inner {
    max-width: 1440px;
    gap: 1rem;
}
.nav-inner > nav {
    display: block;
    min-width: 0;
}
.nav-inner > nav ul {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: clamp(0.45rem, 0.85vw, 0.9rem);
    white-space: nowrap;
}
.nav-inner > nav a {
    font-size: clamp(10px, 0.82vw, 12px);
    white-space: nowrap;
}
@media (max-width: 820px) {
    body {
        padding-top: 140px;
    }
    html {
        scroll-padding-top: 152px;
    }
    section[id] {
        scroll-margin-top: 152px;
    }
    .nav-inner {
        height: auto;
        min-height: 60px;
        padding: 8px 1rem 0;
        display: flex;
        flex-wrap: wrap;
        row-gap: 0;
    }
    .nav-inner > .logo-wrap {
        margin-right: auto;
    }
    .nav-inner > .nav-right {
        margin-left: 8px;
    }
    .nav-inner > nav {
        order: 3;
        display: block;
        flex: 0 0 calc(100% + 2rem);
        width: calc(100% + 2rem);
        margin: 6px -1rem 0;
        padding: 0 1rem 4px;
        overflow: visible;
        border-top: 1px solid var(--border);
    }
    .nav-inner > nav ul {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        gap: 2px 8px;
        padding: 4px 0 0;
        white-space: normal;
    }
    .nav-inner > nav li {
        min-width: 0;
        text-align: center;
    }
    .nav-inner > nav a {
        display: block;
        padding: 6px 1px;
        font-size: clamp(9px, 1.5vw, 11px);
        line-height: 1.35;
        white-space: nowrap;
    }
    #mobile-toggle,
    #mobile-menu {
        display: none !important;
    }
}
@media (max-width: 420px) {
    body {
        padding-top: 136px;
    }
    .logo-text {
        font-size: 12px;
    }
    .theme-toggle {
        padding: 5px 8px;
        font-size: 10px;
    }
    .nav-inner > nav ul {
        column-gap: 4px;
    }
    .nav-inner > nav a {
        font-size: 9px;
    }
}
