:root {
  --paper: #f6f2ea;
  --paper-deep: #efe8dc;
  --ink: #2a312d;
  --muted: #667066;
  --pine: #3e5144;
  --pine-deep: #24362c;
  --line: rgba(74, 63, 48, 0.28);
  --sage: #6f8164;
  --shadow: 0 28px 70px rgba(48, 42, 32, 0.16);
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--serif);
  background-color: #e7e0d4;
}

button, textarea, input { font-family: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

.boot, .message-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  text-align: center;
  font-size: 28px;
}

.sheet {
  width: min(460px, 100%);
  margin: 28px auto 40px;
  background: #fbf8f3;
  box-shadow: var(--shadow);
  position: relative;
  overflow: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(251, 248, 243, 0.78);
  backdrop-filter: blur(10px);
  animation: barIn 1.15s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.top-title {
  flex: 1;
  margin: 0;
  color: #8d978c;
  font-size: 20px;
  font-weight: 500;
}

.icon-btn, .cal-btn, .submit, .choice, .rsvp-toggle {
  border: 0;
  cursor: pointer;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  gap: 5px;
  place-content: center;
}

.icon-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--pine-deep);
}

.cal-btn, .submit {
  background: var(--sage);
  color: #f7f4ee;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.cal-btn {
  flex: 0 0 auto;
  padding: 8px 12px;
  font-size: 15px;
  white-space: nowrap;
}

.cal-btn:hover, .submit:hover { background: #617456; }

.menu {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  z-index: 6;
  margin: 0;
  padding: 8px;
  background: #fbf8f3;
  border: 1px solid rgba(62, 81, 68, 0.12);
  box-shadow: 0 16px 40px rgba(40, 36, 28, 0.12);
}

.menu[hidden] { display: none; }

.menu a {
  display: block;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 22px;
}

.menu a:hover { background: rgba(111, 129, 100, 0.1); }

.hero, .letter, .block, .dress, .plan, .rsvp {
  scroll-margin-top: 74px;
}

.hero {
  position: relative;
  padding: 118px 24px 36px;
  text-align: center;
  overflow: hidden;
}

.cover-art {
  position: absolute;
  z-index: 0;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.cover-tl { top: 0; left: 0; width: 44%; }
.cover-tr { top: 0; right: 0; width: 40%; }
.cover-bl { bottom: -72px; left: -40px; width: 34%; }
.cover-br { right: -36px; bottom: -64px; width: 32%; }

.garland {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.garland-top {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 52px, #000 calc(100% - 52px), transparent),
    linear-gradient(to bottom, transparent, #000 28px);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 52px, #000 calc(100% - 52px), transparent),
    linear-gradient(to bottom, transparent, #000 28px);
  mask-composite: intersect;
}

.edge {
  position: absolute;
  top: 10px;
  z-index: 1;
  width: 34%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.edge-left {
  left: 0;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 24px, #000 46%, transparent),
    linear-gradient(to bottom, transparent, #000 28px);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 24px, #000 46%, transparent),
    linear-gradient(to bottom, transparent, #000 28px);
  mask-composite: intersect;
}

.edge-right {
  right: 0;
  -webkit-mask-image:
    linear-gradient(to left, transparent, #000 24px, #000 46%, transparent),
    linear-gradient(to bottom, transparent, #000 28px);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to left, transparent, #000 24px, #000 46%, transparent),
    linear-gradient(to bottom, transparent, #000 28px);
  mask-composite: intersect;
}

.after-hero {
  position: relative;
}

.after-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("/assets/pattern.png?v=7");
  background-repeat: repeat;
  background-position: center top;
  background-size: 88% auto;
}

.hero > :not(.garland):not(.edge):not(.cover-art):not(.ornament):not(.sprig),
.letter,
.block,
.plan,
.rsvp,
.garland-bottom,
.footer {
  position: relative;
  z-index: 3;
}

.garland-bottom {
  margin-top: 12px;
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 52px, #000 calc(100% - 52px), transparent),
    linear-gradient(to top, transparent, #000 36px);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent, #000 52px, #000 calc(100% - 52px), transparent),
    linear-gradient(to top, transparent, #000 36px);
  mask-composite: intersect;
}

.diamond {
  display: block;
  margin: 0 auto 14px;
  color: #9a9a9a;
  font-size: 13px;
  line-height: 1;
}

.kicker {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.45;
}

.names {
  margin: 12px 36px 2px;
  font-size: clamp(44px, 12vw, 58px);
  font-weight: 500;
  font-style: italic;
  line-height: 0.92;
}

.names span { font-style: italic; }

.date-row {
  width: min(280px, 86%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.date-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.date-side i {
  display: block;
  width: min(92px, 100%);
  height: 1px;
  background: #b7ad9e;
  font-style: normal;
}

.date-num {
  font-size: 48px;
  font-weight: 500;
  line-height: 0.9;
  font-variant-numeric: lining-nums;
}

.wish {
  margin: 22px 0 0;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.55;
}

.wish .diamond {
  margin: 16px auto 0;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: min(100%, 380px);
  margin: 22px auto 0;
  padding: 14px 8px 12px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(48, 42, 32, 0.06);
}

.tick b {
  display: block;
  font-size: 30px;
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}

.tick span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.today-note {
  margin: 8px 0 0;
  font-size: 28px;
  font-style: italic;
}

.letter, .block, .dress, .rsvp {
  padding: 22px 22px 28px;
  text-align: center;
}

.letter { padding-top: 40px; }

.section-icon {
  position: relative;
  z-index: 2;
  display: block;
  width: 46px;
  height: auto;
  margin: 0 auto 10px;
}

.section-widget {
  position: relative;
  z-index: 2;
  display: block;
  width: 145px;
  height: auto;
  margin: 8px auto 16px;
}

#gifts .section-widget { width: 136px; }
.letter .section-widget { width: 168px; }
#dress .section-widget { width: 118px; }

.photo-slot {
  position: relative;
  overflow: hidden;
  background: #f4f0e8;
  border: 1px solid #b7a488;
}

.photo-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.photo-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 7px #fbf8f3,
    inset 0 0 0 8px rgba(183, 164, 136, 0.9);
}

.photo-main {
  width: 93.6%;
  margin: 26px auto 4px;
  aspect-ratio: 4 / 5;
}

.photo-pair {
  display: flex;
  gap: 8px;
  margin: 6px 0 2px;
  padding: 22px 0 14px;
}

.photo-tilt {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 800 / 820;
}

.photo-tilt-left { transform: rotate(-11deg); }
.photo-tilt-right { transform: rotate(11deg); }

.salutation, .quote {
  font-style: italic;
  font-weight: 500;
}

.salutation {
  margin: 0 0 14px;
  font-size: clamp(36px, 10vw, 46px);
  line-height: 1.05;
  white-space: pre-line;
}

.script-title {
  position: relative;
  z-index: 2;
  margin: 0 0 16px;
  font-size: clamp(40px, 11vw, 54px);
  font-weight: 500;
  font-style: italic;
  line-height: 1.05;
  text-align: center;
}

.prose {
  margin: 0 auto;
  max-width: none;
  color: #1c1c1c;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
}

.prose + .prose { margin-top: 14px; }

.block-note {
  margin: 26px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(141, 115, 78, 0.45);
  color: #24362c;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.block-note p { margin: 6px 0 0; }

.block-note-title {
  margin: 0 0 10px;
  color: #6f5a3a;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.block-note-tail {
  margin-top: 14px;
  color: #3e5144;
  font-size: 18px;
}

.quote {
  margin: 22px auto 0;
  max-width: none;
  font-size: 34px;
  line-height: 1.2;
}

.label {
  margin: 0 0 8px;
  color: #1a1a1a;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.place-time {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

.place-name {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.address {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
}

.map-frame {
  height: 220px;
  margin: 16px auto 0;
  overflow: hidden;
  border: 1px solid rgba(62, 81, 68, 0.16);
  border-radius: 16px;
  background: #fff;
}

.map-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.map-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--pine-deep);
  font-size: 16px;
}

.keep-lines { white-space: pre-line; }

.month {
  margin: 8px auto 0;
  max-width: 360px;
  padding: 16px 12px 18px;
  background: #fffcf8;
  border: 1.5px solid #8d734e;
  border-radius: 16px;
}

.month-title {
  margin: 0 0 12px;
  color: #6f5a3a;
  font-size: 36px;
  font-weight: 500;
  font-style: italic;
  text-transform: capitalize;
}

.month-head, .month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px 0;
  font-size: 18px;
  text-align: center;
  color: #2a312d;
}

.month-head {
  margin-bottom: 8px;
  color: #6f5a3a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
}

.day-mark {
  position: relative;
  width: 32px;
  height: 32px;
  margin: -4px auto;
  display: grid;
  place-items: center;
  color: #24362c;
  font-style: italic;
  font-weight: 600;
}

.day-mark svg {
  position: absolute;
  inset: -2px;
  width: 36px;
  height: 34px;
  margin: auto;
}

#calendar.show .day-mark {
  animation: markerLand 2.2s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.swatch {
  width: 74px;
}

.swatch i {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 6px;
  border-radius: 50%;
  border: 1px solid rgba(48, 42, 32, 0.12);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.35);
}

.swatch span {
  display: block;
  font-size: 14px;
  line-height: 1.2;
  color: var(--muted);
}

.program {
  position: relative;
  overflow: hidden;
  padding: 118px 24px 48px;
  background: #fbf8f3;
  text-align: center;
}

.program .timeline { position: relative; z-index: 2; }

.timeline {
  position: relative;
  max-width: 390px;
  margin: 8px auto 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  margin: 0 0 28px;
  text-align: center;
}

.timeline li:last-child { margin-bottom: 0; }

.when {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  font-style: italic;
  line-height: 1;
}

.timeline h3 {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.15;
}

.timeline li p:not(.when) {
  margin: 6px auto 0;
  max-width: none;
  color: var(--muted);
  font-size: 16px;
  font-style: italic;
  line-height: 1.35;
}

#confirm {
  padding: 36px 22px 12px;
}

.confirm-note {
  position: relative;
  z-index: 6;
  margin: 8px 6px 0;
  padding: 26px 18px 18px;
  background: linear-gradient(180deg, #eceae6 0%, #ddd9d4 100%);
  color: #1a1a1a;
  text-align: center;
  border: 1px solid #c8c4be;
  border-radius: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 12px 18px rgba(48, 42, 32, 0.14);
  transform: rotate(-1.1deg);
}

.paperclip {
  position: absolute;
  top: -30px;
  left: 12px;
  width: 36px;
  height: 62px;
  transform: rotate(-16deg);
  filter: drop-shadow(1px 2px 1px rgba(40, 36, 30, 0.28));
}

.confirm-note h2 {
  margin: 0;
  color: #2a2a2a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1.3;
  text-transform: uppercase;
}

.confirm-note p {
  margin: 8px auto 0;
  max-width: none;
  color: #1c1c1c;
  font-size: 18px;
  font-weight: 500;
  font-style: normal;
  line-height: 1.35;
}

.confirm-note .confirm-date {
  margin: 12px auto 2px;
  color: #24362c;
  font-size: 36px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1;
}

.confirm-note .confirm-date span {
  display: block;
  margin-bottom: 6px;
  color: #3a3a3a;
  font-size: 14px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.rsvp-card {
  margin-top: 22px;
  padding: 8px 4px 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(48, 42, 32, 0.05);
}

.attendance {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 0 8px;
}

.rsvp-toggle {
  padding: 14px 12px;
  background: #6d7f62;
  color: #f7f4ee;
  border: 0;
  border-radius: 12px;
  font-size: 22px;
}

.rsvp-no {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(62, 81, 68, 0.28);
}

.rsvp-toggle[aria-pressed="true"] {
  background: #5c6c52;
  color: #f6f3ee;
  border-color: #5c6c52;
}

.regret {
  margin: -6px 0 18px;
  text-align: center;
}

.regret[hidden] { display: none; }

.regret-face {
  width: 148px;
  height: auto;
}

.tear {
  transform-box: fill-box;
  transform-origin: center;
  animation: tear 1.15s ease-in infinite;
}

.tear-b { animation-delay: 0.5s; }

@keyframes tear {
  0% { transform: translateY(0); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateY(46px); opacity: 0; }
}

.regret-caption {
  margin: 8px 0 0;
  font-size: 26px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
}

fieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.message-caption {
  margin: 4px 8px 10px;
  text-align: center;
  font-size: 22px;
  font-style: italic;
}

.ask-note {
  margin: 18px 0 8px;
  padding: 14px 16px;
  background: #e7f2f6;
  border-left: 4px solid #e07a3d;
  text-align: center;
  font-size: 18px;
  line-height: 1.35;
}

.ask-note p { margin: 0; }

.questions { padding: 8px 8px 0; text-align: left; }

legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.question-missing legend {
  color: #b42318;
}

.choices {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 20px;
  text-align: left;
}

.choice::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid #2a312d;
  border-radius: 50%;
  background: transparent;
}

.choice-multi::before { border-radius: 3px; }

.choice[aria-pressed="true"] {
  background: transparent;
  color: inherit;
}

.choice[aria-pressed="true"]::before {
  background: var(--pine-deep);
  box-shadow: inset 0 0 0 3px #fff;
}

.hint {
  margin: -4px 0 8px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.detail { margin: 4px 0 2px; }
.detail[hidden] { display: none; }

.detail-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(62, 81, 68, 0.2);
  border-radius: 12px;
  font-size: 18px;
}

textarea {
  display: block;
  width: calc(100% - 16px);
  min-height: 92px;
  margin: 0 8px 14px;
  padding: 12px;
  resize: vertical;
  background: #fff;
  border: 1px solid rgba(62, 81, 68, 0.2);
  border-radius: 12px;
  font-size: 18px;
}

.submit {
  display: block;
  width: auto;
  margin: 0 8px 4px auto;
  padding: 10px 22px;
  background: #8a8680;
  color: #fff;
}

.submit:hover { background: #736f6a; }

.form-error, .form-ok {
  margin: 12px 0 0;
  font-size: 20px;
}

.form-error { color: #7a3b32; }

.form-ok {
  text-align: center;
  font-size: 26px;
  line-height: 1.3;
}

.footer {
  padding: 18px 24px 28px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}

.footer p { margin: 0; }

.rise {
  animation: rise 0.8s ease both;
}

.pine-in {
  animation: pineIn 2s cubic-bezier(0.215, 0.61, 0.355, 1) both;
  transform-origin: center top;
}

.edge-left.pine-in, .cover-tl.pine-in { transform-origin: left top; animation-delay: 0.05s; }
.edge-right.pine-in, .cover-tr.pine-in { transform-origin: right top; animation-delay: 0.15s; }
.cover-bl.pine-in { transform-origin: left bottom; animation-delay: 0.22s; }
.cover-br.pine-in { transform-origin: right bottom; animation-delay: 0.28s; }

.title-in {
  animation: titleIn 2.15s cubic-bezier(0.215, 0.61, 0.355, 1) 0.28s both;
  transform-origin: center center;
}

.fade-in { animation: fadeIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }

.tick {
  animation: fadeIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.reveal {
  opacity: 0;
  transform: translateY(46px);
}

.reveal.show {
  animation: fromBottom 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.d1 { animation-delay: 0.12s; }
.d2 { animation-delay: 0.28s; }
.d3 { animation-delay: 0.48s; }
.d4 { animation-delay: 0.66s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes barIn {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: none; }
}

@keyframes pineIn {
  from { opacity: 0; transform: scale(1.55); }
  to { opacity: 1; transform: none; }
}

@keyframes titleIn {
  from { opacity: 0; transform: scale(1.62); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fromBottom {
  from { opacity: 0; transform: translateY(46px); }
  to { opacity: 1; transform: none; }
}

@keyframes markerLand {
  0% { opacity: 0; transform: scale(3.1) rotate(-8deg); }
  45% { opacity: 1; transform: scale(1.12) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@media (max-width: 520px) {
  .sheet {
    width: 100%;
    margin: 0;
    min-height: 100vh;
    box-shadow: none;
    background: #fbf8f3;
  }
}

.look-newyear .snow {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.look-newyear .snow i {
  position: absolute;
  top: -28px;
  color: #f4fbff;
  filter: drop-shadow(0 0 1px rgba(90, 150, 190, 0.9));
  animation: snowfall linear infinite;
}

.look-newyear .snow svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes snowfall {
  0% { transform: translate3d(0, -12vh, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift), 112vh, 0) rotate(var(--spin)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .tear, .pine-in, .title-in, .fade-in, .tick, .topbar,
  .reveal, .reveal.show, #calendar.show .day-mark { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .look-newyear .snow { display: none; }
}
