/* Sealed web: invite + letter pages. Same tokens as the app (SealedKit/Tokens). */
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 800; font-display: swap; src: url("/fonts/Inter-ExtraBold.woff2") format("woff2"); }
@font-face { font-family: "Nanum Pen Script"; font-weight: 400; font-display: swap; src: url("/fonts/NanumPenScript-Regular.woff2") format("woff2"); }

:root {
  --bg: #F2F2F0;
  --surface: #FFFFFF;
  --surface-muted: #F1F1EF;
  --ink: #1C1C1E;
  --on-ink: #FFFFFF;
  --ink-2: #6C6C70;
  --line: #2B2B2B;
  --shadow: 28, 28, 30;
  --grain-blend: multiply;
  --grain-opacity: .42;
  --glow-a: rgba(246, 170, 120, .75);
  --glow-b: rgba(240, 150, 170, .5);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --surface: #222225;
    --surface-muted: #2C2C30;
    --ink: #F2F2F0;
    --on-ink: #1C1C1E;
    --ink-2: #A1A1A6;
    --line: #EDEBE6;
    --shadow: 0, 0, 0;
    --grain-blend: screen;
    --grain-opacity: .23;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.45 "Inter", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Film grain (spec §3.2): fractal noise, static, above the chrome. */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: var(--grain-blend);
  opacity: var(--grain-opacity);
  z-index: 10;
}

main {
  max-width: 420px;
  margin: 0 auto;
  padding: 22px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

main > section { width: 100%; display: flex; flex-direction: column; align-items: center; }
.from { margin: -4px 0 8px; color: var(--ink-2); font: 400 28px/1 "Nanum Pen Script", cursive; }
.wordmark { align-self: flex-start; font-weight: 800; font-size: 20px; letter-spacing: -.5px; color: var(--ink); text-decoration: none; }

/* The envelope: a die-cut sticker (white border following the shape), glowing. */
.hero { position: relative; width: 260px; height: 210px; margin: 18px 0 6px; display: grid; place-items: center; }
.glow {
  position: absolute; width: 290px; height: 210px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow-a), var(--glow-b) 60%, transparent);
  filter: blur(20px);
  animation: breathe 3.2s ease-in-out infinite;
}
.envelope {
  position: relative; width: 230px; height: auto;
  transform: rotate(-5deg);
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff)
          drop-shadow(0 2px 2px rgba(28,28,30,.14)) drop-shadow(0 12px 18px rgba(28,28,30,.16));
  animation: wiggle 2.6s ease-in-out infinite;
}
.hero.small { height: 150px; margin-top: 30px; }
.hero.gray .envelope { filter: grayscale(1) drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 10px 16px rgba(28,28,30,.14)); animation: none; }
.hero.gray .glow { display: none; }
.pup {
  width: 120px; height: auto; transform: rotate(4deg);
  filter: drop-shadow(3px 0 0 #fff) drop-shadow(-3px 0 0 #fff) drop-shadow(0 3px 0 #fff) drop-shadow(0 -3px 0 #fff) drop-shadow(0 6px 8px rgba(28,28,30,.18));
}
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .glow, .envelope { animation: none; } }

h1 {
  margin: 6px 0 6px;
  font: 400 44px/1.02 "Nanum Pen Script", "Bradley Hand", cursive;
  color: var(--line);
  text-wrap: balance;
}
.lead { margin: 0 0 22px; color: var(--ink-2); font-size: 17px; text-wrap: pretty; }

.card {
  width: 100%;
  background: var(--surface);
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(var(--shadow), .06);
  text-align: left;
}
.card + .card { margin-top: 14px; }
.label { margin: 0 0 8px; font-weight: 700; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-2); }
.steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: baseline; margin: 6px 0; font-size: 15px; }
.steps li::before {
  content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--surface-muted); color: var(--ink);
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; border-radius: 999px; border: 0;
  font: 600 16px "Inter", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  transition: transform .15s ease;
}
.btn:active { transform: scale(.97); }
.btn + .btn { margin-top: 10px; }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: 0 10px 24px rgba(var(--shadow), .18); }
.btn.secondary { background: var(--surface-muted); color: var(--ink); }
.btn.surface { background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px rgba(var(--shadow), .06); }

.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.code { font-weight: 800; font-size: 30px; letter-spacing: 6px; font-variant-numeric: tabular-nums; }
.copy {
  height: 38px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface-muted); color: var(--ink); font: 600 14px "Inter", system-ui, sans-serif;
}
.small { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }

footer { margin-top: 26px; font-size: 13px; color: var(--ink-2); max-width: 300px; }
footer p { margin: 4px 0; }

[hidden] { display: none !important; }
