/* ==========================================================================
   UNIT 8 · WHO THIS IS FOR
   --------------------------------------------------------------------------
   Bento mosaic: a title tile, four people tiles (photos) and two
   organisation tiles (one navy icon tile, one wide archive photo).
   • 2 columns mobile · 3 columns tablet · 4 columns desktop, each with its
     own grid-template-areas so every tile keeps a deliberate shape.
   • Entrance: tiles open with staggered clip-path wipes (GSAP, on view).
   • Interaction: a soft teal spotlight follows the pointer across each
     tile (CSS vars --mx / --my set by audience.js; desktop pointers only).
   ========================================================================== */

.audience {
  background: linear-gradient(180deg, var(--c-cloud) 0%, #EEF3F6 100%);
}

.audience__decor {
  background:
    radial-gradient(ellipse 40% 35% at 100% 0%, rgba(0, 169, 182, 0.12), transparent 70%),
    radial-gradient(ellipse 45% 40% at 0% 100%, rgba(1, 62, 106, 0.08), transparent 70%);
}

[dir="rtl"] .audience__decor {
  scale: -1 1;
}

/* ---------------------------------------------------------------------------
   Bento grid
   --------------------------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(9rem, auto);
  gap: var(--space-sm);
  grid-template-areas:
    "title title"
    "cfo   cio"
    "cfo   ops"
    "proc  ent"
    "proc  ent"
    "org   org";
}

@media (min-width: 48rem) {
  .bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(11rem, auto);
    gap: var(--space-md);
    grid-template-areas:
      "title title cio"
      "cfo   ops   proc"
      "cfo   ent   proc"
      "org   org   org";
  }
}

@media (min-width: 64rem) {
  .bento {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(13rem, auto);
    grid-template-areas:
      "title title cfo  cio"
      "ops   ent   cfo  proc"
      "org   org   org  proc";
  }
}

.bento__title { grid-area: title; }
.bento__cfo   { grid-area: cfo; }
.bento__cio   { grid-area: cio; }
.bento__ops   { grid-area: ops; }
.bento__proc  { grid-area: proc; }
.bento__ent   { grid-area: ent; }
.bento__org   { grid-area: org; }

/* ---------------------------------------------------------------------------
   Shared tile shell + pointer spotlight
   --------------------------------------------------------------------------- */
.bento__tile {
  --mx: 50%;
  --my: 50%;

  position: relative;
  overflow: hidden;
  border-radius: var(--r-panel);
  isolation: isolate;
}

.bento__tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(0, 169, 182, 0.28), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}

.bento__tile:hover::before {
  opacity: 1;
}

/* Text-based tiles keep their content above the spotlight layer */
.bento__title > *,
.bento__ent > * {
  position: relative;
  z-index: 2;
}

/* ---------------------------------------------------------------------------
   Title tile
   --------------------------------------------------------------------------- */
.bento__title {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  background-color: var(--c-white);
  box-shadow: var(--shadow-md);
  text-align: center;
}

@media (min-width: 48rem) {
  .bento__title {
    justify-items: start;
    text-align: start;
  }
}

/* Avatar stack drawn from the people in the mosaic */
.avatars {
  display: flex;
  align-items: center;
}

.avatars img,
.avatars__more {
  inline-size: 2.75rem;
  block-size: 2.75rem;
  border-radius: 50%;
  border: 3px solid var(--c-white);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.avatars > * + * {
  margin-inline-start: -0.75rem;
}

.avatars__more {
  display: grid;
  place-items: center;
  background-color: var(--c-navy);
  color: var(--c-teal);
}

.avatars__more svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

/* ---------------------------------------------------------------------------
   Photo tiles
   --------------------------------------------------------------------------- */
.bento__photo {
  min-block-size: 9rem;
  background-color: var(--c-deep-teal);
}

.bento__photo img {
  position: absolute;
  inset: 0;
  z-index: -2;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: scale 0.8s var(--ease-out);
}

.bento__photo:hover img {
  scale: 1.06;
}

.bento__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(2, 17, 58, 0) 40%, rgba(2, 17, 58, 0.82) 100%);
}

/* Glass label */
.bento__label {
  position: absolute;
  inset-inline: var(--space-sm);
  inset-block-end: var(--space-sm);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.625rem;
  border-radius: 14px;
  border: 1px solid var(--c-glass-border);
  background-color: rgba(2, 17, 58, 0.42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: translate var(--dur-micro) var(--ease-out);
}

.bento__tile:hover .bento__label {
  translate: 0 -4px;
}

.bento__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 10px;
  background-color: var(--c-teal);
  color: var(--c-navy);
}

.bento__icon svg {
  inline-size: 1.125rem;
  block-size: 1.125rem;
}

.bento__tile h3 {
  font-size: clamp(0.875rem, 0.82rem + 0.25vw, 1rem);
  line-height: 1.3;
  color: var(--c-on-dark);
}

/* Narrow phones: icon above text so long labels keep room */
@media (max-width: 29.99rem) {
  .bento__photo .bento__label {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .bento__photo .bento__icon {
    inline-size: 1.875rem;
    block-size: 1.875rem;
  }
}

/* ---------------------------------------------------------------------------
   Navy organisation tile (no photo — icon composition)
   --------------------------------------------------------------------------- */
.bento__ent {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(0, 169, 182, 0.28), transparent 70%),
    var(--c-navy);
}

[dir="rtl"] .bento__ent {
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(0, 169, 182, 0.28), transparent 70%),
    var(--c-navy);
}

/* Stacked "ERP modules" motif */
.bento__stack {
  display: grid;
  gap: 0.375rem;
  inline-size: min(100%, 9rem);
}

.bento__stack span {
  block-size: 0.75rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.12);
}

.bento__stack span:nth-child(2) { inline-size: 85%; }
.bento__stack span:nth-child(3) { inline-size: 70%; background-color: rgba(255, 255, 255, 0.08); }
.bento__stack span:first-child  { background-color: var(--c-teal); }

.bento__ent .bento__icon {
  inline-size: 2.75rem;
  block-size: 2.75rem;
}

.bento__ent .bento__icon svg {
  inline-size: 1.375rem;
  block-size: 1.375rem;
}

.bento__ent-foot {
  display: grid;
  gap: var(--space-sm);
}

/* ---------------------------------------------------------------------------
   Pre-animation state (JS motion only)
   --------------------------------------------------------------------------- */
.js-motion .bento:not(.is-open) [data-bento-anim] {
  clip-path: inset(100% 0% 0% 0% round 24px);
}
