:root {
  --forest: #04361a;
  --forest-deep: #021e10;
  --leaf: #b4d44c;
  --leaf-soft: #d7ef7c;
  --cream: #f5f1da;
  --sky: #95c8b3;
  --soil: #2a2119;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  --edge: rgba(245, 241, 218, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  min-height: 100%;
  background: var(--forest);
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(180, 212, 76, 0.18), transparent 26rem),
    radial-gradient(circle at 86% 84%, rgba(149, 200, 179, 0.18), transparent 28rem),
    linear-gradient(135deg, var(--forest-deep) 0%, var(--forest) 48%, #102918 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image:
    linear-gradient(110deg, transparent 0 47%, rgba(245, 241, 218, 0.09) 48% 49%, transparent 50% 100%),
    linear-gradient(20deg, transparent 0 46%, rgba(180, 212, 76, 0.08) 47% 48%, transparent 49% 100%);
  background-size: 180px 180px, 220px 220px;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flyer-deck {
  position: relative;
  isolation: isolate;
}

.flyer-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.flyer-frame {
  position: relative;
  width: min(calc(100vw - 28px), 720px);
  max-height: calc(100vh - 28px);
  max-height: calc(100svh - 28px);
  overflow: hidden;
  aspect-ratio: var(--flyer-aspect, 2 / 3);
  background: var(--forest);
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.flyer-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-link {
  position: absolute;
  top: 45.5%;
  left: 5%;
  display: grid;
  width: 24%;
  height: 16%;
  padding: 0 10px;
  place-items: center;
  overflow: hidden;
  color: var(--forest);
  text-decoration: none;
  background: var(--leaf);
  border: 1px solid rgba(245, 241, 218, 0.8);
  border-radius: 6px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.qr-link__text {
  display: block;
  color: var(--forest);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.pilot-link {
  position: absolute;
  top: 83.2%;
  left: 3.5%;
  display: flex;
  width: 93%;
  height: 12%;
  align-items: center;
  justify-content: center;
  color: var(--forest);
  text-decoration: none;
  border-radius: 8px;
}

.pilot-link span {
  display: inline-flex;
  min-height: 42px;
  max-width: calc(100% - 18px);
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  background: rgba(180, 212, 76, 0.94);
  border: 1px solid rgba(245, 241, 218, 0.65);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.qr-link:hover,
.qr-link:focus-visible {
  transform: translateY(-1px) scale(1.025);
  outline: 2px solid rgba(245, 241, 218, 0.9);
  outline-offset: 3px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.pilot-link:hover span,
.pilot-link:focus-visible span {
  transform: translateY(-1px);
  background: var(--leaf-soft);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.pilot-link:focus-visible {
  outline: 2px solid rgba(245, 241, 218, 0.9);
  outline-offset: 3px;
}

.pilot-link::before {
  position: absolute;
  top: 2%;
  right: 10%;
  z-index: 0;
  width: 32%;
  height: 88%;
  content: "";
  background: #123d22;
  border: 1px solid rgba(180, 212, 76, 0.42);
  border-radius: 4px;
}

.pilot-link span {
  position: relative;
  z-index: 1;
}

.page-rail {
  position: fixed;
  top: 50%;
  right: max(14px, env(safe-area-inset-right));
  z-index: 20;
  display: grid;
  gap: 6px;
  padding: 7px;
  background: rgba(4, 54, 26, 0.72);
  border: 1px solid rgba(245, 241, 218, 0.2);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
}

.page-dot,
.rail-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  background: rgba(245, 241, 218, 0.1);
  border: 1px solid rgba(245, 241, 218, 0.18);
  border-radius: 50%;
  transition: transform 160ms var(--ease), background 160ms var(--ease), border-color 160ms var(--ease), opacity 160ms var(--ease);
}

.page-dot span {
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.page-dot:hover,
.rail-arrow:hover:not(:disabled),
.page-dot:focus-visible,
.rail-arrow:focus-visible {
  background: rgba(245, 241, 218, 0.18);
  border-color: rgba(245, 241, 218, 0.42);
  outline: none;
  transform: scale(1.04);
}

.page-dot[aria-current="page"] {
  color: var(--forest);
  background: var(--leaf);
  border-color: rgba(245, 241, 218, 0.8);
}

.rail-arrow:disabled {
  cursor: default;
  opacity: 0.34;
}

.rail-arrow span {
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.rail-arrow--prev span {
  transform: translateY(2px) rotate(45deg);
}

.rail-arrow--next span {
  transform: translateY(-2px) rotate(225deg);
}

.return-link {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 20;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: var(--cream);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  background: rgba(4, 54, 26, 0.78);
  border: 1px solid rgba(245, 241, 218, 0.24);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.return-link:hover,
.return-link:focus-visible {
  color: var(--forest);
  background: var(--leaf);
  outline: none;
}

@media (max-width: 720px) {
  .flyer-page {
    padding: 8px;
  }

  .flyer-frame {
    width: calc(100vw - 16px);
    max-height: calc(100svh - 16px);
  }

  .page-rail {
    top: auto;
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 50%;
    grid-auto-flow: column;
    gap: 4px;
    padding: 5px;
    border-radius: 16px;
    transform: translateX(-50%);
  }

  .page-dot,
  .rail-arrow {
    width: 30px;
    height: 30px;
  }

  .page-dot span {
    font-size: 0.72rem;
  }

  .qr-link {
    padding: 0 8px;
  }

  .qr-link__text {
    font-size: 0.82rem;
  }

  .pilot-link span {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.78rem;
  }

}

@media (min-aspect-ratio: 2 / 3) {
  .flyer-frame {
    width: auto;
    height: min(calc(100vh - 28px), 1080px);
    height: min(calc(100svh - 28px), 1080px);
  }
}

@media (max-width: 720px) and (min-aspect-ratio: 2 / 3) {
  .flyer-frame {
    height: calc(100svh - 16px);
  }
}

@media (max-width: 380px) {
  .qr-link__text {
    font-size: 0.72rem;
  }

  .pilot-link span {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
