/* Shared homepage/inner-page header. Load after each page's own stylesheet. */
body.inner-page { padding-top: 0; }

.header {
  width: 100%;
  height: 69px;
  min-height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(2, 5, 9, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: static;
  transform: none;
  text-decoration: none;
  min-height: 40px;
}

.header .logo img {
  display: block;
  /* Match V89's visible mark while excluding this PNG's transparent padding. */
  height: calc(40px * 161 / 286 * 285 / 132);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0;
  margin-top: calc(-40px * 161 / 286 * 74 / 132);
  margin-bottom: calc(-40px * 161 / 286 * 79 / 132);
  transform: none;
}

/* Same footer navigation on all pages; each HTML omits its own page link. */
.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 18px;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.footer-nav a:hover,
.footer-nav a:focus-visible { color: var(--primary); }

.header-actions,
.header-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-nav { margin-right: 0; }
.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
}
.header-nav a:hover,
.header-nav a:focus-visible,
.header-nav a[aria-current="page"] { color: var(--primary); }

.header .lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 13, 24, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
}
.header .lang-btn:hover {
  border-color: var(--border);
  background: rgba(0, 180, 255, 0.08);
}
.header .lang-btn svg {
  width: 15px;
  height: 15px;
  opacity: 0.75;
  flex-shrink: 0;
}
.header a:focus-visible,
.header button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 5px;
}

/* Desktop keeps a visible button and a right-side drawer. */
.header .menu-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(6, 13, 24, 0.82);
  color: var(--text);
  cursor: pointer;
}
.header .menu-toggle span { display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.drawer-overlay {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 398;
  background: rgba(0, 3, 8, 0.74);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s, visibility 0.28s;
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; }
.site-drawer {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  z-index: 399;
  width: min(380px, 66vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: radial-gradient(circle at 100% 0, rgba(0, 180, 255, 0.13), transparent 38%), #071321;
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.55);
  transform: translateX(102%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, visibility 0.3s;
}
.site-drawer.is-open { visibility: visible; pointer-events: auto; transform: translateX(0); }
.site-drawer:focus { outline: none; }
.menu-open { overflow: hidden; }
.drawer-head { min-height: 80px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.drawer-logo img { display: block; width: 150px; height: auto; }
.drawer-close { min-width: 44px; min-height: 44px; border: 0; background: none; color: var(--text-muted); font-size: 36px; cursor: pointer; }
.drawer-home { margin: 18px 16px 0; min-height: 66px; padding: 12px 14px; display: flex; align-items: center; gap: 14px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); text-decoration: none; }
.drawer-home[aria-current="page"], .drawer-nav a[aria-current="page"] { border-color: var(--border); background: rgba(0, 180, 255, 0.08); }
.drawer-home > svg, .drawer-nav svg, .drawer-language > svg { width: 24px; height: 24px; flex: 0 0 24px; color: var(--primary); }
.drawer-home span, .drawer-nav a span { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.drawer-home strong, .drawer-nav strong { font-size: 17px; }
.drawer-home small, .drawer-nav small { color: var(--text-muted); font-size: 12px; }
.drawer-nav { padding: 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.drawer-nav a { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid transparent; border-radius: 12px; color: var(--text); text-decoration: none; }
.drawer-home:hover, .drawer-nav a:hover { border-color: var(--primary); background: rgba(0, 180, 255, 0.1); }
.drawer-language { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px 20px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 180, 255, 0.06); color: var(--text-muted); font: inherit; text-align: left; cursor: pointer; }
.drawer-language .language-label { margin-left: auto; color: var(--text); font-weight: 700; }
.site-drawer a:focus-visible, .site-drawer button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Mobile keeps the menu button and also supports the left-edge swipe. */
@media (max-width: 900px) {
  body { touch-action: pan-y pinch-zoom; }
  .header {
    height: 69px;
    min-height: 69px;
    padding: 12px 16px;
    flex-wrap: nowrap;
    gap: 14px;
  }
  body:not(.inner-page) .header .logo { flex: 1 1 auto; min-width: 0; max-width: calc(100% - 140px); }
  body:not(.inner-page) .header-actions { display: flex; flex: 0 0 auto; gap: 8px; }
  .header .header-nav { display: none; }
  .inner-page .header .logo { max-width: calc(100% - 58px); }
  .inner-page .header .logo img { height: calc(40px * 161 / 286 * 285 / 132); }
  .inner-page .header-actions { display: flex; flex: 0 0 auto; gap: 0; }
  .inner-page .header-nav,
  .inner-page .header .lang-btn { display: none; }
  .header .menu-toggle {
    display: inline-flex;
    position: static;
    width: 40px;
    height: 40px;
    overflow: visible;
    clip-path: none;
    padding: 0;
    border: 1px solid var(--border);
  }
  .site-drawer,
  .drawer-overlay { display: block; }
  .site-drawer {
    position: fixed;
    top: 0;
    left: auto;
    right: 0;
    z-index: 399;
    width: min(320px, 84vw);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    transform: translateX(102%);
  }
  .site-drawer.is-open { transform: translateX(0); }
  .site-drawer.opens-from-left {
    left: 0;
    right: auto;
    background: radial-gradient(circle at 0 0, rgba(0, 180, 255, 0.13), transparent 38%), #071321;
    border-left: 0;
    border-right: 1px solid var(--border);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.55);
    transform: translateX(-102%);
  }
  .site-drawer.opens-from-left.is-open { transform: translateX(0); }
}

@media (max-width: 500px) {
  .header { height: 65px; min-height: 65px; }
}

@media (max-width: 500px) {
  .header { padding: 12px 16px; }
  body:not(.inner-page) .header-actions { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .site-drawer,
  .drawer-overlay { transition: none; }
}
