:root {
  --cream: #f3edda;
  --gold: #c7b277;
  --green: #142e22;
  --serif: Georgia, "Times New Roman", serif;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: #0d2117;
  color: var(--cream);
  font: 20px/1.8 var(--serif);
}
main {
  max-width: 760px;
  margin: auto;
  overflow: hidden;
  background: var(--green);
  box-shadow: 0 0 100px #0004;
}
section {
  padding: 75px 50px;
  text-align: center;
  position: relative;
}
section.artwork {
  background:
    linear-gradient(#10251915, #10251915),
    url("/assets/green-silk.webp") center/cover;
}
.hero {
  min-height: 850px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 110px;
}
.eyebrow {
  font:
    11px/1.5 Arial,
    sans-serif;
  letter-spacing: 3px;
  color: var(--gold);
  margin: 0 0 28px;
}
h1 {
  font: 52px/1.35 var(--serif);
  font-weight: 400;
  margin: 20px 0 28px;
  overflow-wrap: anywhere;
}
h1 span {
  display: block;
  color: var(--gold);
  font-size: 30px;
  font-style: italic;
}
h2 {
  font: italic 36px/1.3 var(--serif);
  font-weight: 400;
  margin: 0 0 28px;
}
h2 small {
  font-size: 22px;
  display: block;
  margin-top: 8px;
}
.script {
  font-size: 28px;
  font-style: italic;
  margin: 8px 0;
}
.date {
  display: flex;
  gap: 28px;
  justify-content: center;
  align-items: center;
  line-height: 1.5;
}
.date strong {
  font: italic 74px var(--serif);
  color: var(--gold);
}
.date > div {
  border-left: 1px solid var(--gold);
  padding-left: 25px;
  text-align: left;
  font-size: 20px;
}
.date small {
  display: block;
  font-size: 17px;
}
p {
  margin: 18px 0;
}
.down {
  font-size: 30px;
  color: var(--gold);
  text-decoration: none;
}
.letter {
  background:
    linear-gradient(#142e22eb, #142e22eb),
    url("/assets/green-silk.webp") center/cover;
}
.names {
  display: block;
  font-weight: 400;
  font-size: 29px;
  margin: 15px 0;
}
.ornament {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 10px;
  margin: 35px auto;
  width: 160px;
}
.ornament:before,
.ornament:after {
  content: "";
  width: 65px;
  height: 1px;
  background: var(--gold);
}
.venue img {
  display: block;
  width: 100%;
  height: auto;
  margin: 25px auto 0;
}
.button {
  display: inline-block;
  border: 1px solid #dfd2ac;
  border-radius: 40px;
  background: var(--cream);
  color: #243a28;
  padding: 12px 32px;
  font: 16px/1.5 var(--serif);
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
}
.button:disabled {
  opacity: 0.5;
}
.note {
  font-size: 14px;
  color: #c5c3a6;
}
.timeline {
  list-style: none;
  margin: 40px auto;
  padding: 0;
  max-width: 480px;
  text-align: left;
}
.timeline li {
  display: grid;
  grid-template-columns: 65px 1fr;
  gap: 24px;
  padding-bottom: 32px;
}
.timeline time {
  color: var(--gold);
  font-size: 20px;
}
.timeline li > div {
  border-left: 1px solid #c7b27765;
  padding-left: 24px;
  position: relative;
}
.timeline li > div:before {
  content: "";
  position: absolute;
  left: -4px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
h3 {
  font-size: 20px;
  font-weight: 400;
  margin: 0;
}
.timeline p {
  font-size: 17px;
  line-height: 1.6;
  color: #cbcdb9;
  margin: 8px 0;
}
.wishes h2:not(:first-child) {
  margin-top: 65px;
}
form {
  max-width: 440px;
  margin: 35px auto;
  text-align: left;
}
label {
  display: block;
  font-size: 18px;
  margin: 20px 0;
}
input:not([type="radio"]),
select,
textarea {
  display: block;
  width: 100%;
  background: #f4efde;
  color: #203c2b;
  border: 1px solid var(--gold);
  border-radius: 4px;
  min-height: 48px;
  padding: 10px;
  font: 17px/1.5 var(--serif);
  margin-top: 8px;
}
fieldset {
  border: 0;
  padding: 10px 0;
  margin: 0;
}
legend {
  font-size: 18px;
}
.radio {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 18px;
}
.radio input {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
}
form > .button {
  display: block;
  margin: 28px auto 0;
}
#form-status {
  font-size: 16px;
  text-align: center;
}
.countdown {
  display: flex;
  justify-content: center;
  gap: 38px;
  margin: 35px 0;
}
.countdown strong {
  display: block;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.3;
}
.countdown span {
  font:
    10px Arial,
    sans-serif;
  letter-spacing: 2px;
  color: var(--gold);
}
.closing {
  padding-top: 100px;
  padding-bottom: 100px;
}
footer {
  text-align: center;
  color: var(--gold);
  font:
    13px Arial,
    sans-serif;
  letter-spacing: 3px;
  padding: 30px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  body {
    font-size: 18px;
  }
  section {
    padding: 65px 26px;
  }
  .hero {
    min-height: 780px;
    padding: 100px 20px 70px;
  }
  h1 {
    font-size: clamp(34px, 8.7vw, 50px);
  }
  h2 {
    font-size: 30px;
  }
  .letter p {
    line-height: 1.9;
  }
  .names {
    font-size: 25px;
  }
  .venue {
    padding-left: 20px;
    padding-right: 20px;
  }
  .timeline li {
    gap: 12px;
    grid-template-columns: 58px 1fr;
  }
  .timeline li > div {
    padding-left: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
/* One continuous animated fabric behind stable, readable invitation text. */
.moving-background {
  position: fixed;
  inset: 0;
  max-width: 760px;
  margin: auto;
  background: #10271a url("/assets/green-silk.webp") center/cover;
  z-index: -1;
  overflow: hidden;
}
#silk {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s;
}
#silk[data-ready="true"] {
  opacity: 1;
}
body {
  isolation: isolate;
}
main {
  background: transparent;
}
section.artwork {
  background: linear-gradient(90deg, #10261925, #10261908, #10261925);
}
.letter {
  background: #142e22d9;
  backdrop-filter: blur(3px);
}
#schedule,
.wishes {
  background: #142e22e8;
  backdrop-filter: blur(3px);
}
.rsvp.artwork {
  background: #1026198c;
}
.heart-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}
.touch-heart {
  position: absolute;
  aspect-ratio: 1;
  will-change: transform, opacity;
  filter: drop-shadow(0 2px 4px #081b0d50);
}
.touch-heart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
@media (prefers-reduced-motion: reduce) {
  #silk {
    transition: none;
  }
  .letter,
  #schedule,
  .wishes {
    backdrop-filter: none;
  }
}
@supports selector(:has(*)) {
  .moving-background:has(#silk[hidden]) {
    animation: fabric-fallback 18s ease-in-out infinite alternate;
    background-size: auto 108%;
  }
}
@keyframes fabric-fallback {
  from {
    background-position: 48% 48%;
  }
  to {
    background-position: 52% 54%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .moving-background {
    animation: none !important;
  }
}

#rsvp-form textarea { height: 48px; min-height: 48px; resize: vertical; }
#rsvp-form input::placeholder, #rsvp-form textarea::placeholder { color: #617160; opacity: 1; }

.text-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 850ms ease, transform 850ms cubic-bezier(.2,.7,.25,1);
}
.text-reveal.revealed { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .text-reveal { opacity: 1; transform: none; transition: none; }
}

.music-toggle {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 100;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #cbbf86;
  border-radius: 50%;
  background: #f3eedb;
  color: #173b29;
  font: 22px Georgia, serif;
  box-shadow: 0 4px 20px #07180f35;
  cursor: pointer;
}
.music-toggle:focus-visible { outline: 2px solid #f3eedb; outline-offset: 4px; }

body.opening-active { overflow: hidden; }
#opening {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 28px; border: 0; color: #f3eedb;
  background: #10291d url('/assets/green-silk.webp') center/cover;
  display: none; align-items: center; justify-content: center;
  transition: transform 1.1s cubic-bezier(.65,0,.2,1), opacity 1s ease;
}
#opening[open] { display: flex; }
#opening::backdrop { background: #10291d; }
.opening-panel { text-align: center; width: min(100%,480px); padding: 35px 15px; background: radial-gradient(ellipse,#10291dd9,transparent 72%); }
.opening-panel h2 { font-size: clamp(35px,7vw,58px); line-height: 1.1; margin: 30px 0; }
.opening-panel h2 span { font-size: 24px; color: #d9c485; }
.opening-seal { border: 1px solid #d9c485; border-radius: 50%; width: 78px; height: 78px; margin: 30px auto; display: grid; place-items: center; box-shadow: 0 0 0 5px #d9c48518; }
.opening-panel .button { margin-top: 25px; }
.opening-hint { font-size: 14px; opacity: .75; }
#opening.opening-away { transform: translateY(-100%); opacity: 0; }
@media(prefers-reduced-motion:reduce) { #opening { transition: opacity .2s; } }
