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

:root {
    --navy: #1c2e4a;
    --navy-mid: #243a5e;
    --gold: #c9a84c;
    --gold-light: #e8c96e;
    --gold-pale: #f5e6b8;
    --white: #ffffff;
    --glass: rgba(255,255,255,0.12);
    --glass-border: rgba(201,168,76,0.35);
}

html, body { height: 100%; font-family: 'Raleway', sans-serif; }

body {
    background: var(--navy);
    color: var(--white);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── BACKGROUND IMAGE PLACEHOLDER ── */
.bg-image {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url("../img/inst_bg.jpg");
    background-size: cover;
    background-position: left center;
    background-repeat: no-repeat;
    background-color: #2a3f60;
}
/* Тонировка поверх фото */
    .bg-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(20, 35, 60, 0.60) 0%,
        rgba(20, 35, 60, 0.40) 35%,
        rgba(20, 35, 60, 0.65) 75%,
        rgba(20, 35, 60, 0.92) 100%
    );
}

/* ── HEADER ── */
header {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 2.2rem 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeDown .8s ease both;
}
@keyframes fadeDown { from{opacity:0;transform:translateY(-20px)} to{opacity:1;transform:none} }

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.emblem-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 180px;
}

.emblem-wrap img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.org-subtitle {
    font-weight: 500;
    font-size: clamp(.72rem, 1.6vw, .85rem);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: .55rem;
    animation: fadeDown .8s .2s ease both;
}

.org-subtitle, .org-tagline {
    text-shadow: 2px 3px 3px rgba(0,0,0,1);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3.8vw, 2.7rem);
    line-height: 1.2;
    color: var(--white);
    max-width: 820px;
    margin-bottom: .4rem;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8), 0 0 40px rgba(0,0,0,0.5);
    animation: fadeDown .8s .3s ease both;
}

.gold-rule {
    width: 110px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: .9rem auto .75rem;
    animation: fadeDown .8s .38s ease both;
}

.org-tagline {
    font-size: clamp(.75rem, 1.5vw, .9rem);
    font-weight: 300;
    letter-spacing: .12em;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    animation: fadeDown .8s .44s ease both;
}

/* ── MAIN ── */
main {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 2.5rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-size: 1.5rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    text-align: center;
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-shadow: 2px 3px 3px rgba(0,0,0,1);
    opacity: 1;
    animation: fadeUp .8s .5s ease both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:none} }

/* ── GRID ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 960px;
}

.card {
    position: relative;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1.3rem 1.15rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    text-decoration: none;
    color: var(--white);
    cursor: pointer;
    transition: transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
    animation: fadeUp .7s calc(.52s + var(--i, 0) * .065s) ease both;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(6px);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201,168,76,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .22s;
    border-radius: inherit;
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
    background: rgba(255,255,255,0.18);
    border-color: var(--gold);
    box-shadow: 0 10px 28px rgba(0,0,0,0.38), 0 0 18px rgba(201,168,76,0.15);
}

.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-2px) scale(1.01); }

.card-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: rgba(201,168,76,0.14);
    border: 1px solid rgba(201,168,76,0.28);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.card-title {
    font-weight: 600;
    font-size: .86rem;
    line-height: 1.3;
    color: var(--white);
}
.card-desc {
    font-size: .74rem;
    font-weight: 300;
    color: rgba(255,255,255,0.55);
    line-height: 1.4;
}
.card-arrow {
    margin-top: auto;
    font-size: .73rem;
    color: var(--gold);
    display: flex; align-items: center; gap: 4px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .2s, transform .2s;
}
.card:hover .card-arrow { opacity: 1; transform: none; }

/* ── FOOTER ── */
footer {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(201,168,76,0.18);
    background: rgba(15,25,45,0.75);
    backdrop-filter: blur(8px);
}

.footer-text { font-size: .7rem; color: rgba(255,255,255,0.35); letter-spacing: .05em; }

.footer-contacts { display: flex; gap: 1.4rem; }

.footer-contacts a {
    font-size: .7rem; color: var(--gold-light); text-decoration: none; opacity: .65; transition: opacity .2s;
}
.footer-contacts a:hover { opacity: 1; }

/* 4. Утилиты */
.nowrap { white-space: nowrap; }

@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr 1fr; }
    footer { flex-direction: column; gap: .5rem; text-align: center; }

    .header-inner {
        flex-direction: column;
        align-items: center;
    }

    .header-text {
        align-items: center;
        text-align: center;
    }

    .emblem-wrap img {
        height: 180px;
        width: auto;
        object-fit: contain;
    }
}

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