/* Chat example buttons styling */
.chat-example-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    align-items: flex-end;
    width: 100%;
    padding-bottom: 6px;
}
.chat-example-btn {
    background: linear-gradient(135deg, #e3eafc 10%, #c1d6f7 100%);
    color: #2c3e50;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-family: inherit;
    font-size: 0.98em;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: background 0.2s, transform 0.2s;
    margin: 0;
    min-width: 100px;
    max-width: 90%;
    display: block;
    text-align: right;
    font-weight: 400;
}
.chat-example-btn:hover {
    transform: translateY(-2px);
    filter: brightness(.98);
    box-shadow: 0 8px 20px rgba(34,49,63,0.08);
}
:root {
    --primary-color: #2c3e50;
    --secondary-color: #1ABC9C;
    --tertiary-color: #ECF0F1;
    --text-color: #2c3e50;
    --text-color-light: #c1c4c5;
    --font-family: 'Poppins', sans-serif;
}

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

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    
}

a:hover {
    color: #06bce9;
}


header {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

nav {
    position: fixed;
    width: 100%;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 40px;
    z-index: 1000;
    background: rgba(236, 240, 241, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.2s;
    flex-wrap: wrap;
}

nav.nav-hidden {
    transform: translateY(-100%);
}

#header-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color-light);
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

nav ul li {
    margin: 0 4px;
}

nav ul li a {
    font-size: 0.9rem;
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

nav ul li a:hover {
    color: var(--secondary-color);
    background: rgba(26, 188, 156, 0.08);
}

.nav-resume-btn {
    background: var(--primary-color) !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 0.88rem !important;
    letter-spacing: 0.03em !important;
    transition: background 0.2s, transform 0.2s, color 0.2s !important;
}

.nav-resume-btn:hover {
    background: var(--secondary-color) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
}

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

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

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: auto;
    padding: 50px;
}

#Me {
    width: 100%;
    max-width: 455px;
    height: auto;
    padding: 10px;
   
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-right: 90px;
}

#Me:hover {
    transform: rotate(4deg) scale(1.05);
}

.header-text-container {
    max-width: 600px;
}

.header-text-container h1 {
    font-size: 4.5rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.header-text-container p {
    font-size: 1.2rem;
    margin: 10px 0;
    line-height: 1.6;
}

#link {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary-color);
    transition: color 0.3s ease;
    height: 20px;
}

#link:hover {
    color: var(--primary-color);
}

main {
    padding: 50px 0;
}

section {
    padding: 100px 50px;
    text-align: left;
}

.about-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
    padding: 50px 20px;
    background: var(--tertiary-color);
    margin: 40px;
}

.about-content {
    flex: 1 1 50%;
    padding: 20px;
}

.about-text {
    margin-bottom: 20px;
    size: 100px;
    
}

.about-text h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.about-text p {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 18px;
}

.about-image {
    flex: 1 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#about_pic {
    width: 100%;
    max-width: 500px;
    height: auto;
    padding: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 50px;
}

#about_pic:hover {
    transform: rotate(-2deg) scale(1.05);
}

#portfolio {
    background-color: var(--tertiary-color);
    padding: 100px 50px;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.grid {
    grid-template-columns: 1fr 1fr;
    display: grid;
    gap: 40px;
    padding: 0 20px;
    width: 100%;
}

.portfolio-item {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 1500px;
    align-content: center;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.portfolio-image {
    width: 100%;
    height: auto;
}

.portfolio-info {
    padding: 20px;
}

.portfolio-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.portfolio-description {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-color);
    line-height: 1.6;
}

footer {
    text-align: center;
    padding: 30px;
    background-color: var(--tertiary-color);
    color: var(--text-color);
}

.fa {
    padding: 20px;
    font-size: 30px;
    width: 40px;
    text-align: center;
    text-decoration: none;
    margin: 5px 2px;
    border-radius: 50%;
}

.fa:hover {
    opacity: 0.7;
    color: var(--secondary-color);
}

.fa-instagram {
    color: var(--primary-color);
}

.fa-linkedin {
    color: var(--primary-color);
}
.btn {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    transition: background-color 0.3s ease;
}
.btn:hover {
    background-color: var(--tertiary-color);
}


@media (max-width: 768px) {
    nav {
        padding: 12px 20px;
    }

    .nav-hamburger {
        display: flex;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        flex-direction: column;
        width: auto;
        min-width: 200px;
        gap: 0;
        padding: 8px 0 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        border-radius: 0 0 12px 12px;
        border-top: 2px solid var(--secondary-color);
        z-index: 999;
    }

    nav.nav-open ul {
        display: flex;
    }

    nav ul li {
        margin: 0;
        width: 100%;
    }

    nav ul li a {
        display: block;
        padding: 11px 20px;
        font-size: 0.95rem;
        border-radius: 0;
        white-space: nowrap;
        color: var(--text-color);
    }

    .nav-resume-btn {
        display: inline-block !important;
        margin: 6px 12px 0 12px !important;
        width: calc(100% - 24px) !important;
        text-align: center !important;
        border-radius: 8px !important;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    #Me {
        width: 140px;
        margin-right: 0;
        margin-bottom: 20px;
    }

    .header-text-container {
        max-width: 100%;
    }

    .header-text-container h1 {
        font-size: 2.4rem;
    }

    #link {
        font-size: 1.2rem;
    }

    section {
        padding: 60px 20px;
    }

    #portfolio {
        padding: 60px 20px;
    }

    .about-section {
        flex-direction: column;
        margin: 16px;
        padding: 28px 16px;
    }

    .about-content {
        flex: unset;
        width: 100%;
        padding: 0;
    }

    .about-image {
        flex: unset;
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .portfolio-title {
        font-size: 1.4rem;
    }
}

/* Fixed chat toggle and widget (bottom-right) */

.chat-toggle-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    isolation: isolate;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color) 10%, var(--secondary-color) 100%);
    color: white;
    display: grid;
    place-items: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 2200;
    box-shadow: 0 10px 30px rgba(44,62,80,0.18), 0 2px 8px rgba(0,0,0,0.12);
    transition: transform .18s ease, box-shadow .18s ease, opacity .22s ease;
}
.chat-toggle-btn:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 18px 40px rgba(44,62,80,0.18); }

.chat-toggle-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2.5px solid var(--secondary-color);
    animation: pulse-ring 2s ease-out infinite;
    pointer-events: none;
}

@keyframes pulse-ring {
    0%   { transform: scale(1);   opacity: 0.85; }
    100% { transform: scale(1.6); opacity: 0; }
}

.chat-label {
    position: fixed;
    right: 98px;
    bottom: 36px;
    background: #fff;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', var(--font-family);
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(44,62,80,0.14);
    z-index: 2200;
    pointer-events: none;
    animation: chat-label-show 6s ease forwards;
}

@keyframes chat-label-show {
    0%   { opacity: 0; transform: translateX(8px); }
    12%  { opacity: 1; transform: translateX(0); }
    75%  { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(8px); }
}

body:has(.chatBot.open) .chat-label {
    display: none;
}

.chatBot {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2150;
    border-radius: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s ease, transform .26s cubic-bezier(.2,.9,.25,1), visibility .26s;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-color) 10%, var(--secondary-color) 100%);
    flex: 0 0 auto;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.chat-header-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    font-family: 'Poppins', var(--font-family);
}

.chat-header-status {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    font-family: 'Poppins', var(--font-family);
}

.chat-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: grid;
    place-items: center;
    transition: background .15s ease;
}
.chat-close-btn:hover { background: rgba(255,255,255,0.28); }

.chatbox {
    padding: 18px;
    list-style: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.chat-input {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 10px 10px 3px;
    border-top: 1px solid #e6e6e6;
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
}

.chat { display:flex }
.chat p, .bubble {
    padding: 12px 16px;
    border-radius: 20px;
    max-width: 78%;
    min-width: 80px;
    width: fit-content;
    margin: 2px 0;
    word-wrap: break-word;
    box-sizing: border-box;
    box-shadow: 0 6px 22px rgba(17,24,39,0.06);
    line-height: 1.5;
    font-size: 15px;
    font-family: 'Poppins', var(--font-family);
    letter-spacing: 0.01em;
}

/* Links inside chat bubbles */
.bubble a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(26, 188, 156, 0.1);
    color: #0e9076;
    padding: 3px 10px 3px 8px;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(26, 188, 156, 0.3);
    margin: 2px 2px;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    white-space: nowrap;
}
.bubble a:hover {
    background: var(--secondary-color);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
}
.chat-outgoing .bubble a {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-color: rgba(255,255,255,0.35);
}
.chat-outgoing .bubble a:hover {
    background: rgba(255,255,255,0.32);
    color: #fff;
}

/* assistant avatar + bubble layout */
.assistant-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex: 0 0 44px;
    box-shadow: 0 8px 26px rgba(17,24,39,0.08);
}

.chat-incoming { justify-content: flex-start }
.chat-outgoing { justify-content: flex-end }
.chat-incoming > div, .chat-outgoing > div { width: 100%; }

.chat-incoming .bubble, .chat-incoming p {
    background: linear-gradient(180deg, var(--tertiary-color) 0%, #f7f9fa 100%);
    color: #1f2833;
    align-self: flex-start;
    border-top-left-radius: 12px;
    border-top-right-radius: 18px;
    width: 78%;
}
.chat-incoming .bubble.thinking-animation, .chat-incoming p.thinking-animation {
    padding-right: 32px;
}
.chat-outgoing .bubble, .chat-outgoing p {
    background: linear-gradient(180deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color) 70%, #000 10%));
    color: #fff;
    align-self: flex-end;
    border-top-right-radius: 12px;
    border-top-left-radius: 18px;
}

.chat-input textarea {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid rgba(34,49,63,0.08);
    border-radius: 12px;
    resize: none;
    height: 64px; /* explicit height to match Send button */
    font-size: 15px;
    box-sizing: border-box;
    font-family: 'Poppins', var(--font-family);
    color: #26333a;
    margin-bottom: 4px;
}
.chat-input button {
    background: linear-gradient(135deg, var(--primary-color) 10%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 0 18px; /* horizontal padding only */
    height: 64px; /* match textarea height */
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
    margin-bottom: 6px;
}
.chat-input button:hover { transform: translateY(-2px); filter: brightness(.98); box-shadow: 0 8px 20px rgba(34,49,63,0.08); }

/* visible state */
.chatBot.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatBot.open ~ .chat-toggle-btn,
body:has(.chatBot.open) .chat-toggle-btn {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 520px) {
    .chat-toggle-btn { right: 12px; bottom: 12px; width: 56px; height: 56px; }
    .chat-label { display: none; }
}

/* Homepage refinement */
:root {
    --primary-color: #243247;
    --secondary-color: #12866f;
    --tertiary-color: #f2f5f4;
    --surface: #ffffff;
    --muted: #5d6978;
    --line: rgba(36, 50, 71, 0.12);
    --shadow: 0 18px 60px rgba(36, 50, 71, 0.10);
}

body { background: var(--surface); font-family: var(--font-family); }

.skip-link {
    position: fixed; left: 16px; top: 10px; z-index: 3000;
    padding: 10px 14px; border-radius: 8px; background: var(--primary-color); color: #fff;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

header { min-height: 760px; height: auto; padding-top: 72px; background: linear-gradient(145deg, #f7faf9 0%, #fff 62%); }
nav { padding: 12px clamp(20px, 5vw, 72px); background: rgba(255,255,255,.9); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.brand img { height: 40px; width: 40px; object-fit: contain; }

.header-content { width: min(1180px, 100%); min-height: 680px; padding: 80px clamp(24px, 6vw, 80px); gap: clamp(44px, 8vw, 100px); }
.hero-portrait-wrap { position: relative; flex: 0 1 420px; }
.hero-portrait-wrap::before { content: none; }
#Me { position: relative; display: block; max-width: 420px; margin: 0; padding: 0; border-radius: 0; filter: grayscale(100%); }
.header-text-container { max-width: 650px; }
#link { height: auto; min-height: 28px; margin-bottom: 14px; font-size: .95rem; text-transform: uppercase; letter-spacing: .12em; }
.header-text-container h1 { max-width: 12ch; font-size: clamp(3.25rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.055em; }
.header-text-container .hero-lede { max-width: 58ch; margin-top: 24px; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 10px; font-weight: 600; }
.button-primary { background: var(--primary-color); color: #fff; }
.button-primary:hover { background: var(--secondary-color); color: #fff; transform: translateY(-2px); }
.button-secondary { border: 1px solid var(--line); background: #fff; }
.button-secondary:hover { border-color: var(--secondary-color); color: var(--secondary-color); }

main { padding: 0; }
#portfolio { padding: 110px clamp(24px, 5vw, 72px); }
.section-heading { width: min(1120px, 100%); margin: 0 auto 48px; }
.section-heading h2, .about-text h2 { max-width: 18ch; margin: 8px 0 14px; font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.08; letter-spacing: -.04em; }
.section-heading > p:last-child { max-width: 60ch; color: var(--muted); font-size: 1.06rem; }
.eyebrow { color: var(--secondary-color) !important; font-size: .82rem !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.grid { width: min(1120px, 100%); margin: auto; padding: 0; gap: 28px; }
.portfolio-link { display: block; height: 100%; border-radius: 18px; }
.portfolio-link:focus-visible { outline: 3px solid var(--secondary-color); outline-offset: 5px; }
.portfolio-item { height: 100%; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 24px rgba(36,50,71,.05); }
.portfolio-item:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.portfolio-image { aspect-ratio: 16 / 9; object-fit: cover; background: #e7eceb; }
.portfolio-info { display: flex; min-height: 300px; flex-direction: column; padding: 28px; }
.project-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.portfolio-title { font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.18; letter-spacing: -.025em; }
.portfolio-description { color: var(--muted); }
.case-study-link { margin-top: auto; color: var(--secondary-color); font-weight: 700; }

.about-section { width: min(1180px, calc(100% - 48px)); margin: 80px auto; padding: clamp(32px, 6vw, 80px); border-radius: 24px; gap: 60px; }
.about-content { padding: 0; }
.about-text p { color: var(--muted); font-size: 1.02rem; }
.about-text br { display: none; }
.about-text p + p { margin-top: 18px; }
.fun-fact { padding: 18px 20px; border-left: 4px solid var(--secondary-color); background: rgba(255,255,255,.72); border-radius: 0 12px 12px 0; }
#about_pic { padding: 0; border-radius: 20px; }
footer { display: flex; align-items: center; justify-content: space-between; padding: 28px clamp(24px, 5vw, 72px); }
.social-links { display: flex; }
.fa { display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; }

@media (max-width: 768px) {
    header { min-height: auto; padding-top: 64px; }
    .brand span { display: none; }
    .header-content { min-height: auto; padding: 42px 24px 56px; gap: 28px; text-align: left; }
    .hero-portrait-wrap { flex: none; width: min(62vw, 260px); }
    #Me { width: 100%; max-width: none; }
    .header-text-container h1 { font-size: clamp(2.55rem, 12vw, 3.7rem); }
    .header-text-container .hero-lede { margin-top: 18px; font-size: 1rem; }
    .hero-actions { margin-top: 22px; }
    #portfolio { padding: 78px 20px; }
    .grid { gap: 20px; }
    .portfolio-info { min-height: 260px; padding: 22px; }
    .about-section { width: calc(100% - 32px); margin: 48px auto; padding: 28px 20px; }
    footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
