.certificates-page {
  --cert-navy: #061b31;
  --cert-blue: #0a4d88;
  --cert-yellow: #ffb600;
  --cert-line: #d8e2eb;
  --cert-muted: #60758a;
  background: #fff;
  color: #092542;
}

.certificates-page main {
  overflow: hidden;
}

.certificates-hero {
  position: relative;
  min-height: 278px;
  overflow: hidden;
  background-color: var(--cert-navy);
  background-image: url("../media/images/Certificates-banner.jpg");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.certificates-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(3, 22, 40, .18);
  pointer-events: none;
}

.certificates-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: center;
  gap: 40px;
  width: min(1320px, calc(100% - 80px));
  min-height: 278px;
  margin: 0 auto;
  padding: 32px 0 50px;
}

.certificates-hero-copy {
  max-width: 760px;
}

.certificates-eyebrow {
  margin: 0 0 9px;
  color: var(--cert-yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.certificates-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 4vw, 52px);
  line-height: 1.03;
}

.certificates-title-rule {
  display: block;
  width: 62px;
  height: 3px;
  margin: 15px 0 12px;
  background: var(--cert-yellow);
}

.certificates-hero-intro {
  max-width: 700px;
  margin: 0;
  color: #d8e5ef;
  font-size: 14px;
  line-height: 1.6;
}

.certificates-hero-machine {
  display: none;
}

.certificates-overview {
  position: relative;
  z-index: 4;
  width: min(1088px, calc(100% - 48px));
  margin: -34px auto 0;
}

.certificates-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 84px;
  border: 1px solid var(--cert-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 32, 56, .14);
}

.certificate-stat {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 15px 20px;
}

.certificate-stat + .certificate-stat {
  border-left: 1px solid var(--cert-line);
}

.certificate-stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--cert-navy);
}

.certificate-stat-icon svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.65;
}

.certificate-stat > strong {
  flex: 0 0 auto;
  color: var(--cert-navy);
  font-size: 28px;
  line-height: 1;
}

.certificate-stat h2 {
  margin: 0 0 3px;
  color: #0b2b4b;
  font-size: 13px;
  line-height: 1.2;
}

.certificate-stat p {
  margin: 0;
  color: var(--cert-muted);
  font-size: 10px;
  line-height: 1.35;
}

.certificate-featured-section {
  width: min(1180px, calc(100% - 48px));
  margin: 30px auto 96px;
}

.certificate-featured-stage {
  position: relative;
  min-height: 520px;
  padding: 54px 34px 78px;
  border: 1px solid #dce5ec;
  background: #f0f5f8;
  box-shadow: 0 18px 44px rgba(9, 38, 66, .1);
  isolation: isolate;
}

.certificate-featured-stage::before {
  content: "";
  position: absolute;
  inset: 54% 0 auto;
  height: 1px;
  background: #d8e2e9;
}

.certificate-featured-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 375px;
  perspective: 1400px;
}

.certificate-featured-slot {
  position: relative;
  width: clamp(112px, 12.5vw, 168px);
  aspect-ratio: 471 / 719;
  flex: 0 0 auto;
  margin: 0 -8px;
  transform-origin: center bottom;
}

.certificate-featured-card {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 6px;
  border: 5px solid #37291e;
  outline: 3px solid #b3914d;
  background: #d8b965;
  box-shadow: 0 18px 26px rgba(8, 27, 43, .22), inset 0 0 0 1px #f4df97;
  transform-origin: center bottom;
  transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
  will-change: transform;
  pointer-events: none;
}

.certificate-featured-card img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #b8aa87;
  object-fit: cover;
  background: #fff;
}

.certificate-featured-slot:nth-child(1) { z-index: 1; transform: translateY(36px) rotateY(14deg) scale(.88); }
.certificate-featured-slot:nth-child(2) { z-index: 2; transform: translateY(22px) rotateY(10deg) scale(.94); }
.certificate-featured-slot:nth-child(3) { z-index: 3; transform: translateY(8px) rotateY(5deg); }
.certificate-featured-slot:nth-child(4) { z-index: 4; transform: translateY(-12px) scale(1.08); }
.certificate-featured-slot:nth-child(5) { z-index: 3; transform: translateY(8px) rotateY(-5deg); }
.certificate-featured-slot:nth-child(6) { z-index: 2; transform: translateY(22px) rotateY(-10deg) scale(.94); }
.certificate-featured-slot:nth-child(7) { z-index: 1; transform: translateY(36px) rotateY(-14deg) scale(.88); }

.certificate-featured-slot:hover {
  z-index: 20;
}

.certificate-featured-slot:hover .certificate-featured-card {
  transform: scale(1.2);
  filter: saturate(1.04);
  box-shadow: 0 34px 54px rgba(6, 27, 47, .33), inset 0 0 0 1px #f4df97;
}

.certificate-stage-base {
  position: absolute;
  z-index: 1;
  right: 8%;
  bottom: 30px;
  left: 8%;
  height: 62px;
  border: 1px solid #c8d2d9;
  border-radius: 50%;
  background: #e2e9ed;
  box-shadow: 0 22px 28px rgba(8, 33, 53, .2), inset 0 -14px 0 #d1dbe1;
}

.certificate-perspective-section {
  padding: 76px 0 28px;
  background: #eaf4fa;
}

.certificate-perspective-heading {
  width: min(920px, calc(100% - 48px));
  margin: 0 auto 28px;
  text-align: center;
}

.certificate-perspective-heading h2 {
  margin: 0;
  color: #0b2b4b;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.certificate-perspective-heading > p:last-child {
  max-width: 680px;
  margin: 13px auto 0;
  color: #4e6b83;
  font-size: 15px;
  line-height: 1.6;
}

.certificate-perspective-scene {
  position: relative;
  width: min(1180px, calc(100% - 48px));
  height: 330px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d4e4ed;
  background: #dfeef6;
  perspective: 1200px;
}

.certificate-perspective-scene::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: #c9dce7;
}

.certificate-perspective-plane {
  position: absolute;
  top: 20px;
  right: -10%;
  left: -10%;
  transform: rotateX(50deg);
  transform-origin: center top;
  transform-style: preserve-3d;
}

.certificate-perspective-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.certificate-perspective-track.is-ready {
  animation: certificate-scroll-right 36s linear infinite both;
  animation-play-state: running;
}

.certificate-perspective-set {
  display: grid;
  grid-template-rows: repeat(2, 180px);
  grid-auto-columns: 128px;
  grid-auto-flow: column;
  gap: 16px 14px;
  padding-right: 14px;
}

.certificate-perspective-set figure {
  position: relative;
  aspect-ratio: 2480 / 3508;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 0 10px 18px rgba(8, 39, 64, .2);
}

.certificate-perspective-set figure:nth-child(3n + 1) { transform: translateZ(4px); }
.certificate-perspective-set figure:nth-child(3n + 2) { transform: translateZ(10px); }
.certificate-perspective-set figure:nth-child(3n) { transform: translateZ(1px); }

.certificate-perspective-set img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

@keyframes certificate-scroll-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

.certificate-trust-strip {
  display: grid;
  grid-template-columns: 1.15fr 2.45fr;
  align-items: center;
  gap: 32px;
  width: min(1088px, calc(100% - 48px));
  min-height: 82px;
  margin: 24px auto 18px;
  padding: 12px 18px;
  border: 1px solid var(--cert-line);
  border-radius: 5px;
  background: #f7f9fb;
  box-shadow: 0 7px 17px rgba(11, 41, 70, .07);
}

.certificate-trust-copy {
  display: flex;
  align-items: center;
  gap: 15px;
}

.certificate-trust-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  color: #0b2b4b;
}

.certificate-trust-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 1.6;
}

.certificate-trust-copy h2 {
  margin: 0 0 2px;
  color: #0b2b4b;
  font-size: 14px;
}

.certificate-trust-copy p {
  margin: 0;
  color: var(--cert-muted);
  font-size: 10px;
  line-height: 1.35;
}

.certificate-trust-logos {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
}

.certificate-trust-logos figure {
  display: grid;
  place-items: center;
  min-width: 0;
  margin: 0;
}

.certificate-trust-logos img {
  width: auto;
  max-width: 100%;
  height: 42px;
  object-fit: contain;
}

html[dir="rtl"] .certificate-stat + .certificate-stat {
  border-right: 1px solid var(--cert-line);
  border-left: 0;
}

@media (max-width: 1100px) {
  .certificates-hero-inner {
    width: min(100% - 48px, 1000px);
  }

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

  .certificate-stat:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--cert-line);
  }

  .certificate-stat:nth-child(4) {
    border-top: 1px solid var(--cert-line);
  }

  .certificate-featured-stage {
    min-height: 470px;
  }

  .certificate-featured-row {
    min-height: 330px;
  }

  .certificate-perspective-scene {
    height: 315px;
  }
}

@media (max-width: 760px) {
  .certificates-hero {
    min-height: 390px;
    background-position: 32% center;
  }

  .certificates-hero::after {
    background: rgba(3, 22, 40, .42);
  }

  .certificates-hero-inner {
    display: block;
    width: calc(100% - 36px);
    min-height: 390px;
    padding: 54px 0 74px;
  }

  .certificates-hero-copy {
    position: relative;
    z-index: 2;
  }

  .certificates-hero h1 {
    font-size: clamp(34px, 10vw, 48px);
  }

  .certificates-hero-intro {
    font-size: 14px;
  }

  .certificates-overview,
  .certificate-featured-section,
  .certificate-trust-strip {
    width: calc(100% - 32px);
  }

  .certificate-stat {
    padding: 15px;
  }

  .certificate-stat-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .certificate-stat-icon svg {
    width: 29px;
    height: 29px;
  }

  .certificate-stat > strong {
    font-size: 24px;
  }

  .certificate-featured-section {
    margin-top: 24px;
    margin-bottom: 58px;
  }

  .certificate-featured-stage {
    min-height: 0;
    padding: 24px 18px 48px;
  }

  .certificate-featured-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 16px 10px;
    min-height: 0;
  }

  .certificate-featured-slot,
  .certificate-featured-slot:nth-child(n) {
    width: 100%;
    margin: 0;
    transform: none;
  }

  .certificate-featured-card {
    width: 100%;
    padding: 3px;
    border-width: 3px;
    outline-width: 2px;
    transform: none;
  }

  .certificate-featured-slot:nth-child(5) {
    grid-column: 1 / 2;
  }

  .certificate-featured-slot:hover .certificate-featured-card {
    transform: scale(1.08);
  }

  .certificate-stage-base {
    right: 4%;
    bottom: 14px;
    left: 4%;
    height: 42px;
  }

  .certificate-perspective-section {
    padding-top: 54px;
  }

  .certificate-perspective-heading {
    width: calc(100% - 36px);
    margin-bottom: 20px;
  }

  .certificate-perspective-heading h2 {
    font-size: clamp(29px, 8vw, 40px);
  }

  .certificate-perspective-heading > p:last-child {
    font-size: 14px;
  }

  .certificate-perspective-scene {
    width: calc(100% - 24px);
    height: 260px;
  }

  .certificate-perspective-plane {
    top: 14px;
    right: -42%;
    left: -42%;
    transform: rotateX(52deg);
  }

  .certificate-perspective-track.is-ready {
    animation-duration: 32s;
  }

  .certificate-perspective-set {
    grid-template-rows: repeat(2, 132px);
    grid-auto-columns: 94px;
    gap: 10px 8px;
    padding-right: 8px;
  }

  .certificate-perspective-set figure {
    border-width: 3px;
  }

  .certificate-trust-strip {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }

  .certificate-trust-logos {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 10px;
  }

  .certificate-trust-logos img {
    height: 35px;
  }
}

@media (max-width: 460px) {
  .certificates-stats {
    grid-template-columns: 1fr;
  }

  .certificate-stat + .certificate-stat,
  .certificate-stat:nth-child(3),
  .certificate-stat:nth-child(4) {
    border-top: 1px solid var(--cert-line);
    border-left: 0;
  }

  .certificate-featured-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .certificate-featured-slot:nth-child(5) {
    grid-column: auto;
  }

  .certificate-featured-slot:nth-child(7) {
    grid-column: 2 / 3;
  }

  .certificate-perspective-scene {
    height: 240px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .certificate-featured-card {
    transition: none;
  }

  .certificate-perspective-track.is-ready {
    animation-duration: 56s;
  }
}
