/*
 * Meetem illustrations and glass. Built on meetem-tokens.css: no colour of its own.
 *
 * Decoration only. Nothing here loops: every movement that starts by itself plays once and has
 * come to rest within five seconds (WCAG 2.2.2 — there is no "pause" control because nothing is
 * left to pause). meetem-tokens.css already stops every animation for people who ask for reduced
 * motion; the rules at the end of this file also take away the parts that would otherwise show.
 * Nothing here is used on the call screen while a call is running.
 *
 *   .mt-backdrop    the waiting picture, dimmed and soft, fixed behind the page
 *   .mt-glass       a card you can see that picture through
 *   .mt-art         one illustration (RoomUi.Art inside)
 *   .mt-art--status the unplugged cable across the top of a status card; its light swells twice
 *   .mt-art--hero   the landing page's two video tiles; one pulse runs along the line between them
 *   .mt-art--secure the lock; two rings widen once
 *   .mt-art--band   a picture lying behind words, under a scrim of the page's navy
 *   .mt-layer       one cut-out piece in front of a landing picture: arrives once, then is still
 */

/* ── Behind the glass: waiting to be let in ─────────────────────── */
.mt-backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; animation: mt-art-in 900ms var(--mt-ease) both; }
.mt-backdrop[hidden] { display: none; }
.mt-backdrop picture, .mt-backdrop img { display: block; width: 100%; height: 100%; }
.mt-backdrop img { object-fit: cover; object-position: 50% 45%; opacity: 0.5; filter: blur(3px); transform: scale(1.06); animation: mt-art-settle 4.5s var(--mt-ease) 1 both; }
.mt-backdrop::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, transparent 10%, var(--mt-scrim) 82%); }
.mt-page.has-backdrop .mt-shell { position: relative; z-index: 1; }
.mt-page.is-waiting .mt-shell__top { background: color-mix(in srgb, var(--mt-surface) 78%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.mt-page.is-waiting .mt-glass {
  background: color-mix(in srgb, var(--mt-surface) 66%, transparent);
  border-color: color-mix(in srgb, var(--mt-teal-200) 24%, var(--mt-border));
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--mt-shadow-3);
  transition: background-color var(--mt-slow) var(--mt-ease), border-color var(--mt-slow) var(--mt-ease);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .mt-page.is-waiting .mt-glass { background: color-mix(in srgb, var(--mt-surface) 94%, transparent); }
}
@keyframes mt-art-in { from { opacity: 0; } to { opacity: 1; } }
/* The picture eases back into place once, and stays. */
@keyframes mt-art-settle { from { transform: scale(1.12) translate3d(1%, -0.6%, 0); } to { transform: scale(1.06); } }

/* ── One illustration ───────────────────────────────────────────── */
.mt-art { position: relative; margin: 0; }
.mt-art[hidden] { display: none; }
.mt-art picture { display: block; }
.mt-art img { display: block; width: 100%; height: auto; }

/* ── Status pages: the unplugged cable ──────────────────────────── */
.mt-art--status { overflow: hidden; border-start-start-radius: inherit; border-start-end-radius: inherit; }
.mt-art--status img {
  aspect-ratio: 16 / 7; object-fit: cover; object-position: 50% 44%;
  -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%); mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}
/* The light round the plug swells twice and settles. */
.mt-art__glow {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse 22% 46% at 48% 56%, color-mix(in srgb, var(--mt-accent) 55%, transparent), transparent 100%);
  opacity: 0.4; animation: mt-art-breathe 1.1s ease-in-out 0.3s 4 alternate;
}
@keyframes mt-art-breathe { from { opacity: 0.4; } to { opacity: 0.85; } }
.mt-status .mt-art--status + .mt-empty { padding-block-start: 0; }
/* The page's own sign (clock, link, lock…) sits on the picture's lower edge. */
.mt-status .mt-art--status + .mt-empty .mt-empty__icon { position: relative; margin-block-start: -36px; box-shadow: 0 0 0 4px var(--mt-surface); background: color-mix(in srgb, var(--mt-accent) 16%, var(--mt-surface)); }
.mt-status[data-kind="error"] .mt-art--status + .mt-empty .mt-empty__icon { background: color-mix(in srgb, var(--mt-warning-text) 14%, var(--mt-surface)); }
/* The same picture when a call has FAILED (inside the room page, shown only then; see Call.endScreen). */
.mt-overlay .mt-art--status { width: min(420px, 100%); border-radius: var(--mt-radius-lg); }
.mt-overlay[data-kind="error"] .mt-empty__icon { color: var(--mt-warning-text); background: var(--mt-warning-soft); }
/* "Rejoin" and "you can close this page" are one column, not a button beside a floating line. */
.mt-overlay .mt-empty__actions { flex-direction: column; align-items: center; }
.mt-overlay .mt-art--status:not([hidden]) + .mt-empty__icon { position: relative; margin-block-start: calc(-36px - var(--mt-space-3)); box-shadow: 0 0 0 4px var(--mt-page); background: color-mix(in srgb, var(--mt-warning-text) 14%, var(--mt-page)); }

/* ── Landing: the two tiles ─────────────────────────────────────── */
.mt-art--hero { transform: perspective(1400px) rotateX(var(--mt-tilt-x, 0deg)) rotateY(var(--mt-tilt-y, 0deg)); transition: transform 500ms var(--mt-ease); }
.mt-art--hero picture, .mt-art--secure picture {
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 50%, black 68%, transparent 100%);
          mask-image: radial-gradient(ellipse closest-side at 50% 50%, black 68%, transparent 100%);
}
.mt-art--hero picture { animation: mt-art-in 1200ms var(--mt-ease) both; }
.mt-art--hero img { animation: mt-art-float 4.6s var(--mt-ease) 1 both; }
@keyframes mt-art-float { from { transform: scale(1.06) translate3d(0, 1.2%, 0); } to { transform: none; } }
/* One pulse of light along the line that joins the tiles (40%–60% across, 64% down the picture). */
.mt-art__pulse { position: absolute; inset-inline-start: 38%; inset-block-start: 57%; width: 24%; height: 14%; pointer-events: none; overflow: hidden; mix-blend-mode: screen; }
.mt-art__pulse::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 34%;
  background: radial-gradient(ellipse closest-side, var(--mt-teal-200), transparent 100%);
  animation: mt-art-pulse 3.2s cubic-bezier(0.45, 0, 0.55, 1) 1.3s 1 both;
}
[dir="rtl"] .mt-art__pulse::before { animation-name: mt-art-pulse-rtl; }
@keyframes mt-art-pulse { 0% { transform: translateX(-110%); opacity: 0; } 12% { opacity: 0.9; } 48% { opacity: 0.9; } 60%, 100% { transform: translateX(300%); opacity: 0; } }
@keyframes mt-art-pulse-rtl { 0% { transform: translateX(110%); opacity: 0; } 12% { opacity: 0.9; } 48% { opacity: 0.9; } 60%, 100% { transform: translateX(-300%); opacity: 0; } }

/* ── Landing and privacy: the lock ──────────────────────────────── */
.mt-art--secure { isolation: isolate; }
.mt-art__ring { position: absolute; inset-inline-start: 50%; inset-block-start: 76%; width: 46%; aspect-ratio: 5 / 2; pointer-events: none; border: 1px solid var(--mt-teal-300); border-radius: 50%; translate: -50% -50%; opacity: 0; animation: mt-art-ring 2.6s ease-out 0.4s 1 both; }
[dir="rtl"] .mt-art__ring { translate: 50% -50%; }
.mt-art__ring + .mt-art__ring { animation-delay: 1.8s; }
@keyframes mt-art-ring { 0% { transform: scale(0.5); opacity: 0; } 20% { opacity: 0.55; } 100% { transform: scale(1.9); opacity: 0; } }

/* ── Landing: a picture behind words ────────────────────────────── */
/* The picture fills the band. Over it lies a scrim of the page's navy, at least 86% solid wherever
   words can be, so white on it keeps far more than 4.5 : 1 even where the line of light runs under
   a sentence. The light shows on the far side only. On a narrow screen the words cross the whole
   band, and so does the scrim. Nothing here moves. */
.mt-art--band picture, .mt-art--band img { width: 100%; height: 100%; }
.mt-art--band img { object-fit: cover; object-position: 100% 50%; }
[dir="rtl"] .mt-art--band picture { transform: scaleX(-1); }
.mt-art--band::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, color-mix(in srgb, var(--mt-page) 92%, transparent) 0%, color-mix(in srgb, var(--mt-page) 86%, transparent) 52%, transparent 86%);
}
[dir="rtl"] .mt-art--band::after { background: linear-gradient(to left, color-mix(in srgb, var(--mt-page) 92%, transparent) 0%, color-mix(in srgb, var(--mt-page) 86%, transparent) 52%, transparent 86%); }
@media (max-width: 900px) {
  .mt-art--band::after, [dir="rtl"] .mt-art--band::after { background: color-mix(in srgb, var(--mt-page) 86%, transparent); }
}

/* ── Landing: cut-out pieces in front of a picture ──────────────── */
/* Real transparency, cut by the build script. The specks are light keyed off black: they belong
   on navy and nowhere else (by day they sit on a pane of it, .mt-stay-dark). Each piece arrives once and is at rest within five
   seconds. A piece below the fold waits for meetem-art.js to say it has been reached — and can be
   held back only under ".mt-art-js", the class that script sets itself, so without the script it
   is simply there. Never over words; never on a meeting page. */
.mt-layer { position: absolute; pointer-events: none; translate: var(--mt-near-x, 0px) var(--mt-near-y, 0px); transition: translate 500ms var(--mt-ease); }
.mt-art .mt-layer picture { -webkit-mask-image: none; mask-image: none; animation: none; }
.mt-art .mt-layer img { animation: none; }
.mt-art .mt-layer--lock picture { animation: mt-layer-in 1.2s var(--mt-ease) 1.5s 1 both; filter: drop-shadow(0 10px 18px var(--mt-scrim)); }
.mt-layer--particles { inset: 0; mix-blend-mode: screen; opacity: 0.85; }
.mt-art .mt-layer--particles picture { animation: mt-layer-drift 4.4s var(--mt-ease) 0.4s 1 both; }
.mt-art-js .mt-layer[data-mt-reveal]:not(.is-in):not(.is-there) picture { opacity: 0; }
.mt-art-js .mt-layer[data-mt-reveal].is-in picture { animation: mt-layer-in 1.6s var(--mt-ease) 0.2s 1 both; }
@keyframes mt-layer-in { from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes mt-layer-drift { from { opacity: 0; transform: translate3d(-2.5%, 1.5%, 0); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .mt-layer { translate: none; transition: none; }
  .mt-art .mt-layer picture { animation: none !important; }
  .mt-art-js .mt-layer[data-mt-reveal]:not(.is-in) picture { opacity: 1; }
  .mt-backdrop, .mt-backdrop img, .mt-art--hero picture, .mt-art--hero img { animation: none !important; }
  .mt-art--hero { transform: none; transition: none; }
  .mt-art__glow { animation: none !important; opacity: 0.4; }
  .mt-art__pulse, .mt-art__ring { display: none; }
}
