.guestbook.wrap {
  width: min(1370px, 90%);
  margin-inline: auto;
  padding-block: clamp(32px, 4vw, 64px) clamp(48px, 6.5vw, 96px);
  border-top: 1px solid var(--navy);
}
.guestbook [hidden] { display: none !important; }
.guest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin-bottom: clamp(24px, 3.3vw, 50px);
}
.guest-head h2 {
  font: 800 clamp(32px, 4.8vw, 76px)/1.18 var(--display);
  letter-spacing: -.055em;
}
.guest-head p, #guest-privacy {
  max-width: 37em;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.guest-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: start;
  gap: clamp(26px, 5vw, 78px);
}
.guestbook h3 {
  margin: 0;
  font: 800 clamp(20px, 1.8vw, 28px)/1.35 var(--display);
  letter-spacing: -.025em;
}
.guest-compose {
  position: relative;
  padding: clamp(20px, 2.6vw, 38px);
  background: linear-gradient(115deg, #fffbef, #f3eddf);
  border: 1px solid #ccc3b1;
  color: var(--navy);
  box-shadow: 3px 4px 0 -1px var(--paper), 3px 4px 0 0 #c8bda8;
}
.guest-compose::before {
  content: "";
  position: absolute;
  top: -1px;
  left: clamp(20px, 2.6vw, 38px);
  width: 34px;
  height: 3px;
  background: var(--red);
  transition: width .55s cubic-bezier(.22,.75,.27,1);
}
.guest-compose:focus-within::before { width: min(35%, 160px); }
#guestbook-form { display: grid; gap: 9px; margin: 0; }
.guest-compose h3 + #guestbook-form { margin-top: 18px; }
#guestbook-form label { display: block; font: 600 14px/1.6 var(--sans); }
#guestbook-form label small { font-weight: 400; color: var(--muted); }
#guestbook-form :where(input, textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  border-radius: 0;
  border: 0;
  color: var(--blue);
  font: 16px/1.7 var(--sans);
  accent-color: var(--red);
}
#guestbook-form :is(input, textarea)::placeholder { color: #6a6e65; opacity: 1; }
#guestbook-form :is(input, textarea):focus-visible { outline-offset: 3px; }
#guest-name {
  padding: 6px 1px;
  margin-bottom: 8px;
  border-bottom: 1px solid #b6ac99;
  background: linear-gradient(var(--blue),var(--blue)) left bottom / 0 2px no-repeat;
  transition: background-size .45s cubic-bezier(.2,.75,.25,1);
}
#guest-name:focus { background-size: 100% 2px; }
#guest-message {
  min-height: 124px;
  padding: 0 2px 2px;
  resize: vertical;
  line-height: 30px;
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 29px, #51718b 29px 30px),
    repeating-linear-gradient(to bottom, transparent 0 29px, #c7bca9 29px 30px);
  background-position: left top;
  background-repeat: no-repeat;
  background-size: 0 100%, 100% 100%;
  transition: background-size .6s cubic-bezier(.22,.75,.27,1);
}
#guest-message:focus { background-size: 100% 100%, 100% 100%; }
#guestbook-form label :is(input, textarea) { margin-top: 6px; font-weight: 400; }
#guest-send {
  justify-self: start;
  margin: 9px 4px 4px 0;
  min-height: 44px;
  padding: 8px 21px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fffaf0;
  box-shadow: 2px 2px 0 #fff7e5, 3px 3px 0 #4d6070;
  font: 600 14px/1.4 var(--sans);
  letter-spacing: .06em;
}
.guestbook button:disabled, .guestbook :is(input, textarea):disabled { opacity: .62; cursor: default; }
#guest-status, #guest-list-status {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
#guest-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 11px; min-height: 27px; }
#guest-status[data-state=success] { color: var(--navy); }
#guest-status[data-state=error] { color: #953b2a; }
.guest-receipt {
  display: inline-block;
  padding: 2px 5px 2px 7px;
  border: 3px double currentColor;
  color: #9b3e29;
  font: 700 13px/1.2 var(--standard-serif);
  letter-spacing: .12em;
  transform: rotate(-3deg);
}
#guestbook-form[aria-busy=true] #guest-send { opacity: 1; }
#guestbook-form[aria-busy=true] #guest-send::before { transform: scaleX(1); }
#guest-local-preview, #guest-refresh, #guest-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  padding: 4px 0;
  font: 600 13px/1.4 var(--sans);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #a3a59b;
}
.guest-entries { min-width: 0; }
.guest-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-block: 0 10px;
  border-bottom: 1px solid var(--navy);
}
#guest-list-status:not(:empty) { margin-top: 17px; }
#guest-list { list-style: none; margin: 0; padding: 0; }
#guest-list li { padding: 17px 0; border-bottom: 1px solid var(--rule); }
#guest-list li header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  flex-wrap: wrap;
}
#guest-list strong {
  font: 700 16px/1.5 var(--standard-serif);
  overflow-wrap: anywhere;
}
#guest-list time { color: var(--muted); font: 400 12px/1.5 var(--sans); }
#guest-list li p {
  margin: 5px 0 0;
  color: #3b4647;
  font: 400 15px/1.85 var(--sans);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
#guest-more { margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .guest-compose.guest-paper-open { animation: guest-leaf-settle .66s cubic-bezier(.2,.76,.26,1); }
  .guest-list-head.guest-paper-open { position: relative; }
  .guest-list-head.guest-paper-open::after {
    content: ""; position: absolute; inset: auto 0 -1px; height: 2px;
    background: var(--red); transform-origin: left; opacity: 0;
    animation: guest-rule-in .79s ease-out;
  }
  #guestbook-form[aria-busy=true] #guest-send .arrow { animation: guest-send-arrow .52s ease-in both; }
  .guest-receipt { animation: guest-stamp .48s cubic-bezier(.17,.75,.24,1) both; }
  #guest-list .guest-page-note { animation: guest-page-in .34s ease-out; }
  #guest-list .guest-note-signed {
    position: relative;
    isolation: isolate;
    transform-origin: 8% 18%;
    animation: guest-slip-in .72s cubic-bezier(.16,.78,.24,1);
  }
  #guest-list .guest-note-signed::before {
    content: ""; position: absolute; z-index: -1; inset: 2px -4px 0;
    pointer-events: none; opacity: 0;
    background: linear-gradient(106deg,#fffaf0,#f3ead8);
    border-left: 2px solid var(--red);
    box-shadow: 1px 4px 8px #45372226;
    animation: guest-slip-paper 1.05s ease-out;
  }
}
@keyframes guest-leaf-settle {
  from { transform: translateY(12px) rotate(.5deg); box-shadow: 3px 11px 14px #45372229; }
  to { transform: none; box-shadow: 3px 4px 0 -1px var(--paper), 3px 4px 0 0 #c8bda8; }
}
@keyframes guest-rule-in {
  0% { opacity: .88; transform: scaleX(0); }
  65% { opacity: .88; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}
@keyframes guest-send-arrow {
  0%, 20% { opacity: 1; transform: translateX(0); }
  40% { transform: translateX(-3px); }
  100% { opacity: 0; transform: translateX(13px); }
}
@keyframes guest-stamp {
  0% { opacity: 0; transform: translateY(-8px) scale(1.25) rotate(-10deg); }
  44% { opacity: 1; transform: translateY(1px) scale(.95) rotate(-3deg); }
  70% { transform: translateY(-1px) scale(1.025) rotate(-3deg); }
  100% { opacity: 1; transform: rotate(-3deg); }
}
@keyframes guest-slip-in {
  from { opacity: .25; transform: perspective(850px) translateY(-14px) rotateX(10deg) rotate(-1deg); }
  to { opacity: 1; transform: none; }
}
@keyframes guest-slip-paper {
  0%,48% { opacity: .95; }
  100% { opacity: 0; }
}
@keyframes guest-page-in {
  from { opacity: .45; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@media (hover: hover) {
  #guest-send:hover:enabled { background: var(--blue); }
  .guestbook :is(#guest-local-preview, #guest-more, #guest-refresh):hover { color: var(--red); }
}
@media (min-width: 1021px) and (min-height: 760px) {
  .guest-compose { position: sticky; top: clamp(20px,4vh,50px); }
  #guest-list li p { max-width: 39em; }
}
@media (max-width: 720px) {
  .guest-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .guest-head { margin-bottom: 20px; }
  .guest-head p, #guest-privacy { font-size: 13px; }
  #guest-name { min-height: 44px; }
  #guest-send { justify-self: stretch; width: auto; margin-right: 3px; }
  #guest-refresh { min-width: 44px; justify-content: center; }
}
