/* Suwertehin's 01 Ligature identity — deliberately limited to brand surfaces. */
.crm-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.crm-mark,
.crm-wordmark,
.crm-login-mark {
  display: block;
  height: auto;
}

.crm-mark { width: 42px; }
.crm-wordmark { width: 146px; }
.crm-login-mark { width: 74px; margin-block-end: 22px; }

body.theme-dark :is(.crm-mark, .crm-wordmark, .crm-login-mark),
body.theme-high-contrast :is(.crm-mark, .crm-wordmark, .crm-login-mark),
body.theme-terminal :is(.crm-mark, .crm-wordmark, .crm-login-mark) {
  filter: brightness(0) invert(1);
}

.map-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.map-brand img { filter: brightness(0) invert(1); }
.map-brand .crm-mark { width: 34px; }
.map-brand .crm-wordmark { width: 122px; }

.brand-intro { --intro-ready: 1; }
.brand-intro:not([open]) { display: none; }

dialog.brand-intro[open] {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  margin: 0;
  border: none;
  background: #f9f6ef;
  color: #151412;
  overflow: hidden;
  overscroll-behavior: none;
}

.brand-intro::backdrop { background: transparent; }
html:has(.brand-intro[open]) { overflow: hidden; }

.brand-intro__stage {
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.6vh, 25px);
}

.brand-intro__symbol {
  position: relative;
  width: min(44vw, 33vh, 250px);
  aspect-ratio: 409 / 269;
}

.brand-intro__mark,
.brand-intro__digit { position: absolute; }

.brand-intro__mark {
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.brand-intro__digit {
  top: 0;
  height: 100%;
  width: 36.36%;
  margin-left: -18.18%;
}

.brand-intro__digit img { display: block; height: 100%; width: 100%; }
.brand-intro__digit--left { left: 19.32%; }
.brand-intro__digit--center { left: 50%; }
.brand-intro__digit--center img { transform: scaleX(-1); }
.brand-intro__digit--right { left: 80.44%; }

.brand-intro__word {
  display: block;
  width: min(55vw, 41.25vh, 312px);
  height: auto;
  opacity: 0;
}

.brand-intro .brand-intro__skip {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 8px 10px;
  background: transparent;
  color: #393530 !important;
  border: 0;
  border-radius: 0;
  font: 500 .82rem/1.3 system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: .3em;
  cursor: pointer;
}

.brand-intro__skip:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .crm-mark { width: 35px; }
  .crm-wordmark { width: 128px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog.brand-intro[open] { display: none; }
}

@media print {
  dialog.brand-intro[open] { display: none; }
}
