/* Common styles shared across letter and fall themes */
.container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  appearance: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.25s ease,
    border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: none;
}

.section {
  padding: 40px 0;
}
.section h2 {
  margin: 0 0 10px;
  font-size: 22px;
}
.section-desc {
  margin: 0 0 20px;
}

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}
.carousel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}
.carousel-track {
  display: flex;
  will-change: transform;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.carousel-slide {
  min-width: 100%;
  margin: 0;
  position: relative;
}
.carousel-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.carousel-nav.prev {
  left: 8px;
}
.carousel-nav.next {
  right: 8px;
}
.carousel-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}
.carousel-counter {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 12px;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Secret letter */
.secret-letter {
  margin-top: 16px;
}
.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: pre-wrap;
  border-right: 2px solid rgba(0, 0, 0, 0.2);
  animation: caret 0.8s step-end infinite;
}
@keyframes caret {
  50% {
    border-color: transparent;
  }
}

/* Gift card */
.gift-wrap {
  display: grid;
  place-items: center;
}
.gift-card {
  width: min(92vw, 400px);
  height: min(64vh, 480px);
  perspective: 1200px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.gift-card .face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gift-card .front .title {
  font-weight: 700;
  font-size: 22px;
}
.gift-card .front .hint {
  font-size: 13px;
  margin-top: 6px;
}
.gift-card .back {
  transform: rotateY(180deg);
  padding: 24px 20px;
  text-align: center;
}
.gift-card.flipped .front {
  transform: rotateY(180deg);
}
.gift-card.flipped .back {
  transform: rotateY(360deg);
}
.gift .product {
  width: 68%;
  max-width: 360px;
  height: auto;
  border-radius: 12px;
  margin: 0 auto 24px;
  display: block;
}
.gift h3 {
  margin: 0 0 18px;
  text-align: center;
}
.gift {
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  text-align: left;
}

/* Gift list spacing and alignment */
.gift-list {
  text-align: left;
  display: block;
  margin: 0; /* align with card content left */
  padding-left: 2em; /* comfortable indent; device-safe */
  list-style-position: outside;
}
.gift-list li {
  margin: 6px 0;
  line-height: 1.5;
}
.gift-list--numbered {
  list-style: decimal;
}
.gift-list--bulleted {
  list-style: disc;
}

/* FX canvas */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Gate Overlay */
.gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  background: #fff;
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  height: 100lvh;
  overflow: hidden;
}
.gate-overlay {
  will-change: transform, opacity;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  contain: layout paint size style;
}
.gate-overlay {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.is-gated,
.is-gated body {
  background: #fff;
}
/* Hide all underlying content while gate is active (safari notch shows chrome; ensure page itself is not visible) */
html.is-gated body > *:not(.gate-overlay) {
  visibility: hidden !important;
}
/* purely decorative curved caps to soften the hard edge against iOS chrome */
.gate-overlay::before,
.gate-overlay::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 10002;
  pointer-events: none;
}
.gate-overlay::before {
  top: 0;
  height: 28px;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}
.gate-overlay::after {
  bottom: 0;
  height: 28px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}
.gate-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.02);
}
.gate-card {
  width: min(92vw, 520px);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, #ffffff, #fbfbff);
  box-shadow: 0 24px 60px rgba(22, 10, 46, 0.16);
  padding: 22px 20px;
  max-height: min(92vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.gate-card {
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.gate-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  text-align: center;
  background: linear-gradient(90deg, #2a2233, #5b4f71);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gate-card p {
  margin: 0 0 18px;
  color: #6b6575;
  text-align: center;
}
.gate-letter {
  margin: 14px 0 22px;
  color: #3a3642;
  text-align: center;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 15px;
}
.gate-form {
  display: grid;
  gap: 16px;
}
.gate-field {
  display: grid;
  gap: 8px;
}
.gate-form,
.gate-field,
.gate-options {
  text-align: left;
}
.gate-label {
  font-weight: 700;
  font-size: 14px;
  color: #3a3642;
}
.gate-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 16px;
  background: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.02) inset;
}
.gate-input:focus {
  outline: none;
  box-shadow: 0 0 0 6px rgba(138, 92, 255, 0.2);
  border-color: rgba(138, 92, 255, 0.35);
}
.gate-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gate-options[data-q="q1"] {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gate-options[data-q="q1"] .gate-chip {
  flex: 0 0 auto;
  white-space: nowrap;
}
.gate-options[data-q="q1"] .gate-chip[data-value="none"] {
  border-color: rgba(0, 0, 0, 0.22);
  background: #f2f2f5;
  color: #333;
}
/* ensure selected state overrides gray for 'none' chip */
.gate-options[data-q="q1"] .gate-chip[data-value="none"][aria-pressed="true"] {
  background: linear-gradient(135deg, #ff5fa2, #8a5cff);
  color: #fff;
  border-color: transparent;
}
.gate-chip {
  border: 1px solid rgba(138, 92, 255, 0.28);
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: #4a3f60;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gate-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(22, 10, 46, 0.08);
}
.gate-chip[aria-pressed="true"] {
  background: linear-gradient(135deg, #ff5fa2, #8a5cff);
  color: #fff;
  border-color: transparent;
}
.gate-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 2px;
}
.gate-btn {
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff, #f6f3ff);
  box-shadow: 0 8px 24px rgba(22, 10, 46, 0.08);
  color: #2f2a38;
  touch-action: manipulation;
}
.gate-btn.primary {
  background: linear-gradient(135deg, #ff5fa2, #8a5cff);
  color: #fff;
  border: none;
}
.gate-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px rgba(138, 92, 255, 0.22);
}
.gate-error {
  display: none;
  color: #d12;
  text-align: center;
  font-size: 13px;
}
.gate-error.show {
  display: block;
}

/* While gated, prevent selecting/copying underlying page */
.is-gated body {
  user-select: none;
  -webkit-user-select: none;
}
.is-gated {
  overflow: hidden;
  overscroll-behavior: contain;
}
.is-gated .gate-card,
.is-gated .gate-card * {
  user-select: text;
  -webkit-user-select: text;
}
.gate-hidden {
  display: none !important;
}
