/* Recent work, Case study, How it works, Trust strip */

@keyframes countUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes timelineIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==============================
   TRUST STRIP
   ============================== */
.trust-strip {
  background: var(--cream);
  color: var(--ink);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 26px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(46, 247, 199, 0.18);
}

.trust-strip .trust-ico {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.trust-strip .trust-body {
  flex: 1;
}

.trust-strip .trust-eyebrow {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.trust-strip .trust-txt {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(6, 9, 32, 0.8);
}

.trust-strip .trust-stats {
  display: flex;
  gap: 28px;
  text-align: right;
  flex-shrink: 0;
}

.trust-strip .stat-n {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 24px;
  color: var(--ink);
  line-height: 1;
  opacity: 0;
  transform: translateY(4px);
}

.trust-strip .stat-k {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(6, 9, 32, 0.5);
  margin-top: 4px;
}

/* Animate stats when in view */
.trust-strip.in .stat-n {
  animation: countUp 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.trust-strip.in .trust-stats > div:nth-child(1) .stat-n { animation-delay: 0.05s; }
.trust-strip.in .trust-stats > div:nth-child(2) .stat-n { animation-delay: 0.20s; }
.trust-strip.in .trust-stats > div:nth-child(3) .stat-n { animation-delay: 0.35s; }

.trust-hex-deco {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  opacity: 0.14;
  pointer-events: none;
}

@media (max-width: 767px) {
  .trust-strip {
    margin: 0;
    flex-wrap: wrap;
    gap: 16px;
  }
  .trust-strip .trust-stats {
    width: 100%;
    justify-content: space-around;
    text-align: center;
  }
}

/* ==============================
   SECTION SEPARATOR
   ============================== */
.section-divider {
  padding: 0 28px;
}

/* ==============================
   WORK SECTION HEAD
   ============================== */
.work-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 0;
  margin-bottom: 16px;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: var(--section-pt);
}

.work-head h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-top: 6px;
}

/* ==============================
   WORK GRID
   ============================== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-card .work-ph {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  background: var(--ink-2);
  position: relative;
  overflow: hidden;
}

.work-card .work-ph img.key {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.work-card .work-ph .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 32, 0) 55%, rgba(6, 9, 32, 0.72) 100%);
  transition: background 0.5s;
}

.work-card .logo-on {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.work-card .logo-on img {
  height: 40px;
  max-width: 85%;
  width: auto;
  object-fit: contain; /* prevent vertical stretch on mobile */
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.75));
}

.work-card[data-fit="tall"] .logo-on img { height: 52px; }

.work-card:hover .work-ph { transform: translateY(-4px); box-shadow: 0 24px 50px -20px rgba(6, 9, 32, 0.45); }
.work-card:hover .work-ph img.key { transform: scale(1.05); }
.work-card:hover .work-ph .scrim { background: linear-gradient(180deg, rgba(6, 9, 32, 0.1) 40%, rgba(6, 9, 32, 0.85) 100%); }
.work-card:hover .logo-on { transform: translateY(-4px); }

.work-ph { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.5s; }

.work-card .card-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  margin-top: 6px;
  color: var(--fg);
}

.work-card .card-link {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.work-card .card-link:hover { color: var(--aqua); }

/* Platform badges — used on work cards, hero art, case study */
.platform-badges {
  display: flex;
  gap: 5px;
  align-items: center;
}

.platform-icon {
  width: 15px;
  height: 15px;
  filter: brightness(0) invert(1);
  opacity: 0.70;
  flex-shrink: 0;
  display: block;
}

/* Work card: top-right corner of image */
.work-ph .platform-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

/* Case study: top-right corner of art, mirrors the tier badge */
.cs-art .platform-badges {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
}

/* Hero art badge: inline row beneath the game name */
.hero-art-badge .platform-badges {
  margin-top: 7px;
}

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .work-head { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 64px; margin-top: 32px; /* space above border so it doesn't sit flush against previous section */ }
  .work-head h2 { font-size: 20px; }
  .casestudy { padding-top: 64px; margin-top: 32px; /* space above border so it doesn't sit flush against previous section */ }
  .work-card .logo-on img { max-height: 32px; } /* reduce logo size on mobile, maintain aspect ratio */
}

/* ==============================
   CASE STUDY
   ============================== */
.casestudy {
  border-top: 1px solid var(--line);
  padding-top: var(--section-pt);
  margin-top: 36px;
}

.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.cs-grid h2 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 8px 0 16px;
  color: var(--fg);
  max-width: 22ch;
}

.cs-lede {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 24px;
  max-width: 50ch;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cs-stat .n {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 24px;
  color: var(--aqua);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}

.cs-stat .l {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.4;
}

.cs-quote {
  border-left: 2px solid rgba(46, 247, 199, 0.45);
  padding-left: 16px;
  margin: 0 0 22px;
}

.cs-quote p {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: rgba(243, 244, 248, 0.72);
  line-height: 1.6;
  margin: 0 0 8px;
}

.cs-quote .who {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.cs-art {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
  position: relative;
  aspect-ratio: 5 / 4;
  background: var(--ink-2);
}

.cs-art img:not(.platform-icon) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-art .scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 9, 32, 0) 55%, rgba(6, 9, 32, 0.72) 100%);
  pointer-events: none;
}

.cs-art .cs-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(6, 9, 32, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--aqua);
  padding: 5px 10px;
  border-radius: 999px;
  z-index: 2;
  white-space: nowrap;
  line-height: 1;
}

.cs-art .logo-on {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
}

.cs-art .logo-on img {
  max-height: 56px;
  max-width: 60%;
  width: auto;
  height: auto;
  filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.75));
}

@media (max-width: 900px) {
  .cs-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 767px) {
  .cs-stats { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* ==============================
   HOW IT WORKS
   ============================== */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  position: relative;
}

.how-grid::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 32px;
  height: 2px;
  background: var(--aqua);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0.28;
  transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s;
  z-index: 0;
}

.how-grid.in::before { transform: scaleX(1); }

.how-card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px 22px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
}

.how-grid.in .how-card { animation: timelineIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.how-grid.in .how-card:nth-child(1) { animation-delay: 0.05s; }
.how-grid.in .how-card:nth-child(2) { animation-delay: 0.20s; }
.how-grid.in .how-card:nth-child(3) { animation-delay: 0.35s; }
.how-grid.in .how-card:nth-child(4) { animation-delay: 0.50s; }

.how-card .stage {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.how-card:nth-child(1) .stage { color: var(--aqua); }
.how-card:nth-child(2) .stage { color: #395EE5; }
.how-card:nth-child(3) .stage { color: var(--fuchsia); }
.how-card:nth-child(4) .stage { color: var(--jasmine); }

.how-card .how-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 10px;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.how-card .how-body {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: rgba(243, 244, 248, 0.52);
  line-height: 1.6;
  font-weight: 300;
}

@media (max-width: 900px) {
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid::before { display: none; }
}

@media (max-width: 767px) {
  .how-grid { grid-template-columns: 1fr; gap: 10px; }
}
