/* The IZI Morocco app page. The phone frames come from components/app-showcase.css. */

/* ---------- Top ----------
   Full width and dark in both themes. The copy on one side; on the other, the real app on a phone that
   turns a little toward the pointer (app-page.js), with cards from the game floating around it. */
.app-hero {
  --hero-ink: #fff8e6;
  --hero-muted: #d9c9a0;
  --hero-soft: #a8987a;
  --hero-gold: #f0b44d;
  --hero-gold-light: #ffe3a1;
  --hero-gold-deep: #c98a2a;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid rgb(255 214 120 / .12);
  background: #070604;
  color: var(--hero-ink);
}

.app-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 42% 58% at 72% 50%, rgb(240 180 77 / .26), transparent 70%),
    radial-gradient(ellipse 36% 46% at 8% 100%, rgb(240 180 77 / .09), transparent 70%);
  pointer-events: none;
}
/* A fine gold grid that fades out around the phone. */
.app-hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  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: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 50% 62% at 72% 48%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 50% 62% at 72% 48%, #000 15%, transparent 72%);
}
/* Film grain, as on the home video. */
.app-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  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: .08;
  mix-blend-mode: overlay;
}

.app-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  width: var(--container);
  min-height: clamp(620px, calc(100svh - var(--header-height)), 880px);
  margin-inline: auto;
  padding-block: clamp(48px, 6vw, 96px);
}

.app-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-block: 8px;
  padding-inline: 12px 16px;
  border: 1px solid rgb(255 214 120 / .3);
  border-radius: 999px;
  background: rgb(255 214 120 / .07);
  color: var(--hero-gold-light);
  font-size: 14px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.app-hero-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--hero-gold); }

.app-hero-title { margin-top: 24px; color: var(--hero-ink); font-size: clamp(3.4rem, 6.4vw, 6.6rem); line-height: .92; }
.app-hero-title span { display: block; }
.app-hero-accent {
  background: linear-gradient(100deg, var(--hero-gold-light) 0%, var(--hero-gold) 45%, var(--hero-gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.app-hero-lead { max-width: 46ch; margin: 24px 0 32px; color: var(--hero-muted); font-size: clamp(1.05rem, 1.2vw, 1.2rem); line-height: 1.6; }

.app-hero-perks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 28px 0 0; padding: 0; list-style: none; color: var(--hero-muted); font-size: 15px; }
.app-hero-perks li { display: inline-flex; align-items: center; gap: 8px; }
.app-hero-perks .icon { width: 18px; height: 18px; color: var(--hero-gold); }
.app-hero-devices { margin: 12px 0 0; color: var(--hero-soft); font-size: 14px; }

/* The phones. Their places are the same in Arabic, mirrored through --turn (rtl.css). */
.app-hero-stage {
  --turn: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(500px, 46vw, 660px);
  perspective: 1600px;
  direction: ltr;
}
/* The phone's look comes from components/app-showcase.css. */
.app-hero-stage .app-device { position: absolute; width: clamp(220px, 18.5vw, 280px); }
.app-hero-stage .app-device--front {
  z-index: 2;
  transform:
    translateX(calc(10% * var(--turn)))
    rotateY(calc(-14deg * var(--turn) + var(--tilt-y, 0deg)))
    rotateX(calc(5deg + var(--tilt-x, 0deg)));
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.app-hero-stage .app-device--back {
  z-index: 1;
  width: clamp(180px, 15vw, 226px);
  filter: brightness(.72) saturate(.85);
  transform:
    translateX(calc(-58% * var(--turn)))
    translateY(5%)
    rotateY(calc(-14deg * var(--turn)))
    rotateZ(calc(-7deg * var(--turn)));
}

/* Cards from the game around the phones; their look is in components/app-showcase.css. */
.app-hero-stage .app-float--1 { top: 13%; left: -2%; }
.app-hero-stage .app-float--2 { top: 46%; right: -4%; }
.app-hero-stage .app-float--3 { bottom: 11%; left: 4%; }

/* ---------- Sections ---------- */

/* Four steps in a row. */
.app-how { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Features */
.app-features-section { border-block: 1px solid var(--color-border); background: var(--bg-elevated); }
.app-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px); }
.app-feature { padding: clamp(18px, 2vw, 26px); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--card-bg); }
.app-feature-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgb(255 210 94 / .35); border-radius: 12px; color: var(--gold-text); background: rgb(255 210 94 / .07); }
.app-feature h3 { margin: 16px 0 6px; font-size: 1.05rem; line-height: 1.3; }
.app-feature p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* Screens: a row to swipe through. */
.app-screens { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: clamp(16px, 2vw, 28px); overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.app-screens li { scroll-snap-align: start; }
.app-screen { margin: 0; }
.app-screen .app-phone { width: 100%; max-width: 240px; margin-inline: auto; }
.app-screen figcaption { max-width: 30ch; margin: 14px auto 0; color: var(--text-muted); font-size: .9rem; text-align: center; }

/* Practical information */
.app-info-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.app-info { margin: 0; border-top: 1px solid var(--color-border); }
.app-info-item { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--color-border); }
.app-info dt { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.app-info dt .icon { flex: none; color: var(--gold-text); }
.app-info dd { margin: 0; color: var(--text-muted); }

/* Last call to action */
.app-cta { display: grid; justify-items: center; gap: 6px; padding: clamp(32px, 5vw, 72px); border: 1px solid rgb(255 210 94 / .16); border-radius: var(--radius-lg); background: radial-gradient(ellipse 60% 90% at 50% 0%, rgb(240 180 77 / .16), transparent 70%), #0c0b08; color: #ffdf8a; text-align: center; }
.app-cta .section-title { margin-bottom: 0; color: #fff; }
.app-cta .lead { margin: 0 0 18px; color: #e6c777; }
.app-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.app-cta .btn-primary { min-height: 60px; padding-inline: 30px; background: var(--gold-l); color: #080705; border-color: var(--gold-l); }
.app-cta .btn-primary:hover { background: #ffdf8a; }

/* ---------- Smaller screens ---------- */

@media (max-width: 1100px) {
  .app-how, .app-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .app-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: auto; padding-block: 44px 16px; }
  .app-hero-stage { min-height: 540px; }
  /* The glow and the grid move under the phones, now below the copy. */
  .app-hero-bg { background: radial-gradient(ellipse 75% 38% at 50% 74%, rgb(240 180 77 / .24), transparent 70%); }
  .app-hero-bg::before {
    -webkit-mask-image: radial-gradient(ellipse 75% 40% at 50% 74%, #000 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 75% 40% at 50% 74%, #000 15%, transparent 72%);
  }
}

@media (max-width: 760px) {
  .app-hero-title { font-size: clamp(2.9rem, 13vw, 4.2rem); }
  .app-hero-stage { min-height: 450px; }
  .app-hero-stage .app-device { width: 196px; }
  .app-hero-stage .app-device--back { width: 156px; }
  .app-hero-stage .app-float--3 { display: none; }
  .app-hero-stage .app-float--1 { top: 7%; left: 0; }
  .app-hero-stage .app-float--2 { top: auto; right: 0; bottom: 12%; }

  .app-how, .app-features { grid-template-columns: minmax(0, 1fr); }
  .app-screens { grid-auto-columns: 62%; }
  .app-info-grid { grid-template-columns: minmax(0, 1fr); }
  .app-info-item { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  /* The last buttons stack at the same width, each on one line. */
  .app-cta { padding-inline: 20px; }
  .app-cta-actions { flex-direction: column; align-items: stretch; justify-self: stretch; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .app-hero-copy > * { animation: app-arrive .8s cubic-bezier(.16, 1, .3, 1) backwards; }
  .app-hero-title { animation-delay: .06s; }
  .app-hero-lead { animation-delay: .12s; }
  .app-hero-copy > .app-stores { animation-delay: .18s; }
  .app-hero-perks, .app-hero-devices { animation-delay: .24s; }
  .app-hero-stage .app-device { animation: app-rise 1.1s cubic-bezier(.16, 1, .3, 1) .1s backwards; }
  .app-hero-stage .app-device--back { animation-delay: .25s; }
  .app-hero-stage .app-float { animation: app-pop .7s cubic-bezier(.16, 1, .3, 1) backwards, app-hover 7s ease-in-out infinite; }
  .app-hero-stage .app-float--1 { animation-delay: .6s, 1.3s; }
  .app-hero-stage .app-float--2 { animation-delay: .75s, -1s; }
  .app-hero-stage .app-float--3 { animation-delay: .9s, -3.5s; }
  .app-hero-dot { animation: app-dot 2.4s ease-out infinite; }
}
@keyframes app-arrive { from { opacity: 0; translate: 0 14px; } }
@keyframes app-rise { from { opacity: 0; translate: 0 48px; } }
@keyframes app-pop { from { opacity: 0; scale: .86; } }
@keyframes app-dot { 0% { box-shadow: 0 0 0 0 rgb(240 180 77 / .6); } 70%, 100% { box-shadow: 0 0 0 10px rgb(240 180 77 / 0); } }
