/* The phone header and menu, the same on every page (the owner, 13.11). Static, in the page's own head, so the header is
   drawn right from the first frame: before, a script reshaped it after load and the logo jumped on every page
   («почему каждый раз логотип немного смещается когда переключаюсь на страницы и на меню»).
   One spot for the logo everywhere on a phone: 20 px from the left, its row 44 px high starting 28 px from the top. */
.mb-btn,.mb-panel{display:none}
@media(max-width:600px){
  header nav>a{display:none!important}
  header nav:not(:has(>:not(a))){display:none!important}
  header,header.top,.page-header{flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;min-height:44px;row-gap:0!important}
  header .brand{display:block!important;line-height:0!important;margin:0 auto 0 0!important;padding:0!important}
  header .brand img{height:14px!important;width:auto!important;display:block!important;vertical-align:top}
  .screen .page-header{top:28px!important;left:20px!important;right:20px!important}
  .page-header .hdr-r{display:flex!important;align-items:center;gap:8px}
  header .noise-sw{position:static!important;order:8;margin:0!important}
  header nav{margin:0!important}
  .mb-btn{display:block;order:9;position:relative;flex:none;width:44px;height:44px;margin:0 -11px 0 0;padding:0;border:0;background:none;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mb-panel{position:fixed;inset:0;z-index:10000;overflow:auto;display:flex;flex-direction:column;padding:0 20px calc(28px + env(safe-area-inset-bottom))}
  .mb-panel[hidden]{display:none}
}
.mb-btn i,.mb-x i{position:absolute;left:11px;width:22px;height:2px;border-radius:2px;background:currentColor}
.mb-btn i:nth-child(1){top:15px}.mb-btn i:nth-child(2){top:21px;width:15px}.mb-btn i:nth-child(3){top:27px}
.mb-x{position:relative;flex:none;width:44px;height:44px;margin-right:-11px;padding:0;border:0;background:none;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.mb-x i{top:21px}.mb-x i:nth-child(1){transform:rotate(45deg)}.mb-x i:nth-child(2){transform:rotate(-45deg)}
.mb-btn:focus:not(:focus-visible),.mb-x:focus:not(:focus-visible),.mb-panel:focus,.mb-list a:focus:not(:focus-visible){outline:none}
/* the top of the open menu repeats the page header exactly: the logo and the close button do not move */
.mb-top{display:flex;align-items:center;justify-content:space-between;flex:none;height:44px;margin-top:28px}
.mb-top .brand{display:block;line-height:0}.mb-top .brand img{height:14px;width:auto;display:block}
.mb-list{list-style:none;margin:clamp(36px,8vh,72px) 0 0;padding:0}
.mb-list li{opacity:0;transform:translateY(10px);animation:mb-in .32s cubic-bezier(.2,.7,.2,1) forwards}
.mb-list a{display:flex;align-items:baseline;gap:14px;padding:10px 0;color:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}
.mb-list .n{flex:none;width:22px;font-size:12px;letter-spacing:.04em;opacity:.45;font-variant-numeric:tabular-nums}
.mb-list .t{position:relative;white-space:nowrap;font-size:clamp(30px,8.6vw,38px);line-height:1.08;letter-spacing:-.02em}
.mb-list .ul{position:absolute;left:-2%;bottom:-.3em;width:104%;height:.5em;overflow:visible;fill:none;stroke-width:2.5;stroke-linecap:round;pointer-events:none}
.mb-list a:active .t{opacity:.6}
.mb-panel.go .mb-list a:not([aria-current]) .t{opacity:.55;transition:opacity .2s}
.mb-foot{margin-top:auto;padding-top:36px;display:flex;flex-wrap:wrap;gap:6px 22px;font-size:14px}
.mb-foot a{color:inherit;opacity:.7;text-decoration:none}.mb-foot a:hover{opacity:1}
.mb-panel.noisy .mb-list .t{text-transform:uppercase;letter-spacing:0;font-size:clamp(24px,7.4vw,34px)}
@keyframes mb-in{to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.mb-list li{animation:none;opacity:1;transform:none}}
/* One footer on every inner page (the owner, 14.11: «приведи везде футер к какому-то логичному состоянию и одинаково
   отображаться должно»; «Back to the home page кажется должен быть всегда слева, справа должен быть всегда Back to the top»).
   Left: back to the home page. Middle: the page's own section, if it has one, and About me. Right: back to the top. */
footer.site-foot{display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"home mid top";align-items:baseline;gap:12px 24px;
  margin:96px 0 0!important;padding:24px 0 64px!important;border-top:1px solid var(--line,rgba(127,127,127,.25));font-size:15px;line-height:1.5}
footer.site-foot a{white-space:nowrap}
footer.site-foot>:first-child{grid-area:home}
footer.site-foot>:last-child{grid-area:top;justify-self:end}
/* the middle links are the quieter ones, so the two edges read first */
footer.site-foot .sf-mid{grid-area:mid;display:flex;justify-content:center;gap:20px;opacity:.7}
footer.site-foot .sf-mid a:hover{opacity:1}
/* a phone: one plain list, everything on the left edge, the top last, 24 px apart (14.11: «на телефоне вертикальное
   расстояние больше должно быть») (the owner, 14.11, on the stepped layout with the top
   pushed right: «а вот это что за верстка такая?») */
@media(max-width:640px){footer.site-foot{grid-template-columns:1fr;grid-template-areas:"home" "mid" "top";gap:24px;margin-top:72px!important}
  footer.site-foot>:last-child{justify-self:start}
  footer.site-foot .sf-mid{flex-direction:column;align-items:flex-start;gap:24px;opacity:1}}
/* Tablets, the home only (.page-header): its menu doesn't fit next to the logo and the noise switch between 601 and
   860 px, and each item broke into two lines (the owner, 14.11: «а почему тут не бургер меню а каша какая-то?»).
   So the home shows the burger there too, the same as on a phone. Text pages keep their menu: it fits. */
.page-header .menu-n a{white-space:nowrap}
@media(min-width:601px) and (max-width:860px){
  .page-header nav>a{display:none!important}
  .page-header nav:not(:has(>:not(a))){display:none!important}
  .page-header{flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;min-height:44px;row-gap:0!important}
  .page-header .brand{display:block!important;line-height:0!important;margin:0 auto 0 0!important;padding:0!important}
  .page-header .hdr-r{display:flex!important;align-items:center;gap:8px}
  .page-header .noise-sw{position:static!important;order:8;margin:0!important}
  .page-header nav{margin:0!important}
  .page-header .mb-btn{display:block;order:9;position:relative;flex:none;width:44px;height:44px;margin:0 -11px 0 0;padding:0;border:0;background:none;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .mb-panel{position:fixed;inset:0;z-index:10000;overflow:auto;display:flex;flex-direction:column;padding:0 max(20px,calc((100vw - 680px)/2)) calc(28px + env(safe-area-inset-bottom))}
  .mb-panel[hidden]{display:none}
}
/* on a computer too, the logo sits in one spot on every page with the column layout (the blog's was 3.5 px lower) */
@media(min-width:601px){
  header:not(.page-header){align-items:flex-start!important}
  header:not(.page-header) .brand{display:block;line-height:0;margin-top:5px}
  header:not(.page-header) .brand img{display:block}
}
