* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    margin: 32px auto;
    max-width: 860px;
    line-height: 1.65;
    padding: 0 24px;
    color: #202020;
    background: #fff;
    text-align: left;
    overflow-wrap: break-word;
}

h1,
h2 {
    color: #333;
    line-height: 1.25;
}

h1 {
    font-size: 2rem;
    margin: 0 0 16px;
}

h2 {
    font-size: 1.45rem;
    margin: 0 0 16px;
}

p {
    margin: 0 0 18px;
}

a {
    color: #8B0000;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-thickness: 2px;
}

a:focus-visible,
video:focus-visible {
    outline: 2px solid #8B0000;
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    padding: 8px 12px;
    background: #fff;
    z-index: 1;
}

.skip-link:focus {
    top: 8px;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    padding-bottom: 20px;
    margin-bottom: 28px;
    border-bottom: 1px solid #e7e7e7;
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
}

nav a:hover,
nav a[aria-current="page"] {
    background: #f7eeee;
}

.container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
    gap: 28px;
    margin-bottom: 32px;
}

.text {
    min-width: 0;
}

.photo img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.profile-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 7px 12px;
    border: 1px solid #d6b9b9;
    border-radius: 5px;
    font-size: 0.95rem;
    text-decoration: none;
}

.profile-actions a:hover {
    background: #f7eeee;
}

.section {
    margin-bottom: 32px;
}

.page-illustration {
    display: block;
    max-width: 480px;
    margin: 0 auto 28px;
}

.page-illustration--write {
    max-width: 400px;
}

.page-illustration img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-illustration--speak img {
    aspect-ratio: 3 / 1;
    object-fit: cover;
}

ul {
    padding-left: 22px;
}

.paper,
.conference,
.talk {
    margin-bottom: 20px;
    padding-left: 2px;
}

.paper-title,
.conference-title {
    font-weight: bold;
}

.paper-title a,
.conference-title a {
    text-decoration: none;
}

.paper-title a:hover,
.conference-title a:hover {
    text-decoration: underline;
}

.paper-authors {
    font-style: italic;
}

.gallery {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
    align-items: start;
    gap: 24px;
}

.gallery figure {
    margin: 0;
    min-width: 0;
    text-align: center;
}

.video {
    width: 100%;
    max-width: 280px;
    justify-self: center;
}

.video video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    background: #111;
    border-radius: 10px;
}

.gallery figcaption {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #444;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
    min-width: 0;
}

.image-grid img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.problem-list li {
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    body {
        margin: 16px auto;
        padding: 0 20px;
    }

    nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-bottom: 16px;
        margin-bottom: 24px;
    }

    h1 {
        font-size: 1.85rem;
    }

    .container {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        margin-bottom: 28px;
    }

    .photo {
        width: 180px;
        justify-self: center;
    }

    .programming-page .photo {
        width: 150px;
    }

    .gallery,
    .image-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .video {
        max-width: 240px;
    }
}
