/* Offline (agent A, round 4): the Friday market at dusk, and no internet at all. Noor still makes the
   sale; it is saved on her phone and backed up when the internet comes back. One place to look at a
   time: the badge over the stall (the internet, then where the sale is kept), or the hands across the table. */
.offline { --mark: rgba(240,168,106,.55); }
.offline .of-bg { background: linear-gradient(180deg, #211F47 0%, #322B58 40%, #5A4170 72%, #7E5368 100%); }
.offline .of-bg::before { content: ""; position: absolute; inset: 0; background: radial-gradient(42% 46% at 52% 62%, rgba(255,198,120,.22), rgba(255,198,120,0)); }

/* ---------- the market ---------- */
.offline .of-view { position: absolute; inset: 0; pointer-events: none; }
.offline .of-scene { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; transform-origin: 720px 0; }
.offline[dir="rtl"] .of-scene { transform: scaleX(-1); }
.offline .of-back, .offline .of-front { position: absolute; left: 0; top: 0; overflow: visible; }
.offline .of-front { z-index: 2; }
.offline .of-noor { position: absolute; left: 550px; top: 489px; z-index: 1; }
.offline .of-cust { position: absolute; left: 755px; top: 513px; z-index: 3; }
.offline .of-noor > svg, .offline .of-cust > svg { display: block; overflow: visible; }
.offline .kc .fing, .offline .kc .pr-box, .offline .kc .pr-bag { opacity: 0 !important; }
.offline .of-cgive .kc { --sh-r: -62.1deg; --el-r: -51.3deg; --sh-l: 7deg; --el-l: -5deg; }
.offline .of-thing { position: absolute; left: 0; top: 0; z-index: 4; will-change: transform; }
.offline .of-thing > svg { display: block; filter: drop-shadow(0 3px 3px rgba(6,10,30,.3)); }
.offline .of-bulb { filter: drop-shadow(0 0 5px rgba(255,217,138,.9)); animation: of-twinkle 2.6s ease-in-out infinite alternate; }
.offline .of-bulb.a1, .offline .of-bulb.b2 { animation-delay: -1.1s; }
.offline .of-bulb.a2, .offline .of-bulb.b0 { animation-delay: -1.9s; }
@keyframes of-twinkle { from { opacity: 1 } to { opacity: .72 } }
.offline .of-lantern { filter: drop-shadow(0 0 8px rgba(255,217,138,.85)); }

/* ---------- the badge: the internet, then where the sale is kept ---------- */
.offline .of-ui { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; z-index: 5; }
.offline .of-badge { position: absolute; top: 272px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; border-radius: 26px; box-sizing: border-box;
  background: #FFFFFF; color: #0F1D22; font-size: 16px; font-weight: 800; white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(11,186,216,0), 0 14px 30px -10px rgba(6,10,30,.55); transition: opacity .5s var(--ease), box-shadow .5s var(--ease), background .4s; }
.offline .of-badge.rest { opacity: .5; }
.offline .of-bars { display: flex; align-items: flex-end; gap: 4px; height: 24px; }
.offline .of-bars i { width: 6px; border-radius: 2px; background: #0BBAD8; transition: background .35s ease; }
.offline .of-bars i:nth-child(1) { height: 7px; } .offline .of-bars i:nth-child(2) { height: 12px; } .offline .of-bars i:nth-child(3) { height: 18px; } .offline .of-bars i:nth-child(4) { height: 24px; }
.offline .of-bt { display: none; align-items: center; gap: 8px; }
.offline .of-bt svg { width: 22px; height: 22px; flex: none; }
.offline .of-bt b { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: inline-grid; place-items: center; background: #1E8449; color: #fff; font-size: 13px; font-weight: 800; box-sizing: border-box; }
/* drain: the bars go out one by one */
.offline .of-badge.b-drain .of-bars i { animation: of-out .35s ease forwards; }
.offline .of-badge.b-drain .of-bars i:nth-child(4) { animation-delay: 0s; } .offline .of-badge.b-drain .of-bars i:nth-child(3) { animation-delay: .3s; }
.offline .of-badge.b-drain .of-bars i:nth-child(2) { animation-delay: .6s; } .offline .of-badge.b-drain .of-bars i:nth-child(1) { animation-delay: .9s; }
@keyframes of-out { to { background: #C9D2D8; } }
.offline .of-badge.b-none .of-bars i, .offline .of-badge.b-saved .of-bars i { background: #C9D2D8; }
.offline .of-badge.b-none .of-bt-none { display: inline-flex; color: #B3261E; }
.offline .of-badge.b-none, .offline .of-badge.b-saved, .offline .of-badge.b-back { animation: of-pop .45s var(--spring) 1; }
@keyframes of-pop { 0% { transform: translateX(-50%) scale(.9) } 60% { transform: translateX(-50%) scale(1.05) } 100% { transform: translateX(-50%) scale(1) } }
.offline .of-badge.b-saved .of-bt-saved, .offline .of-badge.b-fill .of-bt-saved { display: inline-flex; }
.offline .of-badge.b-saved, .offline .of-badge.b-fill { box-shadow: 0 0 0 3px rgba(30,132,73,.55), 0 14px 30px -10px rgba(6,10,30,.55); }
/* fill: the bars come back one by one */
.offline .of-badge.b-fill .of-bars i { background: #C9D2D8; animation: of-in .35s ease forwards; }
.offline .of-badge.b-fill .of-bars i:nth-child(1) { animation-delay: 0s; } .offline .of-badge.b-fill .of-bars i:nth-child(2) { animation-delay: .25s; }
.offline .of-badge.b-fill .of-bars i:nth-child(3) { animation-delay: .5s; } .offline .of-badge.b-fill .of-bars i:nth-child(4) { animation-delay: .75s; }
@keyframes of-in { to { background: #0BBAD8; } }
.offline .of-badge.b-back .of-bt-back { display: inline-flex; color: #0A7F92; }
.offline .of-badge.b-back { box-shadow: 0 0 0 3px rgba(11,186,216,.6), 0 14px 30px -10px rgba(6,10,30,.55); }

/* the sale, as a small card that leaves the phone and is kept */
.offline .of-card { position: absolute; left: 0; top: 0; width: 180px; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; box-sizing: border-box; border-radius: 14px;
  background: #FFFFFF; box-shadow: 0 12px 26px -10px rgba(6,10,30,.6); will-change: transform; }
.offline .of-card i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #1E8449; color: #fff; }
.offline .of-card i svg { width: 15px; height: 15px; }
.offline .of-card span { display: grid; line-height: 1.2; }
.offline .of-card b { font-size: 14px; font-weight: 800; color: #0F1D22; }
.offline .of-card small { font-size: 12px; font-weight: 600; color: #4A6275; }

/* ---------- copy (end edge) ---------- */
.offline .of-copy { position: absolute; inset-inline-end: 64px; top: 104px; width: 340px; }
.offline .of-eyeic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.12); color: #F0A86A; }
.offline .of-eyeic svg { width: 18px; height: 18px; }
.offline .of-copy .h2 { font-size: 52px; }
.offline .of-copy .lead { margin-top: 18px; font-size: 18px; }
.offline .of-facts { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 6px; }
.offline .of-facts li { position: relative; padding-inline-start: 18px; font-size: 15px; font-weight: 700; line-height: 1.4; color: #FFFFFF; }
.offline .of-facts li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 8px; height: 8px; border-radius: 2px; background: #F0A86A; }
.offline .of-beats { margin-top: 26px; }
.offline .of-beats .beats { display: grid; gap: 4px; }
.offline .of-beats .beats li { font-size: 15px; padding-bottom: 8px; }
.offline .of-beats .beats li i { background: #F0A86A; }

/* ---------- the live phone (start edge) ---------- */
.offline .of-phone { position: absolute; inset-inline-start: 72px; top: 98px; }
.offline .of-phone .phone { --pz: .8; }
.offline[lang="ar"] .of-p-en, .offline:not([lang="ar"]) .of-p-ar { display: none; }

/* ---------- narrow: copy, the market, the phone ---------- */
html.kp-narrow .offline .kframe { display: flex; flex-direction: column; padding: 88px 0 40px; }
html.kp-narrow .offline .of-copy { position: static; width: auto; padding: 0 20px; order: 1; }
html.kp-narrow .offline .of-copy .h2 { font-size: 40px; }
html.kp-narrow .offline .of-copy .lead { font-size: 17px; }
html.kp-narrow .offline .of-beats .beats { display: flex; flex-wrap: wrap; gap: 4px 16px; }
html.kp-narrow .offline .of-view { position: relative; inset: auto; order: 2; width: 600px; height: 730px; overflow: hidden; margin: 18px auto 0; zoom: .62; }
html.kp-narrow .offline .of-scene, html.kp-narrow .offline .of-ui { left: -420px; top: -110px; }
html.kp-narrow .offline[dir="rtl"] .of-scene, html.kp-narrow .offline[dir="rtl"] .of-ui { left: -420px; }
html.kp-narrow .offline .of-phone { position: static; order: 3; display: flex; justify-content: center; margin-top: 20px; }
html.kp-narrow .offline .of-phone .phone { --pz: .7; }
@media (min-width: 420px) { html.kp-narrow .offline .of-view { zoom: .68; } }
@media (min-width: 520px) { html.kp-narrow .offline .of-view { zoom: .8; } }
@media (prefers-reduced-motion: reduce) { .offline .of-thing, .offline .of-card { transition: none !important; } .offline .of-bulb { animation: none; } }
/* narrow: the market is drawn small, so its words grow back to a readable size */
html.kp-narrow .offline .of-badge { scale: 1.35; transform-origin: 0 50%; }
html.kp-narrow .offline .of-card { scale: 1.3; }

/* small phones (round 5): the drawing fits the screen width, nothing cut at the edge */
@media (max-width: 389px) { html.kp-narrow .offline .of-view { zoom: 0.6; } }
@media (max-width: 359px) { html.kp-narrow .offline .of-view { zoom: 0.533; } }

/* phones, told full screen (kphone-story.js, story/offline.js): the whole 1440 x 900 market,
   moved by the story's camera; the old phone crop is undone */
html.kp-narrow .offline[data-kst] .of-scene, html.kp-narrow .offline[data-kst] .of-ui,
html.kp-narrow .offline[dir="rtl"][data-kst] .of-scene, html.kp-narrow .offline[dir="rtl"][data-kst] .of-ui { left: 0; top: 0; }
html.kp-narrow .offline[data-kst] .of-bg { inset: 0; }
html.kp-narrow .offline[data-kst] .of-badge { scale: 1.25; }
html.kp-narrow .offline[data-kst] .of-card { scale: 1.25; }
