/* A fixed stationery surround; the invitation scrolls beneath the paper edge. */
:root {
  --frame-inset: 17px;
  --frame-color: #b4ac99;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
body {
  padding-top: 118px;
  background-image: url('/assets/ivory-card-paper.webp');
  background-repeat: repeat;
  background-size: 384px 384px;
}
/* Grain belongs to the paper itself, so typography and green ink stay sharp. */
body::before { display: none; }
.paper-frame {
  inset: var(--frame-inset);
  border-color: var(--frame-color);
  z-index: 12;
  box-shadow: 0 0 0 var(--frame-inset) #e9e4d8,
              0 0 0 calc(var(--frame-inset) - 3px) var(--paper),
              inset 0 0 22px -16px #69604b;
}
.paper-frame::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid #c9c2b34d;
}
.frame-corner {
  position: absolute;
  width: clamp(125px, 15vw, 205px);
  height: auto;
  object-fit: contain;
  opacity: .82;
  user-select: none;
}
.top-left { top: 5px; left: 5px; transform: scaleX(-1); }
.top-right { top: 5px; right: 5px; }
.bottom-left { bottom: 5px; left: 5px; transform: scaleX(-1); }
.bottom-right { bottom: 5px; right: 5px; }
.frame-crest {
  position: absolute;
  width: 124px;
  height: auto;
  top: 7px;
  left: calc(50% - 62px);
  opacity: .8;
}
.flourish { width: 174px; height: auto; object-fit: contain; opacity: .8; }
.hero-copy > .flourish { margin-top: 32px; margin-bottom: 8px; }
footer .flourish { width: 120px; }
.invitation-calligraphy {
  display: block;
  width: 240px;
  height: auto;
  margin: 0 auto 22px;
}
/* A carved SVG picture frame with a recessed, transparent centre. */
.button.primary {
  position: relative;
  isolation: isolate;
  justify-content: center;
  min-width: 210px;
  min-height: 53px;
  padding: 17px 30px;
  overflow: visible;
  border-color: transparent;
  background: transparent;
}
.button-ornament {
  position: absolute;
  z-index: -1;
  inset: -50% -9.6%;
  background: url('/assets/ornamental-button-frame.svg') center / 100% 100% no-repeat;
  pointer-events: none;
  opacity: 1;
  filter: none;
  transition: filter .35s ease;
}
.button.primary:hover .button-ornament { filter: brightness(1.02); }
.button.primary:hover { background: transparent; }
.submit.button.primary { display: flex; width: 210px; max-width: 210px; margin: 25px auto; }
.hero-copy .countdown { margin-bottom: 50px; }
.hero { padding-bottom: 150px; }
.countdown { margin-bottom: 36px; }
.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 15px;
  margin: 20px auto 28px;
}
.countdown > div { display: flex; flex-direction: column; min-width: 52px; }
.countdown-value {
  font: 400 38px/1.1 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  color: #5e654f;
}
.countdown-label {
  font: 400 8px/1.5 var(--sans);
  letter-spacing: .17em;
  text-transform: uppercase;
  margin-top: 7px;
  color: var(--muted);
}
.countdown-separator { font: 400 24px/1.5 var(--serif); color: #b4ac99; }
.countdown-message { font: italic 24px/1.5 var(--serif); color: var(--accent); margin: 20px 0 28px; }
.header {
  position: fixed;
  z-index: 11;
  top: calc(var(--frame-inset) + 18px);
  left: 50%;
  transform: translateX(-50%);
  height: 70px;
  width: min(860px, calc(100% - 290px));
  padding: 0;
  margin: 0;
  border: 0;
}
.header::before {
  content: '';
  position: absolute;
  inset: -18px -40px -12px;
  z-index: -1;
  background: linear-gradient(var(--paper) 50%, #f7f4ebee 72%, #f7f4eb00);
  pointer-events: none;
}
.header nav {
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr .9fr 110px .9fr 1.2fr;
  gap: 18px;
  text-align: center;
  font-size: 10px;
  letter-spacing: .13em;
}
.header nav a { white-space: nowrap; position: relative; }
.header nav .monogram {
  font: 500 43px/.9 var(--serif);
  letter-spacing: -3px;
  padding: 0;
  text-transform: none;
}
.header nav .nav-rsvp { border: 0; }
.header nav a:not(.monogram)::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 15%;
  width: 70%;
  height: 1px;
  background: #92977d;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .45s var(--ease-out);
}
.header nav a:hover::after,
.header nav a[aria-current="location"]::after { transform: scaleX(1); }
.frame-rsvp {
  position: fixed;
  z-index: 13;
  bottom: calc(var(--frame-inset) - 11px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 9px 22px;
  background: var(--paper);
  background-image: url('/assets/ivory-card-paper.webp');
  background-size: 384px 384px;
  border: 1px solid var(--frame-color);
  font: 500 15px var(--serif);
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.frame-rsvp span { display: none; }
.frame-rsvp:hover { color: #82876b; }
.hero { min-height: max(690px, calc(100svh - 118px)); padding-bottom: 130px; }
.hero-foot {
  bottom: 65px;
  left: 15%;
  right: 15%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
}
.hero-foot > span:first-child { justify-self: start; }
.hero-foot > a { grid-column: 2; justify-self: center; }
.hero-foot > span:last-child { justify-self: end; }
.botanical { opacity: .5; }
.botanical-left { left: 6%; }
.botanical-right { right: 6%; }
footer { padding-bottom: 95px; }

/* Entrance movement is finite, with a light stagger instead of a loading screen. */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: invitation-enter 1.4s var(--ease-out) both; }
  .hero-copy .hero-intro { animation-delay: .1s; }
  .hero-copy .hero-invite { animation-delay: .22s; }
  .hero-copy h1 { animation: none; }
  h1 > span { animation: name-enter 1.8s var(--ease-out) both; }
  h1 > span:nth-child(1) { animation-delay: .32s; }
  h1 > span:nth-child(2) { animation-delay: .46s; }
  h1 > span:nth-child(3) { animation-delay: .6s; }
  .hero-copy > .flourish { animation-delay: .75s; }
  .hero-copy .hero-date { animation-delay: .85s; }
  .hero-copy .hero-location { animation-delay: .95s; }
  .hero-copy .countdown { animation-delay: 1.05s; }
  .hero-copy .button { animation-delay: 1.15s; }
  .paper-frame, .header, .frame-rsvp { animation: frame-enter 1.9s var(--ease-out) both; }
  .hero-foot .scroll-line { transform-origin: top; animation: scroll-breathe 3.2s ease-in-out infinite; }
  .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 1.1s var(--ease-out), transform 1.3s var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
  .reveal:focus-within { opacity: 1; transform: none; }
  .notes-list details[open] p { animation: invitation-enter .55s var(--ease-out) both; }
  .button-flower { transition: transform .9s var(--ease-out); }
  .submit:hover .button-flower { transform: rotate(90deg); }
}
@keyframes invitation-enter { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes name-enter { from { opacity: 0; transform: translateY(23px); filter: blur(3px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes frame-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes scroll-breathe { 0%,100% { opacity: .35; transform: scaleY(.7); } 50% { opacity: .9; transform: scaleY(1); } }

@media (max-width: 1000px) {
  .header { width: calc(100% - 230px); }
  .header nav { grid-template-columns: 1fr 1fr 80px 1fr 1fr; gap: 10px; font-size: 9px; }
  .header nav .monogram { font-size: 38px; }
  .botanical-left { left: -10px; }
  .botanical-right { right: -10px; }
}
@media (max-width: 650px) {
  :root { --frame-inset: 10px; }
  body { padding-top: 98px; }
  .paper-frame::before { inset: 4px; }
  .frame-corner { width: 85px; height: auto; opacity: .72; }
  .frame-crest { width: 84px; height: auto; top: 5px; left: calc(50% - 42px); }
  .flourish { width: 140px; }
  .hero-copy > .flourish { margin-top: 25px; }
  .hero .button.primary { padding-left: 30px; padding-right: 30px; }
  .submit.button.primary { min-width: 0; width: 210px; margin: 25px auto; padding-left: 14px; padding-right: 14px; }
  .header { top: 32px; height: 48px; width: calc(100% - 100px); }
  .header::before { inset: -15px -10px -13px; }
  .header nav { grid-template-columns: 1fr 70px 1fr; gap: 5px; font-size: 8px; letter-spacing: .09em; }
  .header nav a:first-child, .header nav .nav-notes { display: none; }
  .header nav .monogram { font-size: 35px; }
  .frame-rsvp { bottom: 1px; padding: 9px 16px; gap: 12px; font-size: 12px; }
  .frame-rsvp span { height: 12px; }
  .hero { min-height: calc(100svh - 98px); padding: 20px 24px 105px; }
  .hero-copy { width: 100%; max-width: 520px; }
  .invitation-calligraphy { width: 190px; margin-bottom: 17px; }
  .hero-intro { font-size: 9px; margin-bottom: 7px; }
  .hero-invite { font-size: 17px; line-height: 1.3; max-width: 270px; margin: 0 auto 25px; }
  h1 { flex-direction: row; justify-content: center; align-items: center; gap: 10px; margin-bottom: 18px; }
  h1 .name { font-size: clamp(36px, 11vw, 64px); letter-spacing: -.045em; }
  h1 .surname { font-size: 8px; letter-spacing: .23em; margin: 13px 0 0; }
  h1 .ampersand { font-size: clamp(25px, 6.5vw, 36px); margin: -15px 0 0; }
  .hero-copy > .flourish { width: 112px; margin-top: 19px; margin-bottom: 9px; }
  .hero-date { font-size: 22px; margin-top: 12px; }
  .hero-location { font-size: 8px; margin: 8px 0 18px; }
  .countdown { gap: 9px; margin: 18px auto 25px; }
  .hero-copy .countdown { margin-bottom: 39px; }
  .countdown > div { min-width: 44px; }
  .countdown-value { font-size: 33px; }
  .countdown-label { font-size: 7px; letter-spacing: .1em; }
  .countdown-separator { font-size: 21px; }
  .hero-foot { bottom: 43px; left: 53px; right: 53px; }
  .hero-foot > span { display: none; }
  .hero-foot > a { margin: auto; }
  .botanical { opacity: .3; }
  .botanical-left { left: -30px; }
  .botanical-right { right: -30px; }
  footer { padding-bottom: 90px; }
}

/* Reserve space for the fixed navigation and the scroll cue, including on
   short laptop and phone screens. The copy scales only when it needs to fit. */
.hero {
  height: calc(100svh - 118px);
  min-height: 0;
  padding: 12px 25px 100px;
}
.hero-copy {
  flex-shrink: 0;
  transform: scale(var(--hero-fit, 1));
  transform-origin: center;
}
.hero-foot { bottom: 48px; }
@media (max-width: 650px) {
  .hero { height: calc(100svh - 98px); min-height: 0; padding: 12px 24px 95px; }
  .hero-foot { bottom: 43px; }
}
