/* ==========================================================
   ATRA BYTE
   Engagement / Situation Cards
   ========================================================== */

.eng-section {
  --eng-ink: #0b0d18;
  --eng-muted: #666a7d;
  --eng-violet: #5d3de1;
  --eng-soft: #f3f2fa;
  --eng-card: #ffffff;
  --eng-rule: #d7d9e2;

  background: #f6f6fb;
  color: var(--eng-ink);

  padding: clamp(5rem, 8vw, 8rem) 0;

  font-family: inherit;
}


/* ==========================================================
   Container
   ========================================================== */

.eng-inner {
  width: min(1380px, calc(100% - 5rem));
  margin-inline: auto;
}


/* ==========================================================
   Heading
   ========================================================== */

.eng-heading {
  display: flex;
  flex-direction: column;
  align-items: center;

  margin-bottom: clamp(2.8rem, 5vw, 4.5rem);

  text-align: center;
}

.eng-eyebrow {
  margin-bottom: 1rem;

  color: var(--eng-violet);

  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;

  letter-spacing: 0.08em;
}

html[dir="rtl"] .eng-eyebrow {
  letter-spacing: 0;
}

.eng-heading h2 {
  max-width: 20ch;

  margin: 0;

  font-size: clamp(2.25rem, 4vw, 4rem);
  font-weight: 650;
  line-height: 1.25;

  letter-spacing: -0.035em;

  text-wrap: balance;
}

html[dir="rtl"] .eng-heading h2 {
  letter-spacing: 0;
}

.eng-heading p {
  max-width: 50ch;

  margin: 1rem 0 0;

  color: var(--eng-muted);

  font-size: clamp(0.9rem, 1vw, 1.05rem);
  line-height: 1.9;

  text-wrap: pretty;
}


/* ==========================================================
   Cards grid
   ========================================================== */

.eng-cards {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: clamp(1rem, 1.6vw, 1.5rem);
}


/* ==========================================================
   Card
   ========================================================== */

.eng-card {
  position: relative;

  display: flex;
  flex-direction: column;

  min-width: 0;

  overflow: hidden;

  background: var(--eng-card);

  border: 1px solid var(--eng-rule);
  border-radius: 18px;

  transition:
    border-color 0.35s ease,
    background 0.35s ease;
}


/* ==========================================================
   Visual area
   ========================================================== */

.eng-card-visual {
  position: relative;

  height: clamp(16rem, 24vw, 21rem);

  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 75%,
      rgba(93, 61, 225, 0.12),
      transparent 48%
    ),
    #f4f4fb;

  border-bottom: 1px solid var(--eng-rule);
}


/* subtle background structure */

.eng-card-visual::before {
  content: "";

  position: absolute;
  inset: 12%;

  border: 1px solid rgba(93, 61, 225, 0.08);
  border-radius: 50%;

  pointer-events: none;
}

.eng-card-visual::after {
  content: "";

  position: absolute;

  width: 45%;
  aspect-ratio: 1;

  inset-inline-start: -12%;
  bottom: -30%;

  border: 1px solid rgba(93, 61, 225, 0.08);
  border-radius: 50%;

  pointer-events: none;
}


/* ==========================================================
   Number
   ========================================================== */

.eng-card-number {
  position: absolute;

  inset-block-start: 1.25rem;
  inset-inline-start: 1.25rem;

  z-index: 4;

  color: var(--eng-violet);

  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}


/* ==========================================================
   Character image
   ========================================================== */

.eng-card-avatar {
  position: absolute;

  z-index: 1;

  inset-inline-start: 50%;
  bottom: 0;

  width: 88%;
  height: 94%;

  object-fit: contain;
  object-position: center bottom;

  transform: translateX(-50%);

  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

html[dir="rtl"] .eng-card-avatar {
  transform: translateX(50%);
}


/* ==========================================================
   Thought bubble
   ========================================================== */

.eng-thought {
  position: absolute;

  z-index: 5;

  inset-block-start: 1.1rem;
  inset-inline-end: 1.1rem;

  width: min(58%, 12.5rem);

  padding: 0.75rem 0.9rem;

  background: rgba(255, 255, 255, 0.94);

  border: 1px solid rgba(11, 13, 24, 0.12);
  border-radius: 12px;

  color: var(--eng-ink);

  font-size: 0.69rem;
  font-weight: 550;
  line-height: 1.7;

  box-shadow:
    0 8px 30px rgba(11, 13, 24, 0.04);

  backdrop-filter: blur(8px);

  text-wrap: pretty;
}


/* bubble tail */

.eng-thought::after {
  content: "";

  position: absolute;

  inset-inline-end: 1.15rem;
  bottom: -5px;

  width: 9px;
  height: 9px;

  background: #fff;

  border-inline-end: 1px solid rgba(11, 13, 24, 0.12);
  border-bottom: 1px solid rgba(11, 13, 24, 0.12);

  transform: rotate(45deg);
}


/* ==========================================================
   Card body
   ========================================================== */

.eng-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;

  padding: clamp(1.4rem, 2vw, 1.8rem);
}


/* small label */

.eng-card-label {
  color: var(--eng-violet);

  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.5;

  letter-spacing: 0.06em;
}

html[dir="rtl"] .eng-card-label {
  letter-spacing: 0;
}


/* title */

.eng-card h3 {
  max-width: 19ch;

  margin: 0.8rem 0 0;

  font-size: clamp(1.15rem, 1.45vw, 1.45rem);
  font-weight: 650;
  line-height: 1.55;

  text-wrap: balance;
}


/* description */

.eng-card-body > p {
  margin: 0.85rem 0 0;

  color: var(--eng-muted);

  font-size: 0.79rem;
  font-weight: 400;
  line-height: 1.95;

  text-wrap: pretty;
}


/* ==========================================================
   Footer inside each card
   ========================================================== */

.eng-card-footer {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 1rem;

  margin-top: auto;
  padding-top: 1.6rem;
}

.eng-card-footer > span {
  max-width: 12ch;

  color: var(--eng-muted);

  font-size: 0.61rem;
  line-height: 1.6;
}


/* CTA */

.eng-card-footer a {
  display: inline-flex;

  align-items: center;

  gap: 0.5rem;

  flex-shrink: 0;

  color: var(--eng-ink);

  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.4;

  text-decoration: none;
}

.eng-card-footer a > span {
  padding-bottom: 0.25rem;

  border-bottom: 1px solid currentColor;
}

.eng-card-footer a i {
  color: var(--eng-violet);

  font-size: 0.85rem;
  font-style: normal;

  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}


/* ==========================================================
   Hover
   ========================================================== */

@media (hover: hover) {

  .eng-card:hover {
    border-color: rgba(93, 61, 225, 0.4);
  }

  .eng-card:hover .eng-card-visual {
    background:
      radial-gradient(
        circle at 50% 75%,
        rgba(93, 61, 225, 0.18),
        transparent 52%
      ),
      #f2f1fb;
  }

  .eng-card:hover .eng-card-avatar {
    transform:
      translateX(-50%)
      translateY(-5px);
  }

  html[dir="rtl"] .eng-card:hover .eng-card-avatar {
    transform:
      translateX(50%)
      translateY(-5px);
  }

  .eng-card-footer a:hover i {
    transform: translate(3px, -3px);
  }

  html[dir="rtl"] .eng-card-footer a:hover i {
    transform: translate(-3px, -3px);
  }
}


/* ==========================================================
   Focus
   ========================================================== */

.eng-card-footer a:focus-visible {
  outline: 2px solid var(--eng-violet);
  outline-offset: 5px;
  border-radius: 2px;
}


/* ==========================================================
   Section footer
   ========================================================== */

.eng-foot {
  display: flex;

  align-items: center;
  justify-content: center;

  gap: 0.65rem;

  margin-top: 1.75rem;

  color: var(--eng-muted);

  text-align: center;
}

.eng-foot > span {
  color: var(--eng-violet);

  font-size: 0.7rem;
}

.eng-foot p {
  margin: 0;

  font-size: 0.69rem;
  line-height: 1.8;
}


/* ==========================================================
   Tablet
   ========================================================== */

@media (max-width: 1000px) {

  .eng-inner {
    width: calc(100% - 3rem);
  }

  .eng-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eng-card:last-child {
    grid-column: 1 / -1;

    width: calc(50% - 0.75rem);
    justify-self: center;
  }

  .eng-card-visual {
    height: 20rem;
  }
}


/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 700px) {

  .eng-section {
    padding-block: 4.5rem;
  }

  .eng-inner {
    width: calc(100% - 2rem);
  }

  .eng-heading {
    margin-bottom: 2.5rem;
  }

  .eng-heading h2 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .eng-heading p {
    max-width: 34ch;

    font-size: 0.88rem;
  }


  /* Cards stack */

  .eng-cards {
    grid-template-columns: 1fr;

    gap: 1rem;
  }

  .eng-card:last-child {
    grid-column: auto;

    width: 100%;
  }

  .eng-card {
    border-radius: 16px;
  }

  .eng-card-visual {
    height: clamp(17rem, 80vw, 22rem);
  }

  .eng-card-avatar {
    width: 82%;
  }

  .eng-card-body {
    padding: 1.35rem;
  }

  .eng-card h3 {
    max-width: 24ch;

    font-size: 1.2rem;
  }

  .eng-card-footer {
    margin-top: 1.3rem;
  }

}


/* ==========================================================
   Small mobile
   ========================================================== */

@media (max-width: 420px) {

  .eng-inner {
    width: calc(100% - 1.5rem);
  }

  .eng-card-visual {
    height: 17rem;
  }

  .eng-thought {
    width: 58%;

    padding: 0.65rem 0.75rem;

    font-size: 0.64rem;
  }

  .eng-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .eng-card-footer > span {
    max-width: none;
  }

}


/* ==========================================================
   Reduced motion
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

  .eng-card,
  .eng-card-avatar,
  .eng-card-footer a i {
    transition: none !important;
  }

}


