: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; } }
.botanical-air { position:fixed; inset:0; pointer-events:none; overflow:hidden; z-index:20; }
.air-petal,.air-light { position:absolute; display:block; will-change:transform,opacity; }
.air-petal { width:9px; height:16px; border-radius:90% 5% 90% 15%; background:linear-gradient(135deg,#f3edda,#c7b27770); }
.air-light { width:4px; height:4px; border-radius:50%; background:#e5cd85; box-shadow:0 0 10px 3px #e5cd8540; }
.guest-table { border:1px solid #c7b27790; border-radius:10px; padding:12px; color:var(--cream); }

/* A silk folio: the seal releases before the two fabric leaves part. */
#opening { background:transparent; overflow:hidden; transition:none; perspective:1400px; }
#opening::backdrop { background:transparent; }
#opening::before,#opening::after {
  content:""; position:absolute; top:0; bottom:0; width:50.2%; z-index:0;
  background-image:linear-gradient(#061b0c20,#061b0c45),url('/assets/green-silk.webp');
  background-size:200% 100%; will-change:transform;
}
#opening::before { left:0; background-position:left center; border-right:1px solid #d9c48570; box-shadow:8px 0 32px #03130866; }
#opening::after { right:0; background-position:right center; border-left:1px solid #d9c48550; }
.opening-panel { position:relative; z-index:1; border:1px solid #d9c48535; border-radius:160px 160px 20px 20px; padding:40px 20px; background:radial-gradient(ellipse,#10291df0,#10291d9c 65%,transparent); }
.opening-seal { width:88px; height:88px; background:radial-gradient(circle at 35% 25%,#506949,#203d2a 70%); border:2px solid #c7b277; box-shadow:0 0 0 4px #193b27,0 0 0 5px #c7b27780,0 10px 24px #03130870,inset 0 0 0 5px #c7b27720; font-size:22px; }
.opening-hint::before { content:"↑"; display:block; font:24px/1.6 Georgia,serif; color:#d9c485; }
#opening.opening-away { transform:none; opacity:1; }
.opening-away .opening-seal { animation:seal-release .65s cubic-bezier(.2,.7,.3,1) both; }
.opening-away .opening-panel { animation:folio-copy-out .65s .12s ease both; }
#opening.opening-away::before { animation:silk-part-left 1.6s .45s cubic-bezier(.65,0,.15,1) both; }
#opening.opening-away::after { animation:silk-part-right 1.6s .45s cubic-bezier(.65,0,.15,1) both; }
@keyframes seal-release { 45% {transform:scale(1.12) rotate(-8deg);filter:brightness(1.25);} to {transform:scale(.8) translateY(-26px) rotate(12deg);opacity:0;} }
@keyframes folio-copy-out { to {opacity:0;transform:translateY(-20px) scale(1.025);filter:blur(3px);} }
@keyframes silk-part-left { to {transform:translateX(-104%) rotateY(12deg);} }
@keyframes silk-part-right { to {transform:translateX(104%) rotateY(-12deg);} }
@media(max-height:700px) { .opening-panel {padding:18px 16px;} .opening-panel h2 {margin:18px 0;font-size:34px;} .opening-seal {width:64px;height:64px;margin:16px auto;} .opening-panel .eyebrow {margin-bottom:12px;} .opening-panel p {margin:12px 0;} }
@media(prefers-reduced-motion:reduce) {
  .opening-away .opening-panel {animation:folio-copy-out .2s ease both;filter:none;}
  .opening-away .opening-seal {animation:none;}
  #opening.opening-away::before,#opening.opening-away::after {animation:curtain-fade .2s ease both;}
  @keyframes curtain-fade {to {opacity:0;}}
}
/* Keep the fabric depth visible behind every reading section. */
.letter { background:#10291d88; backdrop-filter:none; }
#schedule,.wishes { background:#10291d99; backdrop-filter:none; }
.rsvp.artwork { background:#10291d99; }
main > section { text-shadow:0 2px 12px #03190be0; }
#opening { perspective:1100px; }
#opening::before { transform-origin:left center; }
#opening::after { transform-origin:right center; }
#opening::before,#opening::after { backface-visibility:hidden; }
@keyframes silk-part-left {
  25% {transform:translateX(-3%) rotateY(8deg);filter:brightness(1.12);}
  to {transform:translateX(-85%) rotateY(68deg);filter:brightness(.65);}
}
@keyframes silk-part-right {
  25% {transform:translateX(3%) rotateY(-8deg);filter:brightness(1.12);}
  to {transform:translateX(85%) rotateY(-68deg);filter:brightness(.65);}
}
#opening.opening-away::before,#opening.opening-away::after {animation-duration:2s;}
@media(prefers-reduced-motion:reduce) {
  #opening.opening-away::before,#opening.opening-away::after {animation-duration:.2s;}
}
/* Keep the original artwork intact; a gentle gilded glint travels at its edges. */
.moving-background { background:url('/assets/green-silk.webp') center/cover no-repeat; --glint-shift:0px; }
.gilded-edge { position:absolute; top:-25%; bottom:-25%; width:clamp(36px,10vw,85px); pointer-events:none; opacity:.48; mix-blend-mode:screen; transform:translateY(var(--glint-shift)); }
.edge-left { left:1%; }
.edge-right { right:1%; }
.gilded-edge::before { content:""; position:absolute; inset:0; background:radial-gradient(ellipse 45% 13% at 50% 35%,#efd99b85,transparent 80%); animation:gilded-drift 12s ease-in-out infinite alternate; }
.edge-right::before { animation-delay:-7s; animation-duration:15s; }
@keyframes gilded-drift { from {transform:translateY(-12%);opacity:.35;} to {transform:translateY(30%);opacity:.85;} }
.glints-paused .gilded-edge::before { animation-play-state:paused; }
.countdown { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; max-width:470px; margin:35px auto; }
.countdown strong { font-size:clamp(28px,7vw,44px); font-variant-numeric:tabular-nums; min-width:2ch; }
.countdown span { letter-spacing:1px; font-size:10px; }
@media(prefers-reduced-motion:reduce) { .gilded-edge { display:none; } }
/* Restrained motion: light stays near the gilt foliage, leaving the reading area calm. */
.gilded-edge { width:clamp(44px,12vw,90px); opacity:.6; }
.gilded-edge::before { background:radial-gradient(ellipse 40% 16% at 50% 40%,#f2de9a75,transparent 82%); }
.botanical-air .air-light { width:3px; height:3px; box-shadow:0 0 7px 2px #e5cd8535; }
#opening.opening-away::before,#opening.opening-away::after { animation-duration:1.55s; animation-delay:.32s; }
.opening-panel { box-shadow:inset 0 0 0 6px #11291b28,0 15px 60px #061b0c25; }
.opening-panel .button { border-color:#d9c48590; box-shadow:0 4px 20px #061b0c30; }
.opening-panel .button:focus-visible { outline:2px solid #f3edda; outline-offset:5px; }
.text-reveal { transform:translateY(12px); transition-duration:750ms; }
.countdown strong { line-height:1.5; }
@media(max-width:480px) {
  .opening-panel { padding:30px 16px; }
  .opening-panel .eyebrow { font-size:10px; letter-spacing:2px; }
  .opening-panel h2 { font-size:clamp(31px,9vw,42px); }
  .countdown { gap:8px; }
  .countdown span { font-size:9px; }
}
@media(prefers-reduced-motion:reduce) {
  #opening.opening-away::before,#opening.opening-away::after {animation-duration:.2s;animation-delay:0s;}
  .text-reveal {transform:none;}
}
