html.welcome-seen .welcome-intro {
  display: none;
}

html:not(.welcome-enabled) .welcome-intro {
  display: none;
}

body.welcome-active {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.welcome-intro {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background: #85bac2;
  isolation: isolate;
  transition:
    opacity 900ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 900ms step-end;
}

.welcome-intro[hidden] {
  display: none;
}

.welcome-intro.is-leaving {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.welcome-intro__scene,
.welcome-intro__scene::after,
.welcome-intro__camera,
.welcome-intro__branch-motion,
.welcome-intro__branch,
.welcome-intro__veil,
.welcome-intro__wind,
.welcome-intro__petals {
  position: absolute;
  inset: 0;
}

.welcome-intro__scene {
  z-index: -3;
  overflow: hidden;
  background: #9bcbd0;
}

.welcome-intro__scene::after {
  z-index: 2;
  content: "";
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(0deg, rgba(18, 35, 29, 0.28), transparent 36%);
}

.welcome-intro__camera {
  z-index: 0;
  transform: scale(1.075);
  transform-origin: center;
  will-change: transform;
}

.welcome-intro__image {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 48%;
  filter: saturate(0.94) contrast(1.02);
}

.welcome-intro.is-visible .welcome-intro__camera {
  animation: welcome-camera 14s cubic-bezier(0.18, 0.72, 0.25, 1) both;
}

.welcome-intro__branch-motion {
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.welcome-intro__branch {
  background-image: url("assets/images/white-cassia-welcome-clean.webp");
  background-position: center 48%;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.94) contrast(1.02);
  will-change: transform;
}

.welcome-intro__branch--upper {
  -webkit-mask-image: radial-gradient(
    ellipse 72% 31% at 68% 2%,
    #000 0 44%,
    rgba(0, 0, 0, 0.86) 60%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 72% 31% at 68% 2%,
    #000 0 44%,
    rgba(0, 0, 0, 0.86) 60%,
    transparent 100%
  );
  transform-origin: 100% 31%;
  animation: welcome-branch-sway-upper 8.6s ease-in-out -2.4s infinite;
}

.welcome-intro__branch--middle {
  -webkit-mask-image: radial-gradient(
    ellipse 52% 22% at 57% 27%,
    #000 0 38%,
    rgba(0, 0, 0, 0.82) 58%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 52% 22% at 57% 27%,
    #000 0 38%,
    rgba(0, 0, 0, 0.82) 58%,
    transparent 100%
  );
  transform-origin: 96% 39%;
  animation: welcome-branch-sway-middle 7.4s ease-in-out -4.1s infinite;
}

.welcome-intro__branch--right {
  -webkit-mask-image: radial-gradient(
    ellipse 38% 37% at 91% 37%,
    #000 0 35%,
    rgba(0, 0, 0, 0.78) 58%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 38% 37% at 91% 37%,
    #000 0 35%,
    rgba(0, 0, 0, 0.78) 58%,
    transparent 100%
  );
  transform-origin: 100% 58%;
  animation: welcome-branch-sway-right 9.2s ease-in-out -5.7s infinite;
}

.welcome-intro__veil {
  z-index: 3;
  background:
    linear-gradient(
      90deg,
      rgba(16, 31, 29, 0.66) 0%,
      rgba(20, 41, 37, 0.46) 26%,
      rgba(26, 49, 43, 0.16) 58%,
      rgba(17, 36, 31, 0.05) 100%
    ),
    linear-gradient(0deg, rgba(28, 34, 24, 0.22), transparent 42%);
}

.welcome-intro__wind {
  z-index: 4;
  overflow: hidden;
  opacity: 0.42;
  pointer-events: none;
}

.welcome-intro__wind::before,
.welcome-intro__wind::after {
  position: absolute;
  width: 68vw;
  height: 12vh;
  content: "";
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28),
    rgba(255, 255, 255, 0.04),
    transparent
  );
  filter: blur(10px);
  transform: translate3d(125vw, 0, 0) rotate(-12deg);
}

.welcome-intro__wind::before {
  top: 24%;
  animation: welcome-wind 7.5s ease-in-out 500ms infinite;
}

.welcome-intro__wind::after {
  top: 53%;
  height: 7vh;
  opacity: 0.62;
  animation: welcome-wind 9s ease-in-out 3.6s infinite;
}

.welcome-intro__petals {
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.welcome-petal-path {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  animation: welcome-petal-drift var(--fall-duration) linear var(--fall-delay) infinite;
  will-change: transform;
}

.welcome-petal {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: var(--petal-size);
  height: var(--petal-size);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter:
    drop-shadow(0 1px 1px rgba(92, 45, 53, 0.28))
    saturate(1.04);
  opacity: var(--petal-opacity);
  transform-origin: 50% 50%;
  animation: welcome-petal-flutter var(--spin-duration) ease-in-out var(--spin-delay) infinite;
  will-change: transform;
}

.welcome-petal--real-1 {
  background-image: url("assets/images/petals/cassia-petal-1.webp");
}

.welcome-petal--real-2 {
  background-image: url("assets/images/petals/cassia-petal-2.webp");
}

.welcome-petal--real-3 {
  background-image: url("assets/images/petals/cassia-petal-3.webp");
}

.welcome-petal--real-4 {
  background-image: url("assets/images/petals/cassia-petal-4.webp");
}

.welcome-petal--near {
  filter:
    blur(0.3px)
    drop-shadow(0 3px 4px rgba(82, 39, 47, 0.3))
    saturate(1.08);
}

.welcome-intro__content {
  position: relative;
  z-index: 5;
  align-self: center;
  justify-self: start;
  width: min(720px, calc(100% - 56px));
  margin-left: clamp(28px, 9vw, 156px);
  padding-top: 5vh;
}

.welcome-intro__title {
  margin: 0;
  color: #fff;
  font-family: "Foman Welcome Serif", var(--font-serif);
  font-synthesis: none;
  font-weight: 700;
  line-height: 1.1;
  text-shadow:
    0 3px 22px rgba(14, 33, 27, 0.58),
    0 1px 2px rgba(14, 33, 27, 0.42);
}

.welcome-intro__title span,
.welcome-intro__title strong {
  display: block;
  font-weight: 700;
  opacity: 0;
  transform: translateY(24px);
}

.welcome-intro__title span {
  margin-bottom: 12px;
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.32em;
}

.welcome-intro__title strong {
  font-size: clamp(3.5rem, 7vw, 6.7rem);
  letter-spacing: 0.15em;
}

.welcome-intro.is-visible .welcome-intro__title span {
  animation: welcome-copy-in 1.45s cubic-bezier(0.18, 0.72, 0.22, 1) 1.2s forwards;
}

.welcome-intro.is-visible .welcome-intro__title strong {
  animation: welcome-copy-in 1.8s cubic-bezier(0.18, 0.72, 0.22, 1) 2.75s forwards;
}

.welcome-intro__rule {
  display: block;
  width: 0;
  height: 1px;
  margin: 28px 0 30px;
  background: linear-gradient(90deg, #f5dca6, rgba(255, 255, 255, 0.18));
  box-shadow: 0 0 14px rgba(245, 220, 166, 0.42);
}

.welcome-intro.is-visible .welcome-intro__rule {
  animation: welcome-rule-in 1.1s ease 4.55s forwards;
}

.welcome-intro__enter {
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  visibility: hidden;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 14px 22px 14px 28px;
  color: #5f292f;
  background: rgba(255, 252, 247, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  box-shadow:
    0 14px 36px rgba(17, 35, 30, 0.24),
    inset 0 0 0 1px rgba(174, 126, 74, 0.14);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.25;
  opacity: 0;
  text-decoration: none;
  touch-action: manipulation;
  transform: translateY(18px);
  transition:
    color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.welcome-intro.is-visible .welcome-intro__enter {
  animation: welcome-button-in 1.2s cubic-bezier(0.18, 0.72, 0.22, 1) 5.65s forwards;
}

.welcome-intro__enter:focus-visible {
  visibility: visible;
  outline: 4px solid #fff;
  outline-offset: 5px;
  opacity: 1;
  transform: none;
  animation: none !important;
}

.welcome-intro__arrow {
  display: grid;
  width: 30px;
  height: 30px;
  margin-left: 16px;
  place-items: center;
  color: #fff;
  background: #713037;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .welcome-intro__enter:hover {
    color: #fff;
    background: #713037;
    box-shadow: 0 18px 42px rgba(17, 35, 30, 0.32);
    transform: translateY(-2px);
  }

  .welcome-intro__enter:hover .welcome-intro__arrow {
    color: #713037;
    background: #fff;
    transform: translateX(3px);
  }
}

@media (hover: none), (pointer: coarse) {
  .welcome-intro__enter:active {
    background: #fff;
    transform: scale(0.98);
  }
}

@keyframes welcome-camera {
  from {
    transform: scale(1.075) translate3d(0, 0, 0);
  }

  to {
    transform: scale(1.015) translate3d(-0.6%, 0.4%, 0);
  }
}

@keyframes welcome-wind {
  0% {
    opacity: 0;
    transform: translate3d(125vw, 0, 0) rotate(-12deg);
  }

  12% {
    opacity: 0.68;
  }

  58% {
    opacity: 0.25;
  }

  100% {
    opacity: 0;
    transform: translate3d(-85vw, 12vh, 0) rotate(-12deg);
  }
}

@keyframes welcome-branch-sway-upper {
  0%,
  13%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-0.035deg);
  }

  31% {
    transform: translate3d(-1.2px, 0.8px, 0) rotate(0.14deg);
  }

  47% {
    transform: translate3d(0.5px, -0.3px, 0) rotate(-0.075deg);
  }

  71% {
    transform: translate3d(-0.8px, 0.45px, 0) rotate(0.09deg);
  }
}

@keyframes welcome-branch-sway-middle {
  0%,
  16%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0.025deg);
  }

  36% {
    transform: translate3d(-1.35px, 0.7px, 0) rotate(0.17deg);
  }

  55% {
    transform: translate3d(0.55px, -0.25px, 0) rotate(-0.08deg);
  }

  78% {
    transform: translate3d(-0.65px, 0.35px, 0) rotate(0.075deg);
  }
}

@keyframes welcome-branch-sway-right {
  0%,
  19%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-0.02deg);
  }

  39% {
    transform: translate3d(-0.7px, 0.6px, 0) rotate(0.105deg);
  }

  59% {
    transform: translate3d(0.35px, -0.2px, 0) rotate(-0.055deg);
  }

  82% {
    transform: translate3d(-0.4px, 0.3px, 0) rotate(0.06deg);
  }
}

@keyframes welcome-petal-drift {
  0% {
    transform: translate3d(var(--start-x), -14vh, 0);
  }

  22% {
    transform: translate3d(var(--mid-one-x), 19vh, 0);
  }

  48% {
    transform: translate3d(var(--mid-two-x), 50vh, 0);
  }

  73% {
    transform: translate3d(var(--mid-three-x), 81vh, 0);
  }

  100% {
    transform: translate3d(var(--end-x), 114vh, 0);
  }
}

@keyframes welcome-petal-flutter {
  0% {
    transform: rotate(0deg) rotateX(20deg) scale(0.9);
  }

  35% {
    transform: rotate(130deg) rotateX(72deg) scale(1.04);
  }

  68% {
    transform: rotate(255deg) rotateY(68deg) scale(0.88);
  }

  100% {
    transform: rotate(390deg) rotateX(24deg) scale(1);
  }
}

@keyframes welcome-copy-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcome-rule-in {
  to {
    width: min(390px, 70vw);
  }
}

@keyframes welcome-button-in {
  from {
    visibility: visible;
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .welcome-intro__image,
  .welcome-intro__branch {
    object-position: 61% 48%;
    background-position: 61% 48%;
  }

  .welcome-intro__veil {
    background:
      linear-gradient(
        180deg,
        rgba(16, 31, 29, 0.1) 0%,
        rgba(16, 31, 29, 0.24) 36%,
        rgba(16, 31, 29, 0.72) 100%
      ),
      linear-gradient(90deg, rgba(16, 31, 29, 0.16), rgba(16, 31, 29, 0.04));
  }

  .welcome-intro__content {
    align-self: center;
    justify-self: center;
    width: calc(100% - 40px);
    margin: clamp(72px, 14svh, 128px) 0 0;
    padding: 0;
    text-align: center;
  }

  .welcome-intro__title span {
    margin-bottom: 8px;
    font-size: clamp(1.28rem, 6vw, 1.8rem);
    letter-spacing: 0.26em;
  }

  .welcome-intro__title strong {
    font-size: clamp(3.15rem, 15vw, 5.1rem);
    letter-spacing: 0.11em;
  }

  .welcome-intro__rule {
    margin: 22px auto 25px;
  }

  .welcome-intro__enter {
    min-height: 56px;
    padding: 13px 18px 13px 24px;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
  }

  .welcome-intro__arrow {
    margin-left: 12px;
  }

  @keyframes welcome-rule-in {
    to {
      width: min(290px, 70vw);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-intro__camera,
  .welcome-intro__branch,
  .welcome-intro__wind::before,
  .welcome-intro__wind::after,
  .welcome-petal-path,
  .welcome-petal {
    animation: none !important;
  }

  .welcome-intro__petals,
  .welcome-intro__branch-motion,
  .welcome-intro__wind {
    display: none;
  }

  .welcome-intro__camera {
    transform: scale(1.015);
  }

  .welcome-intro__title span,
  .welcome-intro__title strong,
  .welcome-intro__enter {
    visibility: visible;
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .welcome-intro__rule {
    width: min(390px, 70vw);
    animation: none !important;
  }

  .welcome-intro,
  .welcome-intro__enter {
    transition-duration: 1ms;
  }
}

@media print {
  .welcome-intro {
    display: none !important;
  }
}
