.nd96-hero {
  --nd96-bg-from: #01572b;
  --nd96-bg-to: #5aba1c;
  --nd96-bg-angle: 270deg;
  --nd96-accent: #ebffe6;
  align-items: center;
  background-color: var(--nd96-bg-to);
  background-image: linear-gradient(var(--nd96-bg-angle), var(--nd96-bg-from), var(--nd96-bg-to));
  display: flex;
  direction: rtl;
  justify-content: flex-start;
  min-height: 491px;
  overflow: hidden;
  position: relative;
  transition: background-color .6s cubic-bezier(.4, 0, .2, 1), background-image .6s cubic-bezier(.4, 0, .2, 1);
}

.nd96-hero::before {
  background-image: url("assets/hero/slider-pattern-n96.svg");
  background-repeat: repeat;
  content: "";
  inset: 0;
  opacity: .34;
  pointer-events: none;
  position: absolute;
}

.nd96-hero--heritage { --nd96-bg-from: #01572b; --nd96-bg-to: #5aba1c; --nd96-accent: #ebffe6; }
.nd96-hero--courage { --nd96-bg-from: #1b2613; --nd96-bg-to: #607c4f; --nd96-accent: #c9e0bb; }
.nd96-hero--ambition { --nd96-bg-from: #340117; --nd96-bg-to: #971a4d; --nd96-accent: #ff85c7; }
.nd96-hero--generosity { --nd96-bg-from: #312d6e; --nd96-bg-to: #6565e0; --nd96-accent: #ded8f7; }
.nd96-hero--kindness { --nd96-bg-from: #011d3a; --nd96-bg-to: #0050af; --nd96-accent: #07b9ff; }
.nd96-hero--vision { --nd96-bg-from: #211501; --nd96-bg-to: #7c5d21; --nd96-accent: #d8b67a; }

.nd96-hero__container {
  width: min(1180px, 92vw);
  margin-inline: auto;
  padding-block: 42px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.nd96-hero__content {
  color: #fff;
  max-width: 640px;
  pointer-events: auto;
  text-align: start;
}

.nd96-hero__deck {
  height: 491px;
  left: 0;
  max-width: 100%;
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 720px;
  z-index: 0;
}

.nd96-hero__slide {
  background-color: transparent;
  background-position: 100%;
  background-repeat: no-repeat;
  background-size: auto 100%;
  border: 0;
  cursor: pointer;
  height: 100%;
  padding: 0;
  position: absolute;
  right: var(--nd96-x, 0);
  top: 0;
  transition: right .6s cubic-bezier(.4, 0, .2, 1) var(--nd96-delay, 0ms), width .6s cubic-bezier(.4, 0, .2, 1) var(--nd96-delay, 0ms), background-position .6s cubic-bezier(.4, 0, .2, 1) var(--nd96-delay, 0ms);
  width: 45.8px;
  z-index: 2;
}

.nd96-hero__slide:not(.is-active) {
  pointer-events: auto;
}

.nd96-hero__slide.is-active {
  background-position: 50%;
  cursor: default;
  width: 491px;
  z-index: 3;
}

.nd96-hero__slide--heritage { background-image: url("assets/hero/hero-heritage-n96.png"); }
.nd96-hero__slide--courage { background-image: url("assets/hero/hero-courage-n96.png"); }
.nd96-hero__slide--ambition { background-image: url("assets/hero/hero-ambition-n96.png"); }
.nd96-hero__slide--generosity { background-image: url("assets/hero/hero-generosity-n96.png"); }
.nd96-hero__slide--kindness { background-image: url("assets/hero/hero-kindness-n96.png"); }
.nd96-hero__slide--vision { background-image: url("assets/hero/hero-vision-n96.png"); }

.nd96-hero__lockup {
  background: url("assets/hero/logo-n96.svg") no-repeat 50% / contain;
  height: 80px;
  margin-bottom: 32px;
  width: 175px;
}

.nd96-hero__title {
  color: #fff;
  font-size: clamp(50px, 5.8vw, 74px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 24px;
  min-height: 1em;
  white-space: nowrap;
}

.nd96-hero__typed { color: var(--nd96-accent); }

.nd96-hero__caret {
  animation: nd96-caret .9s step-end infinite;
  background-color: currentColor;
  display: inline-block;
  height: .72em;
  margin-right: 2px;
  width: 2px;
}

.nd96-hero__body {
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.8;
  margin: 0 0 32px;
  max-width: 680px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s cubic-bezier(.4, 0, .2, 1), transform .5s cubic-bezier(.4, 0, .2, 1);
}

.nd96-hero__body.is-in {
  opacity: 1;
  transform: none;
}

.nd96-hero__controls {
  align-items: center;
  display: flex;
  gap: 22px;
}

.nd96-hero__arrow {
  align-items: center;
  background-color: rgba(27, 131, 84, .92);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 30px;
  height: 48px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: .25s ease;
  width: 48px;
}

.nd96-hero__arrow:hover {
  background-color: #166a45;
  transform: translateY(-2px);
}

.nd96-hero__bullets {
  align-items: center;
  display: flex;
  gap: 8px;
}

.nd96-hero__bullet {
  background-color: rgba(255, 255, 255, .74);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  height: 12px;
  padding: 0;
  transition: .25s ease;
  width: 12px;
}

.nd96-hero__bullet.is-active {
  background-color: #fff;
  transform: scale(1.28);
}

@keyframes nd96-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 1020px) {
  .nd96-hero {
    --nd96-bg-angle: 180deg;
    align-items: center;
    flex-direction: column;
    min-height: 0;
    padding: 34px 20px 42px;
    text-align: center;
  }

  .nd96-hero__container,
  .nd96-hero__content {
    display: contents;
  }

  .nd96-hero__lockup { order: 1; }

  .nd96-hero__deck {
    aspect-ratio: 430 / 324;
    height: auto;
    left: auto;
    max-width: 651px;
    order: 2;
    position: relative;
    top: auto;
    transform: none;
    width: calc(100% + 40px);
  }

  .nd96-hero__slide {
    background-position: 50%;
    background-size: contain;
    height: 73.7%;
    opacity: 0;
    right: calc(22.23% + var(--nd96-rel, 0) * 69.17%);
    top: 13.15%;
    width: 55.54%;
  }

  .nd96-hero__slide.is-near { opacity: 1; }

  .nd96-hero__slide.is-active {
    height: 100%;
    right: 12.33%;
    top: 0;
    width: 75.35%;
  }

  .nd96-hero__title {
    font-size: clamp(38px, 8vw, 50px);
    order: 3;
    text-align: center;
    white-space: normal;
  }

  .nd96-hero__body {
    font-size: 18px;
    line-height: 1.7;
    max-width: 760px;
    order: 4;
    text-align: center;
  }

  .nd96-hero__controls { order: 5; }
  .nd96-hero__arrow { display: none; }
}


/* Scoped to the homepage so internal pages keep their existing design. */
#home .nd96-hero__content { max-width: min(43%, 600px); }
#home .nd96-hero__title { font-size: clamp(38px, 4vw, 64px); line-height: 1.35; white-space: normal; }
#home .nd96-hero__body { font-size: 19px; min-height: 108px; }
.nd96-hero__pause { color: #fff; border: 1px solid #ffffff80; background: #00000026; border-radius: 24px; padding: 8px 14px; font: inherit; font-size: 13px; }
.nd96-hero button:focus-visible { outline: 3px solid white; outline-offset: 5px; }
/* Use the supplied National Day pattern as the background of every homepage section. */
#home > section:not(.nd96-hero) { position: relative; isolation: isolate; overflow: hidden; }
#home > section:not(.nd96-hero)::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: url('assets/patterns/sec-bg-n96.svg') repeat center top / auto 360px; opacity: .13; }
#home > section:not(.nd96-hero) > * { position: relative; z-index: 1; }

/* Full-colour National Day separators between the homepage sections. */
#home > section:not(.nd96-hero)::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 82px;
  z-index: 2;
  pointer-events: none;
  background-position: center top;
  background-repeat: repeat-x;
  background-size: auto 82px;
  opacity: .46;
}
#home-about::after { background-image: url('assets/patterns/arrows-pattern-n96.svg'); }
#home-services::after { background-image: url('assets/patterns/blue-pattern-n96.svg'); }
#home-researches::after { background-image: url('assets/patterns/arrows-pattern-n96.svg'); }
#home-recent-news::after { background-image: url('assets/patterns/blue-pattern-n96.svg'); }
#home > section:last-of-type::after { background-image: url('assets/patterns/brown-pattern-n96.svg'); }
@media (min-width: 1021px) and (max-width: 1450px) {
  #home .nd96-hero__deck { transform: translateY(-50%) scale(.8); transform-origin: left center; }
}
@media (max-width: 1020px) {
  #home .nd96-hero__content { max-width: none; }
  #home .nd96-hero__body { min-height: 100px; font-size: 17px; }
  #home .nd96-hero__controls { gap: 16px; }
  #home .nd96-hero__title { font-size: clamp(32px, 7vw, 50px); }
  .nd96-hero__deck { pointer-events: none; }
  .nd96-hero__arrow { display: inline-flex; height: 34px; width: 34px; }
  .nd96-hero__bullet { width: 10px; height: 10px; }
  .nd96-hero__controls { flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 767px) {
  #home > section:not(.nd96-hero)::after { height: 56px; background-size: auto 56px; opacity: .4; }
}
@media (prefers-reduced-motion: reduce) {
  .nd96-hero, .nd96-hero * { transition: none !important; animation: none !important; }
}
