/* Shared chrome: left rail, region links, slide-out site menu, burger morph.
   Lifted from the RRC visualiser unchanged so the rail reads as one site. */

.sidebar { position: relative; background: var(--rail); display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.logo-wrap { width: 60px; height: 192px; position: relative; flex: none; }
.logo-wrap .logo { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(90deg); width: 140px; height: auto; }
.side-menu { position: absolute; top: 48%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; background: none; border: none; cursor: pointer; padding: 0; }
.regions { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; flex-direction: column; align-items: stretch; padding: 0 14px; }
.regions a { color: #ccc; font-family: 'Bebas Neue', sans-serif; font-size: 16px; font-weight: 400; line-height: 19px; letter-spacing: .5px; text-decoration: none; padding: 6px 0; text-align: left; }
.regions a.active { color: #fff; font-weight: 600; }
.regions a + a { border-top: 2px solid #ccc; margin-top: 3px; }

.menu-overlay { position: fixed; inset: 0; z-index: 9998; visibility: hidden; transition: visibility 0s linear 1.2s; }
.menu-overlay.show { visibility: visible; transition: visibility 0s linear 0s; }
.menu-backdrop { position: absolute; inset: 0; }
.menu-panel { position: absolute; top: 0; left: 0; bottom: 0; width: 606px; max-width: 92vw; background: none; display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 1.2s ease; }
.menu-scroll { position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-start; padding: 80px 84px 54px 107px; }
.menu-panel::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; right: 60px; background: #000; }
.menu-overlay.show .menu-panel { transform: translateX(0); }
.menu-strip { position: absolute; top: 0; right: 0; bottom: 0; width: 60px; z-index: 2; background: rgba(0,0,0,.73); }
.menu-logo { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 192px; }
.menu-logo img { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(90deg); width: 140px; height: auto; }
.menu-nav { display: flex; flex-direction: column; }
.menu-head { font-family: 'Sugar Magic', sans-serif; color: var(--gold); font-weight: 500; font-size: 32px; line-height: 32px; margin: 0 0 20px; }
.menu-head a { color: inherit; text-decoration: none; }
.menu-overlay a:focus-visible, .menu-overlay button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.menu-head + .menu-list { margin-bottom: 50px; }
.menu-list { list-style: none; }
.menu-link { font-family: 'Poppins', sans-serif; color: #505050; font-weight: 300; font-size: 18px; line-height: 20px; text-decoration: none; display: inline-block; padding: 7px 0; cursor: pointer; transition: color .4s; }
.menu-link:hover { color: #fff; }
.menu-link[lang="ja"] { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; }
.menu-regions { display: none; }
.menu-docs { margin-top: auto; padding-top: 50px; display: flex; flex-direction: column; gap: 10px; }
.menu-docs a { font-family: 'Poppins', sans-serif; color: #505050; font-weight: 300; font-size: 14px; text-decoration: none; transition: color .4s; }
.menu-docs a:hover { color: #fff; }

/* burger <-> X morph, replicated from the site's Lottie ("Menu", 140f @60fps) */
.menu-burger { position: absolute; top: 48%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; background: none; border: none; cursor: pointer; padding: 0; }
.burger span { position: absolute; left: 50%; top: 50%; width: 20px; height: 3px; margin: -1.5px 0 0 -10px; background: #fff; border-radius: 1.5px; }
.burger .b-top { transform: translateY(-7px); }
.burger .b-bot { transform: translateY(7px); }
.burger.open .b-top { animation: bTop 1.15s ease both; }
.burger.open .b-mid { animation: bMid 1.15s ease both; }
.burger.open .b-bot { animation: bBot 1.15s ease both; }
.burger.closing .b-top { animation: bTop 1.15s ease both reverse; }
.burger.closing .b-mid { animation: bMid 1.15s ease both reverse; }
.burger.closing .b-bot { animation: bBot 1.15s ease both reverse; }
@keyframes bTop { 0%, 14% { transform: translateY(-7px) rotate(0); } 33% { transform: translateY(-10px) rotate(0); }
                  51%, 57% { transform: translateY(0) rotate(0); } 86%, 100% { transform: translateY(0) rotate(-45deg); } }
@keyframes bMid { 0%, 57% { transform: rotate(0); } 86%, 100% { transform: rotate(45deg); } }
@keyframes bBot { 0%, 14% { transform: translateY(7px) rotate(0); } 33% { transform: translateY(10px) rotate(0); }
                  51%, 57% { transform: translateY(0) rotate(0); } 86%, 100% { transform: translateY(0) rotate(-45deg); } }

/* mobile: the rail becomes a 52px top bar; region links move into the menu */
@media (max-width: 900px) {
  .sidebar { flex-direction: row; justify-content: center; height: 52px;
             position: fixed; top: 0; left: 0; right: 0; width: auto; z-index: 9999; }
  .logo-wrap { width: auto; height: 52px; display: flex; align-items: center; }
  .logo-wrap .logo { position: static; transform: none; width: 112px; }
  .side-menu { top: 50%; left: auto; right: 16px; transform: translateY(-50%); }
  .sidebar .regions { display: none; }

  .menu-panel { left: 0; right: 0; width: auto; max-width: none; transform: translateY(-100%); }
  .menu-scroll { padding: 68px 28px 28px; }
  .menu-docs { padding-top: 24px; }
  .menu-overlay.show .menu-panel { transform: translateY(0); }
  .menu-panel::before { right: 0; }
  .menu-strip { display: none; }
  body.menu-open .sidebar { background: #000; }
  body.menu-open .logo-wrap { visibility: hidden; }

  .menu-head { margin-bottom: 14px; }
  .menu-head + .menu-list { margin-bottom: 32px; }
  .menu-link { font-size: 20px; padding: 9px 0; }
  .menu-regions { display: flex; align-items: center; gap: 14px; margin: 16px 0 20px; }
  .menu-regions a { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: .5px; color: #555; text-decoration: none; }
  .menu-regions a.active { color: #fff; }
  .menu-regions a + a { border-left: 1px solid #555; padding-left: 14px; }
}
