@font-face {
  font-family: Allura;
  src: url("assets/allura.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/cormorant-garamond.woff2") format("woff2");
  font-weight: 500 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #35241f;
  --muted: #6a4c43;
  --rose: #8c3b54;
  --rose-dark: #723046;
  --rule: #c8a392;
  --paper: #fff9ed;
  --display: "Cormorant Garamond", Georgia, serif;
  --hand: Allura, "Snell Roundhand", "Segoe Script", cursive;
  --grain: repeating-linear-gradient(7deg, #62372805 0 1px, transparent 1px 4px),
    repeating-linear-gradient(86deg, #ffffff32 0 1px, transparent 1px 5px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, serif;
  background:
    var(--grain),
    radial-gradient(ellipse at 14% 16%, #fffcf2, transparent 60%),
    radial-gradient(ellipse at 92% 24%, #efd2cc, transparent 57%),
    #f8eddf;
}

button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 6px; }

.stationery {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  isolation: isolate;
  padding: clamp(4rem, 8vw, 8rem) clamp(1.5rem, 8vw, 8rem);
}

.stationery::before, .stationery::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: clamp(.65rem, 2vw, 1.8rem);
  border: 1px solid #a76c5f65;
}

.stationery::after {
  inset: clamp(.9rem, 2.3vw, 2.15rem);
  border-color: #a76c5f39;
}

.page-mark {
  position: absolute;
  top: clamp(.35rem, 1.65vw, 1.38rem);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 1.55rem;
  color: var(--rose);
  background: #f9eee3;
  font: 1.2rem/1 Georgia, serif;
}

.landing {
  display: grid;
  grid-template:
    ". stage" 1fr
    "intro stage" auto
    "button stage" auto
    ". stage" 1fr
    / minmax(0, .92fr) minmax(0, 1.08fr);
  column-gap: clamp(1rem, 5vw, 5.5rem);
  align-items: center;
  width: min(100%, 72rem);
}

.intro { grid-area: intro; position: relative; z-index: 1; }

.eyebrow {
  margin: 0;
  color: var(--rose);
  font: 600 .875rem/1.45 system-ui, sans-serif;
  letter-spacing: .17em;
}

.small-rule {
  display: inline-block;
  width: 1.45rem;
  margin-right: .45rem;
  border-top: 1px solid currentColor;
  vertical-align: .24em;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.045em;
}

h1 {
  margin-top: 1.4rem;
  font-size: clamp(4.6rem, 8.2vw, 8.05rem);
  line-height: .77;
}

.script { font: normal 400 1em/1 var(--hand); color: var(--rose); }

h1 .script {
  display: block;
  width: fit-content;
  margin: .09em 0 0 .065em;
  font-size: 1.135em;
  letter-spacing: -.04em;
  line-height: .74;
  padding: .13em .1em .12em 0;
}

.intro-note {
  max-width: 23rem;
  margin: 1.15rem 0 1.8rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.65;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .85em;
  width: fit-content;
  min-height: 3.2rem;
  padding: .72rem 1.38rem;
  border: 1px solid transparent;
  border-radius: .23rem;
  color: #fff9f1;
  background: var(--rose);
  box-shadow: 0 4px 10px #711d3720;
  font: 600 .9375rem/1.35 system-ui, sans-serif;
  text-align: center;
  text-decoration: none;
  transition: background .2s, box-shadow .2s;
}

.button:hover, .button:focus-visible { background: var(--rose-dark); box-shadow: 0 6px 16px #711d3730; }
.open-button { grid-area: button; }
.open-button span { font: 1.25rem/1 Georgia, serif; }

.stage {
  position: relative;
  grid-area: stage;
  display: grid;
  place-items: center;
  aspect-ratio: 1.055;
  isolation: isolate;
}

.halo {
  position: absolute;
  z-index: -2;
  inset: 0 2%;
  border: 1px solid #c6878580;
  border-radius: 50%;
  background:
    var(--grain),
    radial-gradient(ellipse at 38% 22%, #f9e7de, #e7b8b6 90%);
  box-shadow: inset 0 0 0 .6rem #fff8ee33, inset 0 0 0 .65rem #bc797946;
  transform: rotate(-12deg);
}

.postmark {
  position: absolute;
  top: 11%;
  right: 6%;
  display: grid;
  place-items: center;
  width: 21%;
  aspect-ratio: .86;
  transform: rotate(13deg);
  color: #924c5b;
  background: #f6e1da;
  border: 3px dotted #d39e99;
  box-shadow: 0 4px 18px #6b343228;
}

.postmark span {
  display: grid;
  place-items: center;
  width: 78%;
  height: 78%;
  border: 1px solid #b9757988;
  background: repeating-linear-gradient(-45deg, #b9757914 0 1px, transparent 1px 4px);
  font: clamp(1.9rem, 4.3vw, 3.65rem)/1 Georgia, serif;
}

.glint { position: absolute; color: #834152; line-height: 1; pointer-events: none; }
.glint-top { top: 13%; left: 16%; font-size: clamp(1.4rem, 3.4vw, 2.8rem); }
.glint-bottom { bottom: 14%; right: 15%; font-size: clamp(.85rem, 2.1vw, 1.7rem); }

.envelope {
  position: relative;
  display: block;
  width: 79%;
  aspect-ratio: 1.57;
  isolation: isolate;
  perspective: 58rem;
  transform: rotate(-7deg);
  filter: drop-shadow(0 1.1rem 1rem #6f3e3c3b);
  border-radius: .3rem;
  transition: transform .28s ease;
}

.envelope:hover, .envelope:focus-visible { transform: translateY(-.3rem) rotate(-5deg); }

.envelope-back, .envelope-pocket, .envelope-flap {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.envelope-back {
  background: var(--grain), linear-gradient(135deg, #ba747b, #e8afa8 65%, #d49894);
}

.envelope-letter {
  position: absolute;
  z-index: 1;
  inset: 6% 8% 5%;
  display: grid;
  place-items: center;
  padding-bottom: 24%;
  background: var(--grain), #fff9eb;
  border: 1px solid #b88d73;
  box-shadow: inset 0 0 0 .45rem #fff9eb, inset 0 0 0 .51rem #cda599;
  font-size: clamp(1.5rem, 4.5vw, 4rem);
}

.envelope-pocket {
  z-index: 2;
  background: var(--grain), linear-gradient(144deg, #eec4b8, #edc1b6 56%, #dca39e);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}

.envelope-pocket::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid #ac6d652e;
  border-radius: inherit;
  background: var(--grain), linear-gradient(170deg, #dc9b96, #f1c7bb 81%);
  clip-path: polygon(0 100%, 49% 42%, 51% 42%, 100% 100%);
}

.envelope-flap {
  z-index: 3;
  transform-origin: top center;
  filter: drop-shadow(0 2px 1px #935b5277);
}

.envelope-flap span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    var(--grain),
    linear-gradient(160deg, #f5d3c5, #e7afa7 77%);
  clip-path: polygon(0 0, 100% 0, 52% 62%, 50% 64%, 48% 62%);
}

.seal {
  position: absolute;
  z-index: 4;
  top: 60%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 18.5%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(8deg);
  border-radius: 48% 52% 47% 53% / 53% 47% 53% 47%;
  color: #f7d0c2;
  background: radial-gradient(circle at 33% 20%, #bd697a, #98495f 52%, #783248 93%);
  box-shadow: inset 1px 2px 3px #f1b0b290, inset -2px -3px 5px #62243780, 0 7px 12px #762f4260;
}

.seal span {
  display: grid;
  place-items: center;
  width: 75%;
  aspect-ratio: 1;
  border: 1px solid #efb5b167;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #62243753;
  text-shadow: 0 2px #72263d;
  font: clamp(1.1rem, 3.5vw, 3rem)/1 Georgia, serif;
}

.is-opening .envelope { animation: steady-envelope .95s ease both; cursor: default; }
.is-opening .envelope-flap { animation: lift-flap .58s .1s ease-in-out both; }
.is-opening .seal { animation: break-seal .28s ease-in both; }
.is-opening .envelope-letter { animation: slide-letter .55s .38s cubic-bezier(.19,.72,.27,1) both; }

.is-closing .envelope { animation: steady-envelope 1.08s .13s ease reverse both; cursor: default; }
.is-closing .envelope-flap { animation: lift-flap .58s .48s ease-in-out reverse both; }
.is-closing .seal { animation: break-seal .28s .93s ease-in reverse both; }
.is-closing .envelope-letter { animation: slide-letter .63s .15s cubic-bezier(.19,.72,.27,1) reverse both; }

@keyframes steady-envelope {
  from { transform: rotate(-7deg); }
  to { transform: translateY(.7rem) rotate(-2deg); }
}

@keyframes lift-flap {
  0% { transform: rotateX(0); z-index: 3; }
  48% { z-index: 3; }
  49%, 100% { z-index: 0; }
  100% { transform: rotateX(172deg); }
}

@keyframes break-seal {
  to { opacity: 0; transform: translate(-48%, -32%) rotate(20deg) scale(.82); }
}

@keyframes slide-letter {
  0% { transform: translateY(0); }
  100% { transform: translateY(-73%); }
}

.invitation {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.4rem, 3vw, 2.75rem);
  width: min(100%, 66rem);
}

.is-revealed { animation: unfold .44s ease-out both; }
.invitation.is-closing { animation: fold-away .2s ease-in both; }

@keyframes unfold {
  from { opacity: 0; transform: translateY(.8rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fold-away {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(.65rem); }
}

@keyframes letter-fade-out {
  to { opacity: 0; }
}

@keyframes envelope-fade-in {
  from { opacity: .25; }
}

.letter {
  position: relative;
  padding: clamp(1.5rem, 5vw, 3.7rem);
  background: var(--grain), linear-gradient(145deg, #fffaf0, #f8ebda);
  box-shadow: 0 .85rem 2.5rem #70433224;
}

.letter::before {
  content: "";
  position: absolute;
  inset: .65rem;
  border: 1px solid #b782686e;
  pointer-events: none;
}

.letter h2 {
  margin: .2rem 0 1.2rem;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: .88;
}

.letter h2:focus { outline: none; }

.letter > p:not(.script), .venue-info > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.salutation, .signature { margin: 0; font-size: clamp(2rem, 4.5vw, 3rem); }
.signature { margin-top: 1.3rem; }

.letter-divider {
  display: flex;
  gap: .7rem;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--rose);
}

.letter-divider::before, .letter-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule);
}

.event-details { margin-top: .75rem; }

.event-time {
  display: grid;
  gap: .2rem;
  margin-top: .4rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.event-time strong { color: var(--ink); font-size: 1.125rem; }

.countdown { margin-top: 1.2rem; }

.countdown-clock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.3rem, 1vw, .6rem);
  max-width: 23rem;
  margin-top: .45rem;
}

.countdown-unit {
  display: grid;
  gap: .38rem;
  justify-items: center;
  color: var(--rose-dark);
  font: 600 .8125rem/1.2 system-ui, sans-serif;
}

.countdown-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: clamp(2.7rem, 6vw, 3.65rem);
  perspective: 8rem;
}

.countdown-card::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid #9a636552;
  pointer-events: none;
}

.countdown-card b {
  display: grid;
  place-items: center;
  grid-area: 1 / 1;
  padding: .2rem;
  border: 1px solid #ad7d7773;
  border-radius: .25rem;
  background: linear-gradient(to bottom, #f4dbd5 50%, #ebc5c2 50%);
  box-shadow: 0 2px 3px #62372820;
  backface-visibility: hidden;
  font: 600 clamp(1.6rem, 4vw, 2.35rem)/1 var(--display);
  font-variant-numeric: lining-nums tabular-nums;
}

.previous-number { opacity: 0; pointer-events: none; }

.countdown-message { margin: 0; color: var(--rose-dark); }

.venue {
  padding: clamp(1.25rem, 3.4vw, 2.15rem);
  border: 1px solid #b17a7477;
  background: var(--grain), linear-gradient(145deg, #f8e2dc, #f0d1cd);
  box-shadow: 0 .55rem 1.75rem #70433216;
}

.venue h3 { margin-top: .24em; font-size: clamp(2.75rem, 5vw, 4.25rem); line-height: .9; }
.venue-info > p:not(.eyebrow) { margin: .7rem 0 1.35rem; }

.map-preview {
  margin-bottom: 1rem;
  border-block: 1px solid #aa7a737d;
  color: var(--rose-dark);
}

.map-preview summary {
  min-height: 2.85rem;
  padding: .75rem .2rem;
  cursor: pointer;
  font: 600 .9375rem/1.4 system-ui, sans-serif;
}

.map-preview summary:hover { text-decoration: underline; }
.map { padding-bottom: .75rem; }
.map iframe { display: block; width: 100%; height: 14rem; border: 0; background: #fff3ea; }

.venue-actions { display: flex; flex-wrap: wrap; gap: .55rem; }

.menu-button, .button-outline {
  border-color: #9b5b67;
  color: var(--rose-dark);
  background: #fff9ed75;
  box-shadow: none;
}

.menu-button:hover, .menu-button:focus-visible,
.button-outline:hover, .button-outline:focus-visible {
  background: #fff9ed;
  box-shadow: 0 3px 9px #711d3718;
}

.menu-footer a {
  color: var(--rose-dark);
  font: 600 .875rem/1.45 system-ui, sans-serif;
  text-underline-offset: .2em;
}

.restaurant-link {
  display: flex;
  width: 100%;
  margin-top: .85rem;
}

.menu-dialog {
  width: min(49rem, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: .45rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1rem 4rem #35241f55;
  overflow: hidden;
}

.menu-dialog[open] { display: flex; flex-direction: column; }
.menu-dialog::backdrop { background: #35241f9c; }
html:has(.menu-dialog[open]) { overflow: hidden; }

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .55rem .85rem .55rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.menu-header h2 { font-size: clamp(1.9rem, 5vw, 2.7rem); line-height: 1.05; }

.menu-close {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: .2rem;
  color: var(--rose-dark);
  background: transparent;
  font: 1.65rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.menu-close:hover { background: #efd2cc; }
.menu-close:focus-visible { outline-offset: 0; }

.menu-frame {
  display: block;
  width: 100%;
  height: min(72dvh, 47rem);
  min-height: 0;
  border: 0;
  background: #efe5d9;
}

.menu-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.pin-icon {
  width: .75rem;
  height: .75rem;
  position: relative;
  border: 1px solid currentColor;
  border-radius: 50% 50% 50% 0;
  transform: translateY(-.1em) rotate(-45deg);
}

.pin-icon::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: currentColor;
}

.replay {
  grid-column: 1 / -1;
  justify-self: center;
  border-radius: 999px;
  cursor: pointer;
}

.envelope-icon {
  position: relative;
  width: 1rem;
  height: .72rem;
  border: 1px solid currentColor;
  border-radius: .12rem;
  overflow: hidden;
}

.envelope-icon::before {
  content: "";
  position: absolute;
  top: -.39rem;
  left: 50%;
  width: .64rem;
  height: .64rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

@media (max-width: 900px) {
  h1 { font-size: clamp(4rem, 9.1vw, 5.75rem); }
  .stationery { padding-inline: clamp(2.2rem, 6vw, 4.5rem); }
}

@media (max-width: 680px) {
  .stationery { padding: 3.5rem 1.85rem 2.75rem; }

  .landing {
    grid-template: "intro" auto "stage" auto "button" auto / minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }

  .small-rule { display: none; }
  h1 { margin-top: 1.15rem; font-size: clamp(3.6rem, 11.6vw, 5.35rem); }
  h1 .script { margin-inline: auto; padding-right: .1em; }
  .intro-note { margin: .7rem auto .8rem; max-width: 17rem; line-height: 1.5; }
  .stage { width: min(100%, 23rem); aspect-ratio: 1.22; margin: .25rem 0 .95rem; }
  .halo { inset-inline: 6%; }
  .envelope { width: 77%; }
  .seal span { font-size: clamp(1.25rem, 5vw, 2rem); }
  .invitation { grid-template-columns: minmax(0, 1fr); width: min(100%, 28rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .invitation.is-closing { animation: letter-fade-out .18s ease both !important; }
  .landing.is-closing .envelope { animation: envelope-fade-in .28s .08s ease both !important; }
}
