:root {
  --cream: #fbf5e9;
  --cream-2: #f4ead6;
  --red: #c8232c;
  --red-dark: #9e1a22;
  --green: #1f4d2b;
  --green-2: #2f6b3c;
  --sage: #a9c3a0;
  --gold: #c9a043;
  --ink: #1f3a26;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Oswald", system-ui, sans-serif;
  /* candy-stripe wallpaper like the invite */
  background:
    repeating-linear-gradient(90deg, var(--sage) 0 34px, var(--cream) 34px 68px);
  padding: 28px 14px 40px;
  overflow-x: hidden;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ---------- card ---------- */
.card {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  background: var(--cream);
  border: 6px solid var(--green);
  border-radius: 220px 220px 28px 28px;
  padding: 70px 28px 90px;
  box-shadow: 0 20px 60px rgba(31, 77, 43, .25);
  text-align: center;
}

@media (max-width: 560px) {
  .card { border-radius: 140px 140px 22px 22px; padding: 56px 16px 80px; }
}

/* ---------- string lights ---------- */
.lights {
  position: absolute;
  left: 8%;
  right: 8%;
  top: -22px;
  height: 75px;
  pointer-events: none;
}
.lights.bottom { top: auto; bottom: -33px; }
.lights svg { width: 100%; height: 100%; overflow: visible; }
.bulb { transform-box: fill-box; transform-origin: 50% 0; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px currentColor); }
  50% { opacity: .45; filter: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding-top: 10px; }

.sparkles .sp {
  position: absolute;
  font-size: 28px;
  animation: sparkle 2.4s ease-in-out infinite;
}
.sp:nth-child(2n) { animation-delay: .8s; font-size: 22px; }
.sp:nth-child(3n) { animation-delay: 1.4s; }
.sp.gold { color: var(--gold); }
.sp.red { color: var(--red); }
.sp.green { color: var(--green); }
@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(.6) rotate(25deg); opacity: .5; }
}

.script {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  color: var(--red);
  margin: 0;
  line-height: .9;
}
h1.script .line { display: block; }
h1.script .l1 { font-size: clamp(64px, 16vw, 120px); }
h1.script .l2 { font-size: clamp(64px, 15vw, 116px); animation: wiggle 4s ease-in-out infinite; transform-origin: center; }
@keyframes wiggle {
  0%, 90%, 100% { transform: rotate(0); }
  93% { transform: rotate(-2deg); }
  96% { transform: rotate(2deg); }
}

.script.small { font-size: clamp(40px, 9vw, 60px); margin-bottom: 6px; }

.name {
  font-family: "Cormorant SC", serif;
  font-weight: 700;
  letter-spacing: .08em;
  font-size: clamp(30px, 7vw, 46px);
  color: var(--red);
  margin: 10px 0 0;
}

.one {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: -10px;
}

.ne {
  font-family: "Archivo Black", "Oswald", sans-serif;
  font-size: clamp(110px, 28vw, 200px);
  line-height: .8;
  color: var(--red);
  -webkit-text-stroke: 8px var(--green);
  paint-order: stroke fill;
  letter-spacing: -.02em;
  text-shadow: 6px 6px 0 rgba(31, 77, 43, .18);
}

.face-o {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  width: clamp(130px, 32vw, 230px);
  margin-right: -6px;
  margin-bottom: -6px;
  animation: bob 2.6s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.face-o { aspect-ratio: 1 / 1.05; }
.face-o img {
  /* fixed frame so swapping photos of different shapes never shifts the layout */
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.18));
}
.face-o.pop img { animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.face-o:focus-visible { outline: 3px dashed var(--gold); outline-offset: 6px; border-radius: 50%; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
}
@keyframes pop {
  0% { transform: scale(.4) rotate(-20deg); }
  100% { transform: scale(1) rotate(0); }
}

.hint {
  font-family: "Dancing Script", cursive;
  font-size: 22px;
  color: var(--gold);
  margin: 10px 0 0;
}

.tree-hint {
  /* ~16em wide; scale with the screen so the sparkles stay on the same line */
  font-size: min(22px, calc((100vw - 80px) / 16.2));
}
.nowrap { white-space: nowrap; }

/* ---------- countdown ---------- */
.countdown { margin: 40px auto 10px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 14px;
  color: var(--green-2);
  margin: 0 0 12px;
}
.clock { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.clock > div {
  background: var(--green);
  color: var(--cream);
  border-radius: 14px;
  min-width: 78px;
  padding: 12px 8px 8px;
  box-shadow: inset 0 0 0 2px var(--gold);
}
.clock span { display: block; font-size: 38px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.clock small { text-transform: uppercase; letter-spacing: .15em; font-size: 11px; opacity: .8; }
@media (max-width: 420px) {
  .clock { gap: 8px; flex-wrap: nowrap; }
  .clock > div { min-width: 0; flex: 1; max-width: 72px; padding: 10px 4px 6px; }
  .clock span { font-size: 30px; }
  .clock small { font-size: 10px; letter-spacing: .08em; }
}
.countdown.done .clock { display: none; }
.party-now { font-family: "Dancing Script", cursive; font-size: 40px; color: var(--red); margin: 0; }

/* ---------- details ---------- */
.details { margin: 36px 0 30px; }
.details p { margin: 0; }
.when, .where {
  font-size: clamp(24px, 5.5vw, 34px);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--green);
  line-height: 1.25;
}
.where a { color: inherit; text-decoration: none; border-bottom: 3px dotted var(--sage); }
.where a:hover { border-bottom-color: var(--red); }
.wear {
  margin-top: 10px !important;
  font-size: clamp(20px, 4.5vw, 26px);
  text-transform: uppercase;
  color: var(--gold);
}
.note {
  margin-top: 14px !important;
  /* ~16.7em wide; scale with the screen so it stays on one line on phones */
  font-size: min(20px, calc((100vw - 80px) / 17.1));
  line-height: 1.4;
}

.btn {
  font: 500 16px "Oswald", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 999px;
  border: 3px solid var(--red);
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 0 var(--red-dark);
  transition: transform .1s, box-shadow .1s;
  user-select: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }

/* add to calendar dropdown */
.cal { position: relative; display: inline-block; margin-top: 24px; }
.cal summary { list-style: none; display: inline-block; }
.cal summary::-webkit-details-marker { display: none; }
.cal summary::after { content: " ▾"; }
.cal[open] summary::after { content: " ▴"; }
.cal-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  min-width: 210px;
  background: #fff;
  border: 3px solid var(--green);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(31, 77, 43, .2);
}
.cal-menu a, .cal-menu button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: none;
  font: 500 17px "Oswald", sans-serif;
  color: var(--green);
  text-decoration: none;
  cursor: pointer;
}
.cal-menu a + button { border-top: 2px dashed var(--sage); }
.cal-menu a:hover, .cal-menu button:hover { background: var(--cream-2); color: var(--red); }

/* ---------- tree ---------- */
.tree-section {
  border-top: 3px dashed var(--sage);
  padding-top: 30px;
  margin-top: 20px;
}
.lede { font-size: 20px; line-height: 1.45; max-width: 520px; margin: 0 auto; }

.tree-wrap { position: relative; max-width: 320px; margin: 10px auto 0; }
#tree { width: 100%; height: auto; cursor: pointer; touch-action: manipulation; }
/* opacity/glow only — no transforms, which mobile Safari pivots wrongly on SVG text */
#tree .star { font-size: 44px; fill: var(--gold); animation: starGlow 2.4s ease-in-out infinite; }
@keyframes starGlow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(201, 160, 67, .9)); }
  50% { opacity: .65; filter: none; }
}
.orn { transform-box: view-box; animation: drop .6s cubic-bezier(.3,1.5,.5,1), swing 3s ease-in-out .6s infinite; }
@keyframes drop { from { transform: translateY(-40px) scale(.2); opacity: 0; } }
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.gift { position: absolute; right: -10px; bottom: 6px; font-size: 64px; animation: bob 3s ease-in-out infinite; }
.count { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--green-2); }

footer { margin-top: 40px; }
footer p {
  font-family: "Dancing Script", cursive;
  /* the line is ~13em wide; scale with the screen so it stays on one line on phones */
  font-size: min(34px, calc((100vw - 80px) / 13.4));
  color: var(--red);
  margin: 0;
  text-wrap: balance;
}

/* ---------- confetti ---------- */
.confetti {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  font-size: 22px;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #snow { display: none; }
}
