* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --gold: #d8bd82;
    --paper: #eee4cb;
}

body {
    min-height: 100vh;
    margin: 0;
    color: #f4f1e9;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(130, 100, 51, .16), transparent 55%),
        linear-gradient(145deg, #191816, #10100f 60%, #171512);
    font-family: Arial, Helvetica, sans-serif;
}

.moscow-page strong,
.moscow-page b,
.moscow-page em {
    color: var(--gold);
}

a[href^="http://"]:link,
a[href^="http://"]:visited,
a[href^="https://"]:link,
a[href^="https://"]:visited {
    color: #d8bd82;
}

a[href^="http://"]:hover,
a[href^="https://"]:hover {
    color: #f0d99f;
}

.moscow-page {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 80px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(216, 189, 130, .34);
    border-radius: 999px;
    color: var(--gold);
    text-decoration: none;
    font-size: 14px;
    transition: background .2s ease, border-color .2s ease;
}

.back-link:hover {
    border-color: rgba(216, 189, 130, .75);
    background: rgba(216, 189, 130, .08);
}

.back-link:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.map-shortcut {
    margin: -20px 0 28px;
    text-align: center;
}

.map-shortcut a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(216, 189, 130, .62);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(216, 189, 130, .18), rgba(216, 189, 130, .08));
    color: var(--gold);
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.map-shortcut a:hover,
.map-shortcut a:focus-visible {
    border-color: #e4ca8b;
    background: rgba(216, 189, 130, .2);
    transform: translateY(-1px);
}

.moscow-header {
    position: relative;
    display: grid;
    justify-items: center;
    margin: 28px 0 44px;
    padding: 54px 24px 42px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(216, 189, 130, .18);
    border-radius: 22px;
    background:
        linear-gradient(0deg, rgba(14, 13, 12, .88), rgba(14, 13, 12, .38)),
        url("images/moscow-state.jpg") center 42% / cover,
        #211e18;
    text-align: center;
}

.moscow-header::before,
.moscow-header::after {
    position: absolute;
    z-index: -1;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(216, 189, 130, .23);
    border-radius: 50%;
    content: "";
}

.moscow-header::before {
    top: -142px;
    left: -58px;
}

.moscow-header::after {
    right: -58px;
    bottom: -158px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.moscow-header h1 {
    max-width: 900px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: 1.04;
    text-shadow: 0 3px 22px rgba(0, 0, 0, .6);
}

.header-rule {
    width: 72px;
    height: 2px;
    margin-top: 25px;
    background: var(--gold);
    box-shadow: 0 0 18px rgba(216, 189, 130, .75);
}

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

.period-card {
    --accent: #d8bd82;
    position: relative;
    display: flex;
    min-height: 220px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 29px 32px 27px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background:
        radial-gradient(ellipse at 80% 18%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 48%),
        linear-gradient(145deg, #26231e 0%, #191817 56%, #121211 100%);
    box-shadow: 0 14px 35px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .04);
}

a.period-card {
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

a.period-card:hover {
    transform: translateY(-3px);
    border-color: rgba(216, 189, 130, .5);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .06);
}

a.period-card:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

.period-card::before,
.period-card::after {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    content: "";
}

.period-card::before {
    inset: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    border-radius: 12px;
}

.period-card::after {
    top: -65px;
    right: -20px;
    width: 230px;
    height: 230px;
    border: 1px solid color-mix(in srgb, var(--accent) 13%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent) 3%, transparent), 0 0 0 37px color-mix(in srgb, var(--accent) 3%, transparent);
}

.card-number {
    position: absolute;
    top: 26px;
    left: 32px;
    color: color-mix(in srgb, var(--accent) 78%, white);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
}

.card-emblem {
    position: absolute;
    top: 22px;
    right: 35px;
    color: color-mix(in srgb, var(--accent) 64%, white);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 78px;
    line-height: 1;
    opacity: .32;
    text-shadow: 0 0 28px color-mix(in srgb, var(--accent) 26%, transparent);
}

.period-card h2 {
    max-width: 440px;
    margin: 0;
    color: var(--paper);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(23px, 3vw, 31px);
    font-weight: 500;
    line-height: 1.16;
    text-wrap: balance;
}

.card-rule {
    width: 46px;
    height: 2px;
    margin-top: 17px;
    background: var(--accent);
    opacity: .85;
}

.card-vasily-iii { --accent: #9caa9d; }
.card-ivan-iv { --accent: #bd8b6b; }
.card-troubles { --accent: #a76a5b; }
.card-romanovs { --accent: #b59d72; }
.card-transition { --accent: #8193a0; }
.card-culture-xvi { --accent: #bba86d; }
.card-culture-xvii { --accent: #9d83aa; }

@media (max-width: 700px) {
    .moscow-page {
        width: min(100% - 32px, 560px);
        padding-top: 22px;
    }

    .moscow-header {
        margin: 24px 0 28px;
        padding: 44px 18px 36px;
    }

    .period-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .period-card {
        min-height: 190px;
        padding: 27px 27px 25px;
    }

    .card-number { left: 27px; }
    .card-emblem { right: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; }
}
