/* Sorto. Components follow the Sorto Design System's components/bundle.css, adapted to the site's markup. */

/* @font-face rules (self-hosted, SIL Open Font License) */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-ext-98740c.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-d4c6b2.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-ext-0fa996.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-16709f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/fonts/familjen-grotesk-latin-ext-330ebc.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 600 700; font-display: swap; src: url("/fonts/familjen-grotesk-latin-c2c51a.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/kalam-latin-ext-9048a2.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/kalam-latin-794c16.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/kalam-latin-ext-b85fae.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Kalam"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/kalam-latin-9c682b.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Colours, fonts, spacing, radius, shadows and tilt come from /tokens.css, built from design/tokens.json. */

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 17px/1.5 var(--font-body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
}
main { flex: 1; width: 100%; padding-bottom: 56px; }
p { margin: 0; }
a { color: var(--bic); }
a:hover { color: var(--bic-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-left: max(var(--space-5), env(safe-area-inset-left)); padding-right: max(var(--space-5), env(safe-area-inset-right)); }
.wrap.wide { max-width: 1120px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.center { text-align: center; }

h1, h2, h3, .h1, .h2, .h3 { font-family: var(--font-display); font-weight: 700; margin: 0; text-wrap: balance; }
.h1, h1 { font-size: clamp(38px, 10vw, 58px); line-height: 1.02; letter-spacing: -0.035em; }
.h2, h2 { font-size: 27px; line-height: 1.1; letter-spacing: -0.02em; }
.h3, h3 { font-size: 19px; line-height: 1.2; letter-spacing: -0.01em; }
.hand { font-family: var(--font-hand); color: var(--bic); }
.hint { font-size: 14px; line-height: 1.45; color: var(--muted); }
.small { font-size: 13px; }
.soft { color: var(--night-soft); }
.lead { font-size: 18px; line-height: 1.45; }
.mark { background: var(--gold); color: #1a1d2b; padding: 0 6px; border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.squiggle { position: relative; display: inline-block; padding-bottom: 10px; }
.squiggle::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--bic);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10'><path d='M1 6c5-5 10 5 15 0s10-5 15 0 10 5 15 0 10-5 13 0' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/></svg>") left center / 36px 8px repeat-x;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 10'><path d='M1 6c5-5 10 5 15 0s10-5 15 0 10 5 15 0 10-5 13 0' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'/></svg>") left center / 36px 8px repeat-x; }

/* ---------- bands: night (December ground) and paper ---------- */

.band { position: relative; overflow: hidden; }
.night { background: var(--night); color: var(--night-ink); }
.night a { color: var(--night-ink); }
.night .hint { color: var(--night-soft); }
.night .hand { color: var(--night-ink); }
.night .slip .hand, .night .slip a { color: var(--bic); }
.band.night { padding-bottom: 28px; }
/* The night ground stops 150px early, so the bottom of the hero (the form on home) lies on the paper. */
.band.night.lifted { background: linear-gradient(var(--night) calc(100% - 150px), transparent calc(100% - 150px)); padding-bottom: 0; }

.top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 27px/1 var(--font-display); letter-spacing: -0.035em; color: var(--bic); text-decoration: none; text-transform: lowercase; }
.night .logo { color: var(--night-ink); }
.logo-mark { width: 32px; height: 32px; flex: none; background: url("/favicon.svg") center / contain no-repeat; }
.lang { font: 700 13px/1 var(--font-display); letter-spacing: .08em; color: inherit; text-decoration: none; border: 1.5px solid currentColor; border-radius: var(--radius-pill); padding: 8px 11px; }
.hero { position: relative; display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.home-text > .chip { align-self: flex-start; }
.hero > .confetti { left: 50%; }
.hero .lead { color: var(--night-soft); }

.foot { margin-top: auto; padding-bottom: max(26px, env(safe-area-inset-bottom)); }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 18px; font-size: 15px; }
.foot-inner p { color: var(--night-soft); }
.foot-links { display: flex; gap: 18px; }

/* Paper chain garland */
.chain { display: flex; align-items: center; height: 30px; padding-left: 4px; overflow: hidden; transform: rotate(var(--tilt-chain)); margin: -2px -6px 0; }
.chain i { flex: none; width: 32px; height: 16px; border: 5px solid var(--holly); border-radius: 9px; margin-left: -7px; }
.chain i:nth-child(4n+2) { border-color: var(--gold); width: 14px; height: 26px; }
.chain i:nth-child(4n+3) { border-color: var(--pine-light); }
.chain i:nth-child(4n) { border-color: var(--night-ink); width: 14px; height: 26px; }
.band:not(.night) .chain i:nth-child(4n) { border-color: var(--bic); }

/* Progress chain on the organiser page: one link per person */
.chain-progress { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; padding-left: 8px; min-height: 34px; }
.chain-progress i { flex: none; width: 40px; height: 18px; border: 6px solid var(--holly); border-radius: 10px; margin-left: -8px; }
.chain-progress i:nth-child(even) { width: 16px; height: 30px; }
.chain-progress i:nth-child(4n+2) { border-color: var(--gold); }
.chain-progress i:nth-child(4n+3) { border-color: var(--pine-light); }
.chain-progress i:nth-child(4n) { border-color: var(--bic); }
.chain-progress i.empty { border: 3px dashed var(--chain-empty); margin-left: -6px; }

/* Cut-paper snowflakes */
.flakes { position: absolute; inset: 0; pointer-events: none; }
.flakes span { position: absolute; width: 34px; height: 34px; background: var(--night-ink); opacity: .92;
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'><defs><path id='a' d='M-4 2V-38l4-8 4 8V2z M0-20l-13-11 3-4 10 9 10-9 3 4z M0-6l-9-7 3-3 6 5 6-5 3 3z'/></defs><use href='%23a'/><use href='%23a' transform='rotate(60)'/><use href='%23a' transform='rotate(120)'/><use href='%23a' transform='rotate(180)'/><use href='%23a' transform='rotate(240)'/><use href='%23a' transform='rotate(300)'/><circle r='9'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'><defs><path id='a' d='M-4 2V-38l4-8 4 8V2z M0-20l-13-11 3-4 10 9 10-9 3 4z M0-6l-9-7 3-3 6 5 6-5 3 3z'/></defs><use href='%23a'/><use href='%23a' transform='rotate(60)'/><use href='%23a' transform='rotate(120)'/><use href='%23a' transform='rotate(180)'/><use href='%23a' transform='rotate(240)'/><use href='%23a' transform='rotate(300)'/><circle r='9'/></svg>") center / contain no-repeat; }
.flakes span:nth-child(1) { left: 3%; top: 42%; width: 30px; height: 30px; transform: rotate(10deg); }
.flakes span:nth-child(2) { left: 88%; top: 46%; width: 40px; height: 40px; transform: rotate(-14deg); }
.flakes span:nth-child(3) { left: 66%; top: 34%; width: 20px; height: 20px; }
.flakes span:nth-child(4) { left: 91%; top: 58%; width: 28px; height: 28px; transform: rotate(20deg); }
.flakes span:nth-child(5) { left: 6%; top: 76%; width: 36px; height: 36px; transform: rotate(-8deg); }
.flakes span:nth-child(6) { left: 48%; top: 88%; width: 22px; height: 22px; }
.flakes span:nth-child(7) { left: 78%; top: 84%; width: 32px; height: 32px; transform: rotate(16deg); }
.flakes span:nth-child(8) { left: 60%; top: 70%; width: 18px; height: 18px; }

/* Torn-paper confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti span { position: absolute; width: 10px; height: 16px; background: var(--holly); clip-path: polygon(0 8%, 100% 0, 92% 100%, 6% 90%); }
.confetti span:nth-child(3n+2) { background: var(--gold); width: 14px; height: 9px; }
.confetti span:nth-child(3n) { background: var(--bic); }
.confetti span:nth-child(5n) { background: var(--pine-light); }
.night .confetti span:nth-child(3n) { background: var(--night-ink); }
.confetti span:nth-child(1) { left: 8%; top: 6%; transform: rotate(20deg); }
.confetti span:nth-child(2) { left: 22%; top: 14%; transform: rotate(-30deg); }
.confetti span:nth-child(3) { left: 38%; top: 4%; transform: rotate(50deg); }
.confetti span:nth-child(4) { left: 55%; top: 12%; transform: rotate(-12deg); }
.confetti span:nth-child(5) { left: 70%; top: 6%; transform: rotate(35deg); }
.confetti span:nth-child(6) { left: 86%; top: 15%; transform: rotate(-45deg); }
.confetti span:nth-child(7) { left: 14%; top: 26%; transform: rotate(70deg); }
.confetti span:nth-child(8) { left: 32%; top: 22%; transform: rotate(10deg); }
.confetti span:nth-child(9) { left: 63%; top: 24%; transform: rotate(-60deg); }
.confetti span:nth-child(10) { left: 80%; top: 28%; transform: rotate(25deg); }
.confetti span:nth-child(11) { left: 4%; top: 40%; transform: rotate(-20deg); }
.confetti span:nth-child(12) { left: 93%; top: 42%; transform: rotate(40deg); }
.confetti span:nth-child(13) { left: 47%; top: 32%; transform: rotate(-35deg); }
.confetti span:nth-child(14) { left: 26%; top: 38%; transform: rotate(55deg); }

/* ---------- paper ---------- */

.slip-w { position: relative; display: block; filter: drop-shadow(var(--shadow-slip)); }
.slip {
  position: relative; display: block; background-color: var(--surface);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
  clip-path: polygon(0% 6px, 5% 2px, 11% 5px, 18% 0, 25% 4px, 32% 1px, 40% 5px, 47% 0, 55% 4px, 62% 1px, 70% 5px, 77% 0, 85% 4px, 92% 1px, 100% 5px, 100% 100%, 0% 100%);
  padding: 24px 16px 18px 34px;
  color: var(--ink);
}
.slip::before { content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 1.5px; background: var(--margin); }
.slip.plain { padding-left: 16px; }
.slip.plain::before { display: none; }
.slip.taken { background-color: var(--taken-bg); }
.tape { position: absolute; z-index: 2; top: -9px; left: 50%; width: 64px; height: 20px; margin-left: -32px; background: var(--tape-gold); transform: rotate(var(--tilt-tape)); clip-path: polygon(3% 0, 97% 6%, 100% 100%, 0 94%); }
.tape.kraft { background: var(--tape-kraft); transform: rotate(calc(var(--tilt-tape) * -0.8)); }
.tape.red { background: var(--tape-red); transform: rotate(calc(var(--tilt-tape) * 0.5)); }
.sheet {
  position: relative; background-color: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-xl);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px; box-shadow: var(--shadow-sheet);
  padding: 22px 20px 24px;
  color: var(--ink);
}
.night .sheet .hint, .night .slip .hint { color: var(--muted); }
.night .sheet a { color: var(--bic); }
.lined { background-color: var(--surface); background-image: linear-gradient(transparent 31px, var(--grid) 31px); background-size: 100% 32px; background-position: 0 14px; }
.margin-line { position: relative; }
.margin-line::before { content: ""; position: absolute; top: 0; bottom: 0; left: 26px; width: 1.5px; background: var(--margin); z-index: 1; pointer-events: none; }
.sticky { position: relative; background: var(--gold); color: #1a1d2b; padding: 18px; transform: rotate(var(--tilt-sticky)); box-shadow: var(--shadow-sticky); }
.sticky.green { background: var(--done-bg); color: var(--done-ink); }
.kraftcard { position: relative; background: var(--kraft); color: #1a1d2b; border-radius: var(--radius-sm); padding: 22px 20px; transform: rotate(0.6deg); }
.kraftcard a, .kraftcard .hint { color: var(--kraft-ink); }

/* Gift tag with a string, for links people copy */
.tag-wrap { position: relative; margin-left: 30px; }
.tag-string { position: absolute; left: -36px; top: 50%; width: 48px; height: 2px; background: var(--holly); transform: rotate(-14deg); }
.tag { position: relative; display: flex; align-items: center; gap: 8px; background: var(--kraft); color: #1a1d2b; clip-path: polygon(30px 0, 100% 0, 100% 100%, 30px 100%, 0 50%); padding: 12px 14px 12px 46px; transform: rotate(-1.5deg); }
.tag::before { content: ""; position: absolute; left: 18px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px rgba(26, 29, 43, .35); }
.night .tag::before { background: var(--night); }
.tag input { flex: 1; min-width: 0; border: 0; background: transparent; color: #1a1d2b; font: 600 15px/1.2 ui-monospace, "SF Mono", Menlo, monospace; padding: 6px 0; text-overflow: ellipsis; }
.tag input:focus { outline: none; }

/* Stamp */
.stamp { display: inline-grid; place-items: center; text-align: center; border: 3px solid var(--holly); color: var(--holly); font: 700 13px/1.1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; padding: 8px 12px; border-radius: 8px; transform: rotate(var(--tilt-stamp)); background: var(--surface); }
.stamp.round { width: 112px; height: 112px; border-radius: 50%; box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 6px var(--holly); padding: 14px; letter-spacing: .06em; }
.stamp.gold { border-color: var(--gold); color: var(--gold); background: transparent; box-shadow: inset 0 0 0 4px var(--night), inset 0 0 0 6px var(--gold); width: 104px; height: 104px; font-size: 11px; letter-spacing: .02em; }

/* ---------- controls ---------- */

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 var(--space-5); border: 0; border-radius: var(--radius-lg); font: 700 18px/1 var(--font-display); letter-spacing: -0.01em; text-decoration: none; cursor: pointer; text-align: center; }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn[hidden] { display: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-holly, .btn-holly:hover { background: var(--holly); color: #ffffff; box-shadow: var(--shadow-press-holly); }
.btn-bic, .btn-bic:hover { background: var(--bic); color: var(--surface); box-shadow: var(--shadow-press-bic); }
.btn-wa, .btn-wa:hover { background: var(--wa); color: #ffffff; box-shadow: var(--shadow-press-wa); }
.btn-paper, .btn-paper:hover { background: var(--surface); color: var(--ink); border: 2px solid var(--ink); box-shadow: var(--shadow-press-paper); }
.btn-ghost { background: transparent; color: inherit; border: 2px solid currentColor; }
.night .btn-ghost { color: var(--night-ink); }
.btn-text { background: none; color: var(--holly); min-height: 44px; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; }
.btn-small { min-height: 44px; font-size: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); border: 1.5px solid var(--ink); font: 700 14px/1 var(--font-display); white-space: nowrap; }
.chip.gold { background: var(--gold); border-color: var(--gold); color: #1a1d2b; }
.night .chip.ghost { background: transparent; color: var(--night-ink); border-color: var(--night-ink); }
.night .slip .chip.ghost { color: var(--ink); border-color: var(--ink); }
button.chip { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; font: 700 13px/1 var(--font-display); padding: 6px 10px; border-radius: var(--radius-pill); }
.pill.done { background: var(--done-bg); color: var(--done-ink); }
.pill.wait { background: var(--wait-bg); color: var(--muted); }

.label { display: block; font: 700 17px/1.2 var(--font-display); margin: 0 0 8px; }
.input, .field input[type="text"], .field input[type="date"], .field select {
  display: block; width: 100%; border: 2px solid var(--ink); border-radius: var(--radius-md); background: var(--surface);
  padding: 12px 14px; font: 17px/1.4 var(--font-body); color: var(--ink);
}
textarea.input { resize: vertical; }
.input.handwritten { font: 400 23px/1.32 var(--font-hand); color: var(--bic); }
.input::placeholder { color: var(--taken-ink); }
.field + .field, .field + .fold, .fold + .fold { margin-top: 20px; }
.field .hint { margin-top: 8px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 400px) { .row { grid-template-columns: minmax(0, 1fr); } }

/* Optional parts of the form */
.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 14px; background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius-md); font: 600 16px/1.2 var(--font-display); color: var(--ink); cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: "+"; font: 700 22px/1 var(--font-display); color: var(--bic); }
.fold[open] > summary::after { content: "−"; }
.fold-body { display: flex; flex-direction: column; gap: 12px; padding: 14px 2px 2px; }
.pair-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.pair-picker[hidden] { display: none; }
.pair-picker .btn { grid-column: 1 / -1; }
.create .btn-holly { margin-top: 24px; }

/* Honeypot: off-screen instead of display:none, so bots that skip hidden fields still see it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Doodles in ballpoint (masks, so they take a token colour) */
.doodle { display: inline-block; flex: none; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; pointer-events: none; }
.d-star { width: 36px; height: 36px; background: var(--bic);
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><path d='M20 4l4.5 11.5L37 16l-9.8 7.6L30.5 36 20 28.8 9.5 36l3.3-12.4L3 16l12.5-.5z' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'><path d='M20 4l4.5 11.5L37 16l-9.8 7.6L30.5 36 20 28.8 9.5 36l3.3-12.4L3 16l12.5-.5z' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'/></svg>"); }
.d-arrow { width: 64px; height: 48px; background: var(--bic);
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 60'><path d='M6 8c20 2 44 10 56 38' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/><path d='M50 40l12 8 4-14' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 60'><path d='M6 8c20 2 44 10 56 38' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/><path d='M50 40l12 8 4-14' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.night .d-arrow { background: var(--night-ink); }
.d-heart { width: 30px; height: 28px; background: var(--holly);
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 30'><path d='M16 27C6 20 2 14 3 9s7-7 10-3l3 4 3-4c3-4 9-2 10 3s-3 11-13 18z' fill='none' stroke='black' stroke-width='2.4' stroke-linejoin='round'/></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 30'><path d='M16 27C6 20 2 14 3 9s7-7 10-3l3 4 3-4c3-4 9-2 10 3s-3 11-13 18z' fill='none' stroke='black' stroke-width='2.4' stroke-linejoin='round'/></svg>"); }
.check { display: inline-block; width: 24px; height: 24px; flex: none; background: var(--bic);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path d='M4 16c4 3 6 6 8 9 4-9 9-15 15-21' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path d='M4 16c4 3 6 6 8 9 4-9 9-15 15-21' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat; }
.strike { position: relative; }
.strike::after { content: ""; position: absolute; left: -6px; right: -6px; top: 52%; height: 3px; background: var(--bic); border-radius: 2px; transform: rotate(-5deg); }

/* A present, drawn in paper */
.present { position: relative; width: 170px; height: 130px; margin: 0 auto; }
.present .body { position: absolute; left: 10px; right: 10px; bottom: 0; height: 96px; background: var(--holly); border-radius: 6px; }
.present .lid { position: absolute; left: 0; right: 0; bottom: 92px; height: 30px; background: var(--holly-light); border-radius: 6px; transform: translate(-26px, -34px) rotate(-20deg); }
.present .rib { position: absolute; left: 50%; width: 22px; margin-left: -11px; bottom: 0; height: 96px; background: var(--gold); }
.present .lid::after { content: ""; position: absolute; left: 50%; width: 22px; margin-left: -11px; top: 0; bottom: 0; background: var(--gold); }

/* ---------- sections ---------- */

.section { padding-top: 56px; display: flex; flex-direction: column; gap: 22px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.steps li:nth-child(1) { transform: rotate(-1.5deg); }
.steps li:nth-child(2) { transform: rotate(1.2deg); }
.steps li:nth-child(3) { transform: rotate(-1deg); }
.steps li:nth-child(1) .tape { left: 20%; }
.steps li:nth-child(2) .tape { left: 80%; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 10px; }
.step-n { grid-row: span 2; font: 700 40px/1 var(--font-hand); color: var(--bic); }

.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 10px 12px; border-radius: 16px; font-size: 16px; line-height: 1.4; background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--bic-tint); border-color: var(--bic-tint); border-bottom-right-radius: 4px; font: 400 19px/1.3 var(--font-hand); }
.bubble.them { border-bottom-left-radius: 4px; }
.code { display: block; background: rgba(255, 255, 255, .55); border-radius: var(--radius-sm); padding: 8px 10px; font: 13px/1.4 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; color: #1a1d2b; }
.ai-tech { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }

.keep { position: relative; }
.keep .stamp { position: absolute; right: 0; top: 40px; }
.keep h2, .keep .checks { max-width: calc(100% - 130px); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checks li { display: flex; gap: 10px; }

.faq-item { border-bottom: 1.5px dashed var(--line); }
.faq-item summary { list-style: none; display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; font: 700 18px/1.3 var(--font-display); cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--bic); font-size: 22px; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 0 16px; color: var(--muted); }

/* Hero slips on home */
.fan { display: flex; justify-content: center; gap: 10px; padding-top: 22px; }
.fan .slip { width: 76px; height: 62px; padding-top: 18px; font: 700 24px/1 var(--font-hand); color: var(--bic); }
.fan .slip-w:nth-child(1) { transform: rotate(-8deg) translateY(6px); }
.fan .slip-w:nth-child(2) { transform: rotate(5deg); }
.fan .slip-w:nth-child(3) { transform: rotate(-3deg) translateY(10px); }
.fan .slip-w:nth-child(4) { transform: rotate(9deg) translateY(2px); }
.fan .slip-w:nth-child(4) .slip { text-align: center; font-size: 34px; padding-top: 12px; color: var(--holly); }
.fan .slip-w:nth-child(2) .tape { background: var(--tape-kraft); }
.fan .slip-w:nth-child(3) .tape { background: var(--tape-red); }
.create .d-star { position: absolute; right: -10px; top: -18px; transform: rotate(14deg); }
.form-error { margin-bottom: 20px; }
.form-error p:first-child { font: 700 17px/1.3 var(--font-display); }

/* Home: hero text and form; side by side on large screens */
.home-grid { display: flex; flex-direction: column; gap: 30px; }
.home-text h1 { font-size: clamp(40px, 11vw, 74px); }

/* The duplicate name gets a red circle, drawn on a layer behind the textarea with the same text. */
.names-box { position: relative; }
.mirror { position: absolute; inset: 0; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; overflow: hidden; pointer-events: none; }
.has-ring textarea { position: relative; background: transparent; }
.ringed { position: relative; }
.ringed::after { content: ""; position: absolute; inset: -8px -14px; pointer-events: none; background: var(--holly);
  -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 50' preserveAspectRatio='none'><path d='M10 28c2-16 40-22 70-20s34 14 30 22-30 14-62 12S6 36 12 22c4-8 18-12 30-13' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 50' preserveAspectRatio='none'><path d='M10 28c2-16 40-22 70-20s34 14 30 22-30 14-62 12S6 36 12 22c4-8 18-12 30-13' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/></svg>") center / 100% 100% no-repeat; }

@media (min-width: 960px) {
  .home-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .home-text { padding-top: 28px; gap: 22px; }
  .home-text .lead { font-size: 21px; max-width: 34ch; }
  .home-text .fan { justify-content: flex-start; gap: 16px; padding-top: 30px; }
  .home-text .fan .slip { width: 100px; height: 76px; padding-top: 22px; font-size: 30px; }
  .home-text .fan .slip-w:nth-child(4) .slip { font-size: 44px; padding-top: 14px; }
  .wide .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
  .wide .step { grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 190px; align-content: start; }
  .wide .step-n { grid-row: auto; font-size: 52px; }
  .duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .faq-list { columns: 2; column-gap: 56px; }
  .faq-item { break-inside: avoid; }
}

/* Shuffle screen while the draw is made */
.shuffle { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px; text-align: center; }
.shuffle[hidden] { display: none; }
.shuffle-stage { position: relative; width: 300px; height: 300px; }
.shuffle-stage .present { position: absolute; left: 65px; bottom: 0; }
.shuffle-stage .slip-w { position: absolute; }
.shuffle-stage .slip { width: 78px; height: 54px; padding-top: 14px; font: 700 22px/1 var(--font-hand); color: var(--bic); }
.shuffle-stage .slip-w:nth-child(1) { left: 10px; top: 40px; transform: rotate(-24deg); animation: float 1.6s ease-in-out infinite; }
.shuffle-stage .slip-w:nth-child(2) { left: 110px; top: 0; transform: rotate(8deg); animation: float 1.6s .3s ease-in-out infinite; }
.shuffle-stage .slip-w:nth-child(3) { left: 210px; top: 50px; transform: rotate(28deg); animation: float 1.6s .6s ease-in-out infinite; }
.shuffle-stage .slip-w:nth-child(4) { left: 50px; top: 130px; transform: rotate(14deg); animation: float 1.6s .9s ease-in-out infinite; }
.shuffle-stage .slip-w:nth-child(5) { left: 180px; top: 136px; transform: rotate(-16deg); animation: float 1.6s 1.2s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -14px; } }

/* ---------- organiser ---------- */

.share-hero { position: relative; }
.share-hero .stamp { position: absolute; right: 0; top: -4px; transform: rotate(12deg); }
.share-hero h1 { max-width: calc(100% - 110px); font-size: clamp(34px, 9vw, 46px); }
.share-message .slip { font: 400 21px/1.35 var(--font-hand); color: var(--bic); overflow-wrap: anywhere; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; border-bottom: 1.5px dashed var(--line); }
.status-row:last-child { border-bottom: 0; }
.status-row .who { font: 700 24px/1.1 var(--font-hand); color: var(--bic); overflow-wrap: anywhere; min-width: 0; }
.status-row form { display: flex; align-items: center; gap: 6px; flex: none; }
.release { border: 0; background: none; font: 600 14px/1 var(--font-display); color: var(--holly); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 0 4px; cursor: pointer; }
.progress p { font: 700 20px/1.2 var(--font-display); }
.danger { display: flex; flex-direction: column; gap: 10px; }
.danger form { display: contents; }
.deletes { padding-top: 32px; }
.notice { margin-top: 32px; }
.sheet > h3 { margin-bottom: 6px; }

/* ---------- pick, claim ---------- */

.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; padding-top: 6px; }
@media (min-width: 560px) { .names { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.names > * { text-decoration: none; }
.names > *:nth-child(4n+1) { transform: rotate(-2deg); }
.names > *:nth-child(4n+2) { transform: rotate(1.5deg); }
.names > *:nth-child(4n+3) { transform: rotate(1deg); }
.names > *:nth-child(4n) { transform: rotate(-1.5deg); }
.names > *:nth-child(3n+2) .tape { background: var(--tape-kraft); }
.names > *:nth-child(3n) .tape { background: var(--tape-red); }
.names .slip { min-height: 84px; display: flex; flex-direction: column; justify-content: center; padding-top: 22px; }
.names .n { font: 700 28px/1.05 var(--font-hand); color: var(--bic); overflow-wrap: anywhere; }
.names a:hover .slip { background-color: var(--bic-tint); }
.names .taken .n { color: var(--taken-ink); }
.names small { font: 600 12px/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.pick-title { display: flex; align-items: flex-end; gap: 6px; }
.pick-title .d-arrow { transform: rotate(18deg) scale(.8); }

.claim { display: flex; flex-direction: column; gap: 26px; padding-top: 32px; }
.claim .slip-w { align-self: center; width: min(100%, 300px); transform: rotate(-3deg); }
.claim .slip { padding: 34px 22px 30px 40px; }
.claim .slip-w > .tape + .tape { left: 72%; transform: rotate(8deg); }
.claim .lead-in { font: 700 22px/1.2 var(--font-display); }
.claim .big { font: 700 clamp(52px, 16vw, 76px)/1 var(--font-hand); color: var(--bic); overflow-wrap: anywhere; }
.claim .taken .big { color: var(--taken-ink); }
.claim .stamp { position: absolute; right: -6px; bottom: -14px; transform: rotate(-14deg); }
.claim .slip-w.is-taken { transform: rotate(3deg); }

/* ---------- your own slip ---------- */

.reveal { position: relative; border-radius: var(--radius-xl); }
.reveal > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 32px 0 8px; }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal > summary:focus-visible { outline-offset: 6px; }
.wrapped { position: relative; width: 270px; height: 200px; }
.wrapped .slip-w { position: absolute; inset: 20px 0 0 0; transform: rotate(-4deg); }
.wrapped .slip { height: 180px; padding: 0; }
.wrapped .rib-h, .wrapped .rib-v { position: absolute; background: var(--gold); }
.wrapped .rib-h { left: 0; right: 0; top: 50%; height: 26px; margin-top: -13px; }
.wrapped .rib-v { top: 0; bottom: 0; left: 50%; width: 26px; margin-left: -13px; }
.wrapped .loop { position: absolute; top: 0; width: 56px; height: 38px; border: 8px solid var(--gold); border-radius: 50%; }
.wrapped .loop:nth-of-type(1) { left: 76px; transform: rotate(-22deg); }
.wrapped .loop:nth-of-type(2) { right: 80px; transform: rotate(14deg); }
.wrapped .knot { position: absolute; left: 50%; top: 18px; width: 22px; height: 22px; margin-left: -9px; background: var(--gold-knot); border-radius: 6px; }
.open-me { display: flex; align-items: flex-start; gap: 4px; font: 700 28px/1.2 var(--font-hand); color: var(--night-ink); }
.open-me .d-arrow { transform: rotate(200deg) scale(.8); }
.drawn { width: 100%; }
.drawn .slip-w { transform: rotate(-2.5deg); }
.drawn .slip { padding: 34px 20px 26px 42px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.drawn .tape { left: 24%; }
.drawn .tape + .tape { left: 78%; transform: rotate(7deg); background: var(--tape-red); }
.drawn .label-in { font: 600 18px/1.3 var(--font-display); color: var(--muted); }
.drawn .name { font: 700 clamp(64px, 20vw, 104px)/.95 var(--font-hand); color: var(--bic); overflow-wrap: anywhere; transform: rotate(-3deg); transform-origin: left; }
.drawn .name .squiggle::after { height: 11px; -webkit-mask-size: 50px 11px; mask-size: 50px 11px; }
.drawn .d-heart { position: absolute; right: 26px; top: 82px; transform: rotate(12deg); }
.drawn .chips { margin-top: 14px; }
.hide-me { font: 600 14px/1 var(--font-display); color: var(--night-soft); text-decoration: underline; text-underline-offset: 3px; }
.reveal:not([open]) .drawn, .reveal:not([open]) .hide-me, .reveal:not([open]) .confetti,
.reveal[open] .wrapped, .reveal[open] .open-me, .reveal[open] .warn { display: none; }
.warn { text-align: center; }
.reveal[open] .drawn .slip-w { animation: unfold .45s ease-out; }
@keyframes unfold { from { transform: rotate(-8deg) scale(.85); opacity: 0; } }
.after-reveal { padding-top: 28px; }

.wish { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 22px/32px var(--font-hand); color: var(--ink); padding: 14px 16px 16px 40px; }
.wish a { font: 700 13px/1 var(--font-display); color: var(--bic); background: var(--bic-tint); border-radius: var(--radius-pill); padding: 4px 9px; text-decoration: none; vertical-align: 3px; white-space: nowrap; }
.wish-sheet { padding: 0; overflow: hidden; }
.wish-sheet textarea { display: block; width: 100%; min-height: 260px; border: 0; background: transparent; padding: 14px 16px 16px 40px; font: 400 22px/32px var(--font-hand); color: var(--bic); resize: vertical; }
.wish-sheet textarea:focus { outline: none; }
.wish-sheet:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.save-row { display: flex; align-items: center; gap: 14px; }
.save-row .btn { flex: 1; }
.save-row .stamp { transform: rotate(-8deg); font-size: 12px; }

/* ---------- dead ends ---------- */

.message { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 48px; text-align: center; }
.message .btn { max-width: 360px; }

.prose { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.prose h2 { font-size: 20px; margin-top: 16px; }

/* ---------- confirm sheet ---------- */

.confirm { width: 100%; max-width: 640px; margin: auto auto 0; border: 0; padding: 0; background: transparent; color: var(--ink); filter: drop-shadow(0 -6px 18px rgba(0, 0, 0, .25)); }
.confirm::backdrop { background: var(--scrim); }
.confirm .slip { padding: 40px 24px max(30px, env(safe-area-inset-bottom)) 46px; display: flex; flex-direction: column; gap: 18px; clip-path: polygon(0% 14px, 5% 4px, 11% 12px, 18% 0, 25% 10px, 32% 3px, 40% 12px, 47% 0, 55% 10px, 62% 3px, 70% 12px, 77% 0, 85% 10px, 92% 3px, 100% 12px, 100% 100%, 0% 100%); }
.confirm-text { font: 700 22px/1.3 var(--font-display); }
.confirm form { display: flex; flex-direction: column; gap: 10px; }

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