/* ------------------------------------------------------------------
   Risograph flyer.

   The whole page is printed in two spot inks on a paper stock. The three
   colours arrive as custom properties from the event's theme; everything
   below derives from them. --blend flips multiply/screen so the same
   overprint tricks work on both light and dark stock.
   ------------------------------------------------------------------ */

:root {
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", "Franklin Gothic Bold",
             "Roboto Condensed", "Liberation Sans Narrow", sans-serif;
  --mono: "Courier New", Courier, ui-monospace, monospace;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;

  --rule: 3px;
  --gutter: clamp(1.1rem, 5vw, 2.25rem);
  --measure: 40rem;

  --dot: color-mix(in srgb, var(--text) 8%, transparent);
  --quiet: color-mix(in srgb, var(--text) 60%, transparent);
  --hairline: color-mix(in srgb, var(--text) 25%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--stock);
  /* The halftone screen a riso print leaves behind. */
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 4px 4px;
  overflow-x: hidden;
}

/* Paper grain, laid over everything and never in the way. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .42;
  mix-blend-mode: var(--blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ layout */

.flyer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(1.5rem, 6vw, 3.5rem) var(--gutter) 4rem;
}

section { margin: clamp(2.25rem, 7vw, 3.25rem) 0; }

/* ------------------------------------------------------------- typography */

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .74rem;
  margin: 0;
  color: var(--quiet);
}

/* The signature: the title printed twice, one ink slightly out of
   register with the other. */
.title {
  position: relative;
  margin: .12em 0 .24em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 14.5vw, 6.75rem);
  line-height: .84;
  letter-spacing: -.015em;
  text-transform: uppercase;
  color: var(--ink-a);
  overflow-wrap: break-word;
}

.title::after {
  content: attr(data-title);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  color: var(--ink-b);
  transform: translate(.035em, .022em);
  mix-blend-mode: var(--blend);
  pointer-events: none;
}

.tagline {
  font-family: var(--mono);
  font-size: 1rem;
  margin: 0;
  padding-left: 1.6rem;
  position: relative;
}
.tagline::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 1.1rem;
  height: 2px;
  background: var(--ink-b);
}

/* The billing. On a gig flyer the support act gets its own credit line, set
   large and centred between two rules. */
.billing {
  margin: 1.75rem 0 0;
  padding: .9rem 0;
  border-top: 2px solid var(--ink-b);
  border-bottom: 2px solid var(--ink-b);
  text-align: center;
  display: grid;
  gap: .85rem;
}
/* Two credits sit side by side once there is room; on a phone they stack, and
   a hairline keeps them from reading as one run-on line. */
@media (min-width: 34rem) {
  .billing { grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; }
  .credit + .credit { border-left: 1px solid var(--hairline); }
}
.credit { margin: 0; padding: 0 .6rem; }
.billing-label {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .68rem;
  color: var(--quiet);
  margin-bottom: .3rem;
}
.billing-names {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  line-height: 1.02;
  text-transform: uppercase;
  color: var(--ink-a);
  overflow-wrap: break-word;
}

.section-head {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 5.5vw, 2.1rem);
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
  display: flex;
  align-items: baseline;
  gap: .6rem;
}

.subhead {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .74rem;
  color: var(--quiet);
  margin: 1.5rem 0 .6rem;
}

.tally {
  font-family: var(--mono);
  font-size: .95rem;
  letter-spacing: 0;
  background: var(--ink-a);
  color: var(--stock);
  padding: .1rem .5rem;
}

a { color: var(--ink-b); text-underline-offset: .18em; }
a:hover { color: var(--ink-a); }

/* ------------------------------------------------------------------ cover */

.cover {
  position: relative;
  margin: 0 0 1.75rem;
  background: var(--ink-a);
  border: var(--rule) solid var(--text);
}
.cover img {
  display: block;
  width: 100%;
  /* A portrait photo would otherwise eat the entire first screen before the
     title has a chance to land. */
  max-height: 42vh;
  object-fit: cover;
  /* Greyscale the photo, then let the ink beneath show through: a duotone
     without touching the bytes. */
  filter: grayscale(1) contrast(1.22) brightness(1.06);
  mix-blend-mode: var(--blend);
}

.tape {
  position: absolute;
  width: 5.5rem;
  height: 1.5rem;
  background: color-mix(in srgb, var(--text) 13%, transparent);
  border-left: 1px dashed color-mix(in srgb, var(--text) 22%, transparent);
  border-right: 1px dashed color-mix(in srgb, var(--text) 22%, transparent);
}
.tape-l { top: -.75rem; left: -1.1rem; transform: rotate(-8deg); }
.tape-r { bottom: -.75rem; right: -1.1rem; transform: rotate(-5deg); }

/* ----------------------------------------------------------------- vitals */

.vitals {
  display: grid;
  gap: 1.15rem;
  padding: 1.25rem 0;
  border-top: var(--rule) solid var(--text);
  border-bottom: var(--rule) solid var(--text);
  margin: 0;
}
/* Two columns only once there is genuinely room; below this the date wraps
   and orphans its last word. */
@media (min-width: 40rem) {
  .vitals { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

.vital-label {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .7rem;
  color: var(--quiet);
  margin-bottom: .3rem;
}
.vital-value {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.25rem, 4.6vw, 1.45rem);
  line-height: 1.08;
  text-transform: uppercase;
  text-wrap: balance;
}
.vital-sub {
  display: block;
  font-family: var(--mono);
  font-size: .95rem;
  margin-top: .2rem;
}

.countdown {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .8rem;
  text-align: center;
  color: var(--quiet);
  margin: 1.5rem 0 0;
}
.countdown-value { color: var(--ink-a); font-weight: 700; }

.about p { margin: 0 0 1rem; }
.about p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- rsvp */

.rsvp { position: relative; }

.stamp {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: .55rem 1.15rem;
  border: 4px double var(--ink-a);
  color: var(--ink-a);
  transform: rotate(-6deg);
  text-align: center;
  animation: thunk .4s cubic-bezier(.2, 1.5, .4, 1) both;
}
.stamp-word {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.stamp-name {
  display: block;
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  margin-top: .2rem;
}
.stamp-no, .stamp-waitlist { border-color: var(--quiet); color: var(--quiet); }

@keyframes thunk {
  0%   { transform: rotate(-6deg) scale(2.3); opacity: 0; }
  55%  { opacity: 1; }
  100% { transform: rotate(-6deg) scale(1); opacity: 1; }
}

.answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  border: 0;
  padding: 0;
  margin: 0 0 1.35rem;
}
.answer input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
}
.answer span {
  display: block;
  padding: 1rem .4rem;
  text-align: center;
  border: 2.5px solid var(--text);
  background: var(--stock);
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.answer input:checked + span {
  background: var(--ink-a);
  color: var(--stock);
  box-shadow: inset 0 0 0 3px var(--stock), inset 0 0 0 5.5px var(--ink-a);
}
.answer input:focus-visible + span {
  outline: 3px solid var(--ink-b);
  outline-offset: 2px;
}

.field { margin: 0 0 1rem; }
.field label {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .7rem;
  margin-bottom: .35rem;
}
.hint { text-transform: none; letter-spacing: 0; color: var(--quiet); }

input[type="text"], input[type="email"], input[type="password"],
input[type="datetime-local"], input[type="number"], input:not([type]),
select, textarea {
  width: 100%;
  font: inherit;
  padding: .72rem .8rem;
  color: var(--text);
  background: var(--stock);
  border: 2.5px solid var(--text);
  border-radius: 0;
  appearance: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--ink-b);
  outline-offset: 1px;
}
::placeholder { color: var(--quiet); opacity: 1; }

.capacity {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--quiet);
  margin: 1rem 0 0;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .8rem 1.35rem;
  color: var(--text);
  background: var(--stock);
  border: 2.5px solid var(--text);
  box-shadow: 4px 4px 0 var(--ink-b);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink-b); color: var(--text); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink-b); }
.btn:focus-visible { outline: 3px solid var(--ink-b); outline-offset: 3px; }

.btn-primary { background: var(--ink-a); color: var(--stock); }
.btn-primary:hover { color: var(--stock); }
.btn-ghost { box-shadow: none; border-width: 2px; padding: .6rem 1rem; font-size: .92rem; }
.btn-ghost:hover { box-shadow: 3px 3px 0 var(--ink-b); }
.btn-danger { border-color: var(--ink-a); color: var(--ink-a); box-shadow: 4px 4px 0 var(--ink-a); }

.calendar { display: flex; flex-wrap: wrap; gap: .6rem; }

.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ----------------------------------------------------------------- guests */

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .7rem .3rem .3rem;
  border: 2px solid var(--text);
  background: var(--stock);
  font-size: .95rem;
}
.chip-initial {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink-a);
  color: var(--stock);
  font-family: var(--display);
  font-size: .92rem;
}
.chip-plus { font-family: var(--mono); font-size: .78rem; color: var(--quiet); }
.chip-maybe .chip-initial { background: var(--ink-b); }
.chip-waitlist .chip-initial { background: var(--ink-b); }
.chip-no { border-color: var(--hairline); color: var(--quiet); }
.chip-no .chip-initial { background: var(--hairline); color: var(--text); }

.notes {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: .95rem;
}
.notes li {
  padding: .4rem 0 .4rem .9rem;
  border-left: 3px solid var(--ink-b);
  margin-bottom: .4rem;
}

/* ------------------------------------------------------------------- talk */

.thread { list-style: none; margin: 0 0 1.75rem; padding: 0; }

.post {
  padding: .7rem 0 .7rem 1rem;
  border-left: 3px solid var(--ink-b);
  margin-bottom: .85rem;
}
.post-meta {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 0 0 .2rem;
  color: var(--quiet);
}
.post-meta strong { color: var(--text); }
.post-body { margin: 0; overflow-wrap: break-word; }

.comment-form .btn, .upload .btn { margin-top: .25rem; }
.upload { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.25rem; }
.upload input[name="caption"] { flex: 1 1 12rem; width: auto; }

/* ----------------------------------------------------------------- photos */

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: .7rem;
}
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--text);
}
.caption { font-family: var(--mono); font-size: .72rem; margin: .3rem 0 0; color: var(--quiet); }

/* ----------------------------------------------------------------- banners */

.banner {
  margin: 0 0 1.5rem;
  padding: .8rem 1rem;
  border: 2.5px solid var(--text);
  background: var(--stock);
  font-family: var(--mono);
  font-size: .88rem;
  box-shadow: 4px 4px 0 var(--ink-b);
}
.banner-loud { border-color: var(--ink-a); box-shadow: 4px 4px 0 var(--ink-a); }

.empty { font-family: var(--mono); font-size: .9rem; color: var(--quiet); }

/* ------------------------------------------------------------------ tables */

.roster { width: 100%; border-collapse: collapse; font-size: .95rem; }
.roster th, .roster td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--hairline); }
.roster th {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .68rem;
  color: var(--quiet);
}
.roster td form { display: inline; }

.stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.stat-value { display: block; font-family: var(--display); font-size: 2.4rem; line-height: 1; color: var(--ink-a); }
.stat-label {
  display: block;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .68rem;
  color: var(--quiet);
}

.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.card {
  display: block;
  padding: 1rem 1.1rem;
  border: 2.5px solid var(--text);
  background: var(--stock);
  text-decoration: none;
  color: var(--text);
  box-shadow: 4px 4px 0 var(--ink-b);
  transition: transform .08s ease, box-shadow .08s ease;
}
.card:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink-b); color: var(--text); }
.card-title { font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; line-height: 1.05; display: block; }
.card-meta { font-family: var(--mono); font-size: .78rem; color: var(--quiet); }

.pill {
  font-family: var(--mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: .1rem .45rem;
  border: 1.5px solid var(--quiet);
  color: var(--quiet);
}
.pill-live { border-color: var(--ink-a); color: var(--ink-a); }

.share-line {
  font-family: var(--mono);
  font-size: .82rem;
  word-break: break-all;
  padding: .7rem .8rem;
  border: 2px dashed var(--hairline);
  margin: 0 0 1rem;
}

fieldset.group {
  border: 2px solid var(--hairline);
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
}
fieldset.group legend {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .7rem;
  padding: 0 .4rem;
}
.row { display: grid; gap: 1rem; }
@media (min-width: 40rem) { .row-2 { grid-template-columns: 1fr 1fr; } }

.check { display: flex; align-items: center; gap: .55rem; margin-bottom: .6rem; font-size: .95rem; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--ink-a); }
.check label { font: inherit; text-transform: none; letter-spacing: 0; margin: 0; }

.themes { display: flex; flex-wrap: wrap; gap: .5rem; }
.theme-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-swatch span {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  border: 2px solid var(--hairline);
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
}
.theme-swatch input:checked + span { border-color: var(--text); box-shadow: 3px 3px 0 var(--ink-b); }
.theme-swatch input:focus-visible + span { outline: 3px solid var(--ink-b); outline-offset: 2px; }
.swatch-dot { width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid var(--text); }

/* ----------------------------------------------------------------- footer */

.footer {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding: 1.5rem var(--gutter) 3rem;
  border-top: 2px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.footer-mark { color: var(--ink-a); }
.inline { display: inline; }
.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--ink-b);
  text-decoration: underline;
  cursor: pointer;
}
.host-strip { font-family: var(--mono); font-size: .8rem; }

/* ------------------------------------------------------------------ utils */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.stack > * + * { margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ------------------------------------------------------------------
   Spellbook.

   The one theme that overrides the press: the flyer becomes a letter
   on aged parchment, the display face turns calligraphic, and the RSVP
   lands as a wax seal instead of a rubber stamp.
   ------------------------------------------------------------------ */

[data-theme="spellbook"] {
  /* Luminari and Trattatello ship with macOS and carry the fantasy
     register; Georgia is the honest fallback everywhere else. */
  --display: Luminari, Trattatello, Herculanum, "Baskerville Old Face",
             Baskerville, "Palatino Linotype", Palatino, Georgia, serif;
  --seal: #5E1F3F;
  --seal-light: #8B3A62;
  --gild: #C9A227;
}

/* Foxing and water stains, so the stock reads as old paper. */
[data-theme="spellbook"] body {
  background-image:
    radial-gradient(ellipse at 12% 8%, rgba(150, 110, 50, .12), transparent 42%),
    radial-gradient(ellipse at 88% 26%, rgba(120, 80, 40, .10), transparent 38%),
    radial-gradient(ellipse at 44% 72%, rgba(140, 100, 45, .09), transparent 46%),
    radial-gradient(ellipse at 70% 96%, rgba(110, 75, 35, .08), transparent 40%),
    radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 4px 4px;
}

/* A serif at display size needs more room to breathe than Impact does, and it
   is far wider per character — at 11vw a word like "Diagonalley" overflowed the
   measure and broke mid-word. */
[data-theme="spellbook"] .title {
  font-size: clamp(2.1rem, 9vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.005em;
  /* Break only as a last resort, and hyphenate rather than split raw. */
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}
[data-theme="spellbook"] .title::after { transform: translate(.022em, .016em); }

[data-theme="spellbook"] .section-head::before {
  content: "❦";
  color: var(--ink-b);
  margin-right: .1em;
  font-size: .85em;
}

[data-theme="spellbook"] .vitals {
  border-top-style: double;
  border-bottom-style: double;
  border-top-width: 6px;
  border-bottom-width: 6px;
}

[data-theme="spellbook"] .vital-value { letter-spacing: .01em; }

/* Buttons read as pressed brass rather than photocopied card. */
[data-theme="spellbook"] .btn { letter-spacing: .08em; }
[data-theme="spellbook"] .btn-primary {
  background: linear-gradient(180deg, #7C3AA3, #55217A);
  color: #F3E7C6;
  border-color: var(--text);
}

[data-theme="spellbook"] .answer input:checked + span {
  background: linear-gradient(180deg, #7C3AA3, #55217A);
  color: #F3E7C6;
  box-shadow: inset 0 0 0 3px var(--stock), inset 0 0 0 5.5px var(--gild);
}

[data-theme="spellbook"] .chip-initial {
  background: radial-gradient(circle at 35% 30%, var(--seal-light), var(--seal));
  color: var(--gild);
}
[data-theme="spellbook"] .chip-maybe .chip-initial,
[data-theme="spellbook"] .chip-waitlist .chip-initial {
  background: radial-gradient(circle at 35% 30%, #B8901F, #8A6A12);
  color: #2A1A08;
}

/* The signature: a blob of wax pressed with a monogram. */
[data-theme="spellbook"] .stamp {
  width: 8.4rem;
  height: 8.4rem;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--gild);
  background:
    radial-gradient(circle at 34% 28%, var(--seal-light) 0%, var(--seal) 55%, #3F1329 100%);
  /* Deliberately uneven, the way wax spreads when it is pressed. */
  border-radius: 47% 53% 52% 48% / 51% 47% 53% 49%;
  box-shadow:
    inset 0 0 0 3px rgba(201, 162, 39, .35),
    inset 2px 3px 10px rgba(0, 0, 0, .35),
    3px 5px 14px rgba(40, 15, 25, .35);
  transform: rotate(-6deg);
  animation: press .45s cubic-bezier(.2, 1.4, .4, 1) both;
}

[data-theme="spellbook"] .stamp-word {
  font-size: 1.5rem;
  line-height: 1.02;
  max-width: 88%;
  letter-spacing: .01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
[data-theme="spellbook"] .stamp-name {
  color: rgba(243, 231, 198, .78);
  letter-spacing: .2em;
  margin-top: .3rem;
}
[data-theme="spellbook"] .stamp-no,
[data-theme="spellbook"] .stamp-waitlist {
  background: radial-gradient(circle at 34% 28%, #6B6257 0%, #46403A 55%, #322D28 100%);
  color: #D8CFC0;
}

/* Wax presses down and squashes out; it does not fall from a height. */
@keyframes press {
  0%   { transform: rotate(-6deg) scale(1.5); opacity: 0; }
  55%  { transform: rotate(-6deg) scale(.94); opacity: 1; }
  100% { transform: rotate(-6deg) scale(1); opacity: 1; }
}

/* ---------------------------------------------------------------- mascot */

.mascot {
  margin: 2.25rem 0 0;
  display: flex;
  justify-content: center;
}
.mascot-art {
  width: clamp(9rem, 36vw, 12.5rem);
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(35, 15, 30, .32));
  transform-origin: 50% 0;
  /* Hung on a wall, in a draught. */
  animation: sway 7s ease-in-out infinite;
}
.mascot-name {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: .03em;
  fill: #3E2C06;
}

@keyframes sway {
  0%, 100% { transform: translateY(0) rotate(-1.1deg); }
  50%      { transform: translateY(-9px) rotate(1.1deg); }
}

/* --------------------------------------------------------------- candles */

/* Ambient only, and strictly behind the content — see the z-index note on
   .flyer below. Kept faint so body copy stays readable on the parchment. */
.candles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .7;
}
.candles i {
  position: absolute;
  width: 9px;
  height: 34px;
  border-radius: 1px;
  /* A dark edge on the left keeps a pale candle legible against pale paper. */
  background: linear-gradient(90deg, #B9A473 0%, #F7EDD2 35%, #EADCB4 70%, #C4AE7C 100%);
  box-shadow: 0 0 26px 10px rgba(232, 166, 45, .2);
  animation: drift 16s ease-in-out infinite;
}
/* The wick, so the flame has something to sit on. */
.candles i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -4px;
  width: 1.5px;
  height: 5px;
  margin-left: -.75px;
  background: #4A3A22;
}
.candles i::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -17px;
  width: 11px;
  height: 18px;
  margin-left: -5.5px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 70%, #FFFBE8 0%, #FFD34D 38%, #F08A1C 62%, rgba(240, 138, 28, 0) 80%);
  animation: flicker 1.7s ease-in-out infinite;
}
.candles i:nth-child(1) { left: 7%;  top: 16%; animation-delay: 0s;    }
.candles i:nth-child(2) { left: 21%; top: 62%; animation-delay: -3.2s; }
.candles i:nth-child(3) { left: 46%; top: 8%;  animation-delay: -6.5s; }
.candles i:nth-child(4) { left: 72%; top: 38%; animation-delay: -9s;   }
.candles i:nth-child(5) { left: 88%; top: 72%; animation-delay: -12s;  }
.candles i:nth-child(6) { left: 61%; top: 88%; animation-delay: -14s;  }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-26px) rotate(1deg); }
}
@keyframes flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 1; }
  35%      { transform: scaleY(1.16) scaleX(.9); opacity: .82; }
  70%      { transform: scaleY(.92) scaleX(1.06); opacity: .95; }
}

/* ---------------------------------------------------------------- snitch */

.snitch {
  position: fixed;
  left: -8vw;
  top: 22%;
  z-index: 0;
  pointer-events: none;
  width: 14px;
  height: 14px;
  animation: flit 21s ease-in-out infinite;
}
.snitch b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFF0B8, #D9A520 60%, #916A0C);
  box-shadow: 0 0 12px 4px rgba(232, 178, 58, .45);
}
.snitch u, .snitch s {
  position: absolute;
  top: 1px;
  width: 15px;
  height: 9px;
  background: rgba(255, 246, 214, .78);
  border-radius: 80% 20% 60% 40% / 100% 60% 40% 0;
}
.snitch u { left: -14px; transform-origin: right center; animation: flap .22s ease-in-out infinite; }
.snitch s { right: -14px; transform-origin: left center; transform: scaleX(-1); animation: flap .22s ease-in-out infinite; }

@keyframes flap {
  0%, 100% { transform: rotate(14deg); }
  50%      { transform: rotate(-24deg); }
}
.snitch s { animation-name: flap-mirror; }
@keyframes flap-mirror {
  0%, 100% { transform: scaleX(-1) rotate(14deg); }
  50%      { transform: scaleX(-1) rotate(-24deg); }
}

/* Crosses the page, loiters, then leaves. Mostly it is not there. */
@keyframes flit {
  0%      { transform: translate(0, 0) scale(.7); opacity: 0; }
  6%      { opacity: 1; }
  22%     { transform: translate(38vw, -12vh) scale(1); }
  38%     { transform: translate(62vw, 16vh) scale(.9); }
  52%     { transform: translate(84vw, -6vh) scale(1.05); }
  64%     { opacity: 1; }
  72%     { transform: translate(118vw, 10vh) scale(.8); opacity: 0; }
  100%    { transform: translate(118vw, 10vh) scale(.8); opacity: 0; }
}

/* The ambient layers sit at z-index 0, so the flyer has to claim a layer of
   its own or the candles would wash over the text. */
.flyer, .footer { position: relative; z-index: 1; }

/* Decoration is the first thing to go when motion is unwelcome. Freezing them
   mid-flight would leave a snitch parked over the copy. */
@media (prefers-reduced-motion: reduce) {
  .candles, .snitch { display: none; }
}

[data-theme="spellbook"] .banner { border-style: double; border-width: 5px; }
[data-theme="spellbook"] .post { border-left-style: double; border-left-width: 5px; }
[data-theme="spellbook"] .notes li { border-left-style: double; border-left-width: 5px; }
[data-theme="spellbook"] .footer-mark::before { content: "⚡"; }
[data-theme="spellbook"] .footer-mark { font-size: 0; }
[data-theme="spellbook"] .footer-mark::before { font-size: .95rem; }
