:root {
  --paper: #f7f2eb;
  --paper-soft: #fbf8f3;
  --ink: #27312c;
  --muted: #6e746d;
  --line: #ddd2c4;
  --sage: #647b69;
  --sage-deep: #435747;
  --clay: #ad7666;
  --rose: #c79989;
  --blue: #6f8293;
  --shadow: 0 18px 50px rgba(68, 54, 42, 0.12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.lock-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(100, 123, 105, 0.18), rgba(199, 153, 137, 0.14)),
    var(--paper);
}

.lock-screen[hidden],
#site-content[hidden] {
  display: none;
}

.lock-card {
  width: min(100%, 620px);
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid rgba(99, 79, 61, 0.16);
  border-radius: 8px;
  background: rgba(251, 248, 243, 0.88);
  box-shadow: var(--shadow);
  animation: card-arrive 560ms ease both;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lock-card h1,
.hero h1,
.section-heading h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
}

.lock-card h1 {
  margin: 0;
  font-size: 3.2rem;
}

.lock-note {
  margin: 18px 0 28px;
  color: var(--muted);
}

.envelope {
  position: relative;
  width: min(100%, 396px);
  aspect-ratio: 66 / 43;
  height: auto;
  margin: 24px 0 8px;
  perspective: 700px;
}

.envelope-back,
.envelope-front,
.envelope-flap,
.envelope-letter {
  position: absolute;
  inset: 0;
}

.envelope-back {
  border-radius: 6px;
  background: #d8c6b3;
}

.envelope-letter {
  inset: 10px 16px 18px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #fffdf9;
  color: var(--clay);
  font-family: var(--serif);
  font-weight: 700;
  transform: translateY(14px);
  transition: transform 3500ms ease;
}

.envelope-front {
  clip-path: polygon(0 30%, 50% 68%, 100% 30%, 100% 100%, 0 100%);
  border-radius: 6px;
  background: #e6d7c8;
}

.envelope-flap {
  transform-origin: top center;
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  border-radius: 6px;
  background: #c5ac98;
  transition: transform 3500ms ease;
}

body.is-unlocking .envelope-flap {
  transform: rotateX(172deg);
}

body.is-unlocking .envelope-letter {
  transform: translateY(-54px);
}

.password-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--sage-deep);
  font-weight: 700;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.password-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #fffdf9;
  color: var(--ink);
}

.password-row button,
.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.password-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.password-row button,
.button.primary {
  background: var(--sage-deep);
  color: #fffdf9;
}

.button.secondary {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(67, 87, 71, 0.28);
  background: #fffdf9;
  color: var(--sage-deep);
}

.password-row button:hover,
.button:hover {
  transform: translateY(-1px);
}

.password-row button:disabled {
  cursor: wait;
  opacity: 0.94;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 253, 249, 0.38);
  border-top-color: #fffdf9;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.password-form.is-working .button-spinner {
  display: inline-block;
}

.unlock-progress {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(67, 87, 71, 0.12);
  opacity: 0;
}

.unlock-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--sage-deep);
  transform: translateX(-110%);
}

.password-form.is-working .unlock-progress {
  opacity: 1;
}

.password-form.is-working .unlock-progress span {
  animation: progress-wander 1300ms ease-in-out infinite;
}

.form-message {
  min-height: 1.5em;
  margin: 10px 0 0;
  color: #9a3f32;
  font-size: 0.95rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(99, 79, 61, 0.12);
  background: rgba(247, 242, 235, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67, 87, 71, 0.22);
  border-radius: 50%;
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
}

.main-nav a:hover {
  color: var(--ink);
  background: rgba(100, 123, 105, 0.1);
}

.section {
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px);
  scroll-margin-top: 82px;
}

.hero {
  display: grid;
  align-items: center;
  padding-top: clamp(40px, 6vw, 56px);
  padding-bottom: clamp(32px, 5vw, 48px);
}

.hero-grid {
  width: min(1140px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(28px, 7vw, 84px);
  align-items: center;
}

#site-content:not([hidden]) .hero-copy > *,
#site-content:not([hidden]) .hero-art,
#site-content:not([hidden]) .vibe-inner {
  animation: soft-rise 640ms ease both;
}

#site-content:not([hidden]) .hero-copy > :nth-child(2) {
  animation-delay: 90ms;
}

#site-content:not([hidden]) .hero-copy > :nth-child(3) {
  animation-delay: 160ms;
}

#site-content:not([hidden]) .hero-copy > :nth-child(4) {
  animation-delay: 220ms;
}

#site-content:not([hidden]) .hero-copy > :nth-child(5),
#site-content:not([hidden]) .hero-art {
  animation-delay: 300ms;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: 5.6rem;
}

.hero-place {
  margin: 18px 0;
  color: var(--sage-deep);
  font-size: 1.22rem;
  font-weight: 800;
}

.hero-welcome {
  max-width: 680px;
  margin: 0 0 30px;
  color: #4d554f;
  font-size: 1.12rem;
}

.hero-art {
  width: min(100%, 420px);
  margin: 0;
  justify-self: center;
  display: grid;
  place-items: center;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(68, 54, 42, 0.18);
}

.section-heading,
.content-panel,
.story-text,
.story-toggle,
.timeline,
.travel-grid,
.travel-note,
.details-intro,
.travel-form,
.faq-list,
.vibe-inner {
  width: min(1040px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.vibe-strip {
  padding: 30px clamp(20px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(173, 118, 102, 0.14), rgba(100, 123, 105, 0.12)),
    #f3eadf;
}

.vibe-inner {
  display: grid;
  gap: 16px;
}

.vibe-inner p {
  margin: 0;
  max-width: 760px;
  color: #425049;
  font-family: var(--serif);
  font-size: 1.42rem;
  line-height: 1.55;
}

.vibe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vibe-tags span {
  border: 1px solid rgba(67, 87, 71, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 253, 249, 0.65);
  color: var(--sage-deep);
  font-size: 0.9rem;
  font-weight: 800;
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: 3.4rem;
}

.section-heading .story-aside {
  max-width: 680px;
  color: var(--sage-deep);
  font-family: var(--sans);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.35;
}

.story-section,
.schedule-section,
.details-section {
  background: var(--paper-soft);
}

.story-text,
.content-panel,
.details-intro,
.embed-placeholder {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.story-text {
  position: relative;
  color: #4e564f;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.75;
}

.story-text p {
  margin: 0 0 1.1em;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-text.is-collapsed {
  max-height: 12rem;
  overflow: hidden;
}

.story-text.is-collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 7rem;
  background: linear-gradient(180deg, rgba(251, 248, 243, 0), var(--paper-soft));
}

.story-toggle {
  display: block;
  margin-top: 20px;
  border: 1px solid rgba(67, 87, 71, 0.28);
  border-radius: 999px;
  padding: 12px 18px;
  background: #fffdf9;
  color: var(--sage-deep);
  font-weight: 800;
  cursor: pointer;
}

.content-panel {
  display: grid;
  gap: 18px;
  color: #4d554f;
  font-size: 1.05rem;
}

.content-panel p {
  margin: 0;
  max-width: 760px;
}

.attire-note {
  width: min(1040px, 100%);
  margin: 12px auto 0;
  color: #4d554f;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-day {
  position: relative;
  padding: 24px;
  border: 1px solid rgba(99, 79, 61, 0.14);
  border-radius: 8px;
  background: #fffdf9;
}

.timeline-day::before {
  content: "";
  position: absolute;
  left: 24px;
  top: -1px;
  width: 72px;
  height: 3px;
  background: var(--rose);
}

.feature-day::before {
  background: var(--sage);
}

.timeline-day h3,
.travel-grid h3 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
}

.timeline-day ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #4d554f;
}

.timeline-day li {
  display: grid;
  grid-template-columns: minmax(0, 160px) 1fr;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid rgba(99, 79, 61, 0.1);
}

.timeline-day li:first-child {
  border-top: 0;
}

.timeline-day li span {
  color: var(--sage-deep);
  font-weight: 800;
}

.timeline-day:not(.feature-day) li {
  display: list-item;
  margin-left: 18px;
  padding-left: 2px;
  list-style: disc;
}

.travel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.travel-grid article {
  position: relative;
  border: 1px solid rgba(99, 79, 61, 0.14);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 253, 249, 0.62);
}

.travel-card-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border: 1px solid rgba(67, 87, 71, 0.18);
  border-radius: 50%;
  background: #fffdf9;
  font-size: 1.2rem;
}

.wide-travel-card {
  grid-column: 1 / -1;
}

.travel-grid p {
  margin: 0;
  color: #4d554f;
}

.travel-note {
  margin-top: 20px;
  padding: 18px 20px;
  border-left: 4px solid var(--blue);
  background: rgba(111, 130, 147, 0.1);
  color: #44505b;
}

.details-intro p,
.form-status {
  margin: 0;
  max-width: 820px;
  color: #4d554f;
}

.travel-form {
  display: grid;
  gap: 20px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label,
.contribution-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(99, 79, 61, 0.14);
  border-radius: 8px;
  background: #fffdf9;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid span,
.guest-row span,
.contribution-box > span,
.contribution-notes span {
  color: var(--sage-deep);
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.guest-row input,
.contribution-notes textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7f2eb;
  color: var(--muted);
}

.field-hint {
  color: #707970;
  font-size: 0.9rem;
}

.form-grid textarea {
  min-height: 78px;
  resize: vertical;
}

.guest-list-section {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(99, 79, 61, 0.14);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 253, 249, 0.66);
}

.form-section-heading {
  display: grid;
  gap: 4px;
}

.form-section-heading h3 {
  margin: 0;
  color: var(--sage-deep);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
}

.form-section-heading p {
  margin: 0;
  color: #4d554f;
}

.guest-list {
  display: grid;
  gap: 10px;
}

.guest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.guest-row label {
  display: grid;
  gap: 8px;
}

.guest-remove,
.add-guest {
  min-height: 44px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.guest-remove {
  border: 1px solid rgba(154, 63, 50, 0.22);
  padding: 10px 14px;
  background: #fffdf9;
  color: #8a3e35;
}

.add-guest {
  justify-self: start;
  border: 1px solid rgba(67, 87, 71, 0.28);
  padding: 10px 15px;
  background: #fffdf9;
  color: var(--sage-deep);
}

.contribution-box p {
  margin: 0;
  color: #4d554f;
}

.choice-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-button {
  min-height: 44px;
  border: 1px solid rgba(67, 87, 71, 0.28);
  border-radius: 999px;
  padding: 10px 15px;
  background: #fffdf9;
  color: var(--sage-deep);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.choice-button:hover {
  transform: translateY(-1px);
}

.royal-decoy {
  border-color: rgba(110, 116, 109, 0.34);
  border-style: dashed;
  background: #ebe7df;
  color: #8a877f;
  cursor: not-allowed;
  opacity: 0.82;
}

.royal-decoy:hover {
  transform: none;
}

.choice-button.is-selected {
  background: var(--sage-deep);
  color: #fffdf9;
}

.royal-decoy.is-fleeing {
  transform: translateX(10px) rotate(-1deg);
}

.royal-message {
  border-left: 4px solid var(--clay);
  padding: 10px 12px;
  background: rgba(173, 118, 102, 0.11);
  color: #5d514a;
}

.royal-message[hidden] {
  display: none;
}

.contribution-notes {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.contribution-notes[hidden] {
  display: none;
}

.hidden-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 1.5em;
  font-weight: 700;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid rgba(99, 79, 61, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.72);
}

.faq-list summary {
  cursor: pointer;
  padding: 18px 20px;
  color: var(--sage-deep);
  font-weight: 800;
}

.faq-list p {
  margin: 0;
  padding: 0 20px 20px;
  color: #4d554f;
}

@media (max-width: 860px) {
  .main-nav {
    width: 100%;
  }

  .hero-grid,
  .travel-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-art {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
  }

  .hero-art img {
    height: 100%;
    object-position: 50% 30%;
  }

  .timeline-day li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .guest-row {
    grid-template-columns: 1fr;
  }

  .guest-remove {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .password-row {
    grid-template-columns: 1fr;
  }

  .password-row button {
    width: 100%;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .lock-card h1 {
    font-size: 2.6rem;
  }

  .section-heading h2 {
    font-size: 2.35rem;
  }

  .section-heading .story-aside {
    font-size: 1.1rem;
  }

  .story-text,
  .vibe-inner p {
    font-size: 1.2rem;
  }

  .timeline-day,
  .travel-grid article,
  .form-grid label,
  .contribution-box {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .password-row button,
  .button,
  .choice-button,
  .envelope-flap,
  .envelope-letter {
    transition: none;
  }

  .lock-card,
  #site-content:not([hidden]) .hero-copy > *,
  #site-content:not([hidden]) .hero-art,
  #site-content:not([hidden]) .vibe-inner,
  .button-spinner,
  .password-form.is-working .unlock-progress span {
    animation: none;
  }
}

@keyframes card-arrive {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes progress-wander {
  0% {
    transform: translateX(-110%);
  }
  55% {
    transform: translateX(85%);
  }
  100% {
    transform: translateX(260%);
  }
}
