.calendar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calendar-tools .demo { align-self: auto; }
.replay {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: transparent;
  font-size: .78rem;
  transition: background calc(.25s * var(--motion-factor));
}
.replay:hover { background: var(--paper); }
.replay svg { color: var(--red); }
[hidden] { display: none !important; }

.village {
  position: relative;
  isolation: isolate;
  min-height: clamp(470px, 78svh, 780px);
  overflow: hidden;
  display: grid;
  align-items: end;
  background: #1b2420;
  color: #fff0dc;
}
.village::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #171410d1, #14140e62 48%, transparent 82%),
              linear-gradient(0deg, #161411ea, transparent 61%);
  pointer-events: none;
}
.village-image, .village-image img, .village-lights {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.village-image { z-index: -2; }
.village-image img {
  object-fit: cover;
  object-position: 57% 54%;
  filter: brightness(.72) saturate(.74);
  transform: scale(1.015);
  transition: filter calc(1s * var(--motion-factor)) ease, transform calc(1.65s * var(--motion-factor)) var(--ease);
}
.village.is-lit .village-image img {
  filter: brightness(1.12) saturate(1.12);
  transform: scale(1.046);
}
.village-inner {
  z-index: 2;
  padding-block: clamp(35px, 8vw, 103px);
}
.village h2, .greetings h2 {
  margin: 0;
  font: 400 clamp(2.85rem, 6vw, 5.9rem)/.99 var(--display);
  letter-spacing: -.04em;
  text-wrap: balance;
}
.village h2 { max-width: 12ch; }
.village h2 em { color: #eec891; font-weight: 400; }
.village p, .greetings-copy p { max-width: 38ch; margin: 16px 0 23px; }
.hero .cta, .village .cta { background: var(--linen); color: var(--midnight); }
.hero .cta:hover, .village .cta:hover { background: color-mix(in srgb, var(--linen) 82%, #fff8e7); }
.village-lights { z-index: 0; opacity: 0; transition: opacity calc(.8s * var(--motion-factor)) ease; pointer-events: none; }
.village.is-lit .village-lights { opacity: 1; }
.village-lights i {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: clamp(4px, .6vw, 8px);
  aspect-ratio: 1;
  background: #fff1bd;
  border-radius: 50%;
  box-shadow: 0 0 10px 3px #ffbd68, 0 0 34px 8px #ff9c3975;
  animation: lamp 2.7s var(--delay, 0s) ease-in-out infinite alternate;
  animation-play-state: paused;
}
.village.is-lit.is-visible .village-lights i { animation-play-state: running; }
.village-lights i:nth-child(1) { --lx: 47%; --ly: 34%; }
.village-lights i:nth-child(2) { --lx: 58%; --ly: 19%; --delay: -.5s; }
.village-lights i:nth-child(3) { --lx: 66%; --ly: 47%; --delay: -1.6s; }
.village-lights i:nth-child(4) { --lx: 76%; --ly: 29%; --delay: -2s; }
.village-lights i:nth-child(5) { --lx: 86%; --ly: 38%; --delay: -.8s; }
.village-lights i:nth-child(6) { --lx: 93%; --ly: 22%; --delay: -1.2s; }
@keyframes lamp { from { opacity: .64; scale: .85; } to { opacity: 1; scale: 1.16; } }

.greetings {
  position: relative;
  min-height: 65svh;
  display: grid;
  align-content: center;
  background: var(--soft);
  padding: clamp(46px, 9vw, 118px) 0;
}
.greetings-inner { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: clamp(28px, 7vw, 95px); }
.greetings-copy h2 em { color: var(--red); font-weight: 400; }
.greetings-copy p { color: var(--muted); }
.postcard {
  --postcard-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.73' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.22' filter='url(%23grain)'/%3E%3C/svg%3E");
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, 560px);
  min-height: clamp(220px, 29vw, 365px);
  transform: rotate(-3deg);
  justify-self: center;
  border-radius: 7px;
  box-shadow: 0 15px 35px var(--shadow);
  background: var(--paper);
  transition: transform calc(.65s * var(--motion-factor)) var(--ease);
}
.postcard.is-open { transform: rotate(0); }
.postcard-cover, .postcard-note {
  position: relative;
  isolation: isolate;
  border-radius: inherit;
  grid-area: 1/1;
  place-content: center;
  justify-items: center;
  padding: 27px;
  text-align: center;
}
.postcard-cover {
  display: grid;
  grid-template-columns: repeat(3, min-content);
  gap: 8px;
  background: var(--postcard-grain), radial-gradient(ellipse at 54% 34%, #891d34, #601324 74%, #410b18);
  background-blend-mode: soft-light, normal;
  color: #fae5bd;
}
.postcard-cover::before, .postcard-note::before {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid currentColor;
  opacity: .54;
  border-radius: 2px;
  pointer-events: none;
}
.postcard-cover::after, .postcard-note::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: url("assets/spruce-divider-wide.png") -48% -2% / 67% auto no-repeat,
              url("assets/spruce-divider-wide.png") 148% 102% / 67% auto no-repeat;
  opacity: .42;
  pointer-events: none;
}
.postcard-note::after { opacity: .2; }
.postcard-cover svg { width: clamp(21px, 4vw, 48px); height: auto; align-self: center; stroke-width: 1; }
.postcard-cover svg:nth-child(3) { transform: scaleX(-1); }
.postcard-cover span {
  grid-column: 1/-1;
  font: italic 400 clamp(3.25rem, 8vw, 7rem)/.9 var(--display);
}
.postcard.is-open .postcard-cover { visibility: hidden; }
.postcard-note {
  display: grid;
  color: var(--red);
  background: var(--postcard-grain), radial-gradient(ellipse at 47% 42%, #2d4437, #172a23 78%);
}
.postcard-note span { font: italic 400 clamp(1.5rem, 3.1vw, 2.6rem)/1 var(--display); }
.postcard-note p { font: 400 clamp(1.12rem, 2.3vw, 1.7rem)/1.2 var(--display); max-width: 24ch; margin: 12px 0 0; }
.postcard.is-open .postcard-note { animation: ink-in calc(.7s * var(--motion-factor)) var(--ease) both; }
@keyframes ink-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 740px) {
  .calendar-tools { margin-top: 6px; gap: 6px; }
  .calendar-tools .demo { margin-top: 0; }
  .replay { min-height: 33px; padding: 3px 8px; font-size: .72rem; }
  .greetings-inner { grid-template-columns: 1fr; }
  .postcard { width: min(94%, 440px); }
  .village::after { background: linear-gradient(0deg, #161411f2, #14140e36 79%); }
  .village-image img { object-position: 54% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .village.is-lit .village-image img { transform: none; }
  .village.is-lit .village-lights i { animation: none; }
}
