body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 80px 0 0 0;
    background-color: #fafafa;
}

header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background-color: #000;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

.social-links {
    display: flex;
    gap: 10px;
    margin: 20px 0 0 0;
    width: 100%;
    justify-content: flex-end;
    padding: 0 20px;
    box-sizing: border-box;
}

.social-link {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: relative;
}

.social-link i {
    font-size: 20px;
    color: #fff;
    transition: color 0.3s;
}

.social-link:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.social-link:hover i {
    color: #007bff;
}

/* Tooltip styling */
.social-link::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    text-transform: capitalize;
    letter-spacing: 0;
    font-weight: normal;
}

.social-link:hover::after {
    opacity: 1;
    visibility: visible;
}

header .logo {
    font-size: 24px;
    color: #fff;
    font-weight: 700;
}

header nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

header nav ul li {
    margin: 0 15px;
}

header nav a {
    color: #fff;
    text-decoration: none;
    text-transform: lowercase;
    font-weight: 600;
}

header nav a:hover {
    color: #dbeafe;
}

main {
    text-align: center;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
}

.bio {
    max-width: 600px;
}

.blog-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: left;
}

.post-article {
    flex: 1 1 620px;
    min-width: 300px;
}

.post-article h2,
.post-article h3 {
    margin-top: 30px;
    color: #111;
}

.post-article p,
.post-article ul {
    line-height: 1.8;
    color: #333;
    text-align: justify;
}

.post-article ul {
    margin-left: 20px;
}

.post-sidebar {
    flex: 0 0 360px;
    min-width: 280px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.image-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.image-card img {
    width: 100%;
    display: block;
    height: auto;
}

.grid-caption {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.grid-caption p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
}

.references-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: 1115px;
    overflow-y: auto;
}

.references-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.references-section h4 {
    margin: 25px 0 10px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 500;
    border-left: 4px solid #007bff;
    padding-left: 12px;
}

.references-section ul {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.references-section li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #495057;
}

.references-section li em {
    font-style: italic;
    color: #6c757d;
}

.references-section a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.references-section a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.latest-work {
    padding: 40px;
}

.work-item {
    background: #fff;
    border: 1px solid #ccc;
    margin: 10px;
    padding: 20px;
    display: inline-block;
    border-radius: 5px;
}

.portfolio-page {
    padding: 30px 20px 50px;
    background: #f4f6f9;
    text-align: left;
}

.portfolio-card {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.portfolio-sidebar {
    width: 30%;
    background: #1e2a38;
    color: #fff;
    padding: 30px;
}

.portfolio-intro h1 {
    margin: 0 0 10px;
    font-size: 24px;
    line-height: 1.2;
}

.portfolio-intro p {
    margin: 0 0 25px;
    font-size: 14px;
    opacity: 0.9;
}

.portfolio-section {
    margin-bottom: 25px;
}

.portfolio-section h3 {
    margin: 0 0 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.project-page {
    padding: 36px 20px 48px;
}

.video-gallery {
    width: min(1440px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.video-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.video-card video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    background: #111827;
}

.video-caption {
    margin: 10px 0 0;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

@media (max-width: 1200px) {
    .video-gallery {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .video-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .video-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .project-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .video-gallery {
        grid-template-columns: 1fr;
    }
}

.portfolio-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.portfolio-section li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.portfolio-main {
    width: 70%;
    padding: 30px;
    color: #333;
}

.portfolio-main h2 {
    margin: 26px 0 12px;
    padding-bottom: 5px;
    border-bottom: 2px solid #1e2a38;
    color: #1e2a38;
    font-size: 22px;
}

.portfolio-main h2:first-child {
    margin-top: 0;
}

.portfolio-main p {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.7;
}

.portfolio-item {
    margin-bottom: 20px;
}

.portfolio-item h4 {
    margin: 0 0 4px;
    color: #333;
    font-size: 16px;
}

.portfolio-item span {
    display: block;
    margin-bottom: 6px;
    color: #777;
    font-size: 13px;
}

@media (max-width: 768px) {
    .portfolio-page {
        padding: 20px 12px 40px;
    }

    .portfolio-card {
        flex-direction: column;
    }

    .portfolio-sidebar,
    .portfolio-main {
        width: 100%;
    }
}

.cv-toolbar {
    max-width: 1200px;
    margin: 0 auto 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cv-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #111;
    border-radius: 6px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font: 700 14px Arial, sans-serif;
    cursor: pointer;
}

.cv-action:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.cv-workspace {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 760px) minmax(320px, 1fr);
    gap: 24px;
    align-items: start;
}

.cv-workspace--public {
    max-width: 760px;
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.cv-toolbar--public {
    max-width: 760px;
}

.cv-sheet {
    min-height: 982px;
    padding: 48px 50px;
    background: #fff;
    color: #111;
    border: 1px solid #d9dde5;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    font-family: "Times New Roman", Times, serif;
    box-sizing: border-box;
}

.cv-paper-header {
    display: grid;
    grid-template-columns: 1fr 112px;
    gap: 24px;
    align-items: start;
    margin-bottom: 18px;
}

.cv-paper-intro {
    min-height: 78px;
    padding: 14px 18px;
    background: #f2f3f5;
}

.cv-paper-intro h1 {
    margin: 0 0 10px;
    color: #333399;
    font-size: 19px;
    line-height: 1.15;
    letter-spacing: 0;
}

.cv-paper-intro p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.45;
}

.cv-photo {
    width: 112px;
    height: 124px;
    object-fit: cover;
    display: block;
}

.cv-paper-section {
    margin: 0 0 15px;
    padding: 11px 12px 12px;
    background: #f5f5f5;
}

.cv-paper-section h2 {
    margin: 0 0 10px;
    color: #111;
    font-size: 15px;
    line-height: 1.2;
}

.cv-paper-section p,
.cv-paper-section li {
    color: #111;
    font-size: 14px;
    line-height: 1.45;
}

.cv-paper-section p {
    margin: 0;
}

.cv-paper-section ul {
    margin: 0;
    padding-left: 18px;
}

.cv-paper-section li {
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.cv-editor {
    position: sticky;
    top: 98px;
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 22px;
    background: #fff;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.cv-editor h2 {
    margin: 0 0 8px;
    color: #111;
    font-size: 22px;
}

.cv-editor p {
    margin: 0 0 16px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.cv-editor label {
    display: block;
    margin: 14px 0 6px;
    color: #222;
    font-weight: 700;
    font-size: 14px;
}

.cv-editor input,
.cv-editor textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    font: 14px/1.5 Arial, sans-serif;
}

.cv-editor textarea {
    resize: vertical;
}

.cv-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.cv-editor-actions button {
    flex: 1;
    min-height: 42px;
    border: 1px solid #111;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.cv-editor-actions button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

@media (max-width: 980px) {
    .cv-workspace {
        grid-template-columns: 1fr;
    }

    .cv-editor {
        position: static;
        max-height: none;
        order: -1;
    }
}

@media (max-width: 640px) {
    .cv-toolbar {
        flex-direction: column;
    }

    .cv-sheet {
        padding: 26px 18px;
        min-height: auto;
    }

    .cv-paper-header {
        grid-template-columns: 1fr;
    }

    .cv-photo {
        width: 104px;
        height: 116px;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    background-color: #000;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #333;
}

footer {
    text-align: center;
    padding: 20px;
}

.live-chat {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;
}

.live-chat__toggle {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.live-chat__toggle:hover {
    transform: scale(1.05);
    background: #1d4ed8;
    box-shadow: 0 20px 38px rgba(29, 78, 216, 0.28);
}

.live-chat__toggle:focus-visible,
.live-chat__save-name:focus-visible,
.live-chat__send:focus-visible,
.live-chat__input:focus-visible,
.live-chat__name-input:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.3);
    outline-offset: 3px;
}

.live-chat__panel {
    position: absolute;
    right: 82px;
    top: 50%;
    transform: translateY(-50%);
    width: min(340px, calc(100vw - 32px));
    background: #fff;
    border: 1px solid #d8deea;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.live-chat.is-open .live-chat__panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.live-chat__header {
    padding: 16px 18px;
    background: #111827;
    color: #fff;
}

.live-chat__header h2 {
    margin: 0;
    font-size: 18px;
}

.live-chat__header p {
    margin: 6px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.live-chat__profile {
    padding: 14px 14px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.live-chat__label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.live-chat__profile-row {
    display: flex;
    gap: 10px;
}

.live-chat__name-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
    background: #fff;
}

.live-chat__save-name {
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.live-chat__save-name:hover {
    background: #1d4ed8;
}

.live-chat__saved-name {
    margin: 14px 14px 10px;
    padding: 11px 14px;
    border-radius: 14px;
    background: #e0f2fe;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #bae6fd;
}

.live-chat__messages {
    height: 320px;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.live-chat__message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
}

.live-chat__message-row--user {
    justify-content: flex-end;
}

.live-chat__message-row--user .live-chat__avatar {
    order: 2;
}

.live-chat__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    font-size: 13px;
    font-weight: 700;
}

.live-chat__avatar--bot {
    background: #dbeafe;
    color: #1d4ed8;
}

.live-chat__avatar--user {
    background: #111827;
    color: #fff;
}

.live-chat__message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    line-height: 1.5;
    font-size: 14px;
    word-break: break-word;
}

.live-chat__message--bot {
    background: #fff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-top-left-radius: 6px;
}

.live-chat__message--user {
    margin-left: auto;
    background: #1d4ed8;
    color: #fff;
    border-top-right-radius: 6px;
}

.live-chat__form {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.live-chat__form--stack {
    flex-direction: column;
}

.live-chat__input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 12px 14px;
    font-size: 14px;
}

.live-chat__textarea {
    min-height: 92px;
    resize: vertical;
    border-radius: 16px;
    font-family: Arial, sans-serif;
}

.live-chat__send {
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    background: #111827;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.live-chat__send:hover {
    background: #1d4ed8;
}

.live-chat__send:disabled,
.live-chat__input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .live-chat {
        right: 16px;
        top: auto;
        bottom: 20px;
        transform: none;
    }

    .live-chat__panel {
        right: 0;
        top: auto;
        bottom: 78px;
        transform: translateY(12px);
        width: min(340px, calc(100vw - 24px));
    }

    .live-chat.is-open .live-chat__panel {
        transform: translateY(0);
    }
}

/* Responsive polish for the static Hostinger upload. */
* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    color: #111827;
    text-rendering: optimizeLegibility;
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

iframe,
embed,
object {
    max-width: 100%;
}

input,
textarea,
select,
button {
    font: inherit;
}

header {
    align-items: center;
    gap: 18px;
    padding: 18px clamp(16px, 4vw, 36px);
}

header .logo {
    flex: 0 1 auto;
    min-width: 0;
    font-size: clamp(20px, 3vw, 24px);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

header nav ul {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
    max-width: 100%;
}

header nav ul li {
    margin: 0;
}

.hero {
    gap: clamp(24px, 5vw, 64px);
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: clamp(34px, 7vw, 70px) clamp(18px, 5vw, 50px);
    text-align: left;
}

.bio h1 {
    margin: 0 0 12px;
    font-size: clamp(34px, 7vw, 72px);
    line-height: 0.98;
}

.bio p {
    margin: 0 0 18px;
    color: #374151;
    font-size: clamp(16px, 2.2vw, 20px);
    line-height: 1.65;
}

.hero img {
    width: min(42vw, 420px);
    max-width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 8px;
}

.latest-work {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: clamp(30px, 6vw, 54px) clamp(18px, 5vw, 40px);
}

.work-item {
    max-width: 100%;
    vertical-align: top;
    overflow-wrap: anywhere;
}

#contact-form {
    width: min(560px, 100%);
    text-align: left;
}

.post-article,
.references-section,
.portfolio-main,
.cv-sheet,
.research-card,
.research-panel,
.research-link-card,
.conference-link {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    body {
        padding-top: 116px;
    }

    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 14px 16px;
    }

    header nav ul {
        justify-content: center;
        gap: 9px 14px;
    }

    header nav a {
        display: inline-flex;
        min-height: 32px;
        align-items: center;
    }

    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero img {
        width: min(76vw, 340px);
        order: -1;
    }

    .research-shell,
    .research-output {
        grid-template-columns: 1fr !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .research-menu {
        position: static !important;
    }

    .blog-layout {
        padding: 28px 16px;
    }

    .post-sidebar {
        flex-basis: 100%;
    }

    .references-section {
        max-height: none;
    }
}

@media (max-width: 640px) {
    body {
        padding-top: 142px;
    }

    header .logo,
    header nav {
        width: 100%;
    }

    header nav ul {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    header nav a {
        justify-content: center;
        padding: 6px 4px;
        font-size: 14px;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
        padding: 0 14px;
    }

    .hero,
    .blog-layout,
    .project-page,
    .portfolio-page,
    .research-shell,
    .research-output {
        width: 100%;
    }

    .latest-work {
        display: grid;
        gap: 12px;
    }

    .work-item {
        display: block;
        width: 100%;
        margin: 0;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .post-article p,
    .post-article ul,
    .grid-caption p {
        text-align: left;
    }
}
