/* SpeedRunIT header and footer. Uses tokens.css. */

/* ---------- logo ---------- */
.sr-logo { display: inline-flex; align-items: center; gap: 9px; color: var(--sr-text); text-decoration: none; flex: none }
.sr-logo__mark { display: grid; place-items: center; width: 28px; height: 28px }
.sr-logo__mark svg { width: 28px; height: 28px; overflow: visible }
.sr-logo__word { display: inline-flex; align-items: center; gap: 3px; font: 700 18px/1 var(--sr-font); letter-spacing: -0.035em; white-space: nowrap }
.sr-logo__it {
    font-size: 13.5px; letter-spacing: 0; padding: 3px 5px 4px;
    border-radius: 6px 2px 6px 6px; background: var(--sr-accent); color: var(--sr-accent-ink);
}
.sr-logo:hover { color: var(--sr-text) }

/* ---------- header ---------- */
.sr-header {
    position: sticky; top: 0; z-index: 100;
    padding: 12px var(--sr-gutter) 0;
    font-family: var(--sr-font);
}
.sr-header__bar {
    max-width: var(--sr-page-max); margin: 0 auto;
    height: 58px; display: flex; align-items: center; gap: 12px;
    padding: 0 8px 0 18px;
    border-radius: var(--sr-r-pill);
}
.sr-nav { margin-left: 14px; min-width: 0 }
.sr-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px }
.sr-nav__group { position: relative }
.sr-nav__trigger {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 12px; border: 0; border-radius: var(--sr-r-pill);
    background: transparent; color: var(--sr-muted);
    font: 500 14px/1 var(--sr-font); white-space: nowrap; cursor: pointer;
    transition: background-color .2s, color .2s;
}
.sr-nav__trigger svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--sr-ease) }
.sr-nav__trigger:hover, .sr-nav__group.is-open .sr-nav__trigger { color: var(--sr-text); background: var(--sr-raise) }
.sr-nav__group.is-current .sr-nav__trigger { color: var(--sr-text) }
.sr-nav__group.is-current .sr-nav__trigger::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-left: 1px; order: -1 }
.sr-nav__group.is-open .sr-nav__trigger svg { transform: rotate(180deg) }

.sr-nav__menu {
    position: absolute; top: calc(100% + 10px); left: -6px; min-width: 300px;
    padding: 6px; border-radius: var(--sr-r-md);
    display: flex; flex-direction: column; gap: 2px;
    /* solid on purpose: a blur nested in the glass header samples nothing and the menu turns see-through */
    background: var(--sr-surface); border: 1px solid var(--sr-line-strong); box-shadow: var(--sr-e3);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .18s, transform .18s var(--sr-ease), visibility 0s .18s;
}
.sr-nav__menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px }
.sr-nav__group.is-open .sr-nav__menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .18s var(--sr-ease) }
.sr-nav__item {
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 12px; border-radius: var(--sr-r-sm);
    color: var(--sr-text); text-decoration: none;
}
.sr-nav__item b { font-weight: 500; font-size: 14.5px }
.sr-nav__item span { font-size: 13.5px; color: var(--sr-muted) }
.sr-nav__item:hover { background: var(--sr-raise); color: var(--sr-text) }
.sr-nav__item[aria-current="page"] b { color: var(--sr-accent-text) }

.sr-header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px }
.sr-cta {
    display: inline-flex; align-items: center; gap: 9px;
    height: 40px; padding: 0 16px 0 14px; border-radius: var(--sr-r-pill);
    border: 1px solid var(--sr-line); background: var(--sr-surface); color: var(--sr-text);
    font: 500 13.5px/1 var(--sr-font); white-space: nowrap; text-decoration: none;
    transition: border-color .2s;
}
.sr-cta::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sr-accent); box-shadow: 0 0 0 3px var(--sr-accent-soft) }
.sr-cta:hover { border-color: var(--sr-accent); color: var(--sr-text) }
.sr-cta > span { max-width: 210px; overflow: hidden; text-overflow: ellipsis; line-height: 1.4 }
.sr-cta__name { font-style: normal }
.sr-cta--wide { justify-content: center; height: 48px; margin-top: 8px }

/* theme switch: only on redesigned pages */
.sr-theme {
    position: relative; display: inline-flex; align-items: center; gap: 0;
    width: 64px; height: 36px; padding: 3px; border: 0; border-radius: var(--sr-r-pill);
    background: var(--sr-well); box-shadow: inset 0 1px 3px rgb(var(--sr-shadow-color) / .3); cursor: pointer;
}
html:not([data-sr-page]) .sr-theme { display: none }
.sr-theme svg { position: relative; z-index: 1; width: 29px; height: 14px; fill: none; stroke: var(--sr-muted); stroke-width: 2; stroke-linecap: round; transition: stroke .3s }
.sr-theme__knob {
    position: absolute; top: 3px; left: 3px; width: 29px; height: 30px; border-radius: 50%;
    background: var(--sr-surface); box-shadow: 0 1px 4px rgb(var(--sr-shadow-color) / .35);
    transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
[data-theme="dark"] .sr-theme__knob { transform: translateX(29px) }
[data-theme="light"] .sr-theme__sun, [data-theme="dark"] .sr-theme__moon { stroke: var(--sr-text) }

.sr-burger { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--sr-line); background: var(--sr-surface); cursor: pointer; position: relative }
.sr-burger span { position: absolute; left: 12px; right: 12px; height: 1.8px; border-radius: 2px; background: var(--sr-text); transition: transform .3s var(--sr-ease), top .3s var(--sr-ease) }
.sr-burger span:first-child { top: 16px } .sr-burger span:last-child { top: 23px }
.sr-burger[aria-expanded="true"] span:first-child { top: 19.5px; transform: rotate(45deg) }
.sr-burger[aria-expanded="true"] span:last-child { top: 19.5px; transform: rotate(-45deg) }

.sr-mobile { position: fixed; inset: 0; z-index: 99; background: rgb(0 0 0 / .35); padding: 82px 12px 12px }
.sr-mobile[hidden] { display: none }
.sr-mobile__panel {
    max-width: 520px; margin: 0 auto; max-height: 100%; overflow-y: auto;
    padding: 18px; border-radius: var(--sr-r-lg); background: var(--sr-surface); border: 1px solid var(--sr-line); box-shadow: var(--sr-e3);
    display: flex; flex-direction: column; gap: 18px; font-family: var(--sr-font);
}
.sr-mobile__group { display: flex; flex-direction: column; gap: 2px }
.sr-mobile__group .sr-mono-label { margin: 0 0 6px 12px }
.sr-mobile__group a { padding: 12px; border-radius: var(--sr-r-sm); color: var(--sr-text); text-decoration: none; font-size: 16px; font-weight: 500 }
.sr-mobile__group a:hover { background: var(--sr-raise); color: var(--sr-text) }
.sr-mobile__group a[aria-current="page"] { color: var(--sr-accent-text); background: var(--sr-accent-soft) }

@media (max-width: 1100px) {
    .sr-nav__trigger { padding: 0 9px; font-size: 13.5px }
    /* no room beside the menu: the action alone, the direction is on its page */
    .sr-header__actions .sr-cta__name { display: none }
}
@media (max-width: 1000px) {
    .sr-nav { display: none }
    .sr-burger { display: inline-block }
}
@media (max-width: 560px) {
    .sr-header { padding: 8px 10px 0 }
    .sr-header__bar { height: 56px; padding: 0 6px 0 14px }
    /* «Войти» is short enough for a phone; the longer steps live in the menu */
    .sr-header__actions .sr-cta:not(.sr-cta--short) { display: none }
    .sr-logo__word { font-size: 17px }
    .sr-mobile { padding-top: 74px }
}

/* ---------- footer ---------- */
.sr-footer { margin-top: 40px; border-top: 1px solid var(--sr-line); background: var(--sr-bg); color: var(--sr-text); font-family: var(--sr-font); position: relative; z-index: 1 }
.sr-footer__inner {
    max-width: var(--sr-page-max); margin: 0 auto; padding: 44px var(--sr-gutter) 28px;
    display: grid; grid-template-columns: minmax(0, 1fr) max-content max-content; column-gap: clamp(48px, 8vw, 128px); row-gap: 32px;
}
.sr-footer__brand { display: flex; flex-direction: column; gap: 12px }
.sr-footer__brand p { margin: 0; color: var(--sr-muted); font-size: 14px }
.sr-footer__col h2 { margin: 0 0 14px }
.sr-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px }
.sr-footer__links--two { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: 32px; row-gap: 10px }
.sr-footer__links a { display: inline-flex; align-items: center; gap: 9px; min-height: 22px; color: var(--sr-text); text-decoration: none; font-size: 14.5px; transition: color .2s }
.sr-footer__links a:hover { color: var(--sr-accent-text) }
.sr-footer__links svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; color: var(--sr-muted) }
.sr-footer__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sr-accent); margin: 0 4.5px }
.sr-footer__bottom {
    max-width: var(--sr-page-max); margin: 0 auto; padding: 18px var(--sr-gutter) 28px;
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    border-top: 1px solid var(--sr-line); font-size: 13.5px; color: var(--sr-muted);
}
.sr-footer__bottom p { margin: 0 }
.sr-footer__bottom a { color: var(--sr-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sr-line-strong) }
.sr-footer__bottom a:hover { color: var(--sr-text) }
@media (max-width: 900px) {
    .sr-footer__inner { grid-template-columns: 1fr 1fr; }
    .sr-footer__brand { grid-column: 1 / -1 }
}
@media (max-width: 520px) {
    .sr-footer__inner { grid-template-columns: 1fr; gap: 26px }
}

/* logo: on hover the road is drawn from the bottom of the S upwards and ends at the dot */
.sr-logo__route { stroke-dasharray: 1 }
.sr-logo__dot { transform-box: fill-box; transform-origin: center }
.sr-logo:hover .sr-logo__route { animation: sr-route-draw .7s cubic-bezier(.5, 0, .2, 1) }
.sr-logo:hover .sr-logo__dot { animation: sr-dot-hop .5s cubic-bezier(.3, 1.6, .5, 1) .55s both }
@keyframes sr-route-draw { from { stroke-dashoffset: 1 } to { stroke-dashoffset: 0 } }
@keyframes sr-dot-hop { 0% { transform: translateX(-7px) scale(.2); opacity: 0 } 70% { transform: translateX(1px) scale(1.15); opacity: 1 } 100% { transform: none } }
@media (prefers-reduced-motion: reduce) { .sr-logo:hover .sr-logo__route, .sr-logo:hover .sr-logo__dot { animation: none } }
