/* Invitation refinements — content hierarchy and mobile readability */
.invite-shell::after {
  display: none;
}

.paper-section {
  background-image: url("../images/paper-fiber-ivory.webp");
  background-size: 480px 480px;
  background-blend-mode: multiply;
}

.paper-section::before {
  opacity: .04;
}

.letter-section,
.schedule-section,
.venue-section,
.rsvp-section {
  background-color: var(--paper);
}

.opening-copy {
  padding: clamp(42px, 7vh, 72px) 28px 38px;
}

.opening-kicker {
  font-size: 12px;
  letter-spacing: .2em;
}

.opening-copy h1 {
  margin-top: 18px;
  font-size: clamp(38px, 10.5vw, 62px);
}

.opening-names {
  margin: 24px 0 0;
  letter-spacing: .09em;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: clamp(20px, 5.8vw, 28px);
  font-weight: 500;
}

.name-lockup {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: .42em;
  white-space: nowrap;
}

.opening-names.name-lockup {
  justify-content: center;
}

.name-lockup i {
  position: relative;
  top: .06em;
  color: #e6c7a4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .68em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  opacity: .88;
}

.opening-date {
  margin: 18px 0 0;
  letter-spacing: .08em;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.opening-place {
  margin: 4px 0 0;
  letter-spacing: .08em;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 14px;
  font-weight: 600;
  opacity: .9;
}

.open-button {
  margin-top: auto;
}

.music-control {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgb(49 29 27 / 86%);
}

.hero-content {
  padding-bottom: 108px;
}

.hero-content > .eyebrow {
  display: none;
}

.hero-content h1 {
  max-width: 100%;
  font-size: clamp(30px, 8.2vw, 46px);
  line-height: 1.16;
}

.hero-content .hero-names {
  gap: .28em;
}

.hero-intro {
  margin: 12px 0 17px;
  letter-spacing: .12em;
  font-size: 14px;
}

.hero-date-card {
  display: block;
  padding-top: 13px;
}

.hero-date-card > div {
  display: block;
}

.hero-date-card strong {
  letter-spacing: .04em;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 18px;
  line-height: 1.7;
}

.hero-date-card > p {
  display: none;
}

.scroll-cue {
  right: auto;
  bottom: 28px;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  gap: 9px;
}

.scroll-cue span {
  writing-mode: horizontal-tb;
  letter-spacing: .12em;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 11px;
}

.scroll-cue i {
  width: 1px;
  height: 25px;
  animation: gentleBounce 1.8s infinite;
}

.date-section {
  display: none;
}

.section-inner > .eyebrow,
.menu-section .eyebrow,
.stay-section .eyebrow {
  letter-spacing: .16em;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 11px;
}

.lead-copy {
  white-space: pre-line;
}

.schedule-place a {
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgb(111 47 56 / 32%);
  padding-bottom: 2px;
  transition: border-color .2s ease, opacity .2s ease;
}

.schedule-place a span {
  position: relative;
  top: -.08em;
  font-family: Georgia, serif;
  font-size: .72em;
  opacity: .58;
}

.schedule-place a:active {
  opacity: .62;
}

.nearby-trigger {
  display: inline-flex;
  align-items: baseline;
  gap: .7em;
  color: inherit;
  background: transparent;
  border-bottom: 1px solid rgb(111 47 56 / 32%);
  padding: 0 0 2px;
  text-align: left;
  transition: border-color .2s ease, opacity .2s ease;
}

.nearby-collection-link {
  text-decoration: none;
}

.nearby-trigger span {
  font-size: .78em;
  font-weight: 400;
  opacity: .62;
}

.nearby-trigger:active {
  opacity: .62;
}

.nearby-dialog {
  width: min(92vw, 520px);
  max-height: min(82svh, 720px);
  margin: auto;
  padding: 0;
  color: var(--ink);
  background: var(--paper-light);
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgb(35 20 18 / 32%);
}

.nearby-dialog::backdrop {
  background: rgb(30 22 20 / 58%);
  backdrop-filter: blur(3px);
}

.nearby-sheet {
  max-height: min(82svh, 720px);
  padding: 25px 22px 24px;
  overflow-y: auto;
}

.nearby-sheet header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.nearby-sheet header span {
  color: var(--wine);
  letter-spacing: .12em;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 9px;
}

.nearby-sheet h2 {
  margin: 7px 0 0;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.25;
}

.nearby-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  color: #746761;
  background: #eee9e3;
  border-radius: 50%;
  font: 300 23px/1 Arial, sans-serif;
}

.nearby-intro {
  color: var(--muted);
  margin: 13px 0 0;
  font-size: 12px;
  line-height: 1.7;
}

.nearby-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.nearby-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  min-height: 112px;
  color: inherit;
  background: #fff;
  border: 1px solid rgb(61 55 51 / 10%);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 7px 22px rgb(66 42 32 / 7%);
}

.nearby-card img {
  width: 104px;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
}

.nearby-card > div {
  padding: 14px 14px 13px;
}

.nearby-card span {
  color: var(--wine);
  letter-spacing: .04em;
  font-family: "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 9px;
}

.nearby-card h3 {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.nearby-card p {
  color: var(--muted);
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

@media (hover: hover) {
  .schedule-place a:hover {
    border-color: currentColor;
  }

  .nearby-trigger:hover {
    border-color: currentColor;
  }

  .nearby-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgb(66 42 32 / 12%);
  }
}

.dress-code {
  width: min(100%, 440px);
  margin: 42px auto 0;
  padding: 22px 0 20px;
  border-top: 1px solid rgb(111 47 56 / 14%);
  border-bottom: 1px solid rgb(111 47 56 / 14%);
}

.dress-code-heading {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  color: var(--wine);
}

.dress-code-heading span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: .18em;
}

.dress-code-heading strong {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
}

.dress-code-palette {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.dress-code-swatch {
  min-width: 0;
  color: var(--muted);
  text-align: center;
}

.dress-code-swatch i {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 9px;
  border: 1px solid rgb(74 58 49 / 9%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}

.dress-code-swatch span {
  display: block;
  font-size: 9px;
  line-height: 1.4;
}

.dress-code + .countdown {
  margin-top: 28px;
}

.menu-section::before {
  content: "囍";
  right: -24px;
  color: rgb(255 255 255 / 7%);
  font-size: 230px;
}

@media (max-width: 390px) {
  .opening-copy {
    padding-top: 38px;
    padding-bottom: 28px;
  }

  .opening-names {
    margin-top: 18px;
  }

  .opening-date {
    margin-top: 14px;
  }

  .nearby-sheet {
    padding: 22px 16px 18px;
  }

  .nearby-card {
    grid-template-columns: 88px 1fr;
  }

  .nearby-card img {
    width: 88px;
  }

  .dress-code {
    margin-top: 36px;
  }

  .dress-code-palette {
    gap: 4px;
  }

  .dress-code-swatch i {
    width: 27px;
    height: 27px;
  }

  .dress-code-swatch span {
    font-size: 8px;
  }
}

/* Venue is a single destination, not chapter four: remove the orphan number and its empty rail. */
.venue-copy {
  grid-template-columns: 1fr;
  gap: 0;
}

.venue-number {
  display: none;
}

.venue-copy > div {
  border-left: 0;
  padding-left: 0;
}

/* Keep the ivory swatch subtly warmer than the paper, while remaining an ivory. */
.dress-code-swatch:first-child i {
  background-color: #ECE0CC !important;
}

@media (max-width: 390px) {
  .opening-place {
    margin-top: 3px;
  }

  .hero-content {
    padding-bottom: 98px;
  }
}

/* Public cover: keep the invitation anonymous until the guest opens it. */
body.guest-locked main > :not(audio):not(.opening) {
  display: none !important;
}

.opening-copy {
  padding: clamp(74px, 11.5vh, 118px) 28px calc(42px + env(safe-area-inset-bottom));
}

.opening-kicker {
  font-size: 11px;
  letter-spacing: .26em;
}

.opening-copy h1 {
  margin-top: clamp(24px, 4vh, 40px);
}

.opening-names,
.opening-date,
.opening-place {
  display: none !important;
}

.opening-whisper {
  margin: 20px 0 0;
  color: rgb(255 255 255 / 82%);
  letter-spacing: .18em;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 13px;
  animation: .9s .92s both fadeUp;
}

.open-button {
  margin-top: auto;
}

/* Keep private hero typography below the couple's faces in short WeChat viewports. */
.hero-section,
.hero-content {
  min-height: 100dvh;
}

.hero-content {
  padding: 90px 34px calc(94px + env(safe-area-inset-bottom));
}

.hero-content h1 {
  font-size: clamp(26px, 6.8vw, 38px);
  line-height: 1.08;
}

.hero-intro {
  margin: 9px 0 12px;
  font-size: 12px;
  line-height: 1.65;
}

.hero-date-card {
  padding-top: 10px;
}

.hero-date-card strong {
  font-size: 16px;
  line-height: 1.4;
}

/* The name page is styled as a second sheet of the invitation, not a login screen. */
body.guest-gate-open {
  overflow: hidden;
}

.guest-gate {
  z-index: 140;
  width: min(100%, 620px);
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0 auto;
  color: #302925;
  background: #f4efe8;
  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .65s cubic-bezier(.2, .8, .2, 1);
}

.guest-gate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.guest-gate-paper {
  pointer-events: none;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 38%), transparent 42%),
    radial-gradient(circle at 80% 16%, rgb(119 45 55 / 7%), transparent 32%),
    url("../images/paper-fiber-ivory.webp");
  background-size: auto, auto, 480px 480px;
  position: absolute;
  inset: 0;
}

.guest-gate-paper::before,
.guest-gate-paper::after {
  content: "";
  position: absolute;
  border: 1px solid rgb(111 47 56 / 15%);
  border-radius: 50%;
}

.guest-gate-paper::before {
  width: 280px;
  height: 280px;
  top: -172px;
  right: -126px;
}

.guest-gate-paper::after {
  width: 190px;
  height: 190px;
  right: -98px;
  bottom: -86px;
}

.guest-gate-back {
  z-index: 2;
  color: #756a64;
  background: transparent;
  border: 0;
  align-items: center;
  gap: 7px;
  padding: 12px 0;
  letter-spacing: .06em;
  font: 12px/1.2 "PingFang SC", "Noto Sans SC", sans-serif;
  display: inline-flex;
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  left: 24px;
}

.guest-gate-back span {
  position: relative;
  top: -1px;
}

.guest-gate-inner {
  z-index: 1;
  width: min(100%, 430px);
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(88px + env(safe-area-inset-top))
    30px
    calc(34px + env(safe-area-inset-bottom));
  flex-direction: column;
  justify-content: center;
  display: flex;
  position: relative;
}

.guest-gate-kicker {
  color: #762f3a;
  margin: 0;
  letter-spacing: .24em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  font-weight: 700;
}

.guest-gate-seal {
  width: 42px;
  height: 42px;
  color: #fff9f1;
  background: #762f3a;
  border-radius: 50%;
  place-items: center;
  margin: 24px 0 21px;
  display: grid;
  box-shadow: 0 8px 20px rgb(90 37 44 / 16%);
}

.guest-gate-seal span {
  position: relative;
  top: -1px;
  font-size: 12px;
}

.guest-gate h2 {
  margin: 0;
  letter-spacing: .035em;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: clamp(40px, 11vw, 58px);
  font-weight: 500;
  line-height: 1.16;
}

.guest-gate-copy {
  color: #756b65;
  margin: 25px 0 0;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 14px;
  line-height: 1.95;
}

.guest-gate-form {
  margin-top: clamp(38px, 6vh, 56px);
}

.guest-gate-form label {
  color: #5f514b;
  letter-spacing: .12em;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 12px;
  display: block;
}

.guest-gate-field {
  border-bottom: 1px solid rgb(91 71 62 / 48%);
  align-items: center;
  margin-top: 10px;
  display: flex;
}

.guest-gate-field input {
  width: 100%;
  color: #2f2926;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 11px 4px 12px 0;
  font: 18px/1.4 "Songti SC", "Noto Serif SC", STSong, serif;
}

.guest-gate-field input::placeholder {
  color: #aaa19c;
  opacity: 1;
}

.guest-gate-field span {
  color: #762f3a;
  font-size: 10px;
  opacity: .7;
}

.guest-gate-field:focus-within {
  border-color: #762f3a;
}

.guest-gate-message {
  min-height: 38px;
  color: #756b65;
  margin: 10px 0 0;
  font: 11px/1.65 "PingFang SC", "Noto Sans SC", sans-serif;
}

.guest-gate.has-error .guest-gate-message {
  color: #8a3945;
}

.guest-gate.has-error .guest-gate-field {
  border-color: #9b4651;
  animation: gateShake .35s ease;
}

.guest-gate-submit {
  width: 100%;
  min-height: 58px;
  color: #fffaf5;
  background: #762f3a;
  border: 1px solid #762f3a;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 22px;
  display: flex;
  transition: opacity .2s ease, transform .2s ease, background .4s ease;
}

.guest-gate-submit span {
  letter-spacing: .14em;
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 14px;
}

.guest-gate-submit i {
  width: 38px;
  height: 38px;
  color: #762f3a;
  background: #fffaf5;
  border-radius: 50%;
  place-items: center;
  font: normal 17px/1 Arial, sans-serif;
  display: grid;
}

.guest-gate-submit:active {
  transform: scale(.99);
}

.guest-gate-submit:disabled {
  cursor: wait;
  opacity: .74;
}

.guest-gate-note {
  color: #a09690;
  margin: 16px 0 0;
  letter-spacing: .04em;
  font: 9px/1.6 "PingFang SC", "Noto Sans SC", sans-serif;
  text-align: center;
}

.guest-gate.is-approved .guest-gate-seal {
  animation: gateSeal 1s ease both;
}

.guest-gate.is-approved .guest-gate-submit {
  background: #5f776b;
  border-color: #5f776b;
}

.guest-gate.is-approved .guest-gate-submit i {
  color: #5f776b;
}

@keyframes gateShake {
  0%,
  100% {
    transform: translateX(0);
  }

  30% {
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }
}

@keyframes gateSeal {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.18) rotate(12deg);
  }

  100% {
    color: #fff;
    background: #5f776b;
    transform: scale(1);
  }
}

@media (max-width: 430px) {
  .opening-copy {
    padding-top: clamp(78px, 10.5vh, 104px);
  }

  .opening-copy h1 {
    font-size: clamp(38px, 11.5vw, 52px);
  }

  .hero-content {
    padding-right: 28px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    padding-left: 28px;
  }

  .hero-content h1 {
    font-size: clamp(24px, 6.6vw, 31px);
  }

  .hero-intro {
    letter-spacing: .09em;
    font-size: 11px;
  }

  .hero-date-card strong {
    font-size: 15px;
  }
}

@media (max-height: 740px) {
  .guest-gate-inner {
    justify-content: flex-start;
    padding-top: calc(72px + env(safe-area-inset-top));
  }

  .guest-gate-seal {
    width: 34px;
    height: 34px;
    margin: 17px 0 14px;
  }

  .guest-gate h2 {
    font-size: 38px;
  }

  .guest-gate-copy {
    margin-top: 15px;
    font-size: 12px;
    line-height: 1.75;
  }

  .guest-gate-form {
    margin-top: 24px;
  }

  .guest-gate-submit {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guest-gate,
  .guest-gate-seal,
  .guest-gate-field {
    animation: none !important;
    transition: none !important;
  }
}
