@font-face { font-family: Tanha; src: url("assets/Tanha.woff") format("woff"); font-style: normal; font-weight: 400; font-display: swap }
* { box-sizing: border-box }
[hidden] { display: none !important }
:root { color-scheme: light; --ink: #263d33; --cream: #f9f6ec }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse at top, #f8f6ec, #e0d9c9); font: 16px/1.95 Tanha, Tahoma, sans-serif }
button, a { -webkit-tap-highlight-color: transparent }
button { cursor: pointer; color: inherit; font: inherit }
:focus-visible { outline: 3px solid #aa792e; outline-offset: 3px }
.envelope { position: fixed; z-index: 3; inset: 0; margin: auto; width: min(100%, 56svh); height: 100%; padding: 0; border: 0; overflow: hidden; background: #e9e3d3; box-shadow: 0 0 80px #493b222c; transition: background .4s }
.paper { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; transition: transform 1.2s cubic-bezier(.5,0,.2,1) }
.back { background-image: url("assets/envelope-bottom.png") }
.flap { background-image: url("assets/envelope-top.png") }
.wax { background-image: url("assets/seal.png"); transition: opacity .32s, transform .55s }
.wax i { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 36%; height: 15%; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(ellipse at 38% 36%,#406146,#193b2b 82%); color: #b7c8a9; border: 1px solid #7d976a; font: normal clamp(24px,6svh,48px)/1 Georgia,serif; text-shadow: 1px 2px #172f21 }
.opening { position: absolute; left: 5%; right: 5%; bottom: 11%; color: #3a4939; font-size: 14px; transition: opacity .24s }
.opening span, .script { display: block; font: italic 2.25rem/1.15 Georgia,serif; letter-spacing: -.05em }
.opening span { margin-bottom: .6rem }
.wax i { font-family: "Palatino Linotype", Georgia, serif; font-style: italic; letter-spacing: -.05em }
.opened { pointer-events: none; background: transparent; box-shadow: none }
.opened .back { transform: translateY(105%) }
.opened .flap { transform: translateY(-105%) }
.opened .wax, .opened .opening { opacity: 0 }
.opened .wax { transform: translateY(-4%) }
main { margin: auto; max-width: 760px; text-align: center; background: var(--cream); box-shadow: 0 0 64px #493b2217 }
header { position: relative; }
.portrait, .last-photo { display: block; width: 100%; height: auto }
.welcome, .venue { padding: clamp(32px,7vw,68px) 24px }
.script { color: #83704f; margin: 0 0 8px }
h1,h2,h3 { font-family: inherit; font-weight: normal; margin: 0 }
h1,h2 { font-size: clamp(30px,5vw,46px) }
h3 { font-size: 25px }
.ornament { display: block; width: 138px; margin: 12px auto 20px; filter: brightness(.55) sepia(.35) }
.welcome p:last-child { margin: 0 auto; max-width: 29em }
.countdown { padding: 28px clamp(14px,5vw,40px) 36px; background: #f0ebdd }
.countdown h2 { font-size: clamp(24px,5vw,34px); margin-bottom: 16px }
.clock { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(4px,1.3vw,12px); background: #fffdf6; padding-inline: 5px }
.clock > div { background: #345b3e; color: white; padding: 14px 0; box-shadow: 0 3px 8px #25392c2b }
.clock b,.clock span { display: block }
.clock b { font-size: clamp(24px,6vw,42px); line-height: 1.4; font-weight: normal; font-variant-numeric: tabular-nums }
.clock span { font-size: .88rem }
.album { display: grid; grid-template-columns: repeat(2,1fr); align-items: center; gap: 10px; padding: 12px }
.album img { display: block; width: 100%; height: auto }
.venue { background: #e7ecdf; border-block: 1px solid #bcc6ae; }
address { max-width: 29em; margin: 6px auto 24px; font-style: normal }
nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px }
nav a { display: grid; justify-items: center; gap: 4px; min-width: 70px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none }
nav img { width: 44px; height: 44px; border-radius: 10px }
.venue time { display: block; margin: 0 auto 16px; font-size: 1.15rem }
.calendar { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 20px; padding: 6px 28px; background: var(--ink); color: white; border-radius: 6px; text-decoration: none }
.venue small { display: block; margin-top: 5px }
nav a:hover { background: #d7dfcd }
footer p { margin: 0; padding: 24px }
.rsvp, .dashboard { padding: clamp(24px,6vw,52px) clamp(18px,5vw,44px) }
.rsvp form, .dashboard { text-align: start }
.rsvp form { max-width: 430px; margin: 20px auto 0; display: grid; gap: 16px }
.rsvp input, .rsvp select, .rsvp textarea { font: inherit; color: inherit; accent-color: var(--ink) }
.rsvp input:not([type=radio]), .rsvp select, .rsvp textarea { display: block; width: 100%; padding: 8px; border: 1px solid #87937d; background: #fffdf6; border-radius: 5px }
.rsvp fieldset { border: 0; padding: 0; margin: 0 }
.rsvp fieldset label { display: inline-flex; gap: 4px; align-items: center; min-height: 44px; margin-inline-end: 10px }
.rsvp button { min-height: 48px; border: none; border-radius: 5px; background: var(--ink); color: white }
.rsvp button:disabled { opacity: .6 }
.rsvp a,.dashboard a { color: var(--ink) }
.dashboard { min-height: 100vh }
.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px }
.stats div, .dashboard article { padding: 14px; border: 1px solid #c5ccbe; border-radius: 6px }
.stats dd { margin: 0; font-size: 1.65rem }
.dashboard article { margin-top: 12px; overflow-wrap: anywhere }
.dashboard article p { margin: 4px 0 }
.guest-message { white-space: pre-wrap }
#sound { position: fixed; z-index: 2; bottom: max(16px,env(safe-area-inset-bottom)); left: 16px; width: 46px; height: 46px; border: 1px solid #aeb8a1; border-radius: 50%; background: var(--ink); color: #fff; font-size: 19px }
#error:not(:empty) { position: fixed; bottom: 60px; left: 12px; max-width: 19em; background: var(--cream); padding: 8px }
@media (min-width: 680px) {
  header { display: grid; grid-template-columns: 1fr 1fr; align-items: center }
}
@media (max-width: 679px) {
  .envelope { width: 100%; height: 100dvh }
  .portrait { height: min(58svh, 115vw); object-fit: cover; object-position: 50% 30% }
  .welcome { padding: 23px 20px 30px }
  .welcome .script { font-size: 1.75rem }
  .album { grid-template-columns: 1fr; gap: 8px; padding: 8px }
  .opening { bottom: max(10%,env(safe-area-inset-bottom)) }
  footer p { padding-bottom: max(26px,env(safe-area-inset-bottom)) }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important }
}
