.hero {
  --hero-inline-padding: var(--space-24);

  position: absolute;
  z-index: 2;
  top: 20%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-40);
  width: calc(100% - (var(--hero-inline-padding) * 2));
  max-width: 1400px;
  max-height: calc(80% - var(--space-16));
  overflow-y: auto;
  color: var(--color-text-inverse);
  transform: translateX(-50%);
}

.hero__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.hero__pagination {
  --hero-dot-duration: 360ms;
  --hero-dot-ease: cubic-bezier(.22, 1, .36, 1);

  display: flex;
  gap: var(--space-8);
  height: 8px;
}

.hero__dot {
  position: relative;
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

/* Extend the hit area without changing the Figma indicator size/spacing. */
.hero__dot::before {
  position: absolute;
  inset: -8px -4px;
  content: "";
}

.hero__dot::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--color-carousel-indicator);
  border-radius: var(--radius-pill);
  content: "";
  opacity: .9;
  transform: translate(-50%, -50%) scale(.9);
  transition:
    width var(--hero-dot-duration) var(--hero-dot-ease),
    background-color var(--hero-dot-duration) var(--hero-dot-ease),
    opacity var(--hero-dot-duration) var(--hero-dot-ease),
    transform var(--hero-dot-duration) var(--hero-dot-ease);
}

.hero__dot[aria-pressed="true"]::after {
  width: 16px;
  background: var(--color-surface-primary);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.hero__dot:focus-visible {
  outline-color: var(--color-text-inverse);
}

.hero__title {
  display: grid;
  font-family: "Noto Serif TC", var(--font-family-sans);
  font-size: 4rem;
  font-style: normal;
  font-weight: 700;
  line-height: 140%;
  overflow-wrap: anywhere;
}

.hero__copy {
  grid-area: 1 / 1;
  opacity: 1;
  transition: opacity var(--hero-crossfade-duration) var(--hero-crossfade-ease);
  will-change: opacity;
}

.hero__copy > span {
  display: block;
}

.hero__copy.is-leaving,
.hero__copy.is-entering {
  opacity: 0;
}

.hero__title.is-initial-enter .hero__copy > span:nth-child(2) {
  animation: hero-title-initial-fade 900ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes hero-title-initial-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__copy {
    transition: none;
  }

  .hero__title.is-initial-enter .hero__copy > span:nth-child(2) {
    animation: none;
  }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
}

.hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-16) var(--space-24);
  border: 1px solid var(--color-surface-primary);
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-brand-primary);
  font-size: var(--font-size-20);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-28);
  transition: background-color var(--duration-normal) var(--ease-standard);
}

@media (min-width: 1024px) and (hover: hover) {
  .hero__button:hover {
    background: var(--color-border-default);
  }
}

.hero__button img {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.hero__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes hero-actions-enter {
  from {
    opacity: 0;
    transform: translateY(var(--space-24));
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .hero__actions {
    animation: hero-actions-enter 920ms cubic-bezier(.22, 1, .36, 1) 320ms both;
  }
}


@media (min-width: 1920px) {
  .hero {
    max-width: 1440px;
  }
}

@media (max-width: 1279px) {
  .hero__title {
    font-size: var(--font-size-48);
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .hero__button {
    font-size: var(--font-size-18);
  }
}


@media (min-width: 768px) and (max-width: 1023px) {
  .hero {
    --hero-inline-padding: var(--space-32);

    position: relative;
    top: auto;
    left: auto;
    flex: 0 0 auto;
    gap: var(--space-24);
    width: 100%;
    max-width: none;
    max-height: none;
    margin-top: auto;
    padding: 0 var(--hero-inline-padding) var(--space-64);
    overflow: visible;
    transform: none;
  }

  .hero__heading {
    gap: var(--space-20);
  }

  .hero__actions {
    gap: var(--space-24);
  }

  .hero__title {
    font-size: var(--font-size-32);
  }

  .hero__button {
    gap: var(--space-4);
    padding: var(--space-12) var(--space-16);
    font-size: var(--font-size-16);
    line-height: var(--line-height-24);
  }

  .hero__button img {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 767px) {
  .hero {
    --hero-inline-padding: 0px;

    position: relative;
    top: auto;
    left: auto;
    grid-row: 1;
    grid-column: 1;
    display: grid;
    grid-template-rows:
      calc(100vh - var(--site-header-height) - var(--home-mobile-actions-height));
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    transform: none;
  }

  .hero__heading {
    align-self: end;
    grid-row: 1;
    gap: var(--space-20);
    width: calc(100% - 32px);
    padding-bottom: clamp(
      var(--space-24),
      calc(57.1429vw - 181.714px),
      var(--space-64)
    );
    margin: 0 auto;
  }

  .hero__actions {
    position: fixed;
    z-index: calc(var(--z-header) - 1);
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    height: var(--home-mobile-actions-height);
    padding-inline: var(--space-12);
    background: var(--color-surface-primary);
  }

  .hero__button {
    min-width: 0;
    height: var(--home-mobile-actions-height);
    gap: var(--space-4);
    padding: 0;
    border: 0;
    border-radius: 0;
    font-size: var(--font-size-16);
    line-height: 1.4;
  }

  .hero__button + .hero__button {
    border-left: 1px solid var(--color-border-default);
  }

  .hero__button span {
    white-space: nowrap;
  }

  .hero__button img {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
  }

  .hero__title {
    font-size: min(calc(13.5px + 3.5vw), var(--font-size-32));
    line-height: 145%;
    white-space: nowrap;
  }
}

@media (max-width: 359px) {
  .hero__title {
    font-size: 6.6667vw;
  }

  .hero__button {
    font-size: var(--font-size-14);
  }
}
