/* Alerts (round 5): Konto tells Noor what is going on with her products. Her phone rings: the notification
   pops out of the phone in her hand as a speech bubble, a bell with its count that opens into the note, then each alert lights its own place at home: the linen dresses
   nearly gone from the rail, and the rose perfume batch close to its date. One place to look at a time. */
.alerts { --mark: #FFD3A6; }
.alerts .al-wall { background: linear-gradient(180deg, #FBF3EA 0%, #F6EADC 60%, #F1E1CD 100%); }

/* ---------- the room (one picture, mirrored for Arabic) ---------- */
.alerts .al-view { position: absolute; inset: 0; pointer-events: none; }
.alerts .al-scene { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; transform-origin: 720px 0; }
.alerts[dir="rtl"] .al-scene { transform: scaleX(-1); }
.alerts .al-room { position: absolute; left: 0; top: 0; overflow: visible; }
.alerts .al-noor { position: absolute; left: 490px; top: 505px; z-index: 1; }
.alerts .al-noor > svg { display: block; overflow: visible; }
.alerts .kc .pr-bag, .alerts .kc .fing { opacity: 0 !important; }

/* light on the one place the beat is about */
.alerts .al-lit { opacity: 0; transition: opacity .6s var(--ease); }
.alerts.lit-low .al-lit-low, .alerts.lit-exp .al-lit-exp { opacity: 1; }
.alerts .al-rail, .alerts .al-cab { transition: opacity .6s var(--ease), filter .6s var(--ease); }
.alerts.lit-low .al-cab, .alerts.lit-exp .al-rail { filter: saturate(.75) brightness(.9); }
.alerts.lit-low .al-empty g { animation: al-sway .8s ease-in-out 2 alternate; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes al-sway { from { rotate: -6deg; } to { rotate: 6deg; } }
.alerts .al-sticker { transform-box: fill-box; transform-origin: 50% 50%; }
.alerts.lit-exp .al-sticker { animation: al-blink 1s ease-in-out 3 alternate; }
@keyframes al-blink { from { scale: 1; } to { scale: 1.35; } }

/* ---------- the words over the picture (never mirrored) ---------- */
.alerts .al-ui { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; z-index: 2; }
/* the notification as a speech bubble out of her phone: its tail ends at the phone in her hand
   (LTR x 622, y 664; the room mirrors for Arabic, so the bubble is placed from the end edge). It pops
   out of the phone as a ringing bell with its count, then opens into the note, then goes back in. */
.alerts .al-say { position: absolute; inset-inline-end: 818px; bottom: 236px; transform-origin: 100% 100%; }
.alerts[dir="rtl"] .al-say { transform-origin: 0 100%; }
.alerts .al-say-in { position: relative; padding: 0 42px 40px 0; transform-origin: 100% 100%; opacity: 0; transform: scale(.12);
  transition: opacity .25s ease, transform .5s var(--spring);
  filter: drop-shadow(0 12px 14px rgba(6,20,28,.24)); }
.alerts[dir="rtl"] .al-say-in { padding: 0 0 40px 42px; transform-origin: 0 100%; }
.alerts .al-say.on .al-say-in { opacity: 1; transform: none; }
.alerts .al-say-b { position: relative; z-index: 1; display: flex; align-items: center; padding: 9px; border-radius: 20px; background: #FFFFFF; border: 2.5px solid #0BBAD8; }
.alerts .al-say-tail { position: absolute; inset-inline-end: 0; bottom: 0; display: block; z-index: 2; overflow: visible; }
.alerts[dir="rtl"] .al-say-tail { transform: scaleX(-1); }
.alerts .al-say-ic { position: relative; flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: #E3F7FA; color: #0A8A9C; }
.alerts .al-say-ic svg { width: 26px; height: 26px; }
.alerts .al-say-ic b { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; display: grid; place-items: center;
  background: #E5484D; color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 0 0 2px #FFFFFF; transform: scale(0); transition: transform .4s .25s var(--spring); }
.alerts .al-say.on .al-say-ic b { transform: none; }
.alerts .al-say.ring .al-say-ic svg { animation: al-ring .5s ease-in-out 4 alternate; transform-origin: 50% 10%; }
@keyframes al-ring { from { rotate: -16deg; } to { rotate: 16deg; } }
.alerts .al-say-t { display: grid; line-height: 1.25; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; margin-inline-start: 0;
  transition: max-width .55s var(--ease), opacity .3s ease, margin .55s var(--ease); }
.alerts .al-say.is-note .al-say-t { max-width: 260px; opacity: 1; margin-inline-start: 12px; padding-inline-end: 6px; transition-delay: 0s, .2s, 0s; }
.alerts .al-say-t b { font-size: 15px; font-weight: 800; color: #0F1D22; }
.alerts .al-say-t small { font-size: 13px; font-weight: 600; color: #4A6275; }
/* the phone buzzes while it rings */
.alerts .al-buzz { position: absolute; left: 80px; top: 133px; overflow: visible; opacity: 0; transition: opacity .3s ease; }
.alerts.s-b0 .al-buzz { opacity: 1; animation: al-buzz .35s ease-in-out 6 alternate; }
@keyframes al-buzz { from { scale: .9; } to { scale: 1.1; } }
.alerts .al-tag span { display: grid; line-height: 1.25; }
.alerts .al-tag { position: absolute; display: flex; align-items: center; gap: 8px; padding: 9px 12px; box-sizing: border-box; border-radius: 12px;
  background: #FFFFFF; line-height: 1.25; opacity: 0; transform: translateY(-10px) scale(.92); transition: opacity .3s ease, transform .5s var(--spring), box-shadow .4s; }
.alerts .al-tag.on { opacity: 1; transform: none; }
.alerts .al-tag b { display: block; font-size: 15px; font-weight: 800; }
.alerts .al-tag small { display: block; font-size: 13px; font-weight: 600; color: #4A6275; }
.alerts .al-tag-low { top: 644px; width: 176px; display: grid; box-shadow: 0 0 0 2px #E39B3B, 0 12px 26px -12px rgba(6,20,28,.4); }
.alerts .al-tag-low b { color: #B8650F; }
.alerts .al-tag-exp { top: 528px; width: 196px; box-shadow: 0 0 0 2px #E5484D, 0 12px 26px -12px rgba(6,20,28,.4); }
.alerts .al-tag-exp svg { flex: none; width: 24px; height: 24px; color: #E5484D; }
.alerts .al-tag-exp b { color: #C0392B; }
.alerts .al-tag.rest { box-shadow: 0 12px 26px -12px rgba(6,20,28,.3); }

/* ---------- copy (start edge) ---------- */
.alerts .al-copy { position: absolute; inset-inline-start: 96px; top: 96px; width: 450px; z-index: 3; }
.alerts .al-eyeic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; color: var(--c700); box-shadow: var(--shadow-1); }
.alerts .al-eyeic svg { width: 18px; height: 18px; }
.alerts .al-copy .h2 { font-size: 48px; }
.alerts .al-copy .lead { margin-top: 14px; font-size: 18px; }
.alerts .al-facts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 5px; }
.alerts .al-facts li { position: relative; padding-inline-start: 18px; font-size: 15px; font-weight: 700; line-height: 1.4; }
.alerts .al-facts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 8px; height: 8px; border-radius: 2px; background: #E39B3B; }
.alerts .al-beats { margin-top: 18px; }
.alerts .al-beats .beats { gap: 4px 18px; }
.alerts .al-beats .beats li { font-size: 14px; padding-bottom: 7px; }

/* ---------- the live phone (end edge) ---------- */
.alerts .al-phone { position: absolute; inset-inline-end: 56px; top: 98px; z-index: 3; }
.alerts .al-phone .phone { --pz: .8; }
.alerts[lang="ar"] .al-p-en, .alerts:not([lang="ar"]) .al-p-ar { display: none; }

@media (prefers-reduced-motion: reduce) { .alerts .al-say-ic svg, .alerts .al-buzz, .alerts .al-empty g, .alerts .al-sticker { animation: none !important; } }

/* ---------- phone-only: copy, then the room (the page's phone is hidden on phones) ---------- */
html.kp-narrow .alerts .kframe { display: flex; flex-direction: column; padding: 88px 0 40px; }
html.kp-narrow .alerts .al-copy { position: static; width: auto; padding: 0 20px; order: 1; }
html.kp-narrow .alerts .al-copy .h2 { font-size: 38px; }
html.kp-narrow .alerts .al-copy .lead { font-size: 17px; }
html.kp-narrow .alerts .al-view { position: relative; inset: auto; order: 2; width: 940px; height: 476px; overflow: hidden; margin: 18px auto 0; zoom: .415; }
html.kp-narrow .alerts .al-scene, html.kp-narrow .alerts .al-ui { left: -90px; top: -372px; }
html.kp-narrow .alerts[dir="rtl"] .al-scene, html.kp-narrow .alerts[dir="rtl"] .al-ui { left: -410px; }
html.kp-narrow .alerts .al-ui > * { scale: 1.45; }
html.kp-narrow .alerts[dir="rtl"] .al-tag-exp { transform-origin: 0 50%; }
html.kp-narrow .alerts:not([dir="rtl"]) .al-tag-exp { transform-origin: 100% 50%; }
html.kp-narrow .alerts .al-phone { display: none !important; }
@media (min-width: 420px) { html.kp-narrow .alerts .al-view { zoom: .45; } }
@media (min-width: 520px) { html.kp-narrow .alerts .al-view { zoom: .56; } }
@media (min-width: 640px) { html.kp-narrow .alerts .al-view { zoom: .7; } }
@media (max-width: 359px) { html.kp-narrow .alerts .al-view { zoom: .37; } }

/* phones, told full screen (kphone-story.js, story/alerts.js): the whole 1440 x 900 room,
   moved by the story's camera; the old phone crop is undone and the words over the room
   are drawn a little larger so they stay readable on a small screen */
html.kp-narrow .alerts[data-kst] .al-scene, html.kp-narrow .alerts[data-kst] .al-ui,
html.kp-narrow .alerts[dir="rtl"][data-kst] .al-scene, html.kp-narrow .alerts[dir="rtl"][data-kst] .al-ui { left: 0; top: 0; }
html.kp-narrow .alerts[data-kst] .al-ui > * { scale: 1.3; }
html.kp-narrow .alerts[data-kst] .al-wall { inset: 0; }
/* one place at a time: the rail's tag steps aside while the camera is on the cabinet */
html.kp-narrow .alerts[data-kst].lit-exp .al-tag-low { opacity: 0; }
