:root {
  --sky: #bfeefa;
  --sky-deep: #8ed7f4;
  --grass: #28731c;
  --grass-dark: #1f5c16;
  --paper: #fffaf1;
  --paper-shadow: #e0b85c;
  --red: #c81932;
  --coral: #ff6f61;
  --yellow: #ffd719;
  --blue: #18569b;
  --teal: #73d2d3;
  --ink: #17355d;
  --muted: #5a6a7d;
  --line: #11345a;
  --shadow: 0 16px 0 rgba(20, 58, 80, 0.15);
  --ground-y: 70vh;
  font-family: "Nunito", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.45) 35%, transparent 58%),
    linear-gradient(180deg, var(--sky) 0%, #d8f7fb 100%);
  background-size: 100% 1800px, 100% 1800px;
  background-repeat: repeat-x;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ground-plane {
  position: absolute;
  top: var(--ground-y);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--grass);
}

.cloud {
  position: absolute;
  width: 14rem;
  height: 4.6rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: 0 10px 0 rgba(49, 120, 147, 0.08);
  animation: float 12s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 6rem;
  height: 6rem;
  left: 2rem;
  bottom: 1.6rem;
}

.cloud::after {
  width: 7rem;
  height: 7rem;
  right: 2rem;
  bottom: 1.2rem;
}

.cloud-one {
  left: 2rem;
  top: 4rem;
}

.cloud-two {
  right: 2rem;
  top: 6rem;
  animation-delay: -4s;
}

.cloud-three {
  left: 38%;
  top: 12rem;
  transform: scale(0.78);
  animation-delay: -7s;
}

.bunting {
  position: absolute;
  display: flex;
  gap: 1.5rem;
  transform-origin: center;
}

.bunting::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  left: -1rem;
  right: -1rem;
  height: 0.25rem;
  border-top: 4px solid var(--line);
  border-radius: 50%;
}

.bunting span {
  position: relative;
  width: 3rem;
  height: 4.4rem;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
  animation: pennant 2.8s ease-in-out infinite;
}

.bunting span:nth-child(5n + 1) {
  background: var(--coral);
}

.bunting span:nth-child(5n + 2) {
  background: var(--yellow);
}

.bunting span:nth-child(5n + 3) {
  background: var(--teal);
}

.bunting span:nth-child(5n + 4) {
  background: var(--blue);
}

.bunting span:nth-child(5n + 5) {
  background: var(--red);
}

.bunting-one {
  top: 1rem;
  left: -2rem;
  transform: rotate(-10deg);
}

.bunting-two {
  top: 1rem;
  right: -2rem;
  transform: rotate(10deg);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.hero {
  min-height: 88vh;
  display: grid;
  grid-template-rows: minmax(340px, 1fr) auto;
  align-items: end;
  gap: 1.2rem;
}

.hero-copy {
  max-width: 820px;
  padding-top: 8rem;
}

.ribbon {
  display: inline-block;
  margin: 0 0 1.35rem;
  padding: 0.6rem 2.6rem;
  color: var(--red);
  background: #ffc36e;
  border: 3px solid #e19a36;
  border-radius: 6px;
  box-shadow: 0 10px 0 #c98326;
  font-family: "Fraunces", serif;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  font-weight: 850;
  transform: rotate(-2deg);
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--red);
  font-family: "Fraunces", serif;
  font-size: clamp(5.2rem, 16vw, 10.5rem);
  line-height: 0.8;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 10px 0 rgba(24, 86, 155, 0.22);
}

.hero-date {
  margin: 1.4rem 0 0.35rem;
  color: var(--blue);
  font-size: clamp(1.55rem, 4vw, 3.2rem);
  font-weight: 900;
}

.hero-place {
  margin: 0;
  max-width: 680px;
  color: var(--ink);
  font-size: clamp(1rem, 2.3vw, 1.35rem);
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.4rem;
}

.primary-link,
.primary-button,
.secondary-button {
  min-height: 52px;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  color: #fff;
  background: var(--red);
  box-shadow: 0 7px 0 #861126;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-link:hover,
.primary-button:hover,
.secondary-button:hover,
.counter:hover,
.donation-picker button:hover {
  transform: translateY(-2px) rotate(-0.5deg);
}

.primary-link:active,
.primary-button:active,
.secondary-button:active,
.counter:active,
.donation-picker button:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

.secondary-button {
  color: var(--ink);
  background: #fff4c8;
  box-shadow: 0 7px 0 #d2a746;
}

.door-note {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.55rem 0.8rem;
  color: var(--blue);
  background: rgba(255, 250, 241, 0.82);
  border: 2px dashed var(--blue);
  border-radius: 10px;
  font-weight: 900;
}

.inline {
  margin-top: 1rem;
}

.fair-scene {
  position: relative;
  width: 100vw;
  min-height: clamp(405px, 51vw, 645px);
  margin-left: calc(50% - 50vw);
  margin-top: 0.5rem;
}

/* Each group's inner edge is anchored at a fixed offset from the tree centre.
   Items flow outward from that edge, naturally spilling off their outer screen edge
   as the viewport narrows — left group spills left, right group spills right. */
.fair-left {
  position: absolute;
  right: calc(50% + clamp(135px, 18vw, 248px));
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(18px, 3vw, 42px);
}

.fair-right {
  position: absolute;
  left: calc(50% + clamp(135px, 18vw, 248px));
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: clamp(18px, 3vw, 42px);
}

.fair-element {
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 0 rgba(32, 84, 77, 0.18));
  animation: fairBob var(--bob-duration, 4.8s) ease-in-out var(--bob-delay, 0s) infinite;
}

.fair-dj {
  width: clamp(165px, 18vw, 240px);
  --bob-duration: 4.7s;
  --bob-delay: -1.1s;
}

.fair-tickets {
  width: clamp(165px, 18vw, 248px);
  --bob-duration: 5.25s;
  --bob-delay: -2.35s;
}

.fair-bouncy {
  width: clamp(240px, 28.5vw, 375px);
  --bob-duration: 4.35s;
  --bob-delay: -0.55s;
}

.fair-tree {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 3;
  width: clamp(270px, 31.5vw, 405px);
  filter: drop-shadow(0 12px 0 rgba(32, 84, 77, 0.16));
  animation: none;
}

.fair-games {
  width: clamp(165px, 18vw, 248px);
  --bob-duration: 5.65s;
  --bob-delay: -3.15s;
}

.fair-bbq {
  width: clamp(143px, 16.5vw, 218px);
  --bob-duration: 4.95s;
  --bob-delay: -1.85s;
}

.fair-pets {
  width: clamp(165px, 18vw, 248px);
  --bob-duration: 5.45s;
  --bob-delay: -2.7s;
}

.details-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 5rem 0;
}

.details-strip span {
  padding: 0.6rem 0.85rem;
  color: #fff;
  background: var(--blue);
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2);
  font-size: clamp(0.82rem, 2.5vw, 1.05rem);
  font-weight: 900;
  text-transform: uppercase;
}

.reservation-card {
  position: relative;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2rem);
  background: var(--paper);
  border: 4px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow), inset 0 0 0 6px rgba(255, 215, 25, 0.28);
}

.reservation-card::before {
  content: "";
  position: absolute;
  inset: -18px 26px auto;
  height: 36px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 26px, var(--coral) 26px 52px, var(--teal) 52px 78px);
  border: 3px solid var(--line);
  border-radius: 999px;
  transform: rotate(-1deg);
}

.form-topper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.1rem 0 1.5rem;
}

.eyebrow,
.step-kicker {
  margin: 0 0 0.3rem;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

h2,
h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(2rem, 6vw, 3.6rem);
}

h3 {
  max-width: 780px;
  font-size: clamp(1.75rem, 5vw, 3rem);
}

.progress-wrap {
  min-width: min(240px, 100%);
  font-weight: 900;
}

.progress-track {
  width: 100%;
  height: 14px;
  margin-top: 0.45rem;
  overflow: hidden;
  background: #dceef0;
  border: 3px solid var(--line);
  border-radius: 999px;
}

#progressBar {
  width: 16.666%;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), var(--yellow), var(--teal));
  transition: width 280ms ease;
}

.step {
  display: none;
  min-height: 335px;
  animation: stepIn 260ms ease both;
}

.step.is-active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.helper {
  max-width: 720px;
  color: var(--muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink);
  font-weight: 900;
}

.currency-wrap {
  position: relative;
}

.currency-wrap::before {
  content: "$";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink);
  font-weight: 900;
  pointer-events: none;
}

.currency-wrap input {
  padding-left: 1.8rem;
}

input,
textarea {
  width: 100%;
  border: 3px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.9rem;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 -4px 0 rgba(24, 86, 155, 0.12);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(255, 215, 25, 0.9);
  outline-offset: 3px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.donation-field {
  grid-template-columns: minmax(220px, 420px);
}

.counter-grid,
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.counter-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 240px) 54px;
  align-items: end;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.counter-row.small {
  grid-template-columns: 46px minmax(68px, 1fr) 46px;
  margin-top: 0.75rem;
}

.counter {
  width: 54px;
  height: 54px;
  border: 3px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 6px 0 #d4a900;
  font-size: 1.6rem;
  font-weight: 900;
}

.small .counter {
  width: 46px;
  height: 46px;
}

.shop-tile {
  position: relative;
  padding: 1rem;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 0 rgba(24, 86, 155, 0.18);
}

.shop-tile h4 {
  margin: 0.6rem 0 0.25rem;
  font-size: 1.25rem;
}

.shop-tile p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.shop-tile strong {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--red);
  font-size: 1.5rem;
}

.ticket-icon {
  width: 76px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  border: 3px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.16);
  font-weight: 900;
  transform: rotate(-4deg);
}

.ticket-icon.pack {
  background: var(--blue);
}

.donation-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.2rem 0;
}

.donation-picker button {
  border: 3px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 5px 0 rgba(24, 86, 155, 0.18);
  font-weight: 900;
}

.donation-picker button.is-selected {
  color: #fff;
  background: var(--blue);
}

.review-box {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 1rem;
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 14px;
}

.review-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px dashed rgba(23, 53, 93, 0.18);
  font-weight: 800;
}

.review-total {
  color: var(--red);
  font-size: 1.35rem;
  font-weight: 900;
}

.privacy-note {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.form-error {
  margin-top: 1rem;
  padding: 0.85rem;
  color: #fff;
  background: var(--red);
  border-radius: 12px;
  font-weight: 900;
}

.form-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.form-nav .primary-button {
  margin-left: auto;
}

.confirmation,
.cutoff-notice {
  padding: clamp(1.2rem, 4vw, 2rem);
  background: #fff;
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 0 rgba(24, 86, 155, 0.18);
}

.confirmation h2,
.cutoff-notice h2 {
  color: var(--red);
}

.code-card {
  display: inline-block;
  margin: 1rem 0;
  padding: 0.8rem 1.1rem;
  color: var(--blue);
  background: #fff4c8;
  border: 3px dashed var(--blue);
  border-radius: 12px;
  font-size: clamp(1.5rem, 6vw, 2.6rem);
  font-weight: 900;
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 1.2rem;
  color: #fff;
  background: var(--grass-dark);
  text-align: center;
  font-weight: 800;
}

.site-footer p {
  max-width: 900px;
  margin: 0 auto;
}

.honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(12px);
  }
}

@keyframes pennant {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

@keyframes fairBob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes boothSlideIn {
  from { transform: translateX(calc(-50% + 110vw)); opacity: 0; }
  to   { transform: translateX(-50%); opacity: 1; }
}

@keyframes boothSlideOut {
  from { transform: translateX(-50%); opacity: 1; }
  to   { transform: translateX(calc(-50% - 110vw)); opacity: 0; }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    padding-top: 18px;
  }

  .hero {
    min-height: 94vh;
    grid-template-rows: minmax(310px, 1fr) auto;
  }

  .hero-copy {
    padding-top: 6.5rem;
  }

  .cloud-two {
    display: none;
  }

  h1 {
    white-space: nowrap;
    font-size: min(16vw, 10.5rem);
  }

  .hero-date {
    white-space: nowrap;
    font-size: min(4vw, 3.2rem);
  }

  .hero-place {
    white-space: nowrap;
    font-size: min(3.1vw, 1.35rem);
  }

  .ribbon {
    padding-inline: 1.25rem;
  }

  .hero-actions,
  .form-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    width: 50vw;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions .door-note {
    justify-content: center;
  }

  .primary-link,
  .primary-button,
  .secondary-button {
    width: 100%;
    margin-left: 0;
    text-align: center;
    min-height: 62px;
    padding: 1rem 1.5rem;
  }

  .details-strip span {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
  }

  .fair-scene {
    min-height: 400px;
    margin-inline: -11px;
    position: relative;
    z-index: 2;
  }

  /* Dissolve group wrappers so images sit directly in the scene */
  .fair-left,
  .fair-right {
    display: contents;
  }

  .fair-tree {
    display: none;
  }

  /* Carousel base: all booths hidden, parked off-screen right */
  .fair-dj,
  .fair-tickets,
  .fair-bouncy,
  .fair-games,
  .fair-bbq,
  .fair-pets {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(calc(-50% + 110vw));
    opacity: 0;
    animation: none;
  }

  .fair-dj.is-active,
  .fair-tickets.is-active,
  .fair-bouncy.is-active,
  .fair-games.is-active,
  .fair-bbq.is-active,
  .fair-pets.is-active {
    transform: translateX(-50%);
    opacity: 1;
    animation: fairBob var(--bob-duration, 4.8s) ease-in-out var(--bob-delay, 0s) infinite;
  }

  .fair-dj.is-entering,
  .fair-tickets.is-entering,
  .fair-bouncy.is-entering,
  .fair-games.is-entering,
  .fair-bbq.is-entering,
  .fair-pets.is-entering {
    animation: boothSlideIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }

  .fair-dj.is-leaving,
  .fair-tickets.is-leaving,
  .fair-bouncy.is-leaving,
  .fair-games.is-leaving,
  .fair-bbq.is-leaving,
  .fair-pets.is-leaving {
    animation: boothSlideOut 0.42s cubic-bezier(0.55, 0, 1, 0.45) both;
  }

  .fair-dj     { width: 278px; }
  .fair-tickets { width: 278px; }
  .fair-bouncy { width: 430px; }
  .fair-games  { width: 278px; }
  .fair-bbq    { width: 252px; }
  .fair-pets   { width: 278px; }

  .field-grid,
  .compact,
  .counter-grid,
  .shop-grid {
    grid-template-columns: 1fr;
  }

  .counter-row {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }

  .step {
    min-height: 430px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
