/* KROWNIA lobby: the logo moment (T25 item 40, bundle 2; lobby-logo-moment.js builds the overlay .krlm).
   The owner's 117 A (2026-11-16): "the background should be more less blur and glassy. make the background very smooth
   blur". The page behind turns into a light frosted glass (a 5 px blur, a little more saturation and a thin translucent
   tint; the script brings the blur in from 0 px with an ease-in-out). That large-area blur is his explicit exception to
   the Design Bible's performance note: small, static once in, and gone on close. The text sits on a glass card of its
   own, so it stays readable over any part of the lobby (measured on the pixels: the frost alone gives 2.0 to 3.9:1 at
   the worst pixel, the card above 11:1). Bidi: no dir="auto" (Design Bible); the paragraph gets unicode-bidi: plaintext,
   the display rule for user-entered text. Colours: one look in both lobby styles (the owner's 142 A), New Theme's blue
   and white (his 127 A). */

/* dark first (the lobby is dark without data-theme), then light */
.krlm {
  --krlm-veil: rgba(13, 18, 32, .42);
  --krlm-frost: blur(5px) saturate(1.2);
  --krlm-ink: #f0f3fb;
  --krlm-ink-2: #c3cbe0;
  --krlm-glow: rgba(99, 160, 255, .22);
  --krlm-caret: #7fb2ff;
  --krlm-line: rgba(255, 255, 255, .16);
  --krlm-x-bg: rgba(24, 32, 54, .6);
  --krlm-shadow: rgba(0, 0, 0, .45);
  --krlm-card: rgba(18, 25, 44, .66);
  --krlm-card-line: rgba(255, 255, 255, .12);
  --krlm-card-shadow: 0 12px 36px rgba(0, 0, 0, .35);
  --krlm-font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
}
html[data-theme="light"] .krlm {
  --krlm-veil: rgba(236, 242, 252, .34);
  --krlm-frost: blur(5px) saturate(1.25);
  --krlm-ink: #0d1834;
  --krlm-ink-2: #3f4c68;
  --krlm-glow: rgba(28, 106, 228, .16);
  --krlm-caret: #1c6ae4;
  --krlm-line: rgba(255, 255, 255, .7);
  --krlm-x-bg: rgba(255, 255, 255, .62);
  --krlm-shadow: rgba(28, 52, 110, .24);
  --krlm-card: rgba(255, 255, 255, .7);
  --krlm-card-line: rgba(255, 255, 255, .8);
  --krlm-card-shadow: 0 12px 36px rgba(28, 52, 110, .16);
}

/* above the lobby's windows (300) and its side bar (110), below the shared dialog (100000), which preempts it */
.krlm {
  position: fixed; inset: 0; z-index: 1000; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  font-family: var(--krlm-font); color: var(--krlm-ink); -webkit-tap-highlight-color: transparent; cursor: default;
}
.krlm * { box-sizing: border-box; }
.krlm.is-closing { pointer-events: none; }
/* the page behind: the frost (brought in by the script); a soft glow where the logo lands */
.krlm-veil {
  position: fixed; inset: 0; background: var(--krlm-veil);
  -webkit-backdrop-filter: var(--krlm-frost); backdrop-filter: var(--krlm-frost);
}
.krlm-veil::after {
  content: ""; position: absolute; left: 50%; top: var(--krlm-glow-y, 50%); width: min(90vmin, 680px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, var(--krlm-glow), transparent);
  pointer-events: none;
}
.krlm-x {
  position: fixed; z-index: 2; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  width: 44px; height: 44px; display: grid; place-items: center; margin: 0; padding: 0; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--krlm-line); background: var(--krlm-x-bg); color: var(--krlm-ink);
  -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.krlm-x svg { width: 22px; height: 22px; }
.krlm-x:focus-visible { outline: 2px solid var(--krlm-caret); outline-offset: 2px; }
/* the stage: the logo (its centre on the screen's centre; the script sets the top) and the card under it */
.krlm-stage {
  position: absolute; z-index: 1; left: 0; right: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; padding: 0 16px 24px;
}
.krlm-logo {
  --krlm-logo-w: clamp(132px, 30vmin, 220px);
  display: block; flex: none; width: var(--krlm-logo-w); height: calc(var(--krlm-logo-w) * .89); object-fit: contain;
  transform-origin: 0 0; will-change: transform; cursor: pointer;
  filter: drop-shadow(0 12px 28px var(--krlm-shadow));
}
/* the glass card behind the text: its own stronger frost, only where the text is; as large as the whole text from the
   start, so it never grows while the text types */
.krlm-card {
  margin: 22px 0 0; max-width: min(36em, 100%); padding: 16px 22px 14px; border-radius: 20px; cursor: pointer;
  background: var(--krlm-card); border: 1px solid var(--krlm-card-line); box-shadow: var(--krlm-card-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
}
.krlm-text {
  margin: 0; font-size: clamp(17px, calc(1rem + .4vw), 22px); line-height: 1.6; font-weight: 600; letter-spacing: -.003em;
  text-align: center; color: var(--krlm-ink); unicode-bidi: plaintext; overflow-wrap: break-word;
}
.krlm-rest { color: transparent; }
/* the caret: an empty inline box with a 2 px border; its -1 px margins give it no width, so the line never moves */
.krlm-caret { border-left: 2px solid transparent; margin: 0 -1px; }
.krlm-caret.is-on { border-left-color: var(--krlm-caret); }
.krlm-hint { margin: 10px 0 0; font-size: 13.5px; font-weight: 600; text-align: center; color: var(--krlm-ink-2); opacity: 0; }
.krlm-hint.is-shown { opacity: 1; }
.krlm-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.krlm.is-calm .krlm-caret { display: none; }
/* the source logos leave their place while the moment is open (a root class: it survives the side bar's rebuild) */
html.kr-logo-moment-open .site-header .sh-logo,
html.kr-logo-moment-open .nt-side .nt-logo { visibility: hidden; }

@media (max-width: 540px) {
  .krlm-card { margin-top: 18px; padding: 14px 16px 12px; border-radius: 18px; }
}
/* the caret's blink and the hint's fade only for a reader who did not ask for reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .krlm-caret.is-blink { animation: krlm-blink 1.06s steps(1, end) infinite; }
  .krlm-hint { transition: opacity .3s ease; }
}
@keyframes krlm-blink { 50% { border-left-color: transparent; } }
