html:has(.menu[open]) { overflow: hidden; }

.bar-r { display: flex; align-items: center; gap: 8px; }
.menu-btn { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.menu-btn svg { width: 17px; height: 17px; }
.bar.on-dark .menu-btn { background: var(--dark-2); color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--line-dark); }
.cta .l-short { display: none; }
@media (hover: hover) and (pointer: fine) {
  .menu-btn:hover { background: var(--bg-2); }
  .bar.on-dark .menu-btn:hover { background: var(--dark-3); }
}
@media (max-width: 479px) {
  .cta .l-full { display: none; }
  .cta .l-short { display: inline; }
}
@media (max-width: 359px) {
  .bar .cta { width: 44px; padding: 0; }
  .cta .l-short { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.strip { display: none; }
@media (min-width: 1100px) {
  .strip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--bg); transition: background-color 240ms ease; }
  .bar.on-dark .strip { background: var(--dark); }
  .strip a { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color 200ms ease, color 200ms ease; }
  .bar.on-dark .strip a { color: var(--on-dark-2); }
  .strip a[aria-current] { background: var(--ink); color: var(--surface); }
  .bar.on-dark .strip a[aria-current] { background: var(--on-dark); color: var(--dark); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .strip a:not([aria-current]):hover { color: var(--ink); }
  .bar.on-dark .strip a:not([aria-current]):hover { color: var(--on-dark); }
}

.rail { position: fixed; z-index: 29; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: var(--dark-2); color: var(--on-dark); box-shadow: var(--shadow-dark); opacity: 0; visibility: hidden; transform: translate(-50%, 14px); transition: opacity 200ms var(--e-out), transform 300ms var(--e-out), visibility 0s linear 300ms; }
.rail.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 200ms var(--e-out), transform 260ms var(--e-out), visibility 0s; }
.rail-step { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--on-dark); transition: background-color 160ms ease, opacity 160ms ease; }
.rail-step svg { width: 18px; height: 18px; }
.rail-step[aria-disabled="true"] { opacity: 0.32; cursor: default; }
.rail-list { display: none; }
.rail-now { display: grid; grid-template-columns: 10px auto; align-items: center; column-gap: 10px; min-width: 136px; height: 44px; padding: 0 14px 0 12px; border-radius: 14px; text-align: left; }
.rail-now i { grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 3px; background: var(--sw, var(--on-dark)); box-shadow: inset 0 0 0 1px var(--line-dark); }
.rail-now b { font-size: 15px; font-weight: 600; line-height: 1.15; }
.rail-now small { font-size: 12px; line-height: 1.15; color: var(--on-dark-2); }
@media (hover: hover) and (pointer: fine) {
  .rail-step:not([aria-disabled="true"]):hover, .rail-now:hover { background: var(--dark-3); }
}
@media (min-width: 1100px) {
  .rail-list { display: flex; gap: 2px; list-style: none; }
  .rail-list a { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 15px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--on-dark-2); transition: background-color 200ms ease, color 200ms ease; }
  .rail-list a::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sw); box-shadow: inset 0 0 0 1px var(--line-dark); }
  .rail-list a[aria-current] { background: var(--on-dark); color: var(--dark); }
  .rail-now { display: none; }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1100px) {
  .rail-list a:not([aria-current]):hover { color: var(--on-dark); }
}

.menu { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--dark); color: var(--on-dark); overflow-y: auto; overscroll-behavior: contain; opacity: 0; transition: opacity 200ms var(--e-out), overlay 200ms allow-discrete, display 200ms allow-discrete; }
.menu[open] { opacity: 1; }
.menu::backdrop { background: transparent; }
.menu-in { min-height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; gap: 24px; padding: 0 var(--pad) calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateY(14px); transition: transform 340ms var(--e-out); }
.menu[open] .menu-in { transform: none; }
@starting-style {
  .menu[open] { opacity: 0; }
  .menu[open] .menu-in { transform: translateY(14px); }
}
.menu-top { position: sticky; top: 0; z-index: 1; height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; background: var(--dark); }
.menu .mark { background: var(--dark); color: var(--on-dark); }
.menu .pill { height: 44px; }
.menu-x { background: var(--dark-2); color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--line-dark); }
.menu-cols { display: grid; gap: 36px; align-content: start; padding-top: 8px; }
.mg h2 { font-size: 14px; font-weight: 500; color: var(--on-dark-2); margin-bottom: 6px; }
.mg-list { list-style: none; }
.mg-list a { display: grid; grid-template-columns: 0.34em auto; justify-content: start; align-items: center; column-gap: 14px; min-height: 48px; padding: 3px 0; font-size: clamp(30px, 8.6vw, 44px); font-weight: 600; line-height: 1.05; letter-spacing: -0.035em; transition: transform 260ms var(--e-out); }
.mg-list a i { flex: none; width: 0.34em; height: 0.34em; border-radius: 0.09em; background: var(--sw, var(--on-dark)); box-shadow: inset 0 0 0 1px var(--line-dark); }
.mg-sys a i { background: none; box-shadow: inset 0 0 0 2px var(--on-dark); }
.mg-list a > span { grid-column: 2; padding-bottom: 4px; font-size: 15px; font-weight: 500; line-height: 1.25; letter-spacing: 0; color: var(--on-dark-2); }
.mg-list a > span b { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 1px; background: var(--acc-soft); color: var(--acc-ink); }
.mg-list a[aria-current]::after { content: "вы здесь"; grid-column: 2; justify-self: start; margin-bottom: 4px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; letter-spacing: 0; background: var(--dark-3); color: var(--on-dark); }
.menu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; padding-top: 20px; border-top: 1px solid var(--line-dark); }
.menu-foot > a:not(.pill) { display: inline-flex; align-items: center; min-height: 48px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.menu-foot .pill.solid { background: var(--on-dark); color: var(--dark); }
.menu :focus-visible { outline-color: var(--on-dark); }
@media (hover: hover) and (pointer: fine) {
  .mg-list a:hover { transform: translateX(8px); }
  .menu-x:hover, .fw-x:hover { background: var(--dark-3); }
  .menu-foot .pill.solid:hover { background: var(--surface); }
}
@media (min-width: 900px) {
  .mg-list a { grid-template-columns: 0.34em auto auto auto; }
  .mg-list a > span, .mg-list a[aria-current]::after { grid-column: auto; padding-bottom: 0; margin-bottom: 0; }
  .menu-cols { grid-template-columns: 1fr 1fr; column-gap: 56px; padding-top: 24px; }
  .menu-foot .pill.solid { margin-left: auto; }
}
@media (min-width: 1100px) {
  .menu-in { gap: 32px; }
  .mg-list a { font-size: clamp(36px, 3.4vw, 54px); min-height: 56px; }
}

.mg-who { padding-top: 6px; }
.mg-who h2 { font-size: 14px; font-weight: 500; color: var(--on-dark-2); margin-bottom: 4px; }
.mo-list { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 22px; }
.mo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--on-dark-2); text-decoration: underline 2px transparent; text-underline-offset: 7px; transition: color 200ms ease, text-decoration-color 200ms ease; }
.mo i { flex: none; width: 12px; height: 12px; border-radius: 3px; background: var(--sw); box-shadow: inset 0 0 0 1px var(--line-dark); }
.mo[aria-pressed="true"] { color: var(--on-dark); text-decoration-color: var(--sw); }
@media (hover: hover) and (pointer: fine) { .mo:hover { color: var(--on-dark); } }
@media (min-width: 1100px) { .mo { font-size: 22px; } }

.hw { padding-block: max(0.1em, 6px); margin-block: min(-0.1em, -6px); white-space: nowrap; letter-spacing: inherit; line-height: inherit; text-align: inherit; border-radius: 0.12em; cursor: pointer; }
.hw > span { display: inline-block; text-decoration: underline; text-decoration-color: var(--acc-ink); text-decoration-thickness: 0.065em; text-underline-offset: 0.12em; text-decoration-skip-ink: none; }
.hw svg { display: inline-block; width: 0.42em; height: 0.42em; margin-left: 0.08em; vertical-align: 0.1em; color: var(--acc-ink); transition: transform 200ms var(--e-out); }
.hw:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
html:has(#who:popover-open) .hw svg { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .hw:hover svg { transform: translateY(0.07em); } }
@media (max-width: 359px) { .hero h1 { font-size: 34px; } }

.fw { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 88svh; margin: 0; padding: 16px var(--pad) calc(14px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 26px 26px 0 0; background: var(--dark); color: var(--on-dark); box-shadow: var(--shadow-dark); overflow-y: auto; overscroll-behavior: contain; opacity: 0; transform: translateY(28px); transition: opacity 200ms var(--e-out), transform 320ms var(--e-drawer), overlay 320ms allow-discrete, display 320ms allow-discrete; }
.fw:popover-open { opacity: 1; transform: none; }
@starting-style { .fw:popover-open { opacity: 0; transform: translateY(28px); } }
.fw::backdrop { background: var(--veil); }
.fw-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 6px; }
.fw-t { font-size: 14px; font-weight: 500; color: var(--on-dark-2); }
.fw-x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; margin-right: -6px; border-radius: 999px; background: var(--dark-2); color: var(--on-dark); box-shadow: inset 0 0 0 1px var(--line-dark); }
.fw-x svg { width: 18px; height: 18px; }
.fw-list { list-style: none; }
.fw-o { width: 100%; display: grid; grid-template-columns: 0.34em auto; justify-content: start; align-items: center; column-gap: 14px; min-height: 56px; padding: 7px 0; border-top: 1px solid var(--dark-3); text-align: left; font-size: 27px; font-weight: 600; line-height: 1.1; letter-spacing: -0.03em; color: var(--on-dark); }
.fw-o i { width: 0.34em; height: 0.34em; border-radius: 0.09em; background: var(--sw); box-shadow: inset 0 0 0 1px var(--line-dark); }
.fw-o b { font-weight: 600; }
.fw-o > span { grid-column: 2; font-size: 14px; font-weight: 500; line-height: 1.3; letter-spacing: 0; color: var(--on-dark-2); }
.fw-o[aria-pressed="true"] b::after { content: "сейчас"; display: inline-block; margin-left: 10px; padding: 4px 10px; border-radius: 999px; vertical-align: 0.2em; font-size: 13px; font-weight: 500; letter-spacing: 0; background: var(--dark-3); color: var(--on-dark); }
.fw :focus-visible { outline-color: var(--on-dark); }
@media (hover: hover) and (pointer: fine) {
  .fw-o { transition: transform 160ms ease; }
  .fw-o:hover { transform: translateX(4px); }
}
@media (min-width: 900px) {
  .fw { inset: auto; left: var(--pad); top: calc(var(--bar-h) + 14px); width: 470px; max-height: calc(100svh - var(--bar-h) - 28px); border-radius: 26px; padding: 16px 26px 14px; transform: translateY(-8px) scale(0.97); transform-origin: top left; transition: opacity 180ms var(--e-out), transform 220ms var(--e-out), overlay 220ms allow-discrete, display 220ms allow-discrete; }
  @starting-style { .fw:popover-open { transform: translateY(-8px) scale(0.97); } }
  .fw::backdrop { background: transparent; }
}
@supports (position-anchor: --hw) {
  @media (min-width: 900px) {
    .hw { anchor-name: --hw; }
    .fw { position-anchor: --hw; left: anchor(left); top: anchor(bottom); margin-top: 18px; position-try-fallbacks: flip-block; }
  }
}

:root.is-switching :is(.hw > span, .stage-b, .system .canvas, .note-stack, .system-head p) { animation: v-in 200ms linear; }
@media (prefers-reduced-motion: no-preference) {
  :root.is-switching .hw > span { animation: hw-in 280ms var(--e-out); }
  :root.is-switching :is(.stage-b, .system .canvas, .note-stack, .system-head p) { animation: v-in 240ms var(--e-out); }
}
@keyframes hw-in { from { opacity: 0; transform: translateY(0.32em); } }
@keyframes v-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .fw, .fw:popover-open { transform: none; transition: opacity 160ms linear, overlay 160ms allow-discrete, display 160ms allow-discrete; }
  .rail, .rail.is-on { transform: translate(-50%, 0); transition: opacity 120ms linear, visibility 0s; }
  .menu { transition: opacity 160ms linear, overlay 160ms allow-discrete, display 160ms allow-discrete; }
  .menu-in { transition: none; }
  .menu-in { transform: none; }
  .mg-list a { transition: none; }
}
