/* Supplied arch with many independent botanical sprites behind it. */
:root {
  --gate-chrome: #64754e;
}
/* Safari toolbar/overscroll canvas: green only while the entrance is active. */
html.gate-locked,
html.gate-locked body {
  background-color: var(--gate-chrome);
}
html.gate-locked .phone-app {
  background-color: var(--gate-chrome);
  border-color: var(--gate-chrome);
}
html.gate-locked .screen-gate {
  background-color: var(--gate-chrome);
}
.screen-gate {
  background: var(--forest);
  z-index: 5 !important;
  perspective: 1200px;
}
.gate-world,
.gate-threshold,
.gate-garden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.gate-world {
  overflow: hidden;
}
.gate-garden {
  object-fit: cover;
  transform: scale(1);
  transform-origin: 50% 46%;
}
.gate-threshold {
  transform-origin: 54% 58%;
  perspective: 1100px;
  transform-style: preserve-3d;
}

.gate-heading {
  position: absolute;
  inset: 3.5% 5% auto;
  text-align: center;
  color: var(--cream);
  text-shadow: 0 2px 10px var(--forest);
}
.gate-heading p {
  font-size: 12px;
  letter-spacing: 0.25em;
  margin: 0 0 6px;
}
.gate-heading h1 {
  font:
    500 clamp(36px, 7vw, 44px)/1.1 'Cormorant Garamond',
    serif;
  margin: 0;
}
.gate-heading i {
  font-weight: 400;
  font-size: 0.8em;
}
.gate-action {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0;
  border: 0;
  background: none;
  color: var(--cream);
  padding: 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.gate-action-text {
  font:
    500 23px 'Cormorant Garamond',
    serif;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #fff9ee88;
  padding-bottom: 6px;
}
.gate-action:disabled {
  opacity: 1;
}
.gate-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.gate-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.gate-petals i {
  position: absolute;
  left: 50%;
  top: 65%;
  width: 12px;
  height: 19px;
  background: var(--cream);
  border-radius: 80% 0 80% 20%;
  opacity: 0;
}
.is-opening .gate-action,
.is-opening .gate-heading {
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.is-opening .gate-petals i {
  animation: none;
}
@keyframes petal-flight {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0);
  }
  15% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(calc((var(--i) - 8.5) * 35px), calc(-160px - var(--i) * 17px))
      rotate(calc(var(--i) * 51deg));
  }
}
/* Shared launch: camera, botanical sweep, petals and bird flight run together. */
.is-zooming .gate-threshold {
  transform: scale(5.8);
  opacity: 0;
  transition:
    transform 4s cubic-bezier(0.38, 0, 0.2, 1),
    opacity 0.75s 3.25s;
}
.is-zooming .gate-garden {
  transform: scale(1.25);
  transition: transform 4s cubic-bezier(0.38, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .gate-petals {
    display: none;
  }
}

.gate-wildlife {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gate-heading {
  text-shadow:
    0 2px 12px #142c22,
    0 1px 4px #142c22;
  background: linear-gradient(#142c2288, transparent);
  inset: 0 0 auto;
  padding: 24px 10px 32px;
}
.gate-action-text {
  background: #1c352bd9;
  border: 1px solid #fff9ee66;
  border-radius: 24px;
  padding: 9px 20px;
  box-shadow: 0 4px 16px #10251b33;
}
.gate-petals i:nth-child(3n + 1) {
  background: #a53860;
}
.gate-petals i:nth-child(3n + 2) {
  background: #f9dbbd;
}
.gate-petals i:nth-child(3n) {
  background: #450920;
}
@media (prefers-reduced-motion: reduce) {
  .gate-hummingbird,
  .garden-bird {
    animation: none !important;
  }
}

/* All artwork shares the reference aspect ratio, so the stone arch is never stretched. */
.arch-artboard {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  aspect-ratio: 3/5;
  transform: translateY(-50%);
}
.arch-artboard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.gate-garden {
  filter: brightness(0.9);
}
.is-revealing .gate-garden {
  filter: none;
  transition: filter 1.8s ease;
}
.is-zooming .gate-garden {
  transition:
    transform 4s cubic-bezier(0.38, 0, 0.2, 1),
    filter 1.8s ease;
}
.gate-action {
  bottom: 10%;
}
@media (max-aspect-ratio: 3/5) {
  .arch-artboard {
    width: 110%;
    left: -5%;
  }
}

/* Depth order: garden, flowering shrubs, original arch. The portal crops moving plants. */
.arch-floral-depth {
  position: absolute;
  inset: 0;
  z-index: 1;
  mask: url('/static/img/arch-opening-v4.svg') 0 0/100% 100% no-repeat;
  -webkit-mask: url('/static/img/arch-opening-v4.svg') 0 0/100% 100% no-repeat;
}
.arch-artboard .gate-arch {
  z-index: 2;
}
/* Like the reference trees: whole silhouettes move laterally at different depths. */

.flora-piece {
  position: absolute;
  display: block;
  transform: translate(-50%, -50%) rotate(var(--tilt));
  transform-origin: 50% 65%;
  will-change: transform;
}
.arch-artboard .flora-piece img {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  animation: flora-breathe var(--sway) var(--phase) ease-in-out infinite alternate;
}
.flora-depth-0 {
  z-index: 1;
  filter: brightness(0.9);
}
.flora-depth-1 {
  z-index: 2;
}
.flora-depth-2 {
  z-index: 3;
  filter: drop-shadow(0 3px 3px #142c221a);
}
@keyframes flora-breathe {
  from {
    transform: rotate(-1.3deg);
  }
  to {
    transform: rotate(1.3deg);
  }
}
.bird-flight {
  position: absolute;
  width: 54px;
  will-change: transform;
  transform-origin: 50% 50%;
}
.bird-flight-a {
  left: 18%;
  top: 43%;
}
.bird-flight-b {
  right: 15%;
  top: 58%;
  width: 46px;
}
.gate-hummingbird {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 3px 4px #17291e44);
  animation: bird-hover 2.8s ease-in-out infinite alternate;
}
.gate-hummingbird-b {
  transform: scaleX(-1);
  animation-delay: 0.7s;
}
.is-opening .gate-hummingbird {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .flora-piece img,
  .gate-hummingbird {
    animation: none !important;
  }
}

/* Surrounding canopy, climbing greenery and planted foreground fill the scene edges. */
.gate-threshold .gate-surround {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 3;
  pointer-events: none;
}
.arch-artboard {
  z-index: 2;
}

/* A luminous berry invitation, with a soft glint and botanical sparkle. */
.gate-action .gate-action-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 13px 34px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #fff9eeb3;
  border-radius: 999px;
  color: #fff9ee;
  background:
    radial-gradient(ellipse at 28% 0%, #dc8ba3aa, transparent 60%),
    linear-gradient(135deg, #b94a73, #a53860 56%, #792542);
  box-shadow:
    inset 0 1px 0 #fff9ee66,
    inset 0 -3px 8px #45092026,
    0 8px 25px #45092040,
    0 0 0 5px #fff9ee16;
  font-size: clamp(23px, 6.3vw, 28px);
  line-height: 1.15;
  letter-spacing: 0.035em;
  animation: invitation-glow 3.6s ease-in-out infinite;
  transition:
    translate 0.25s ease,
    box-shadow 0.25s ease;
}
.gate-action .gate-action-text::before {
  content: '';
  position: absolute;
  inset: -80% auto -80% -50%;
  width: 30%;
  background: linear-gradient(90deg, transparent, #fff9ee55, transparent);
  transform: skewX(-22deg);
  animation: invitation-glint 5s ease-in-out infinite;
  pointer-events: none;
}
.gate-action .gate-action-text::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid #fff9ee26;
  border-radius: inherit;
  pointer-events: none;
}
.gate-action::before,
.gate-action::after {
  content: '✧';
  position: absolute;
  color: #fff0c9;
  font-size: 22px;
  line-height: 1;
  text-shadow: 0 0 12px #fff0c9aa;
  pointer-events: none;
  animation: invitation-sparkle 2.6s ease-in-out infinite alternate;
}
.gate-action::before {
  left: -5px;
  top: -2px;
}
.gate-action::after {
  right: -4px;
  bottom: -1px;
  font-size: 16px;
  animation-delay: 0.8s;
}
.gate-action:hover .gate-action-text {
  translate: 0 -3px;
}
.gate-action:active .gate-action-text {
  translate: 0 1px;
}
.gate-action:focus-visible {
  outline: 2px solid #fff9ee;
  outline-offset: 5px;
}
.gate-action:disabled .gate-action-text,
.gate-action:disabled::before,
.gate-action:disabled::after {
  animation-play-state: paused;
}
@keyframes invitation-glow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 #fff9ee66,
      0 8px 25px #45092040,
      0 0 0 5px #fff9ee16;
  }
  50% {
    box-shadow:
      inset 0 1px 0 #fff9ee88,
      0 10px 30px #45092050,
      0 0 0 7px #fff9ee20;
  }
}
@keyframes invitation-glint {
  0%,
  65% {
    left: -50%;
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
  100% {
    left: 135%;
    opacity: 0;
  }
}
@keyframes invitation-sparkle {
  from {
    opacity: 0.45;
    scale: 0.8;
    rotate: -10deg;
  }
  to {
    opacity: 1;
    scale: 1.12;
    rotate: 12deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gate-action .gate-action-text,
  .gate-action .gate-action-text::before,
  .gate-action::before,
  .gate-action::after {
    animation: none !important;
  }
}
