/* Single source for landing and presentation header/footer styling. */
@font-face{font-family:ChromeGolos;src:url('css/fonts/golos-text_regular.ttf');font-weight:400;font-display:swap;}
@font-face{font-family:ChromeGolos;src:url('css/fonts/golos-text_bold.ttf');font-weight:700;font-display:swap;}
@font-face{font-family:ChromeLogo;src:url('css/fonts/logo.ttf');font-display:swap;}
#shared-header,#footer{--black:#000;--white:#fff;--text-color-dark:#111;--secondary-color-1:#ffa500;--secondary-color-4:#8b357c;font-family:ChromeGolos,sans-serif;box-sizing:border-box;}
#shared-header *,#footer *{box-sizing:border-box;}
#shared-header {
    background-color: var(--black);
    color: var(--white);
    padding: 10px;
    display: flex;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    z-index: 1000;
}

#shared-header .header-container {
    max-width: 1000px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#shared-header nav {
    background-color: var(--black);
    overflow: hidden;
}

#shared-header nav a {
    font-size: 18px;
    float: left;
    display: block;
    color: var(--white);
    text-align: right;
    padding: 14px 16px;
    text-decoration: none;
}

#shared-header nav a:hover {
    color: var(--secondary-color-1);
}

#shared-header .dropdown {
    float: left;
    overflow: hidden;
}

#shared-header .dropdown .dropbtn {
    font-size: 18px;
    border: none;
    outline: none;
    color: var(--white);
    padding: 14px 16px;
    background-color: inherit;
    font-family: inherit;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

#shared-header nav a:hover, #shared-header .dropdown:hover .dropbtn {
    color: var(--secondary-color-1);
}

#shared-header .dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 260px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 8px;
    top: 50px;
    padding: 10px 0;
}

#shared-header .dropdown:hover .dropdown-content {
    display: flex;
    flex-direction: column;
}

#shared-header .dropdown-content .dropdown-item {
    display: flex;
    align-items: center;
    float: none;
    color: var(--text-color-dark);
    padding: 12px 16px;
    text-decoration: none;
    text-align: left;
    transition: background-color 0.2s;
}

#shared-header .dropdown-content .dropdown-item:hover {
    background-color: #f1f1f1;
    color: var(--secondary-color-4);
}

#shared-header .dropdown-text {
    display: flex;
    flex-direction: column;
}

#shared-header .dropdown-title {
    font-weight: bold;
    font-size: 16px;
    line-height: 1.2;
    font-family: golosbold;
}

#shared-header .dropdown-desc {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    line-height: 1.2;
}

#shared-header #logo {font-family:ChromeLogo;font-size:28px;font-weight:100;cursor:pointer;text-decoration:none;color:#fff;white-space:nowrap;}
#shared-header .logo-hash{font-size:24px;padding-right:2px;}
#shared-header .dropdown-title{font-family:ChromeGolos;font-weight:700;}
#shared-header .nav-toggle { display: none; }
#shared-header .nav-toggle[hidden], #shared-header nav[hidden] { display: none; }
#shared-header .nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#shared-header .nav-toggle-icon,
#shared-header .nav-toggle-icon::before,
#shared-header .nav-toggle-icon::after {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
}
#shared-header .nav-toggle-icon { position: relative; }
#shared-header .nav-toggle-icon::before,
#shared-header .nav-toggle-icon::after { content: ''; position: absolute; left: 0; }
#shared-header .nav-toggle-icon::before { top: -7px; }
#shared-header .nav-toggle-icon::after { top: 7px; }
#shared-header[data-nav-open] .nav-toggle-icon { background: transparent; }
#shared-header[data-nav-open] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
#shared-header[data-nav-open] .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 900px) {
    /* Keep header and title in the same document flow in mobile WebViews. */
    #shared-header { position: relative; top: auto; height: auto; min-height: 60px; padding: 8px 10px; flex-shrink: 0; }
    #shared-header .header-container { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    #shared-header #logo { display: block; margin: 0; justify-self: start; }
    #shared-header .nav-toggle {
        display: flex;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: #fff;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    #shared-header .nav-toggle[hidden] { display: none; }
    #shared-header nav { display: none; grid-column: 1 / -1; width: 100%; min-width: 0; margin-top: 8px; border-top: 1px solid #ffffff38; }
    #shared-header[data-nav-open] nav { display: block; }
    #shared-header nav a, #shared-header .dropdown { display: block; float: none; width: 100%; text-align: right; }
    #shared-header nav a { padding: 12px 14px; overflow-wrap: anywhere; }
    #shared-header .dropdown .dropbtn { padding: 12px 14px; text-align: right; width: 100%; }
    #shared-header .dropdown-content {
        display: flex;
        flex-direction: column;
        position: static;
        min-width: 0;
        width: 100%;
        padding: 4px 0;
        border-radius: 6px;
        box-shadow: none;
    }
    #shared-header .dropdown-content .dropdown-item { padding: 12px 14px; justify-content: flex-end; text-align: right; }
    #presentation-root { padding-top: 0; }
}

#footer {
    background-color: var(--black);
    color: var(--text-color-light);
    text-align: center;
    width: 100%;
    height: auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

#footer .footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

#footer .footer-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Blog Link Styles */
#footer .link-blog {
    color: var(--telegram-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

#footer .link-blog:hover {
    opacity: 0.8;
}

#footer .link-blog svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

#footer .footer-bottom {
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding: 20px 0;
    margin-top: 0;
}

#footer .footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 0 50px;
    text-align: left;
}

#footer .footer-col {
    display: flex;
    flex-direction: column;
}

#footer .footer-container_text {
    font-size: 13px !important;
    color: #515151;
    margin: 0.25rem 0;
}

@media screen and (max-width: 768px) {
    #footer .footer-grid {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    #footer .footer-item {
        align-items: center;
    }

    #footer .footer-item .text-left {
        text-align: center;
    }

    #footer .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 20px;
        gap: 20px;
    }
}


#footer { --black:#000; --text-color-light:#f1f1f1; --telegram-color:#2AABEE; }
#footer .general-footer {max-width:1000px;width:100%;margin:0 auto;display:flex;flex-direction:column;padding:50px;text-align:left;gap:16px;}
#footer .text-s {font-size:18px;} #footer .text-m {font-size:28px;}
#footer .bold {font-weight:700;font-family:ChromeGolos,sans-serif;}
#footer .lspace {letter-spacing:1px;} #footer .light {color:var(--text-color-light);}
#footer .mg0 {margin-top:0;} #footer .mg20 {margin-top:20px;} #footer .text-left {text-align:left;}
#footer .link-email {color:rgb(255,145,0);text-decoration:none;}
@media(max-width:768px){#footer .general-footer{padding:18px;} #footer .footer-item .text-left{text-align:center;}}

/* Optional shared page title. Text is provided by each page. */
        body.site-title-page {
            margin: 0;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background: #0b0d3c;
            color: #fff;
            font-family: ChromeGolos, sans-serif;
            line-height: 1.5;
        }
        .site-title {
            box-sizing: border-box;
            flex: 1;
            display: flex;
            align-items: center;
            min-height: 520px;
            padding: 140px 28px 100px;
            position: relative; isolation: isolate; overflow: hidden; color: #fff; background: linear-gradient(140deg, #0b0d3c, #511d60);
        }
        .site-title-inner { width: 100%; max-width: 1000px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
        .site-title h1 {
            margin: 0;
            font-size: clamp(36px, 5.5vw, 64px);
            line-height: 1.15;
            letter-spacing: -0.03em;
            overflow-wrap: anywhere;
        }
        .site-title .site-title-subtitle { display: block; margin-top: 18px; color: #f6c96a; }
        .site-title-page .chrome-error { margin: 0; padding: 20px 28px; }
        .site-title-page .chrome-error a { color: #f6c96a; }
        @media (max-width: 600px) {
            .site-title { min-height: 380px; padding: 112px 20px 64px; }
            .site-title h1 { font-size: clamp(32px, 9vw, 44px); }
        }

/* Presentation template backdrop: perspective grid and violet glow. */
        .site-title::before { content: ''; position: absolute; z-index: -1; inset: 28% -25% -60%; opacity: .28; background-image: linear-gradient(#57c1e888 1px, transparent 1px), linear-gradient(90deg, #57c1e888 1px, transparent 1px); background-size: 70px 70px; transform: perspective(500px) rotateX(48deg); mask-image: linear-gradient(transparent, #000); -webkit-mask-image: linear-gradient(transparent, #000); pointer-events: none; }
        .site-title::after { content: ''; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse at 90% 100%, #8b357c55, transparent 65%); pointer-events: none; }

/* The MIPT alumni mark belongs to the shared title template. */
.site-title h1 { flex: 1 1 auto; min-width: 0; }
.site-title-badge { display: grid; place-items: center; flex: 0 0 260px; min-height: 150px; }
.site-title-badge img { display: block; width: 206px; height: auto; transform: rotate(-20deg); }
@media (max-width: 900px) {
    .site-title-inner { flex-direction: row; align-items: center; gap: clamp(12px, 3vw, 24px); }
    .site-title-badge { flex: 0 0 clamp(80px, 24vw, 240px); min-width: 0; min-height: 0; aspect-ratio: 240 / 150; }
    .site-title-badge img { width: 85.833333%; }
}
/* The mobile header now provides the 60px previously reserved inside the title. */
@media (min-width: 601px) and (max-width: 900px) {
    .site-title { min-height: 460px; padding-top: 80px; }
}
@media (max-width: 600px) {
    .site-title { min-height: 320px; padding-top: 52px; }
}
