:root {
    --white: #FFFFFF;
    --dark: #0D0D0D;
    --blue: #589BD4;
    --lavender: #A5A6F6;
    --red: #EB5757;
    --green: #10CF75;
    --yellow: #FFDA44;
    --card-shadow: #E6F0F9;
}

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

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0 auto;
    color: var(--dark);
    background-color: var(--white);
    font-family: "Montserrat", sans-serif;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

button {
    font: inherit;
}

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

::selection {
    color: var(--white);
    background-color: var(--blue);
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 12px 18px;
    color: var(--white);
    background-color: var(--dark);
    border-radius: 50px;
    text-decoration: none;
    transform: translateY(-160%);
}

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

/* Header: the same 12-column composition as BetaBeam. */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    background-color: var(--white);
}

.div_header {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    width: calc(100% - 40px);
    max-width: 1200px;
    height: 100px;
    margin: 0 auto;
    padding: 20px 0;
    align-items: center;
    gap: 20px;
}

.nav {
    display: none;
}

.nav.is-open {
    position: fixed;
    top: 100px;
    left: max(20px, calc((100vw - 1200px) / 2));
    z-index: 50;
    display: grid;
    width: min(430px, calc(100vw - 40px));
    max-height: calc(100vh - 120px);
    padding: 35px;
    gap: 50px;
    color: var(--white);
    background-color: var(--lavender);
    border-radius: 25px;
    overflow-y: auto;
    animation: burgerAnimation 0.4s ease;
}

.div_ul,
.nav_contacts,
.div_nav_info {
    display: grid;
}

.div_ul {
    gap: 15px;
}

.nav_contacts {
    gap: 25px;
}

.div_nav_info {
    gap: 4px;
    font-size: 12px;
    font-weight: 300;
}

.div_nav_info p {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.ul {
    color: var(--white);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
    text-decoration: none;
}

.ul:hover,
.ul.is-active {
    color: var(--dark);
}

.nav_project_link {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.nav_project_link:hover {
    color: var(--dark);
}

.div_burger {
    display: flex;
    grid-column: 1 / 2;
    width: 50px;
    height: 35px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    background-color: transparent;
    cursor: pointer;
}

.burger {
    position: relative;
    display: flex;
    width: 100%;
    height: 24px;
    align-items: center;
}

.burger i,
.burger::before,
.burger::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    content: "";
    background-color: var(--dark);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.burger::before {
    top: 0;
}

.burger::after {
    bottom: 0;
}

.burger i {
    top: 50%;
    transform: translateY(-50%);
}

.div_burger:hover .burger i,
.div_burger:hover .burger::before,
.div_burger:hover .burger::after {
    height: 5px;
    background-color: var(--lavender);
}

.div_burger[aria-expanded="true"] .burger i {
    transform: translateY(-50%) scale(0);
}

.div_burger[aria-expanded="true"] .burger::before {
    top: 50%;
    background-color: var(--red);
    transform: rotate(-45deg) translateY(-50%);
}

.div_burger[aria-expanded="true"] .burger::after {
    bottom: 50%;
    background-color: var(--red);
    transform: rotate(45deg) translateY(50%);
}

.logo {
    display: grid;
    grid-column: 2 / 12;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: auto;
    height: auto;
    max-width: 60px;
    max-height: 60px;
    object-fit: contain;
}

.messengers {
    display: flex;
    grid-column: 12 / 13;
    justify-content: center;
    align-items: center;
}

.header-community {
    display: flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background-color: var(--blue);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.header-community:hover,
.header-community:active {
    background-color: var(--lavender);
}

.header-community:active {
    transform: translateY(4px);
}

@keyframes burgerAnimation {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Main BetaBeam grid. */
.grid-container {
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 0;
}

.main,
.project-section {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    width: 100%;
    align-items: center;
}

.main {
    padding: 160px 0 75px;
    gap: 25px;
}

.div-logo-main {
    display: grid;
    grid-column: 1 / 7;
    width: 100%;
    place-items: center;
}

.logo-main {
    width: auto;
    height: auto;
    max-width: 460px;
    max-height: 520px;
    object-fit: contain;
    justify-self: center;
}

.main-text {
    display: grid;
    grid-column: 7 / 13;
    gap: 22px;
}

.main-label,
.section-label,
.card-index,
.main-meta,
.main_text_1,
.main_text_2,
.card-title,
.card-text,
.result-card p,
.result-note h3,
.result-note p {
    margin: 0;
}

.main-label,
.section-label,
.card-index {
    color: var(--blue);
    font-size: 16px;
    font-weight: 600;
}

.main_text_1 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.12;
}

#main-title {
    font-size: 48px;
    font-weight: 900;
}

.main_text_2 {
    font-size: 28px;
    font-weight: 400;
    line-height: 1.35;
}

.main-meta {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.62;
}

.main-actions {
    display: flex;
    margin-top: 3px;
    gap: 15px;
}

.main_btn {
    display: flex;
    width: 100%;
    padding: 15px 25px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50px;
    color: var(--white);
    background-color: var(--blue);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.main_btn_secondary {
    background-color: var(--lavender);
}

.main_btn:hover,
.main_btn:active {
    background-color: var(--lavender);
}

.main_btn:active {
    transform: translateY(4px);
}

/* The information order follows the project data; all components remain BetaBeam. */
.project-section {
    position: relative;
    padding: 75px 0;
    margin: 0;
    gap: 50px;
}

.section-heading {
    display: grid;
    grid-column: 1 / 8;
    gap: 20px;
}

.section-heading-wide {
    grid-column: 1 / 9;
}

.cards {
    display: grid;
    grid-column: 1 / 13;
    width: 100%;
    gap: 25px;
    align-items: start;
}

.cards-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.about-cards,
.program-cards,
.research-cards {
    margin-top: 0;
}

.card {
    display: flex;
    min-width: 0;
    padding: 25px;
    flex-direction: column;
    gap: 25px;
    background-color: var(--white);
    border-radius: 25px;
    box-shadow: 0 0 10px var(--card-shadow);
    align-self: start;
}

.card-title {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.12;
}

.card-text,
.result-card p {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
}

.lesson-list {
    display: grid;
    margin: 0;
    padding: 0 0 0 22px;
    gap: 22px;
}

.lesson-list li {
    padding-left: 5px;
    font-size: 16px;
}

.lesson-list strong,
.lesson-list span {
    display: block;
}

.lesson-list strong {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
}

.lesson-list span {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.45;
}

.anchor-alias {
    position: absolute;
    top: 0;
}

.section-btn {
    width: fit-content;
    margin-top: 5px;
    font-size: 20px;
}

.research-summary {
    display: grid;
    grid-column: 9 / 13;
    gap: 10px;
}

.research-summary strong {
    color: var(--blue);
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
}

.research-summary span {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.result-card strong {
    color: var(--blue);
    font-size: 32px;
    font-weight: 600;
}

.result-note {
    display: grid;
    grid-column: 1 / 9;
    padding-top: 25px;
    gap: 12px;
    border-top: 3px solid var(--blue);
}

.result-note h3 {
    font-size: 28px;
    font-weight: 600;
}

.result-note p {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.55;
}

.error-page {
    display: grid;
    width: calc(100% - 40px);
    max-width: 1200px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 150px 0 100px;
    align-content: center;
    justify-items: start;
    gap: 20px;
}

.error-code {
    color: var(--blue);
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
}

.error-page .main_text_2 {
    max-width: 700px;
}

.error-route code {
    color: var(--dark);
    font-family: "Montserrat", sans-serif;
    font-size: inherit;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.error-actions {
    width: min(100%, 620px);
}

/* Footer copied from the BetaBeam grid and palette. */
.div_footer {
    background-color: var(--dark);
}

footer {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px;
    align-items: start;
    gap: 40px;
    color: var(--white);
}

.div_info,
.footer_partners {
    display: grid;
    gap: 6px;
}

.div_info {
    grid-column: 1 / 6;
}

.footer_partners {
    grid-column: 6 / 10;
}

.footer_action {
    display: flex;
    grid-column: 10 / 13;
    justify-content: flex-end;
}

footer p {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

footer span {
    font-size: 12px;
    font-weight: 300;
}

.footer_link {
    display: flex;
    padding: 12px 22px;
    align-items: center;
    justify-content: center;
    color: var(--white);
    background-color: var(--blue);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.footer_link:hover,
.footer_link:active {
    background-color: var(--lavender);
}

.footer_link:active {
    transform: translateY(4px);
}

@media (max-width: 1100px) {
    .cards-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .div_header {
        width: calc(100% - 50px);
    }

    .main {
        padding: 140px 0 75px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 25px;
    }

    .div-logo-main {
        width: 100%;
    }

    .logo-main {
        width: min(100%, 430px);
        max-height: none;
        justify-self: center;
    }

    .main-text {
        width: 100%;
        gap: 18px;
    }

    #main-title,
    .main_text_1 {
        font-size: 32px;
    }

    .main_text_2 {
        font-size: 24px;
    }

    .main_btn {
        font-size: 22px;
    }

    .project-section {
        gap: 35px;
    }

    .section-heading,
    .section-heading-wide {
        grid-column: 1 / 9;
    }

    .cards-three {
        grid-template-columns: 1fr;
    }

    .result-note {
        grid-column: 1 / 13;
    }
}

@media (max-width: 720px) {
    html {
        scroll-padding-top: 100px;
    }

    .div_header {
        width: calc(100% - 30px);
        height: 90px;
        gap: 10px;
    }

    .nav.is-open {
        top: 90px;
        left: 15px;
        width: calc(100vw - 30px);
        max-height: calc(100vh - 105px);
        padding: 30px;
    }

    .div_burger {
        width: 40px;
    }

    .logo-img {
        width: auto;
        height: auto;
        max-width: 50px;
        max-height: 50px;
    }

    .header-community {
        width: 50px;
        height: 50px;
    }

    .header-community {
        font-size: 13px;
    }

    .grid-container {
        width: calc(100% - 30px);
    }

    .error-page {
        width: calc(100% - 30px);
    }

    .main {
        padding: 120px 0 60px;
    }

    .logo-main {
        width: min(100%, 320px);
    }

    .main-label,
    .section-label,
    .card-index,
    .main-meta {
        font-size: 14px;
    }

    #main-title,
    .main_text_1 {
        font-size: 30px;
    }

    .main_text_2 {
        font-size: 20px;
    }

    .main-actions {
        flex-direction: column;
    }

    .main_btn {
        font-size: 20px;
    }

    .project-section {
        display: flex;
        padding: 60px 0;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 25px;
    }

    .cards-four {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 25px;
        border-radius: 25px;
    }

    .card-title,
    .result-note h3 {
        font-size: 24px;
    }

    .research-summary strong {
        font-size: 56px;
    }

    footer {
        padding: 80px 20px;
        gap: 35px;
    }

    .div_info,
    .footer_partners,
    .footer_action {
        grid-column: 1 / 13;
    }

    .footer_action {
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .ul {
        font-size: 23px;
    }

    .nav.is-open {
        gap: 35px;
    }

    .logo-main {
        width: min(100%, 260px);
    }

    #main-title,
    .main_text_1 {
        font-size: 28px;
    }

    .main_text_2 {
        font-size: 18px;
    }

    .card { padding: 25px; border-radius: 25px; }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
