/* 9 · Currencies (round 5): "Dollar changed again? Your products already know."
   Noor's shop. Her imported pieces (rose perfume, evening clutches) are priced in dollars, and their
   tags show dinars at the rate on the exchange board: 1,320. The dollar jumps: the board rolls to
   1,520, a news strip runs under it, the radio crackles, the old tags swing. Konto updates the rate
   by itself (its note pops up under the board; nobody taps anything) and the tags flip to their new
   dinar prices on their own, while Noor stays on her stool with her glass of tea. No recording: the
   drawing tells it all, on desktop over the full width. Laid out on the 1440 x 900 frame; the room mirrors for Arabic,
   the words over it (board, news, tags) never mirror and are placed by hand (Currency.dc.html). */
.ks.cf { --mark: #FFD39A; }
.ks.cf .cf-wall { background: linear-gradient(180deg, #FCEFDB 0%, #F8E2C2 60%, #F3D6AE 100%); }

/* ---------- the shop (one picture, mirrored for Arabic) ---------- */
.ks.cf .cf-view { position: absolute; inset: 0; pointer-events: none; }
.ks.cf .cf-scene { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; transform-origin: 720px 0; }
.ks.cf[dir="rtl"] .cf-scene { transform: scaleX(-1); }
.ks.cf .cf-room, .ks.cf .cf-front { position: absolute; left: 0; top: 0; overflow: visible; }
.ks.cf .cf-front { z-index: 2; }
/* Noor (300 x 342, feet at svg 150,333; x 790) sits on her stool (seat y 792) with her tea the whole time */
.ks.cf .cf-noor { position: absolute; left: 640px; top: 513px; z-index: 1; }
.ks.cf .cf-noor > svg.kc { display: block; overflow: visible; }
.ks.cf .kc .pr-bag, .ks.cf .kc .fing { opacity: 0 !important; }
/* sitting back with a glass of tea in her hand */
.ks.cf .cf-relax .kc { --sh-r: -36.7deg; --el-r: 62.3deg; --sh-l: 46.8deg; --el-l: -127.3deg; }
.ks.cf .cf-tea { position: absolute; left: 112px; top: 154px; overflow: visible; opacity: 0; transition: opacity .3s ease; }
.ks.cf.fx-tea .cf-tea { opacity: 1; transition-delay: .45s; }
.ks.cf .cf-steam { animation: cf-steam 2.4s ease-in-out infinite; }
@keyframes cf-steam { 0%, 100% { opacity: .2; translate: 0 2px; } 50% { opacity: .9; translate: 0 -3px; } }

/* the drama of the jump: a red flash over the board, the radio, her surprise */
.ks.cf .cf-flash { opacity: 0; }
.ks.cf.fx-flash .cf-flash { animation: cf-flash .5s ease-in-out 4 alternate; }
@keyframes cf-flash { from { opacity: 0; } to { opacity: 1; } }
.ks.cf .cf-waves { opacity: 0; transition: opacity .3s ease; }
.ks.cf.fx-waves .cf-waves { opacity: 1; animation: cf-waves .6s ease-in-out infinite alternate; }
@keyframes cf-waves { from { opacity: .35; } to { opacity: 1; } }
.ks.cf .cf-wow path { transform-box: fill-box; transform-origin: 0 100%; scale: 0; transition: scale .35s var(--spring); }
.ks.cf.fx-wow .cf-wow path { scale: 1; }
.ks.cf.fx-wow .cf-wow .cf-w2 { transition-delay: .08s; }
.ks.cf.fx-wow .cf-wow .cf-w3 { transition-delay: .16s; }

/* ---------- the rate board: an exchange shop's split-flap sign ---------- */
.ks.cf .cf-ui { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; z-index: 3; }
.ks.cf .cf-board { position: absolute; width: 492px; box-sizing: border-box; padding: 14px 16px 14px; border-radius: 18px;
  background: linear-gradient(180deg, #23272C, #15181C); box-shadow: inset 0 0 0 3px #3A3F45, inset 0 2px 0 rgba(255,255,255,.08), 0 26px 50px -18px rgba(70,35,5,.55); }
.ks.cf .cf-board.jump { animation: cf-shake .45s ease-in-out 2; }
@keyframes cf-shake { 0%, 100% { rotate: 0deg; } 25% { rotate: -1.6deg; } 75% { rotate: 1.6deg; } }
.ks.cf .cf-bolt { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8A9096, #3B4046); }
.ks.cf .cf-bolt.b1 { left: 10px; top: 10px; } .ks.cf .cf-bolt.b2 { right: 10px; top: 10px; }
.ks.cf .cf-bolt.b3 { left: 10px; bottom: 10px; } .ks.cf .cf-bolt.b4 { right: 10px; bottom: 10px; }
.ks.cf .cf-bh { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #F4C66B; }
.ks.cf[dir="rtl"] .cf-bh { letter-spacing: 0; font-size: 15px; }
.ks.cf .cf-dot { width: 8px; height: 8px; border-radius: 50%; background: #5A3A2A; }
.ks.cf .cf-board.jump .cf-dot, .ks.cf .cf-board.up .cf-dot { background: #FF5A4A; box-shadow: 0 0 10px #FF5A4A; animation: cf-led .5s steps(2) infinite; }
@keyframes cf-led { 50% { opacity: .2; } }
.ks.cf .cf-rr { display: flex; justify-content: center; align-items: center; gap: 5px; }
.ks.cf .cf-t { position: relative; display: inline-grid; place-items: center; min-width: .95em; padding: 0 .16em; height: 1.4em; border-radius: 7px; perspective: 400px;
  font-size: 40px; font-weight: 800; line-height: 1; color: #F4F1EA;
  background: linear-gradient(180deg, #33383E 0 49.4%, #111417 49.4% 50.6%, #2B3035 50.6% 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 0 #0B0D0F; }
.ks.cf .cf-t::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: rgba(0,0,0,.55); }
.ks.cf .cf-t.w { color: #9BD7E3; padding: 0 .26em; font-size: 30px; height: 1.87em; }
.ks.cf .cf-t.cm { min-width: .4em; padding: 0 .06em; }
.ks.cf .cf-t.eq { background: none; box-shadow: none; min-width: .7em; }
.ks.cf .cf-t.eq::after { display: none; }
.ks.cf .cf-board.up .cf-t:not(.w):not(.eq):not(.cm) { color: #FFB4A8; }
.ks.cf .cf-f { display: block; transform-origin: 50% 50%; backface-visibility: hidden; }
.ks.cf .cf-t.in .cf-f { animation: cf-flipin .62s cubic-bezier(.3,.6,.3,1) both; animation-delay: var(--d, 0ms); }
.ks.cf .cf-t.roll .cf-f { animation: cf-roll .9s cubic-bezier(.4,0,.6,1) both; animation-delay: var(--d, 0ms); }
@keyframes cf-flipin { 0% { transform: rotateX(90deg); opacity: 0; } 35% { transform: rotateX(-60deg); opacity: 1; } 60% { transform: rotateX(30deg); } 80% { transform: rotateX(-10deg); } 100% { transform: none; } }
@keyframes cf-roll { 0% { transform: none; } 16% { transform: rotateX(-90deg); } 17% { transform: rotateX(90deg); } 33% { transform: rotateX(-90deg); } 34% { transform: rotateX(90deg); }
  50% { transform: rotateX(-90deg); } 51% { transform: rotateX(90deg); } 67% { transform: rotateX(-90deg); } 68% { transform: rotateX(90deg); } 100% { transform: none; } }
.ks.cf .cf-bf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; min-height: 26px; }
.ks.cf .cf-lamp { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: rgba(244,241,234,.35); white-space: nowrap; transition: color .4s var(--ease); }
.ks.cf .cf-lamp::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #3B4046; box-shadow: inset 0 0 0 2px #2A2E33; transition: background .4s var(--ease), box-shadow .4s var(--ease); }
.ks.cf .cf-board.lamp .cf-lamp { color: #F4C66B; }
.ks.cf .cf-board.lamp .cf-lamp::before { background: #FFD983; box-shadow: 0 0 12px #FFC94D, inset 0 0 0 2px #E0A93A; }
.ks.cf .cf-up { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 8px; border-radius: 999px; background: #E5484D; color: #fff; font-size: 15px; font-weight: 800;
  opacity: 0; transform: translateY(6px) scale(.8); transition: opacity .25s ease, transform .45s var(--spring); }
.ks.cf .cf-up svg { width: 14px; height: 14px; }
.ks.cf .cf-board.up .cf-up { opacity: 1; transform: none; transition-delay: .6s; }

/* the news strip under the board */
.ks.cf .cf-news { position: absolute; display: flex; align-items: center; gap: 10px; box-sizing: border-box; width: 440px; padding: 8px 12px; border-radius: 0 0 12px 12px;
  background: #B8302A; color: #fff; box-shadow: 0 12px 24px -12px rgba(120,20,10,.6); overflow: hidden;
  opacity: 0; transform: translateY(-14px); transition: opacity .25s ease, transform .45s var(--spring); }
.ks.cf .cf-news.on { opacity: 1; transform: none; }
.ks.cf .cf-news b { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 2px 8px; border-radius: 6px; background: #fff; color: #B8302A; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ks.cf[dir="rtl"] .cf-news b { letter-spacing: 0; font-size: 13px; }
.ks.cf .cf-news b i { width: 7px; height: 7px; border-radius: 50%; background: #E5484D; animation: cf-led .6s steps(2) infinite; }
.ks.cf .cf-news span { font-size: 15px; font-weight: 800; white-space: nowrap; }
.ks.cf .cf-news.on span { animation: k-rise .45s .15s both var(--ease); }

/* Konto's own note under the board: the rate was updated by itself */
.ks.cf .cf-chip { position: absolute; width: 440px; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px;
  background: #FFFFFF; box-shadow: 0 0 0 2px #0BBAD8, 0 16px 30px -14px rgba(6,20,28,.4);
  opacity: 0; transform: translateY(-12px) scale(.94); transition: opacity .3s ease, transform .5s var(--spring), box-shadow .4s ease; }
.ks.cf .cf-chip.on { opacity: 1; transform: none; }
.ks.cf .cf-chip.rest { box-shadow: 0 0 0 1.5px #A7E6F1, 0 12px 24px -14px rgba(6,20,28,.3); }
.ks.cf .cf-chip img { flex: none; width: 34px; height: 34px; border-radius: 10px; }
.ks.cf .cf-chip span { flex: 1; display: grid; line-height: 1.25; }
.ks.cf .cf-chip b { font-size: 13px; font-weight: 800; color: #0A8A9C; }
.ks.cf .cf-chip small { font-size: 16px; font-weight: 700; color: #0F1D22; }
.ks.cf .cf-chip-ok { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #2BB673; color: #fff; transform: scale(0); transition: transform .45s .35s var(--spring); }
.ks.cf .cf-chip-ok svg { width: 18px; height: 18px; }
.ks.cf .cf-chip.on .cf-chip-ok { transform: none; }

/* the price tags on the shelf: dinars, from the dollar price at the board's rate */
.ks.cf .cf-tag { position: absolute; width: 204px; box-sizing: border-box; display: grid; gap: 1px; padding: 8px 12px 9px 26px; border-radius: 8px 12px 12px 8px;
  background: #FFF8E9; box-shadow: 0 0 0 1.5px #E2C28E, 0 10px 18px -10px rgba(70,35,5,.45); line-height: 1.2; transform-origin: 50% -12px; }
.ks.cf[dir="rtl"] .cf-tag { padding: 8px 26px 9px 12px; border-radius: 12px 8px 8px 12px; }
/* the hole and its string up to the shelf */
.ks.cf .cf-tag::before { content: ""; position: absolute; inset-inline-start: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #F3D6AE; box-shadow: inset 0 0 0 1.5px #C9A26A; }
.ks.cf .cf-tag::after { content: ""; position: absolute; inset-inline-start: 13px; bottom: calc(50% + 3px); width: 2px; height: 30px; background: #9A7A54; }
.ks.cf .cf-tag small { font-size: 14px; font-weight: 700; color: #7A5230; }
.ks.cf .cf-tag b { font-size: 27px; font-weight: 800; color: #1F1A2E; white-space: nowrap; }
.ks.cf .cf-tag em { font-style: normal; font-size: 14px; font-weight: 800; color: #7A5230; }
.ks.cf .cf-pf { display: inline-block; transform-origin: 50% 50%; }
.ks.cf .cf-tag.new b { color: #1E7A4C; }
.ks.cf .cf-tag.pop { animation: cf-tagin .6s var(--spring) both; }
@keyframes cf-tagin { from { opacity: 0; transform: translateY(-14px) rotate(-6deg); } to { opacity: 1; transform: none; } }
.ks.cf .cf-tag.stale { box-shadow: 0 0 0 2px #E39B3B, 0 10px 18px -10px rgba(70,35,5,.45); animation: cf-swing .5s ease-in-out 3 alternate; }
@keyframes cf-swing { from { rotate: -5deg; } to { rotate: 5deg; } }
.ks.cf .cf-tag.flip { animation: cf-glow 1.4s both; }
.ks.cf .cf-tag.flip .cf-pf { animation: cf-pflip .7s cubic-bezier(.4,0,.6,1) both; animation-delay: var(--d, 0ms); }
@keyframes cf-pflip { 0% { transform: none; } 25% { transform: rotateX(-90deg); } 26% { transform: rotateX(90deg); } 50% { transform: rotateX(-90deg); } 51% { transform: rotateX(90deg); } 100% { transform: none; } }
@keyframes cf-glow { 0%, 100% { background: #FFF8E9; } 35% { background: #DDF5E6; box-shadow: 0 0 0 2px #2BB673, 0 10px 18px -10px rgba(70,35,5,.45); } }

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

/* ---------- no recording: the slot stays for the site, never shown ---------- */
.ks.cf .cf-slot { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .ks.cf .cf-steam, .ks.cf .cf-flash, .ks.cf .cf-waves, .ks.cf .cf-board, .ks.cf .cf-dot, .ks.cf .cf-news b i, .ks.cf .cf-tag, .ks.cf .cf-pf, .ks.cf .cf-f { animation: none !important; }
}

/* ---------- phone-only: copy, then the shop (the page's phone is hidden on phones) ---------- */
html.kp-narrow .ks.cf .kframe { display: flex; flex-direction: column; padding: 88px 0 40px; }
html.kp-narrow .ks.cf .cf-copy { position: static; width: auto; padding: 0 20px; order: 1; }
html.kp-narrow .ks.cf .cf-copy .h2 { font-size: 36px; }
html.kp-narrow .ks.cf .cf-copy .lead { font-size: 17px; }
html.kp-narrow .ks.cf .cf-view { position: relative; inset: auto; order: 2; width: 560px; height: 780px; overflow: hidden; margin: 18px auto 0; zoom: .62; }
html.kp-narrow .ks.cf .cf-scene, html.kp-narrow .ks.cf .cf-ui { left: -730px; top: -90px; }
html.kp-narrow .ks.cf[dir="rtl"] .cf-scene, html.kp-narrow .ks.cf[dir="rtl"] .cf-ui { left: -150px; }

/* phones, told full screen (kphone-story.js, story/currencies.js): the whole 1440 x 900 shop, moved
   by the story's camera; the crop above is undone and the words over the shop are drawn a little
   larger so they stay readable on a small screen */
html.kp-narrow .ks.cf[data-kst] .cf-scene, html.kp-narrow .ks.cf[data-kst] .cf-ui,
html.kp-narrow .ks.cf[dir="rtl"][data-kst] .cf-scene, html.kp-narrow .ks.cf[dir="rtl"][data-kst] .cf-ui { left: 0; top: 0; }
html.kp-narrow .ks.cf[data-kst] .cf-wall { inset: 0; }
/* the board, the news and the tags a little larger on a phone, each from its own top */
html.kp-narrow .ks.cf[data-kst] .cf-board, html.kp-narrow .ks.cf[data-kst] .cf-news, html.kp-narrow .ks.cf[data-kst] .cf-chip { scale: 1.12; transform-origin: 50% 0; }
html.kp-narrow .ks.cf[data-kst] .cf-tag { scale: 1.24; }

/* phones: the board hangs from cords that would cross the headline */
html.kp-narrow .ks.cf[data-kst] .cf-cords { display: none; }
