* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #f8fafc;
    background: #020617;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 22% 17%, rgba(29, 78, 216, 0.18), transparent 32%),
        radial-gradient(circle at 80% 8%, rgba(37, 99, 235, 0.10), transparent 28%),
        linear-gradient(180deg, #020617 0%, #050b18 55%, #020617 100%);
}

a {
    color: inherit;
}

/* =====================================================
   HEADER
===================================================== */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding: 0 30px;
    background: rgba(2, 6, 23, 0.94);
    border-bottom: 1px solid #172033;
    backdrop-filter: blur(16px);
}

.nav-container {
    position: relative;
    width: 100%;
    min-height: 76px;
    margin: 0;
    display: flex;
    align-items: center;
}

.site-logo {
    position: absolute;
    left: 30px;
    color: #ffffff;
    text-decoration: none;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.nav-container nav {
    position: absolute;
    left: 50%;
    width: max-content;
    transform: translateX(-50%);
}

nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 42px;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    position: relative;
    color: #f8fafc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}

nav a:hover,
nav a.active {
    color: #3b82f6;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -11px;
    width: 0;
    height: 2px;
    background: #3b82f6;
    transition: width 0.2s ease;
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* =====================================================
   HOME
===================================================== */
#home {
    position: relative;
    min-height: 505px;
    padding: 66px 30px 50px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 38%, rgba(37, 99, 235, 0.22), transparent 29%),
        linear-gradient(145deg, #050b1a 0%, #020617 64%, #07132c 100%);
    border-bottom: 1px solid #162033;
}

#home::after {
    content: "";
    position: absolute;
    left: -12%;
    right: 23%;
    bottom: -235px;
    height: 370px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(30, 64, 175, 0.34), rgba(30, 41, 100, 0.06));
    transform: rotate(-7deg);
}

.home-container {
    position: relative;
    z-index: 1;
    max-width: 1260px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 255px minmax(0, 650px);
    align-items: center;
    gap: 72px;
}

.profile-img {
    width: 245px;
    height: 245px;
    display: block;
    object-fit: cover;
    border: 5px solid #3b82f6;
    border-radius: 50%;
    background: #0f172a;
    box-shadow:
        0 0 0 7px rgba(59, 130, 246, 0.10),
        0 0 42px rgba(37, 99, 235, 0.48);
}

.home-text {
    text-align: left;
}

.home-text h1 {
    margin: 0 0 12px;
    line-height: 1.02;
}

.intro-line,
.name-highlight {
    display: block;
}

.intro-line {
    color: #ffffff;
    font-size: 40px;
    font-weight: 800;
}

.name-highlight {
    margin-top: 6px;
    color: #3b82f6;
    font-size: 50px;
    font-weight: 850;
    letter-spacing: -1.8px;
}

.job-title {
    margin: 0 0 18px !important;
    color: #ffffff !important;
    font-size: 21px !important;
    font-weight: 750;
}

.home-text > p:not(.job-title) {
    max-width: 625px;
    margin: 0 0 26px;
    color: #d5dbea;
    font-size: 16px;
    line-height: 1.6;
}

.download-btn,
.github-btn {
    min-height: 48px;
    padding: 12px 23px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #4f7cff;
    border-radius: 7px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #4338ca 100%);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.download-btn::before {
    content: "↓";
    margin-right: 10px;
    font-size: 19px;
}

.download-btn:hover,
.github-btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
    border-color: #7aa2ff;
    box-shadow: 0 15px 36px rgba(37, 99, 235, 0.4);
}

/* =====================================================
   SHARED SECTIONS AND HEADINGS
===================================================== */
#experience,
#education,
#projects,
#militaryservice,
#contact {
    padding: 48px 30px 64px;
    text-align: center;
    background: #020817;
    border-bottom: 1px solid #121a2b;
}

#experience h2,
#education h2,
#projects h2,
#militaryservice h2,
#contact h2 {
    position: relative;
    max-width: 1260px;
    margin: 0 auto 25px;
    padding-bottom: 12px;
    color: #ffffff;
    font-size: 29px;
    font-weight: 800;
    text-align: center;
}

#experience h2::after,
#education h2::after,
#projects h2::after,
#militaryservice h2::after,
#contact h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 47px;
    height: 3px;
    border-radius: 2px;
    background: #3b82f6;
    transform: translateX(-50%);
}

/* =====================================================
   EXPERIENCE
===================================================== */
.container {
    max-width: 1260px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.box {
    min-height: 322px;
    padding: 22px 20px;
    text-align: left;
    background: linear-gradient(180deg, #0b1424 0%, #09111f 100%);
    border: 1px solid #1f2a3d;
    border-radius: 9px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
    transition: 0.22s ease;
}

.box h3 {
    min-height: 54px;
    margin: 0 0 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 750;
    text-align: left;
}

.box h3 i {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 30px;
    border: 1px solid currentColor;
    border-radius: 7px;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
    font-size: 17px;
}

.box:nth-child(2) h3 i {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
}

.box:nth-child(3) h3 i {
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
}

.box:nth-child(4) h3 i {
    color: #facc15;
    background: rgba(250, 204, 21, 0.08);
}

.box ul {
    margin: 0;
    padding-left: 0;
    list-style-position: inside;
    text-align: left;
}

.box li {
    margin-bottom: 12px;
    color: #d4d9e5;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.box li::marker {
    color: #94a3b8;
}

/* =====================================================
   SHARED CARD HOVER
===================================================== */
.box:hover,
.project-card:hover,
.education-card:hover,
.military-container:hover,
.contact-card:hover {
    transform: translateY(-5px);
    border-color: #335a9a;
    box-shadow: 0 22px 50px rgba(10, 47, 110, 0.20);
}

/* =====================================================
   EDUCATION, PROJECTS, MILITARY
===================================================== */
.education-container,
.projects-container,
.military-container {
    max-width: 1260px;
    margin-left: auto;
    margin-right: auto;
}

.education-card,
.military-container,
.project-card {
    background: linear-gradient(180deg, #0b1424 0%, #09111f 100%);
    border: 1px solid #1f2a3d;
    border-radius: 9px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
    transition: 0.22s ease;
}

.education-card {
    padding: 40px;
    text-align: center;
}

.education-card-image {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.education-card-image img {
    width: 120px;
    height: auto;
}

.education-card h3 {
    margin-bottom: 25px;
    color: #ffffff;
    text-align: center;
}

.education-card ul {
    display: inline-block;
    margin: 0 auto;
    padding-left: 25px;
    text-align: left;
}

.education-card li {
    margin-bottom: 12px;
    line-height: 1.8;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    min-height: 340px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.project-card h3 {
    margin: 0 0 17px;
    color: #ffffff;
    font-size: 20px;
}

.project-description {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.project-description p {
    color: #cbd5e1;
    line-height: 1.65;
    text-align: center;
}

.project-description .github-btn {
    margin-top: auto;
    align-self: center;
}

.military-container {
    padding: 30px;
}

.military-container h3 {
    margin-top: 0;
    color: #ffffff;
}

.military-container p {
    color: #cbd5e1;
    line-height: 1.65;
}

/* =====================================================
   CONTACT
===================================================== */
#contact {
    padding: 48px 30px 64px;
    background:
        radial-gradient(circle at 50% 12%, rgba(37, 99, 235, 0.09), transparent 34%),
        #020817;
}

.contact-intro {
    max-width: 760px;
    margin: 0 auto 32px;
    color: #b8c2d4;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

#contact .contact-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}

#contact .contact-card {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 365px;
    padding: 28px 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    text-align: center;
    background:
        radial-gradient(circle at 50% 20%, rgba(37, 99, 235, 0.13), transparent 36%),
        linear-gradient(180deg, #0b1527 0%, #08111f 100%);
    border: 1px solid #2a3850;
    border-radius: 15px;
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

#contact .contact-card:hover {
    transform: translateY(-7px);
    border-color: rgba(59, 130, 246, 0.72);
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.42),
        0 0 34px rgba(37, 99, 235, 0.13);
}

#contact .contact-icon-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 42px;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

#contact .contact-card:hover .contact-icon-wrapper {
    transform: scale(1.06);
}

#contact .contact-card h3 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    text-align: center;
}

#contact .contact-description {
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
}

#contact .contact-description p {
    margin: 0 0 2px;
    color: #c6cfdf;
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
}

#contact .contact-description p:last-child {
    margin-bottom: 0;
}

#contact .contact-action {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    padding: 11px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 800;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
}

#contact .contact-action:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    filter: brightness(1.1);
}

#contact .contact-action i {
    font-size: 14px;
}

#contact .contact-email .contact-icon-wrapper {
    color: #3b82f6;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.28), rgba(30, 64, 175, 0.09));
    box-shadow:
        0 0 44px rgba(37, 99, 235, 0.28),
        inset 0 0 30px rgba(37, 99, 235, 0.12);
}

#contact .contact-email .contact-icon-wrapper i,
#contact .contact-whatsapp .contact-icon-wrapper i,
#contact .contact-linkedin .contact-icon-wrapper i,
#contact .contact-github .contact-icon-wrapper i {
    color: #ffffff;
}

#contact .contact-email .contact-action {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    border-color: #6184ff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.33);
}

#contact .contact-whatsapp .contact-icon-wrapper {
    color: #22c55e;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.24), rgba(5, 150, 105, 0.07));
    box-shadow:
        0 0 44px rgba(34, 197, 94, 0.24),
        inset 0 0 30px rgba(34, 197, 94, 0.10);
}

#contact .contact-whatsapp .contact-action {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #22c55e;
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.27);
}

#contact .contact-linkedin .contact-icon-wrapper {
    color: #0ea5e9;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25), rgba(2, 132, 199, 0.07));
    box-shadow:
        0 0 44px rgba(14, 165, 233, 0.25),
        inset 0 0 30px rgba(14, 165, 233, 0.11);
}

#contact .contact-linkedin .contact-action {
    background: linear-gradient(135deg, #0284c7 0%, #075da8 100%);
    border-color: #38bdf8;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.28);
}

#contact .contact-github .contact-icon-wrapper {
    color: rgba(255, 255, 255, 0.48);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow:
        0 0 38px rgba(255, 255, 255, 0.06),
        inset 0 0 28px rgba(255, 255, 255, 0.025);
}

#contact .contact-github .contact-action {
    background: linear-gradient(135deg, #182235 0%, #101827 100%);
    border-color: #738096;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* =====================================================
   FOOTER
===================================================== */
footer {
    padding: 20px;
    color: #94a3b8;
    background: #01040d;
    text-align: center;
}

footer .container {
    display: block;
}

/* =====================================================
   AI ASSISTANT
===================================================== */
.hidden {
    display: none !important;
}

body.agent-open {
    overflow: hidden;
}

.agent-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 20px;
    background: rgba(2, 6, 23, 0.46);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.agent-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.agent-panel {
    width: min(620px, 46vw);
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.99), rgba(5, 10, 24, 0.99));
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px;
    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(59, 130, 246, 0.12);
    transform: translateX(34px) scale(0.985);
    transition: transform 0.32s ease;
}

.agent-overlay.active .agent-panel {
    transform: translateX(0) scale(1);
}

.agent-topbar {
    position: static;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    background: transparent;
    border: 0;
}

.agent-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.32);
    font-size: 23px;
}

.agent-brand h2 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 20px;
    line-height: 1.15;
}

.agent-brand p {
    margin: 0;
    color: #a9b4c6;
    font-size: 13px;
}

.agent-status-dot {
    width: 8px;
    height: 8px;
    margin-right: 7px;
    display: inline-block;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.95);
}

.agent-close-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
}

.agent-close-btn:hover {
    background: rgba(239, 68, 68, 0.85);
    transform: rotate(90deg);
}

.agent-video-card {
    position: relative;
    width: calc(100% - 32px);
    height: 520px;
    min-height: 520px;
    flex: 0 0 520px;
    margin: 0 16px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.23);
    border-radius: 18px;
    background: radial-gradient(circle at center, #172554, #070b18 70%);
    box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.28);
}

.did-agent-mount {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 520px;
    display: block;
    overflow: hidden;
    border-radius: 18px;
}

.did-agent-mount > * {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 520px !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
}

.agent-content {
    padding: 20px 20px 22px;
}

.agent-content h3 {
    margin: 0 0 7px;
    color: #ffffff;
    font-size: 20px;
}

.agent-content p {
    margin: 0;
    color: #a9b4c6;
    font-size: 14px;
    line-height: 1.55;
}

.agent-open-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147482999;
    min-height: 56px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    font-size: 15px;
    font-weight: 750;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.agent-open-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
}

.agent-open-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (min-width: 721px) and (max-height: 850px) {
    .agent-video-card {
        height: 390px;
        min-height: 390px;
        flex-basis: 390px;
    }

    .did-agent-mount,
    .did-agent-mount > * {
        min-height: 390px !important;
    }

    .agent-content {
        padding-top: 14px;
        padding-bottom: 14px;
    }
}

@media (max-width: 1050px) {
    .agent-panel {
        width: min(650px, 68vw);
    }

    #contact .contact-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .container,
    .projects-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-container {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 42px;
    }

    .profile-img {
        width: 215px;
        height: 215px;
    }
}

@media (max-width: 760px) {
    header {
        padding: 0 18px;
    }

    .nav-container {
        min-height: 66px;
        padding: 15px 0;
        flex-direction: column;
        align-items: center;
    }

    .site-logo {
        position: static;
        margin-bottom: 15px;
    }

    .nav-container nav {
        position: static;
        width: 100%;
        overflow-x: auto;
        transform: none;
    }

    .nav-container nav ul {
        width: max-content;
        margin: 0 auto;
        gap: 24px;
        padding-bottom: 7px;
    }

    #home {
        padding: 52px 20px 44px;
    }

    .home-container {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 30px;
    }

    .home-text {
        text-align: center;
    }

    .profile-img {
        width: 205px;
        height: 205px;
    }

    .intro-line {
        font-size: 32px;
    }

    .name-highlight {
        font-size: 41px;
    }

    .container,
    .projects-container {
        grid-template-columns: 1fr;
    }

    #experience,
    #education,
    #projects,
    #militaryservice,
    #contact {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 720px) {
    .agent-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .agent-panel {
        width: 100%;
        height: 82vh;
        max-height: 82vh;
        border-radius: 24px 24px 0 0;
    }

    .agent-topbar {
        padding: 15px 16px;
    }

    .agent-video-card {
        width: calc(100% - 24px);
        height: 42vh;
        min-height: 280px;
        flex: 0 0 42vh;
        margin: 0 12px;
    }

    .did-agent-mount,
    .did-agent-mount > * {
        min-height: 280px !important;
    }

    .agent-content {
        padding: 14px 16px 16px;
    }

    .agent-open-btn {
        right: 14px;
        bottom: 14px;
    }
}

.agent-video-card {
  position: relative;
  overflow: hidden;
}

.agent-subtitles {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(10px);

  width: calc(100% - 40px);
  max-width: 96%;
  min-width: 420px;
  padding: 12px 24px;

  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;

  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 16px;

  box-shadow:  0 10px 25px rgba(0,0,0,0.18),
     inset 0 1px 0 rgba(255,255,255,0.35);
    
  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;

  pointer-events: none;
  z-index: 100;
}

.agent-subtitles.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .agent-subtitles {
    bottom: 18px;
    width: calc(100% - 24px);
    padding: 11px 14px;
    font-size: 16px;
    border-radius: 11px;
  }
}

@media (max-width: 620px) {
    #contact {
        padding: 48px 18px 60px;
    }

    .contact-intro {
        margin-bottom: 30px;
        font-size: 15px;
    }

    #contact .contact-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    #contact .contact-card {
        min-height: 340px;
        padding: 24px 18px 18px;
    }

    #contact .contact-icon-wrapper {
        width: 92px;
        height: 92px;
        margin-bottom: 18px;
        font-size: 38px;
    }
}


/* =========================================
   AI AVATAR SUBTITLES
   ========================================= */

.agent-video-card {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

.did-agent-mount {
  position: relative !important;
  z-index: 1 !important;
}

#agent-subtitles::before,
#agent-subtitles::after {
    display: none !important;
}

@media (max-width: 600px) {
  .agent-subtitles {
    bottom: 16px !important;
    width: calc(100% - 30px) !important;
    padding: 10px 14px !important;
    font-size: 16px !important;
  }
}


/* =====================================================
   STATIC D-ID CONTROLS — NO NPM / NO BUILD
===================================================== */
.agent-language-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 18px 14px;
}

.language-button,
.agent-quick-actions button,
.agent-control-btn {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.88);
    color: #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s ease;
}

.language-button {
    min-width: 110px;
    padding: 9px 16px;
    font-weight: 750;
}

.language-button.active,
.language-button:hover,
.agent-quick-actions button:hover,
.agent-control-btn:hover {
    color: #ffffff;
    border-color: #60a5fa;
    background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(79, 70, 229, .95));
}

.agent-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 15px;
}

.agent-quick-actions button {
    min-height: 42px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 700;
}

.agent-custom-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.agent-control-btn {
    padding: 9px 15px;
    font-weight: 700;
}

.agent-content[dir="rtl"] { text-align: right; }
.agent-content[dir="ltr"] { text-align: left; }

#agent-status-dot[data-state="connecting"] { background: #f59e0b; }
#agent-status-dot[data-state="error"] { background: #ef4444; }
#agent-status-dot[data-state="speaking"] { background: #38bdf8; }

@media (max-width: 720px) {
    .agent-quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .language-button { min-width: 95px; }
}

/* Keep subtitles, remove the long black bar */
#agent-subtitles {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(8px);

    width: fit-content;
    max-width: 90%;
    padding: 10px 18px !important;

    background: rgba(255, 255, 255, 0.96) !important;
    color: #000000 !important;

    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;

    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;

    z-index: 999;
}

#agent-subtitles.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

#agent-subtitles::before,
#agent-subtitles::after {
    display: none !important;
}

#agent-subtitles::before,
#agent-subtitles::after {
    display: none !important;
}

#agent-subtitles.visible {
    display: block;
}

/* Mobile only */
@media (max-width: 720px) {

    .agent-overlay {
        align-items: stretch;
        padding: 0;
        overflow: hidden;
    }

    .agent-panel {
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 0;
        -webkit-overflow-scrolling: touch;
    }

    .agent-topbar {
        position: sticky;
        top: 0;
        z-index: 200;
        padding: 12px 14px;
        background: rgba(10, 16, 32, 0.97);
    }

    .agent-language-switch {
        padding: 8px 12px 10px;
    }

    .language-button {
        min-width: 100px;
        padding: 8px 12px;
    }

    .agent-video-card {
        width: calc(100% - 24px);
        height: 34dvh;
        min-height: 220px;
        max-height: 300px;
        flex: 0 0 auto;
        margin: 0 12px;
    }

    .did-agent-mount,
    .did-agent-mount > * {
        width: 100% !important;
        height: 100% !important;
        min-height: 220px !important;
    }

    .agent-content {
        padding: 12px 12px 24px;
    }

    .agent-content h3 {
        font-size: 17px;
        margin-bottom: 5px;
    }

    .agent-content p {
        font-size: 12px;
        line-height: 1.4;
    }

    .agent-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-top: 10px;
    }

    .agent-quick-actions button {
        min-height: 38px;
        padding: 7px 5px;
        font-size: 12px;
    }

    #agent-stop-btn {
        display: none !important;
    }

    .agent-custom-controls {
        justify-content: center;
        margin-top: 10px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    #agent-mic-btn {
        min-width: 170px;
    }
}
