:root {
  --maru-ink: #1d1d1f;
  --maru-sub: #6e6e73;
  --maru-faint: #8e8e93;
  --maru-line: #e5e5ea;
  --maru-soft: #f5f5f7;
  --maru-canvas: #f5f5f7;
  --maru-focus: #1463d6;
  --maru-measure: 640px;
}

.maru-language {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--maru-sub);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1;
  white-space: nowrap;
}

.maru-language a,
.maru-language span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: inherit;
  text-decoration: none;
}

.maru-language [aria-current="page"],
.maru-language .is-active {
  color: var(--maru-ink);
  font-weight: 700;
}

.maru-language i {
  margin: 0 5px;
  color: #c7c7cc;
  font-style: normal;
}

.maru-language a:focus-visible,
.maru-language button:focus-visible {
  outline: 2px solid var(--maru-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* editorial: note / sumo. Keep the brand row stable even when sub-navigation grows. */
html[data-maru-surface="editorial"] .site-header {
  position: relative;
  padding-top: 56px;
}

html[data-maru-surface="editorial"] .site-header .site-name {
  display: flex;
  align-items: center;
  min-height: 24px;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .12em;
  line-height: 24px;
}

html[data-maru-surface="editorial"] .site-header .site-name a,
html[data-maru-surface="editorial"] .site-header .site-name span {
  line-height: 24px;
}

html[data-maru-surface="editorial"] .site-header > .maru-language {
  position: absolute;
  top: 48px;
  right: 0;
}

html[data-maru-surface="editorial"] .site-footer .site-lang {
  display: none;
}

/* tool: a neutral outer canvas separates dense work surfaces without tinting them. */
html[data-maru-surface="tool"],
html[data-maru-surface="tool"] body {
  background: var(--maru-canvas);
}

html[data-maru-surface="tool"] .topbar {
  background: rgba(255, 255, 255, .94);
  border-bottom-color: var(--maru-line);
  backdrop-filter: blur(14px);
}

/* immersive: keep the common language grammar without competing with the game. */
html[data-maru-surface="immersive"] .language-toggle {
  letter-spacing: .06em;
}

@media (max-width: 480px) {
  html[data-maru-surface="editorial"] .site-header {
    padding-top: 40px;
  }

  html[data-maru-surface="editorial"] .site-header > .maru-language {
    top: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maru-language a { transition: none !important; }
}
