/* ================================================================
   Blue palette
   ================================================================ */

:root {
    color-scheme: light;
    --color-primary: #245f87;
    --color-accent: #64acd4;
    --color-section: #d9eaf5;
    --color-subtle-background: #f1f6fa;
    --color-border: #d8e3eb;
    --color-text: #172631;
    --color-white: #ffffff;
}

/* ================================================================
   Base styles and keyboard access
   ================================================================ */

* {
    box-sizing: border-box;
}

html {
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-white);
    scrollbar-gutter: stable;
}

body {
    display: flex;
    flex-direction: column;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--color-primary);
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    z-index: 10;
    top: 8px;
    left: 16px;
    padding: 8px 14px;
    color: var(--color-primary);
    background: var(--color-white);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* ================================================================
   Name and main navigation
   ================================================================ */

.site-header {
    z-index: 1;
    border-bottom: 4px solid var(--color-accent);
    color: var(--color-white);
    background: var(--color-primary);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    min-height: 72px;
    padding: 12px 32px;
}

.site-name {
    flex-shrink: 0;
    color: inherit;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-decoration: none;
}

.site-navigation {
    margin-left: auto;
}

.site-navigation ul {
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.navigation-item {
    display: block;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1.4;
    text-decoration: none;
}

a.navigation-item:hover {
    border-bottom-color: var(--color-accent);
}

.navigation-item[aria-current="page"] {
    border-bottom-color: var(--color-white);
    font-weight: 700;
}

/* ================================================================
   Responsive photographic banner
   ================================================================ */

.header-image {
    height: clamp(20rem, 28vw, 30rem);
    overflow: hidden;
    background: var(--color-subtle-background);
}

.header-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 48% 62%;
}

/* ================================================================
   Profile and readable biography column
   ================================================================ */

.profile-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 76px;
}

.profile-column {
    position: relative;
    margin-top: -96px;
}

.profile-photo {
    display: block;
    width: 210px;
    height: 210px;
    border: 5px solid var(--color-white);
    object-fit: cover;
    object-position: center;
}

.profile-description {
    margin: 22px 5px 0;
    color: var(--color-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.6;
}

.profile-place {
    margin: 14px 5px 0;
    font-size: 0.875rem;
}

.biography {
    min-width: 0;
    padding-top: 50px;
}

.biography h1 {
    margin: 0 0 24px;
    color: var(--color-primary);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.biography p {
    margin: 0 0 24px;
    font-size: 1rem;
    line-height: 1.75;
}

.biography p:last-child {
    margin-bottom: 0;
}

/* ================================================================
   Footer
   ================================================================ */

.site-footer {
    margin-top: auto;
    padding: 22px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-subtle-background);
    text-align: center;
}

.site-footer p {
    margin: 0;
    font-size: 0.875rem;
}

/* ================================================================
   Tablet and phone layouts
   ================================================================ */

@media (max-width: 1000px) {
    .header-inner {
        gap: 20px;
        padding-right: 24px;
        padding-left: 24px;
    }

    .site-navigation ul {
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 20px 8px;
    }

    .site-name {
        font-size: 1.25rem;
    }

    .site-navigation {
        width: 100%;
        margin-left: 0;
    }

    .site-navigation ul {
        justify-content: space-between;
        gap: 8px;
    }

    .navigation-item {
        padding: 10px 0;
        font-size: 0.875rem;
    }

    .header-image {
        height: 240px;
    }

    .profile-layout {
        display: block;
        padding-right: 24px;
        padding-bottom: 48px;
        padding-left: 24px;
    }

    .profile-column {
        margin-top: -50px;
        text-align: center;
    }

    .profile-photo {
        width: 240px;
        height: 240px;
        margin: 0 auto;
    }

    .profile-description {
        max-width: 240px;
        margin: 14px auto 0;
    }

    .profile-place {
        margin-top: 8px;
    }

    .biography {
        padding-top: 36px;
    }

    .biography h1 {
        margin-bottom: 22px;
        font-size: 2rem;
    }
}

@media (max-width: 359px) {
    .header-inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    .site-name {
        font-size: 1.125rem;
    }
}

/* ================================================================
   Language-selection entrance
   ================================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.language-selection {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 24px 72px;
}

.language-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 16px;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    color: var(--color-primary);
    background: var(--color-white);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.language-option:hover {
    background: var(--color-section);
}

/* ================================================================
   Opposite-language link and translated page introduction
   ================================================================ */

.language-switch {
    flex-shrink: 0;
    margin-left: 8px;
    padding: 10px 0;
    color: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    text-underline-offset: 4px;
}

.language-switch:hover {
    text-decoration-thickness: 2px;
}

.biography .page-introduction {
    font-size: 1.125rem;
    line-height: 1.65;
}

@media (max-width: 1000px) {
    .header-inner {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px 20px;
    }

    .site-navigation {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .site-navigation ul {
        justify-content: space-between;
    }

    .language-switch {
        margin-left: auto;
    }
}

@media (max-width: 767px) {
    .language-selection {
        padding-top: 36px;
        padding-bottom: 48px;
    }

    .language-options {
        gap: 16px;
    }

    .language-option {
        padding-right: 10px;
        padding-left: 10px;
        font-size: 1rem;
    }

    .site-navigation ul {
        gap: 8px;
    }
}

@media (max-width: 359px) {
    .site-navigation ul {
        flex-wrap: wrap;
        justify-content: flex-start;
        column-gap: 18px;
    }

    .language-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
