/* North Pole Postal Workshop — no external fonts, images or requests. */
:root {
  --ever-950: #07140e; --ever-900: #0b1d15; --ever-800: #10291d; --ever-700: #173a29;
  --cream: #f6efdf; --paper: #fbf6ea; --paper-2: #f1e7d0; --line: #e0d3b4;
  --ink: #1a2a21; --muted: #5a685e;
  --orange: #fc6200; --orange-deep: #a64000; --red: #c9301c; --err: #b3261e;
  --display: "Bodoni 72", "Didot", "Playfair Display", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fg: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip;
  background: var(--cream); color: var(--ink); font: 1rem/1.6 var(--sans);
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.wrap { width: min(100% - 2.5rem, 70rem); margin-inline: auto; }
.skip { position: absolute; left: .5rem; top: -4rem; z-index: 50; background: var(--orange); color: var(--ever-950); padding: .6rem 1rem; border-radius: 8px; font-weight: 700; }
.skip:focus { top: .5rem; }

/* Dark evergreen surfaces with soft snowfall */
.mast, .hero, .band, .foot { --fg: var(--cream); color: var(--cream); background-color: var(--ever-900); }
.hero, .band {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.10) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 64% 72%, rgba(255,255,255,.08) 0 1.5px, transparent 2.5px),
    radial-gradient(60rem 30rem at 95% -10%, rgba(252,98,0,.22), transparent 60%),
    linear-gradient(180deg, var(--ever-900), var(--ever-950));
  background-size: 110px 110px, 170px 170px, auto, auto;
}
.mast { position: relative; padding-top: env(safe-area-inset-top); background: var(--ever-950); }
.mast::after, .sheet::before {
  content: ""; position: absolute; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(-45deg, var(--orange) 0 12px, var(--cream) 12px 20px, var(--ever-700) 20px 32px, var(--cream) 32px 40px);
}
.mast::after { bottom: 0; }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand img { height: 2.4rem; width: auto; }
.brand-sub { font: 600 .68rem/1.25 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(246,239,223,.7); border-left: 1px solid rgba(246,239,223,.3); padding-left: .9rem; }

/* Type */
.display { font-family: var(--display); font-weight: 800; line-height: .98; letter-spacing: -.02em; margin: 0 0 1rem; font-size: clamp(2.3rem, 6.5vw, 4.2rem); text-wrap: balance; }
.display.sm { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.05; }
.hero .display { font-size: clamp(3.4rem, 11vw, 7.5rem); line-height: .9; }
.display em { color: var(--orange); font-weight: 700; }
.eyebrow { font: 700 .78rem/1.3 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--orange); margin: 0 0 .9rem; }
.eyebrow.dark { color: #b24200; }
.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); max-width: 38rem; color: rgba(246,239,223,.85); margin: 0 0 1.5rem; }
.step-title { font: 800 1.45rem/1.2 var(--display); margin: 0 0 1.1rem; padding: 0; }
.hint, .meta { color: var(--muted); font-size: .92rem; margin: .35rem 0 0; }
.center { text-align: center; }
.loading, .notice { padding: 3rem 0; text-align: center; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: .7rem 1.5rem;
  border: 2px solid transparent; border-radius: 999px; font: 700 1rem/1.1 var(--sans); text-decoration: none; cursor: pointer;
  color: var(--ink); background: none; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-sm { min-height: 2.75rem; padding: .5rem 1.1rem; font-size: .92rem; }
.btn-primary { background: var(--orange); color: var(--ever-950); box-shadow: 0 4px 0 var(--orange-deep); }
.btn-primary:hover { background: #ff7424; transform: translateY(-1px); box-shadow: 0 5px 0 var(--orange-deep); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--orange-deep); }
.btn-ghost { color: var(--fg); border-color: currentColor; }
.btn-ghost:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.btn-danger { color: var(--err); border-color: currentColor; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink); }
.icon-btn:hover { border-color: var(--err); color: var(--err); }

/* Home */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.cta-row { display: flex; flex-wrap: wrap; gap: .9rem; }
.hero-art { position: relative; margin: 0; padding: 12px; background: var(--cream); border-radius: 6px; transform: rotate(2deg); box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.hero-art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; outline: 2px dashed rgba(26,42,33,.35); outline-offset: -8px; }
.postmark {
  position: absolute; left: -1.2rem; bottom: -1.4rem; width: 6.6rem; height: 6.6rem; display: grid; place-items: center; text-align: center;
  border: 3px double var(--orange); border-radius: 50%; color: var(--orange); background: rgba(11,29,21,.92); transform: rotate(-14deg);
  font: 700 .62rem/1.5 var(--mono); letter-spacing: .12em;
}
.paper-band { padding: clamp(2.5rem, 6vw, 4.5rem) 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.route { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; counter-reset: stop; }
.route li { position: relative; padding: 1.4rem 1.2rem; background: var(--cream); border: 1.5px dashed #c9b88f; border-radius: 4px; }
.route h3 { font: 800 1.25rem/1.15 var(--display); margin: .8rem 0 .4rem; }
.route p { margin: 0; color: var(--muted); font-size: .96rem; }
.stop { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--orange); color: var(--ever-950); font: 800 1.1rem var(--display); }
.split { padding-block: clamp(2.5rem, 6vw, 4.5rem); max-width: 42rem; margin-inline: auto; }
.split p { max-width: 36rem; }
#open-invitation { display: grid; gap: .6rem; margin-top: 1.2rem; }
#open-invitation label { font-weight: 700; }
#open-invitation .btn { justify-self: start; margin-top: .4rem; }
#invite-error { color: var(--err); margin: 0; min-height: 1.4em; }

/* Inputs */
input, textarea, select {
  width: 100%; min-height: 3.1rem; padding: .7rem .9rem; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(252,98,0,.2); }
input::placeholder, textarea::placeholder { color: #98a198; }
.field { margin: 0 0 1.25rem; padding: 0; border: 0; min-width: 0; }
label, .label { display: block; font-weight: 700; margin-bottom: .4rem; }
label small, .label small { font-weight: 400; color: var(--muted); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.err { color: var(--err); font-size: .92rem; font-weight: 600; margin: .4rem 0 0; }
.err:empty { display: none; }
.row2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr 1fr; }

/* Paper sheets */
.band { padding: clamp(2rem, 5vw, 3.5rem) 0 4.5rem; }
.band:has(+ .stage > .toolbar:first-child) { padding-bottom: 2.4rem; }
.band .display { margin-bottom: .6rem; }
.band .lead { margin-bottom: 0; }
.stage { position: relative; display: grid; gap: 1.5rem; padding-bottom: 4rem; }
.stage > .sheet:first-child { margin-top: -3.2rem; }
.stage > .toolbar:first-child { padding-top: 1.5rem; }
.stage > .sheet { width: 100%; max-width: 46rem; margin-inline: auto; }
[data-view=admin] .stage > .sheet, [data-view=admin] .toolbar, [data-view=admin] .cards { max-width: 62rem; width: 100%; margin-inline: auto; }
.stage > .sheet.narrow { max-width: 28rem; }
.sheet {
  position: relative; padding: calc(clamp(1.25rem, 4vw, 2.5rem) + 7px) clamp(1.25rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem);
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 0 #fff inset, 0 24px 40px -26px rgba(7,20,14,.5), 0 2px 6px rgba(7,20,14,.08);
}
.sheet::before { top: 0; }
.sheet p { margin: 0 0 1rem; }
.sheet p:last-child { margin-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; margin-top: 1.6rem; }
.actions .btn-ghost:first-child:not(:only-child) { margin-right: auto; }
.actions.left { justify-content: flex-start; margin-top: 1rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.toolbar > :first-child { margin-right: auto; }

/* Progress */
.steps { list-style: none; display: flex; gap: .5rem; margin: 0 0 .8rem; padding: 0; }
.steps li { flex: 1; display: flex; align-items: center; gap: .55rem; color: var(--muted); font: 700 .72rem/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.steps .n { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; font-size: .85rem; }
.steps .now { color: var(--ink); }
.steps .now .n { background: var(--orange); border-color: var(--orange); color: var(--ever-950); }
.steps .done .n { background: var(--ever-800); border-color: var(--ever-800); color: var(--cream); }
.bar { height: 6px; margin-bottom: 1.8rem; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--orange); border-radius: 6px; transition: width .4s ease; }

/* Gift-tag team cards */
.tags-set legend { float: left; width: 100%; }
.tags { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1.1rem; padding: .4rem .2rem; }
.tag { position: relative; display: block; cursor: pointer; filter: drop-shadow(0 6px 6px rgba(7,20,14,.2)); transition: transform .18s, filter .18s; }
.tag:hover { transform: translateY(-4px) rotate(-1.4deg); }
.tag:nth-child(even):hover { transform: translateY(-4px) rotate(1.4deg); }
.tag:active { transform: translateY(1px) scale(.98); }
.tag input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.tag-body {
  --bg: #f0dbb8; --fg: var(--ink); position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 7.8rem;
  padding: 2.4rem .9rem .9rem; background: var(--bg); color: var(--fg); transition: background .18s, color .18s;
  clip-path: polygon(20% 0, 80% 0, 100% 20%, 100% 100%, 0 100%, 0 20%);
}
.tag:nth-child(3n+2) .tag-body { --bg: #fbddc9; }
.tag:nth-child(3n) .tag-body { --bg: #dfe8d3; }
.tag-body::before { content: ""; position: absolute; top: .75rem; left: 50%; width: 1rem; height: 1rem; margin-left: -.5rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 3px rgba(0,0,0,.45); }
.tag-name { font: 800 1.2rem/1.15 var(--display); overflow-wrap: anywhere; }
.tag-tick { position: absolute; right: .6rem; bottom: .6rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ever-950); color: var(--cream); font-size: .9rem; opacity: 0; transform: scale(.4); transition: opacity .18s, transform .18s; }
.tag input:checked + .tag-body { --bg: var(--orange); --fg: var(--ever-950); }
.tag input:checked + .tag-body .tag-tick { opacity: 1; transform: none; }
.tag input:focus-visible + .tag-body { --bg: var(--ever-800); --fg: var(--cream); }
.tag:has(input:focus-visible) { filter: drop-shadow(3px 0 0 var(--ever-950)) drop-shadow(-3px 0 0 var(--ever-950)) drop-shadow(0 3px 0 var(--ever-950)) drop-shadow(0 -3px 0 var(--ever-950)); }

/* Wishes */
.wishes { display: grid; gap: .6rem; }
.wish { display: flex; align-items: center; gap: .6rem; }
.wish-n { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #ffe2cf; color: #8a3500; font: 800 1rem var(--display); }
.add { margin-top: .8rem; }

/* Chips & cards */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.chip { display: inline-flex; align-items: center; padding: .15rem .7rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font: 700 .78rem/1.6 var(--sans); white-space: nowrap; }
.chip.open, .chip.st-sent { background: #dcf1df; border-color: #b4dcba; color: #14532d; }
.chip.locked { background: var(--ever-900); border-color: var(--ever-900); color: var(--cream); }
.chip.st-pending, .chip.st-sending { background: #fff0d1; border-color: #f0d49a; color: #7a4a00; }
.chip.st-failed { background: #fde2dd; border-color: #f4b5aa; color: #9b1c0c; }
code.chip { font-family: var(--mono); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; }
.card { display: grid; gap: .5rem; height: 100%; padding: 1.2rem; text-decoration: none; background: var(--paper); border: 1.5px solid var(--line); border-radius: 6px; transition: transform .18s, border-color .18s, box-shadow .18s; }
.card:hover { transform: translateY(-3px) rotate(-.4deg); border-color: var(--orange); box-shadow: 0 14px 24px -16px rgba(7,20,14,.5); }
.card-title { font: 800 1.35rem/1.15 var(--display); }

/* Organizer details */
.copyrow { display: flex; gap: .6rem; align-items: center; margin-top: .6rem; }
.copyrow input { flex: 1; min-width: 0; }
.seg { display: inline-flex; padding: .25rem; margin-bottom: 1.2rem; background: var(--paper-2); border-radius: 999px; }
.seg button { min-height: 2.5rem; padding: 0 1.1rem; border: 0; border-radius: 999px; background: none; font: 700 .92rem var(--sans); color: var(--ink); cursor: pointer; }
.seg button.on { background: var(--ever-900); color: var(--cream); }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .8rem 1rem; margin: 1rem 0; }
.pair { margin: 0; }
.pair span { display: block; font-weight: 700; margin-bottom: .25rem; }
.people { display: grid; }
.person { border-top: 1px solid var(--line); }
.person:last-child { border-bottom: 1px solid var(--line); }
.person summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; min-height: 3.4rem; padding: .6rem .2rem; cursor: pointer; list-style: none; }
.person summary::-webkit-details-marker { display: none; }
.person summary .who { overflow-wrap: anywhere; }
.person summary .meta { display: inline; margin: 0; }
.person[open] summary { border-bottom: 1px dashed var(--line); }
.person-body { padding: 1rem .2rem 1.4rem; }
.person-body h3 { margin: 1rem 0 .3rem; font: 700 .72rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #b24200; }
.person-body h3:first-child { margin-top: 0; }
.person-body ol { margin: 0; padding-left: 1.4rem; }
.person-body p { margin: 0; }
address { font-style: normal; overflow-wrap: anywhere; }

/* Receipt & reveal */
.stamp { display: inline-block; margin-bottom: 1.2rem; padding: .35rem 1.1rem; border: 3px double var(--red); border-radius: 4px; color: var(--red); font: 800 1.1rem var(--mono); letter-spacing: .3em; transform: rotate(-6deg); animation: stamp .5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes stamp { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } }
.seal { display: grid; place-items: center; width: 5.5rem; height: 5.5rem; margin: 0 auto 1.2rem; border-radius: 50%; color: var(--cream); font-size: 2.2rem; background: radial-gradient(circle at 35% 30%, #e24b32, var(--red) 55%, #86190c); box-shadow: 0 8px 14px -6px rgba(134,25,12,.7), inset 0 -4px 8px rgba(0,0,0,.25); }
.wishlist { margin: 0; padding: 0; list-style: none; counter-reset: w; display: grid; gap: .7rem; }
.wishlist li { counter-increment: w; display: flex; gap: .8rem; align-items: baseline; font-size: 1.1rem; }
.wishlist li::before { content: counter(w); flex: none; font: 800 1.6rem/1 var(--display); color: var(--orange); }
.avoid { margin-top: 1.2rem; padding: .8rem 1rem; background: #fde9e4; border-left: 4px solid var(--red); border-radius: 4px; }
.envelope-card { background: var(--cream); border: 2px dashed #c4b184; }
.envelope-card address { margin-bottom: 1.2rem; font-size: 1.25rem; line-height: 1.55; }
.stamp-sq { position: absolute; top: 1.6rem; right: 1.2rem; display: grid; place-items: center; width: 3.8rem; height: 4.4rem; background: #fff; border: 2px dashed var(--orange); font-size: 1.8rem; transform: rotate(4deg); }

/* Footer & toast */
.foot { padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom)); background: var(--ever-950); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.foot img { height: 1.8rem; width: auto; }
.foot p { margin: 0; font-size: .88rem; color: rgba(246,239,223,.65); max-width: 38rem; }
#toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 60; max-width: min(92vw, 28rem); padding: .8rem 1.3rem; border-radius: 12px; background: var(--ever-900); color: var(--cream); font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transform: translate(-50%, 1rem); transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--err); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 28rem; margin: .5rem auto 1.5rem; }
  .route { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap { width: min(100% - 1.75rem, 70rem); }
  .brand-sub { display: none; }
  .route, .row2 { grid-template-columns: 1fr; }
  .steps .t { font-size: .64rem; letter-spacing: .04em; }
  .steps li { gap: .35rem; }
  .actions .btn { flex: 1 1 auto; }
  .cta-row .btn { flex: 1 1 100%; }
  .copyrow { flex-wrap: wrap; }
  .tags { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
