:root {
  color-scheme: light;
  --wine: #481e29;
  --wine-dark: #361520;
  --rose: #e5a998;
  --cream: #fff5e5;
  --paper: #fffaf1;
  --ink: #40262a;
  --muted: #75575a;
  --line: #e7d4c5;
  --serif: Georgia, 'Times New Roman', serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: #f5e8d6;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a54553; outline-offset: 4px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; }
p, li { line-height: 1.7; }
em { font-weight: inherit; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.13fr); }

.cover { position: sticky; top: 0; grid-area: 1 / 1 / span 2; align-self: start; height: 100svh; background: #55311f; color: var(--cream); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 48% 54%; }
.cover::after { content: ''; position: absolute; inset: 65% 0 0; background: linear-gradient(transparent, #190b07c7); pointer-events: none; }
.cover figcaption { position: absolute; z-index: 1; bottom: 28px; left: 0; right: 0; text-align: center; font: italic 1.2rem var(--serif); }
.cover figcaption span { padding: 0 .75rem; font-size: .65rem; color: #ffcf9a; }

.hero { position: relative; grid-column: 2; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 78px 30px 50px; color: var(--cream); background: radial-gradient(ellipse at 50% 30%, #663041, var(--wine) 58%, var(--wine-dark)); }
.hero::before { content: ''; pointer-events: none; position: absolute; inset: 17px; border: 1px solid #f3cfad43; }
.hero-content { position: relative; text-align: center; width: 100%; }
.eyebrow { color: #8e4350; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; font-weight: 700; }
.hero .eyebrow { color: #f4ceb2; }
h1 { font-size: clamp(3.2rem, 6.3vw, 7.25rem); line-height: .96; letter-spacing: -.065em; margin: 22px 0 26px; }
h1 em { display: block; color: #f1bdaa; }
.lights { position: absolute; top: -40px; left: 15%; right: 15%; height: 87px; border-bottom: 1px solid #cda48372; border-radius: 0 0 50% 50%; display: flex; align-items: end; justify-content: space-around; }
.lights i { width: 5px; height: 8px; border-radius: 50%; background: #ffe0a8; box-shadow: 0 0 12px 3px #fba8515e; animation: twinkle 5s ease-in-out infinite alternate; }
.lights i:nth-child(odd) { animation-delay: -2s; }
.lights i:nth-child(1), .lights i:nth-child(7) { transform: translateY(-18px); }
.lights i:nth-child(2), .lights i:nth-child(6) { transform: translateY(-6px); }
@keyframes twinkle { 50% { opacity: .36; } }

.open-invite { border: 0; padding: 14px 17px 10px; cursor: pointer; background: none; color: var(--cream); }
.open-invite:focus-visible { outline-color: #feceb9; }
.envelope { position: relative; display: grid; place-items: center; width: 151px; height: 98px; margin: 0 auto 17px; border-radius: 5px; background: #efc89f; perspective: 420px; box-shadow: 0 14px 26px #210c16a3; transition: transform .3s ease; }
.envelope::before, .envelope::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.envelope::before { background: linear-gradient(30deg, #eabb91 50%, #e0a47b 50%); clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); }
.envelope::after { background: #fce2bc; clip-path: polygon(0 0, 100% 0, 50% 69%); transform-origin: top; transition: transform .52s ease; }
.seal { position: relative; z-index: 1; width: 33px; height: 33px; display: grid; place-items: center; margin-top: 23px; border-radius: 50%; color: #ffd5bd; background: #843f4a; font: 1.24rem var(--serif); box-shadow: 0 2px 3px #4a263850, inset 0 0 0 2px #a86466; transition: opacity .2s ease; }
.open-invite:hover .envelope { transform: translateY(-4px) rotate(-2deg); }
.open-invite[aria-expanded='true'] .envelope::after { transform: rotateX(168deg); }
.open-invite[aria-expanded='true'] .seal { opacity: 0; }
.open-label { display: flex; gap: .65rem; justify-content: center; font-weight: 650; }

.invitation { grid-column: 2; display: grid; gap: 24px; padding: clamp(16px, 3.7vw, 56px); max-width: 850px; width: 100%; margin-inline: auto; animation: reveal .6s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } }
.panel { position: relative; padding: clamp(20px, 4vw, 58px); background: var(--paper); border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 10px 26px #57302c0b; scroll-margin-top: 18px; }
.letter, .date { text-align: center; }
.letter-top { display: flex; align-items: center; justify-content: center; gap: 16px; color: #9b4951; }
.letter-top span:not(:nth-child(2)) { font-size: .7rem; color: #a47354; }
.letter-top span:nth-child(2) { font: 1.7rem var(--serif); }
h2 { font-size: clamp(2.25rem, 4.7vw, 4.3rem); line-height: 1.02; letter-spacing: -.055em; margin: 10px 0 20px; }
h2 em { color: #934652; }
.panel p + p { margin-top: 13px; }
.connection { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 25px; color: var(--muted); font-size: .88rem; }
.connection-line { width: clamp(32px, 13vw, 110px); position: relative; border-top: 1px dashed #b38178; }
.connection-line b { position: absolute; top: -.7em; left: 0; color: #a54553; animation: travel 3s ease-in-out infinite alternate; }
@keyframes travel { to { left: calc(100% - 12px); } }

.button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 46px; padding: 10px 17px; border: 1px solid transparent; border-radius: 999px; text-decoration: none; font-weight: 650; font-size: .9rem; line-height: 1.35; cursor: pointer; transition: background .2s ease, color .2s ease; }
.primary { background: var(--wine); color: var(--cream); }
.primary:hover { background: #703244; }
.secondary { border-color: #cca6a4; color: var(--wine); background: var(--paper); }
.secondary:hover { background: #f7e6dc; }
.text-link { display: inline-block; font-size: .89rem; color: #813d49; font-weight: 650; text-underline-offset: 3px; }
.date > .text-link { margin-top: 23px; }
fieldset { border: 0; min-width: 0; padding: 0; margin: 0; }
.visually-hidden, .date-option input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.date-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 22px 0 17px; }
.date-option { position: relative; display: block; cursor: pointer; }
.date-option span { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #f9ecdf; padding: 14px 3px; border: 1px solid #e4cabb; border-radius: 4px; font-size: clamp(.71rem, 1.3vw, .94rem); }
.date-option strong { font: 400 2.55rem/.95 var(--serif); }
.date-option input:focus-visible + span { outline: 3px solid #a54553; outline-offset: 3px; }
.date-option:hover span { border-color: #a0636a; }
.date-option input:checked + span { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.reply { margin-top: 22px; padding: 18px 12px; position: relative; overflow: hidden; border: 1px solid #ebc8bb; background: #fff2e8; border-radius: 5px; }
.reply h3 { font-size: clamp(1.55rem, 3vw, 2.2rem); margin: 3px 0 7px; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.help { color: var(--muted); font-size: .8rem; }
.help:empty { display: none; }
.celebration { pointer-events: none; position: absolute; inset: 0; }
.celebration span { position: absolute; bottom: 5%; font-size: 1.15rem; opacity: 0; color: #a54553; animation: float-heart 1.4s ease-out both; }
.celebration span:nth-child(3n+1) { left: 5%; }
.celebration span:nth-child(3n+2) { left: 88%; animation-delay: .12s; color: #b47934; }
.celebration span:nth-child(3n) { left: 77%; animation-delay: .26s; }
.celebration span:nth-child(n+4) { margin-inline-start: -20px; bottom: 20%; }
@keyframes float-heart { 15% { opacity: .8; } to { transform: translateY(-145px) rotate(36deg); } }

.check-status { color: var(--muted); font-weight: 650; font-size: .85rem; }
.ingredients { display: grid; grid-template-columns: .88fr 1.12fr; gap: 17px; margin: 19px 0 22px; }
.ingredients legend { font: 400 1.2rem var(--serif); padding: 0 0 8px; }
.ingredients label { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid #ebdbce; line-height: 1.4; font-size: .87rem; cursor: pointer; }
.ingredients input { flex: none; accent-color: var(--wine); width: 17px; height: 17px; margin: 1px 0 0; }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
small { font-size: .76rem; color: var(--muted); }
details { padding: 13px 0; border-block: 1px solid var(--line); margin-bottom: 13px; }
summary { cursor: pointer; font-weight: 650; }
ol { padding-left: 1.5em; margin: 12px 0 4px; }
li + li { margin-top: 8px; }
footer { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; color: #813d49; }
footer span { font: 1.5rem var(--serif); }

@media (max-width: 740px) {
  .layout { display: block; }
  .hero { min-height: 0; padding: 68px 20px 29px; }
  .hero::before { inset: 9px; }
  h1 { font-size: clamp(3.7rem, 14vw, 6rem); margin: 13px 0 10px; }
  .cover { height: clamp(225px, 38svh, 360px); position: relative; }
  .cover figcaption { bottom: 11px; font-size: .96rem; }
  .cover img { object-position: center 56%; }
  .envelope { width: 113px; height: 72px; margin-bottom: 10px; }
  .seal { width: 28px; height: 28px; margin-top: 18px; }
  .invitation { gap: 16px; }
}

@media (max-width: 430px) {
  .ingredients { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
