@font-face { font-family: Manrope; font-weight: 500; font-display: swap; src: url(manrope-500.woff2) format('woff2'); }
@font-face { font-family: Manrope; font-weight: 800; font-display: swap; src: url(manrope-800.woff2) format('woff2'); }
:root { --ink: #17284a; --muted: #4c627a; --teal: #007586; --line: #d5e4e9; --paper: #fff; --back: #b9dde2; --front: #d3ecef; --flap: #c5e4e8; --envelope: 220px; --dip: 122px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(#fff, #e6f5f6); color: var(--ink); font: 500 15px/1.5 Manrope, system-ui, sans-serif; font-synthesis: none; }
main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px 16px; }
a { color: var(--teal); }
footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--muted); }

/* The envelope: its back, the open flap, the letter in a slot that ends at the envelope's foot, then the front pocket over it. */
.stage { position: relative; width: min(100%, 390px); transition: transform 1.5s cubic-bezier(.45, 0, .25, 1); }
.envelope-back, .pocket { position: absolute; left: 0; right: 0; bottom: 0; height: var(--envelope); border-radius: 14px; }
.envelope-back { z-index: 0; background: var(--back); box-shadow: 0 22px 44px -22px rgb(23 40 74 / .35); }
.slot { position: relative; z-index: 2; overflow: hidden; padding: 12px 24px 0; clip-path: inset(0 0 6px 0); }
.letter { display: grid; gap: 8px; padding: 38px 22px calc(var(--envelope) - 22px); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 -4px 24px -10px rgb(23 40 74 / .2); transition: transform .85s cubic-bezier(.55, 0, .25, 1); }
.pocket { z-index: 3; background: var(--front); clip-path: polygon(0 0, 50% var(--dip), 100% 0, 100% 100%, 0 100%); pointer-events: none; }
.pocket::after { content: ''; position: absolute; inset: 0; background: rgb(255 255 255 / .35); clip-path: polygon(0 100%, 50% calc(var(--dip) - 22px), 100% 100%); }
.flap { position: absolute; z-index: 1; left: 0; right: 0; bottom: calc(var(--envelope) - var(--dip) - 14px); height: calc(var(--dip) + 14px); background: var(--flap); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; transform: rotateX(180deg); transition: transform .65s cubic-bezier(.5, 0, .2, 1); }
.seal { position: absolute; z-index: 5; left: 50%; bottom: calc(var(--envelope) - var(--dip) - 40px); width: 64px; height: 64px; margin-left: -32px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); box-shadow: 0 6px 16px -6px rgb(23 40 74 / .5); opacity: 0; transform: scale(1.7); transition: opacity .25s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; }
.seal svg { width: 42px; height: 42px; overflow: visible; }

/* Sent, in three steps (invite.js): the letter slides in, the flap closes over it, the seal lands. */
.stage.in .letter { transform: translateY(calc(100% - var(--envelope) + 26px)); }
.stage.closed .flap { z-index: 4; transform: rotateX(0deg); }
.stage.sealed .seal { opacity: 1; transform: scale(1); }
.stage.sealed .slot { visibility: hidden; }

.brand { display: flex; justify-content: center; min-height: 44px; }
.logo { align-self: center; display: block; width: 150px; height: auto; overflow: visible; }
h1 { margin: 2px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; text-align: center; }
.lead { margin: 0 0 4px; text-align: center; font-size: 13px; color: var(--muted); }
.field { font-size: 12px; font-weight: 800; }
input[type=email] { width: 100%; min-height: 42px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; font-size: 16px; color: var(--ink); background: #f8fbfc; }
input[type=email]:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.agree { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.agree input { flex: none; width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--teal); }
button { justify-self: center; min-width: 150px; padding: 0 28px; min-height: 42px; border: 0; border-radius: 9px; background: var(--teal); color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
button:hover:not(:disabled) { background: #00636f; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.error { margin: 0; font-size: 13px; color: #a5303b; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.done { position: absolute; top: 100%; left: 0; right: 0; text-align: center; visibility: hidden; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.done.show { visibility: visible; opacity: 1; transform: none; }
.done:focus { outline: none; }
.done h2 { margin: 22px 0 8px; font-size: 22px; font-weight: 800; }
.done p { margin: 0 0 8px; }
.done b { font-weight: 800; overflow-wrap: anywhere; }
.small { font-size: 13px; color: var(--muted); }
.notice { padding-top: 40px; align-items: stretch; justify-content: flex-start; width: min(100%, 620px); margin: 0 auto; }
.notice > a { align-self: center; }
.notice .logo { align-self: center; }
.notice h1 { margin: 18px 0 6px; font-size: 24px; }
.notice h2 { margin: 18px 0 4px; font-size: 16px; font-weight: 800; }
.notice p { margin: 0 0 6px; }

@media (max-width: 420px) {
  :root { --envelope: 200px; --dip: 110px; }
  .stage { width: min(100%, 340px); }
  .slot { padding-inline: 18px; }
  .letter { padding-inline: 18px; }
  h1 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .stage, .letter, .flap, .seal, .done { transition: none; } }
