/* Legacy-parity text rendering: the old Creditas site sets
 * -webkit-font-smoothing: antialiased globally, which renders type
 * lighter/thinner on macOS. Webflow Code Components live in isolated
 * shadow roots, so this must be declared per-component on :host to
 * inherit into the shadow tree (the property does not cross the
 * shadow boundary). Without it, Blink defaults to subpixel smoothing
 * and identical 400-weight text looks heavier than the old site. */
:host {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/**
 * HeroSlide — single slide of the HeroSlideshow carousel.
 *
 * Visibility is driven by the parent HeroSlideshow which sets a
 * `data-active` attribute on this code-island host when the slide is
 * the current one. `:host([data-active])` reads that attribute from
 * inside the shadow DOM and toggles the article's opacity.
 *
 * The article is positioned absolutely so multiple slides can stack
 * inside the parent's `.hero-slideshow__slides` container. Webflow's
 * default `display: contents` on `<code-island>` means the article's
 * containing block walks up to the next positioned ancestor, which is
 * the parent's `.hero-slideshow__slides` (set to `position: relative`).
 *
 * Token values inlined from @creditas-ui/themes standard:
 *   colors.primary.40   = #8edb00
 *   colors.primary.60   = #4f9e00
 *   colors.primary.100  = #1c4200
 *   colors.neutral.0    = #ffffff
 *   colors.neutral.80   = #3b4540
 *   colors.neutral.90   = #292929
 *   radius.lg           = 8px
 *   breakpoints.2xl     = 600px
 *
 *   typography.heading.xl  → 40px / 52px / 0.5px / Maison Neue Extended / 400
 *   typography.heading.2xl → 48px / 64px / 0.5px / Maison Neue Extended / 400
 *   typography.body.lg     → 18px / 26px / 0.3px / Helvetica Now Display / 400
 */

@keyframes hero-slide__image-entrance {
  0% {
    transform: scale(1.2) translateY(10px);
    opacity: 0;
  }
  20%,
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes hero-slide__text-fade-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- slide container ------------------------------------------ */

.hero-slide {
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  transform: scale(1) translateY(0);
  pointer-events: none;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.hero-slide *,
.hero-slide *::before,
.hero-slide *::after {
  box-sizing: border-box;
}

/* Active state. Two selectors so the same rule fires in both contexts:
 *  - Webflow runtime: parent sets `data-active` on the `<code-island>`
 *    host; `:host([data-active]) .hero-slide` matches inside the
 *    component's shadow DOM.
 *  - Vite playground: there's no shadow DOM, so the parent sets
 *    `data-active` directly on the `.hero-slide` article element;
 *    `.hero-slide[data-active]` matches that. */
:host([data-active]) .hero-slide,
.hero-slide[data-active] {
  opacity: 1;
  pointer-events: auto;
}

/* Replay the entrance animations whenever the slide becomes active.
 * Animations fire fresh each time the host or article gets
 * `data-active` toggled on (because the rules only apply while the
 * attribute is present). */
:host([data-active]) .hero-slide__image,
.hero-slide[data-active] .hero-slide__image {
  animation: hero-slide__image-entrance 5s both ease-in-out;
}

:host([data-active]) .hero-slide__content,
.hero-slide[data-active] .hero-slide__content {
  animation: hero-slide__text-fade-in 0.8s 1s both ease-out;
}

:host([data-active]) .hero-slide__title,
.hero-slide[data-active] .hero-slide__title {
  animation: hero-slide__text-fade-in 0.8s both ease-out;
}

:host([data-active]) .hero-slide__description,
.hero-slide[data-active] .hero-slide__description {
  animation: hero-slide__text-fade-in 0.8s 1.25s both ease-out;
}

:host([data-active]) .hero-slide__ctas,
.hero-slide[data-active] .hero-slide__ctas {
  animation: hero-slide__text-fade-in 0.8s 1.25s both ease-out;
}

/* ----- image ---------------------------------------------------- */

.hero-slide__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.1);
  transition: transform 5s ease-in-out;
}

.hero-slide:hover .hero-slide__image {
  transform: scale(1);
}

/* ----- inner content container ---------------------------------- */

.hero-slide__container {
  max-width: 1388px;
  margin: 250px auto 0;
  padding: 20px;
  background: transparent;
}

@media (min-width: 600px) {
  .hero-slide__container {
    margin-top: 255px;
    padding: 40px;
  }
}

/* ----- text content + blur backdrop ----------------------------- */

.hero-slide__content {
  max-width: 410px;
  color: #ffffff;
  display: flex;
  flex-flow: column wrap;
  gap: 1rem;
}

.hero-slide__content::after {
  position: absolute;
  content: '';
  width: 100%;
  height: 100%;
  background-color: #000;
  inset: 0;
  z-index: -1;
  filter: blur(100px);
  transform: scale(1);
  opacity: 0.5;
}

.hero-slide__title {
  margin: 0;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  font-weight: 400;
  font-size: 40px;
  line-height: 52px;
  letter-spacing: 0.5px;
}

@media (min-width: 600px) {
  .hero-slide__title {
    font-size: 48px;
    line-height: 64px;
  }
}

.hero-slide__title b,
.hero-slide__title strong {
  font-weight: 700;
}

.hero-slide__title i,
.hero-slide__title em {
  font-style: italic;
}

.hero-slide__title u {
  text-decoration: underline;
}

.hero-slide__description {
  margin: 0;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 26px;
  letter-spacing: 0.3px;
}

.hero-slide__description b,
.hero-slide__description strong {
  font-weight: 700;
}

.hero-slide__description i,
.hero-slide__description em {
  font-style: italic;
}

.hero-slide__description u {
  text-decoration: underline;
}

/* ----- CTAs ----------------------------------------------------- */

.hero-slide__ctas {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 10px;
  width: 264px;
  margin-top: 12px;
}

.hero-slide__cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  font-family: 'Helvetica Now Display', 'Helveticanowdisplay', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.3px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.hero-slide__cta:focus-visible {
  outline: 2px solid #8edb00;
  outline-offset: 2px;
}

.hero-slide__cta--primary {
  background: #8edb00;
  color: #292929;
}

.hero-slide__cta--primary:hover {
  box-shadow: rgba(0, 0, 0, 0.16) 0px 16px 12px -8px,
    rgba(0, 0, 0, 0.12) 0px 16px 8px -12px;
}

.hero-slide__cta--secondary {
  background: #292929;
  color: #ffffff;
}

.hero-slide__cta--secondary:hover {
  box-shadow: rgba(0, 0, 0, 0.16) 0px 16px 12px -8px,
    rgba(0, 0, 0, 0.12) 0px 16px 8px -12px;
}

