:root {
    --bg-1: #ecf3ff;
    --bg-2: #ffe8d6;
    --text: #142643;
    --muted: #4d6586;
    --accent: #2f66cc;
    --accent-2: #f18423;
    --panel: rgba(255, 255, 255, 0.94);
    --border: rgba(38, 83, 150, 0.18);
    --shadow: 0 20px 45px rgba(30, 72, 145, 0.14);
    --section-gap: clamp(1rem, 2.2vw, 1.6rem);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(180% 160% at 10% 10%, var(--bg-1), var(--bg-2));
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    letter-spacing: 0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

main.container {
    padding-top: clamp(0.8rem, 1.8vw, 1.3rem);
}

main.container > * {
    margin-top: 0;
    margin-bottom: 0;
}

main.container > * + * {
    margin-top: var(--section-gap);
}

.bg-orb {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(18px);
}

.orb-a {
    width: 340px;
    height: 340px;
    top: -90px;
    right: -70px;
    background: rgba(47, 102, 204, 0.22);
}

.orb-b {
    width: 300px;
    height: 300px;
    left: -90px;
    bottom: -50px;
    background: rgba(241, 132, 35, 0.24);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(238, 245, 255, 0.9);
    border-bottom: 1px solid var(--border);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.62rem;
}

.brand-mark {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(33, 84, 160, 0.28));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    max-width: min(54vw, 470px);
}

.brand-top {
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.08em;
}

.brand-bottom {
    font-size: 1rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 0.4rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid transparent;
    transition: 140ms ease;
}

.nav-links a:hover {
    background: rgba(47, 102, 204, 0.1);
    border-color: var(--border);
    transform: translateY(-1px);
}

.lang-switch {
    display: flex;
    gap: 0.35rem;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.auth-user {
    font-size: 0.8rem;
    color: var(--muted);
}

.auth-link {
    font-size: 0.78rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    background: #f8fbff;
}

.auth-link:hover {
    background: rgba(47, 102, 204, 0.1);
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-size: 0.75rem;
    padding: 0.32rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
}

.lang-flag {
    display: inline-block;
    position: relative;
    overflow: hidden;
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(20, 38, 67, 0.25);
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.35);
}

.lang-pill-ru .lang-flag {
    background: linear-gradient(
        to bottom,
        #ffffff 0 33%,
        #2e63c5 33% 66%,
        #d52b1e 66% 100%
    );
}

.lang-pill-uk .lang-flag {
    background: linear-gradient(to bottom, #0057b7 0 50%, #ffd700 50% 100%);
}

.lang-pill-en .lang-flag {
    background: url("/static/img/flags/us.svg") center / cover no-repeat;
}

.lang-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

.hero {
    background: linear-gradient(135deg, rgba(46, 97, 197, 0.94), rgba(238, 126, 31, 0.9));
    color: #fff;
    padding: 2rem;
    border-radius: 1.2rem;
    box-shadow: var(--shadow);
    display: grid;
    gap: 1.1rem;
    align-items: center;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.hero.small {
    display: block;
    padding: 1.4rem 1.6rem;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.76rem;
    opacity: 0.9;
}

.hero h1 {
    margin: 0.6rem 0;
    font-size: clamp(1.6rem, 4.5vw, 2.9rem);
    line-height: 1.12;
}

.hero-copy {
    margin: 0;
    max-width: 60ch;
    opacity: 0.95;
}

.hero-photo-wrap {
    margin: 0;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 12px 28px rgba(17, 37, 74, 0.28);
}

.hero-photo {
    display: block;
    width: 100%;
    height: clamp(220px, 33vw, 360px);
    object-fit: cover;
    object-position: center;
}

.grid-two {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.panel h2 {
    margin-top: 0;
}

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

.auth-panel {
    max-width: 560px;
    margin-inline: auto;
}

.auth-form {
    display: grid;
    gap: 0.55rem;
}

.auth-form label {
    font-weight: 700;
    font-size: 0.86rem;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.58rem 0.68rem;
    background: #fbfdff;
    color: var(--text);
}

.auth-form .btn {
    margin-top: 0.4rem;
    border: 0;
    cursor: pointer;
}

.form-error {
    margin-top: 0;
    color: #8f2a22;
    background: rgba(201, 95, 64, 0.14);
    border: 1px solid rgba(143, 42, 34, 0.25);
    border-radius: 0.7rem;
    padding: 0.6rem 0.72rem;
}

.auth-alt {
    margin-top: 0.75rem;
    color: var(--muted);
}

.auth-alt a {
    color: var(--accent);
    font-weight: 700;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.btn {
    background: var(--accent-2);
    color: #fff;
    padding: 0.42rem 0.78rem;
    border-radius: 0.7rem;
    font-size: 0.88rem;
}

.stack-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.72rem;
}

.stack-list li {
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.75rem;
    background: #fffdf9;
}

.stack-list p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.calendar-month-head p {
    margin: 0.1rem 0 0.8rem;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.calendar-month-label {
    margin: 0;
    text-transform: capitalize;
    font-size: 1.08rem;
}

.calendar-nav-btn {
    border: 1px solid var(--border);
    background: #fffdf9;
    color: var(--text);
    border-radius: 0.65rem;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.calendar-nav-btn:hover {
    background: rgba(47, 102, 204, 0.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.calendar-weekdays span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: right;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.calendar-cell {
    min-height: 105px;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: #fffdf9;
    padding: 0.42rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.calendar-cell-muted {
    opacity: 0.45;
}

.calendar-cell-today {
    border-color: rgba(241, 132, 35, 0.5);
    box-shadow: 0 0 0 1px rgba(241, 132, 35, 0.2) inset;
}

.calendar-day-number {
    font-weight: 700;
    font-size: 0.82rem;
    text-align: right;
    color: var(--text);
}

.calendar-cell-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.25rem;
}

.calendar-cell-events li {
    font-size: 0.7rem;
    color: #1d3f82;
    background: rgba(47, 102, 204, 0.1);
    border-radius: 0.45rem;
    padding: 0.16rem 0.28rem;
    line-height: 1.25;
}

.calendar-cell-events li.calendar-more {
    color: var(--muted);
    background: rgba(20, 38, 67, 0.08);
}

.announcement.urgent {
    border-color: rgba(241, 132, 35, 0.42);
    box-shadow: 0 0 0 2px rgba(241, 132, 35, 0.12) inset;
}

.group-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.group-grid li {
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.8rem;
    background: #fffdf9;
}

.group-grid p {
    margin: 0.35rem 0;
    color: var(--muted);
}

.group-grid small {
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.tags span {
    font-size: 0.74rem;
    background: rgba(47, 102, 204, 0.15);
    color: #1d3f82;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.muted {
    color: var(--muted);
}

.site-footer {
    margin: 1.2rem auto 2rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
}

.reveal,
.reveal-delay,
.reveal-late {
    opacity: 0;
    transform: translateY(14px);
    animation: slide-in 500ms ease forwards;
}

.reveal-delay {
    animation-delay: 140ms;
}

.reveal-late {
    animation-delay: 260ms;
}

@keyframes slide-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .grid-two {
        grid-template-columns: 1fr;
    }

    .site-footer {
        flex-direction: column;
    }

    .calendar-cell {
        min-height: 88px;
    }
}

@media (max-width: 640px) {
    .nav-wrap {
        padding: 0.65rem 0;
    }

    .nav-links {
        order: 3;
        width: 100%;
    }

    .hero {
        margin-top: 1rem;
        padding: 1.3rem;
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
    }

    .calendar-weekdays {
        gap: 0.25rem;
    }

    .calendar-weekdays span {
        font-size: 0.62rem;
    }

    .calendar-grid {
        gap: 0.25rem;
    }

    .calendar-cell {
        min-height: 72px;
        padding: 0.3rem;
    }

    .calendar-day-number {
        font-size: 0.72rem;
    }

    .calendar-cell-events li {
        font-size: 0.61rem;
        padding: 0.12rem 0.2rem;
    }
}
