/* The IZI Morocco app on the home page: a dark panel in both themes, with two real screens of the game.
   The second half of this file is shared with the app page: store buttons, phones, rings, floating cards. */

.app-showcase-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  overflow: hidden;
  padding: clamp(28px, 4.5vw, 72px);
  border: 1px solid rgb(255 210 94 / .16);
  border-radius: clamp(16px, 2vw, 30px);
  background:
    radial-gradient(ellipse 46% 62% at 76% 50%, rgb(240 180 77 / .22), transparent 70%),
    radial-gradient(ellipse 40% 50% at 0% 100%, rgb(240 180 77 / .07), transparent 70%),
    #0a0806;
  color: #ffdf8a;
}
/* A fine gold grid around the phones, and film grain. */
.app-showcase-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 214 120 / .07) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 214 120 / .07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 42% 66% at 76% 50%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 42% 66% at 76% 50%, #000 15%, transparent 72%);
  pointer-events: none;
}
.app-showcase-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  background-size: 180px 180px;
  opacity: .07;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.app-showcase .eyebrow { color: var(--gold-l); }
.app-showcase .section-title { color: #fff; }
.app-showcase .section-title span { display: block; }
.app-showcase-accent {
  background: linear-gradient(100deg, #ffe3a1 0%, #f0b44d 45%, #c98a2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.app-showcase .lead { max-width: 46ch; color: #e6c777; }

/* Short labels of what the app does: two even columns on a computer, wrapping freely on a phone. */
.app-showcase-chips { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 10px; margin: 26px 0 30px; padding: 0; list-style: none; }
.app-showcase-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-block: 8px;
  padding-inline: 10px 14px;
  border: 1px solid rgb(255 214 120 / .22);
  border-radius: 999px;
  background: rgb(255 214 120 / .06);
  color: #f3e6c4;
  font-size: 14px;
  font-weight: 600;
}
.app-showcase-chips .icon { flex: none; width: 18px; height: 18px; color: var(--gold-l); }

.app-showcase-languages { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; color: #bfae86; font-size: 14px; }
.app-showcase-languages .icon { flex: none; width: 18px; height: 18px; color: var(--gold-l); }
.app-showcase-more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; color: var(--gold-l); font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.app-showcase-more:hover { color: #ffdf8a; }

/* Two real screens: a mission behind, the 3D map in front, each with a card from the game.
   In Arabic the phones turn the other way through --turn, and the cards swap sides (rtl.css). */
.app-showcase-stage {
  --turn: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(460px, 42vw, 600px);
  perspective: 1600px;
  direction: ltr;
}
.app-showcase-stage .app-rings { width: min(118%, 640px); }
.app-showcase-stage .app-device { position: absolute; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.app-showcase-stage .app-device--front {
  z-index: 2;
  width: clamp(210px, 17vw, 256px);
  transform: translateX(calc(16% * var(--turn))) rotateY(calc(-12deg * var(--turn))) rotateX(4deg);
}
.app-showcase-stage .app-device--back {
  z-index: 1;
  width: clamp(176px, 14vw, 212px);
  filter: brightness(.72) saturate(.85);
  transform: translateX(calc(-54% * var(--turn))) translateY(4%) rotateY(calc(-12deg * var(--turn))) rotateZ(calc(-7deg * var(--turn)));
}
.app-showcase-stage .app-float--1 { top: 12%; left: 0; }
.app-showcase-stage .app-float--2 { bottom: 13%; right: 0; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .app-showcase-stage:hover .app-device--front { transform: translateX(calc(16% * var(--turn))) translateY(-8px) rotateY(calc(-4deg * var(--turn))) rotateX(2deg); }
  .app-showcase-stage:hover .app-device--back { transform: translateX(calc(-60% * var(--turn))) translateY(4%) rotateY(calc(-12deg * var(--turn))) rotateZ(calc(-9deg * var(--turn))); }
}

@media (max-width: 860px) {
  /* On phones the screens come right after the title, before the labels and the buttons. */
  .app-showcase-panel { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .app-showcase-panel::before {
    -webkit-mask-image: radial-gradient(ellipse 80% 26% at 50% 46%, #000 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 80% 26% at 50% 46%, #000 15%, transparent 72%);
  }
  .app-showcase-copy { display: contents; }
  .app-showcase-copy > .eyebrow, .app-showcase-copy > .section-title, .app-showcase-copy > .lead { order: 1; }
  .app-showcase-copy > .lead { margin-bottom: 0; }
  .app-showcase-stage { order: 2; min-height: 420px; margin-block: 14px 0; }
  .app-showcase-stage .app-device--front { width: 184px; }
  .app-showcase-stage .app-device--back { width: 148px; }
  .app-showcase-stage .app-float--1 { top: 6%; }
  .app-showcase-stage .app-float--2 { bottom: 8%; }
  .app-showcase-chips, .app-showcase-stores, .app-showcase-languages, .app-showcase-more { order: 3; }
  .app-showcase-panel { padding: clamp(22px, 5vw, 40px); }
  .app-showcase-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .app-showcase-chips li { gap: 6px; padding-inline: 10px 12px; }
  .app-showcase-chips .icon { width: 16px; height: 16px; }
}

/* ---------- Shared with the app page ---------- */

/* Store buttons (<x-public.store-badges>): two lines, like the stores' own badges. For dark panels. */
.app-stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding-block: 9px;
  padding-inline: 20px 26px;
  border: 1px solid rgb(255 214 120 / .34);
  border-radius: 999px;
  background: rgb(255 255 255 / .04);
  color: #fff8e6;
  line-height: 1.15;
  text-align: start;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.store-badge .icon { flex: none; width: 26px; height: 26px; }
.store-badge small { display: block; opacity: .8; font-size: 14px; font-weight: 500; }
.store-badge strong { display: block; font-size: 19px; font-weight: 700; }
.store-badge:hover { border-color: rgb(255 214 120 / .65); background: rgb(255 214 120 / .09); transform: translateY(-2px); }
.store-badge--primary {
  border-color: transparent;
  background: linear-gradient(180deg, #ffd879, #f0b44d);
  color: #150f05;
  box-shadow: 0 14px 34px -12px rgb(240 180 77 / .6), inset 0 1px 0 rgb(255 255 255 / .45);
}
.store-badge--primary:hover { border-color: transparent; background: linear-gradient(180deg, #ffe39a, #f5bd5c); }

/* A simple phone frame, used by the screens row of the app page. */
.app-phone {
  --phone-radius: clamp(24px, 2.4vw, 38px);
  position: relative;
  padding: 7px;
  border-radius: var(--phone-radius);
  background: linear-gradient(150deg, #3a3326, #0d0c09 60%);
  box-shadow: 0 28px 60px rgb(0 0 0 / .55), inset 0 0 0 1px rgb(255 210 94 / .22);
}
.app-phone img { display: block; width: 100%; height: auto; border-radius: calc(var(--phone-radius) - 7px); }

/* A phone with a metal edge and a reflection on the glass. */
.app-device {
  --device-radius: clamp(30px, 3vw, 46px);
  position: relative;
  padding: 9px;
  border-radius: var(--device-radius);
  background: linear-gradient(150deg, #574a31 0%, #17130d 24%, #0a0806 62%, #3d3324 100%);
  box-shadow:
    inset 0 0 0 1px rgb(255 226 150 / .3),
    inset 0 0 0 3px #050403,
    0 60px 120px -32px rgb(0 0 0 / .95),
    0 30px 90px -44px rgb(240 180 77 / .55);
}
.app-device img { display: block; width: 100%; height: auto; border-radius: calc(var(--device-radius) - 9px); }
.app-device::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: calc(var(--device-radius) - 9px);
  background: linear-gradient(118deg, rgb(255 255 255 / .17) 0%, rgb(255 255 255 / .04) 26%, transparent 40%);
  pointer-events: none;
}

/* Rings behind the phones, one of them spreading out like a position on a map. */
.app-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(118%, 700px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 58px, rgb(255 214 120 / .11) 59px 60px);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  translate: -50% -50%;
  pointer-events: none;
}
.app-rings::after {
  content: "";
  position: absolute;
  inset: 32%;
  border: 1px solid rgb(255 214 120 / .5);
  border-radius: 50%;
  opacity: 0;
}

/* Cards from the game that float around the phones. Each page sets their places. */
.app-floats { position: absolute; inset: 0; z-index: 3; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.app-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-block: 11px;
  padding-inline: 11px 18px;
  border: 1px solid rgb(255 214 120 / .22);
  border-radius: 18px;
  background: rgb(24 19 11 / .7);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 24px 48px -18px rgb(0 0 0 / .75), inset 0 1px 0 rgb(255 255 255 / .08);
  color: #fff8e6;
  white-space: nowrap;
}
.app-float strong { display: block; font-size: 15px; line-height: 1.25; }
.app-float small { display: block; color: #d9c9a0; font-size: 14px; line-height: 1.3; }
.app-float-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(180deg, #ffd879, #e9a73c); color: #1a1205; }
.app-float-icon .icon { width: 20px; height: 20px; }
/* Sound bars on the audio narration card. */
.app-float-wave { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; margin-inline-start: 4px; }
.app-float-wave i { width: 3px; height: 100%; border-radius: 2px; background: #f0b44d; transform: scaleY(.45); transform-origin: bottom; }
.app-float-wave i:nth-child(2) { transform: scaleY(.95); }
.app-float-wave i:nth-child(3) { transform: scaleY(.6); }
.app-float-wave i:nth-child(4) { transform: scaleY(.8); }

@media (max-width: 760px) {
  .app-stores { flex-direction: column; }
  .store-badge { justify-content: center; }
  .app-float { gap: 9px; padding-block: 8px; padding-inline: 8px 14px; border-radius: 14px; }
  .app-float-icon { width: 32px; height: 32px; border-radius: 10px; }
  .app-float-icon .icon { width: 17px; height: 17px; }
  .app-float strong { font-size: 14px; }
  .app-float small, .app-float-wave { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .app-float { animation: app-hover 7s ease-in-out infinite; }
  .app-float--2 { animation-delay: -3.5s; }
  .app-float-wave i { animation: app-wave 1.1s ease-in-out infinite; }
  .app-float-wave i:nth-child(2) { animation-delay: -.25s; }
  .app-float-wave i:nth-child(3) { animation-delay: -.5s; }
  .app-float-wave i:nth-child(4) { animation-delay: -.75s; }
  .app-rings::after { animation: app-ping 4.5s cubic-bezier(.2, .6, .3, 1) infinite; }
}
@keyframes app-hover { 50% { translate: 0 -10px; } }
@keyframes app-wave { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes app-ping { 0% { opacity: .9; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.7); } }
