/* ---- шапка ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 11, 10, 0.78);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.header.is-scrolled { border-bottom-color: var(--line); }

.header__inner { height: var(--header-h); display: flex; align-items: center; gap: 40px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 20px/1 var(--display); }
.brand__logo { width: 30px; height: 30px; image-rendering: pixelated; transition: transform 0.3s var(--bounce); }
.brand:hover .brand__logo { transform: rotate(-8deg) scale(1.08); }

.nav { position: relative; display: flex; gap: 2px; margin-right: auto; }
.nav a {
  padding: 6px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
/* полоска под активным разделом: переезжает к нему (позицию ставит chrome.js) */
.nav__bar {
  position: absolute;
  left: 0;
  bottom: -15px;
  height: 4px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(242, 184, 75, 0.6);
  transition: transform 0.35s var(--bounce), width 0.35s var(--bounce), opacity 0.2s;
  pointer-events: none;
}

.header__tools { display: flex; align-items: center; gap: 2px; }

.iconlink {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--muted);
  transition: color 0.15s, transform 0.2s var(--bounce);
}
.iconlink:hover { color: var(--accent); transform: translateY(-2px); }
.iconlink--sm { width: 28px; height: 28px; }

/* ---- выбор языка ---- */
.langmenu { position: relative; margin-left: 8px; }
.langbtn {
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line-strong);
  background: none;
  color: var(--muted);
  font: 500 12px/1 var(--mono);
  transition: color 0.15s, border-color 0.15s;
}
.langbtn:hover, .langmenu.is-open .langbtn { color: var(--text); border-color: var(--accent); }
.langmenu.is-open .langbtn .icon { animation: spin-once 0.5s var(--ease); }
@keyframes spin-once { to { transform: rotate(180deg); } }

.langmenu__list {
  --px-line: var(--line-strong);
  --px-fill: var(--bg-raised);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 200px;
  padding: 6px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s, transform 0.25s var(--bounce), visibility 0.18s;
}
.langmenu.is-open .langmenu__list { visibility: visible; opacity: 1; transform: none; }
.langmenu__list button {
  width: 100%;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  transition: background 0.12s, color 0.12s, padding 0.15s;
}
.langmenu__list button .mono { width: 20px; color: var(--faint); font-size: 11px; text-transform: uppercase; }
.langmenu__list button:hover { background: var(--surface-hover); color: var(--text); padding-left: 14px; }
.langmenu__list button[aria-selected="true"] { color: var(--accent); }
.langmenu__list button[aria-selected="true"] .mono { color: var(--accent); }

.menubtn { display: none; }
.menubtn__close { display: none; }

@media (max-width: 760px) {
  .header__inner { gap: 12px; justify-content: space-between; }
  .header__tools .iconlink:not(.menubtn) { display: none; }
  .menubtn { display: inline-grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    height: calc(100dvh - var(--header-h));
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 16px var(--gutter);
    background: var(--bg);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
  }
  .nav a { padding: 18px 0; font: 600 26px/1 var(--display); border-bottom: 2px solid var(--line); opacity: 0; transform: translateX(-12px); transition: opacity 0.3s, transform 0.3s var(--ease), color 0.15s; }
  .nav a:nth-child(2) { transition-delay: 0.05s; }
  .nav a:nth-child(3) { transition-delay: 0.1s; }
  .nav a[aria-current="page"] { color: var(--accent); }
  .nav__bar { display: none; }
  .is-open .nav { visibility: visible; opacity: 1; }
  .is-open .nav a { opacity: 1; transform: none; }
  .is-open .menubtn__open { display: none; }
  .is-open .menubtn__close { display: block; }
  .header.is-open { background: var(--bg); }
}

/* ---- подвал ---- */
.footer { position: relative; margin-top: 112px; background: var(--bg-raised); }
/* верхний край подвала — ступеньками, как край блока */
.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
  background:
    linear-gradient(90deg, var(--bg-raised) 50%, transparent 50%) 0 0 / 24px 6px repeat-x,
    linear-gradient(var(--bg-raised), var(--bg-raised)) 0 6px / 100% 6px no-repeat;
}

.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
.footer__about p { margin: 14px 0 18px; color: var(--muted); max-width: 300px; font-size: 14px; }
.footer__socials { display: flex; gap: 2px; margin-left: -8px; }
.footer h4 { margin-bottom: 14px; color: var(--faint); font: 600 15px/1 var(--display); }
.footer li + li { margin-top: 8px; }
.footer li a { color: var(--muted); font-size: 14px; transition: color 0.15s, padding 0.2s var(--ease); }
.footer li a:hover { color: var(--accent); padding-left: 4px; }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 2px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}

@media (max-width: 760px) {
  .footer { margin-top: 80px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__about { grid-column: 1 / -1; }
}
