/* ============================================
   hiyalhu — the invitation scroll
   standalone • dark fantasy • blood & parchment
   ============================================ */

/* ---------- self-hosted faces ---------- */
@font-face {
  font-family: "Quotes Script";
  src: url("fonts/quotes-script.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "WC Mano Negra";
  src: url("fonts/WCManoNegraBoldBta.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Garet";
  src: url("fonts/Garet-Book.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Garet";
  src: url("fonts/Garet-Heavy.woff") format("woff");
  font-weight: 850;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #64111f;
  --void-2: #420a14;

  --blood: #7c1524;
  --blood-bright: #b22838;
  --blood-glow: rgba(178, 40, 56, 0.25);

  --gold: #c9a55c;
  --gold-bright: #e3c47e;
  --gold-dim: rgba(201, 165, 92, 0.5);

  --parch-1: #ddc596;
  --parch-2: #c9af7c;
  --parch-3: #b0925d;
  --ink: #3a2716;
  --ink-soft: rgba(58, 39, 22, 0.68);
  --ink-faint: rgba(58, 39, 22, 0.46);
  --ink-crimson: #64111f;

  /* age: blotches, water stains & tanning vignette */
  --stains:
    radial-gradient(150px 96px at 80% 14%, rgba(94, 56, 18, 0.22), transparent 70%),
    radial-gradient(96px 62px at 12% 42%, rgba(108, 68, 24, 0.17), transparent 70%),
    radial-gradient(180px 120px at 86% 80%, rgba(86, 50, 16, 0.21), transparent 72%),
    radial-gradient(74px 48px at 27% 90%, rgba(102, 62, 22, 0.16), transparent 70%),
    radial-gradient(58px 38px at 52% 6%, rgba(118, 78, 28, 0.13), transparent 70%),
    radial-gradient(44px 28px at 40% 68%, rgba(110, 70, 26, 0.11), transparent 70%),
    radial-gradient(96px 60px at 68% 34%, rgba(96, 22, 28, 0.07), transparent 70%),
    radial-gradient(120% 95% at 50% 50%, transparent 50%, rgba(70, 42, 14, 0.3) 100%);

  /* age: crinkle lines from centuries of rolling */
  --folds:
    linear-gradient(180deg, transparent calc(18% - 1px), rgba(70, 42, 14, 0.11) 18%, transparent calc(18% + 1px)),
    linear-gradient(180deg, transparent calc(43% - 1px), rgba(70, 42, 14, 0.08) 43%, transparent calc(43% + 1px)),
    linear-gradient(180deg, transparent calc(67% - 1px), rgba(70, 42, 14, 0.1) 67%, transparent calc(67% + 1px)),
    linear-gradient(180deg, transparent calc(88% - 1px), rgba(70, 42, 14, 0.09) 88%, transparent calc(88% + 1px));

  --font-script: "WC Mano Negra", "Quotes Script", "Segoe Script", cursive;
  --font-title: "Smooch", "Imbue", serif;
  --font-grunge: "WC Mano Negra", "Quotes Script", cursive;
  --font-label: "Garet", "Avenir Next", "Segoe UI", sans-serif;
  --font-serif: "Imbue", "Cormorant Garamond", Georgia, serif;

  --font-display: var(--font-label);
  --font-body: var(--font-serif);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-unroll: cubic-bezier(0.65, 0, 0.35, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  background:
    radial-gradient(1100px 700px at 50% -12%, rgba(255, 72, 72, 0.12), transparent 62%),
    radial-gradient(900px 640px at 88% 104%, rgba(40, 2, 5, 0.55), transparent 72%),
    var(--void);
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--parch-1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--blood);
  color: var(--parch-1);
}

/* ---------- atmosphere ---------- */
.fx {
  position: fixed;
  pointer-events: none;
}

.fx__moon {
  top: 9%;
  right: 7%;
  width: min(190px, 26vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(22px 16px at 63% 30%, rgba(16, 3, 7, 0.5), transparent 72%),
    radial-gradient(12px 9px at 42% 56%, rgba(16, 3, 7, 0.42), transparent 72%),
    radial-gradient(9px 7px at 71% 62%, rgba(16, 3, 7, 0.4), transparent 72%),
    radial-gradient(30px 22px at 30% 24%, rgba(28, 7, 11, 0.35), transparent 72%),
    radial-gradient(circle at 38% 32%, #6b1e29 0%, #491019 48%, #26070f 100%);
  box-shadow:
    0 0 40px 8px rgba(178, 40, 56, 0.2),
    0 0 120px 48px rgba(178, 40, 56, 0.08),
    inset -16px -12px 44px rgba(0, 0, 0, 0.65);
  animation: moonPulse 8s ease-in-out infinite;
  z-index: 0;
}

@keyframes moonPulse {
  50% {
    box-shadow:
      0 0 55px 12px rgba(178, 40, 56, 0.26),
      0 0 150px 60px rgba(178, 40, 56, 0.11),
      inset -16px -12px 44px rgba(0, 0, 0, 0.65);
  }
}

.fx__fog {
  left: -20%;
  width: 140%;
  height: 42%;
  bottom: -8%;
  background: radial-gradient(50% 100% at 50% 100%, rgba(62, 8, 12, 0.42), transparent 70%);
  filter: blur(26px);
  animation: fogDrift 24s ease-in-out infinite alternate;
  z-index: 1;
}

.fx__fog--2 {
  bottom: -16%;
  opacity: 0.7;
  background: radial-gradient(50% 100% at 50% 100%, rgba(40, 4, 8, 0.34), transparent 70%);
  animation-duration: 32s;
  animation-direction: alternate-reverse;
}

@keyframes fogDrift {
  from { transform: translateX(-4%); }
  to   { transform: translateX(4%); }
}

.fx__vignette {
  inset: 0;
  background: radial-gradient(125% 105% at 50% 32%, transparent 40%, rgba(31, 2, 5, 0.84) 100%);
  z-index: 2;
}

/* embers rising */
.embers {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.ember {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffb259 0%, #c2372a 55%, transparent 75%);
  filter: blur(0.4px);
  animation: emberRise linear infinite;
}

@keyframes emberRise {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: var(--o, 0.5);
  }
  80% {
    opacity: calc(var(--o, 0.5) * 0.8);
  }
  100% {
    transform: translate(var(--dx, 30px), -108vh) scale(0.55);
    opacity: 0;
  }
}

/* ---------- stage ---------- */
.stage {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(4.5rem, 9vh, 7rem) 1rem 5.5rem;
}

.noscript-msg {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold);
}

/* ---------- the scroll ---------- */
.scroll {
  position: relative;
  width: min(92vw, 600px);
  transform: rotate(-0.6deg);
  animation: scrollArrive 1.2s var(--ease) both;
}

@keyframes scrollArrive {
  from {
    opacity: 0;
    transform: rotate(-0.6deg) scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: rotate(-0.6deg) scale(1) translateY(0);
  }
}

/* wooden rods */
.rod {
  position: absolute;
  left: -16px;
  right: -16px;
  height: 32px;
  z-index: 6;
  border-radius: 99px;
  background: linear-gradient(180deg, #4a2e18 0%, #33200e 38%, #1e0f04 78%, #110701 100%);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.7),
    inset 0 2px 3px rgba(202, 164, 106, 0.15),
    inset 0 -3px 5px rgba(0, 0, 0, 0.6);
}

.rod::before,
.rod::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle at 34% 30%, #d0ac6d 0%, #7c5f29 55%, #41300e 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(240, 220, 175, 0.3);
}

.rod::before { left: -10px; }
.rod::after  { right: -10px; }

.rod--top    { top: 0; }
.rod--bottom { bottom: 0; }

/* the parchment */
.paper {
  position: relative;
  z-index: 4;
  margin: 10px 6px;
  max-height: 0;
  overflow: hidden;
  background:
    var(--folds),
    var(--stains),
    linear-gradient(165deg, var(--parch-1) 0%, var(--parch-2) 48%, var(--parch-3) 100%);
  box-shadow:
    inset 0 0 95px rgba(56, 30, 8, 0.55),
    inset 0 0 30px rgba(38, 19, 3, 0.45),
    inset 0 0 9px rgba(28, 13, 1, 0.42),
    0 30px 70px -20px rgba(0, 0, 0, 0.85);
  transition: max-height 1.9s var(--ease-unroll);
}

.scroll.is-open .paper {
  max-height: 3200px;
}

/* fibre texture */
.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.028 0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.22 0 0 0 0.16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

/* wax drip decoration, top-left */
.paper-inner::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 9%;
  width: 26px;
  height: 40px;
  border-radius: 40% 40% 45% 45% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, #9c2c38, #6f1220 68%, #4c0d17);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 2px 3px rgba(255, 150, 160, 0.16);
  opacity: 0.92;
}

.paper-inner {
  position: relative;
  padding: clamp(2.6rem, 6vw, 4rem) clamp(1.6rem, 5vw, 3.2rem) clamp(2.2rem, 5vw, 3rem);
  text-align: center;
  color: var(--ink);
}

/* engraved double-rule frame, like a printed invitation */
.paper-inner::after {
  content: "";
  position: absolute;
  inset: clamp(0.85rem, 3vw, 1.3rem);
  pointer-events: none;
  border: 1px solid rgba(58, 39, 22, 0.36);
  outline: 1px solid rgba(58, 39, 22, 0.15);
  outline-offset: 4px;
}

/* staggered content reveal */
.paper-inner > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: calc(var(--i, 0) * 140ms + 120ms);
}

.scroll.is-revealed .paper-inner > * {
  opacity: 1;
  transform: none;
}

/* ---------- invitation content ---------- */
.inv-brand {
  display: grid;
  justify-items: center;
}

.inv-brand .mark {
  width: clamp(200px, 46vw, 256px);
  line-height: 0;
  transform: rotate(-2.4deg);
}

/* the circular crest: a solid maroon & gold emblem, set like a wax badge */
.inv-brand .mark img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 22px rgba(20, 2, 6, 0.42));
}

.inv-eyebrow {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--font-grunge);
  font-style: normal;
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  letter-spacing: 0.04em;
  color: var(--ink-crimson);
}

.inv-eyebrow::before,
.inv-eyebrow::after {
  content: "";
  height: 1px;
  flex: 0 1 76px;
  background: linear-gradient(90deg, transparent, rgba(100, 17, 31, 0.55));
}

.inv-eyebrow::after {
  transform: scaleX(-1);
}

.inv-name {
  margin-top: 0.7rem;
  font-family: var(--font-script);
  font-style: normal;
  font-weight: 700;
  font-size: clamp(4rem, 14vw, 6.4rem);
  line-height: 1.08;
  color: var(--ink-crimson);
  text-shadow: 0 1px 0 rgba(255, 243, 214, 0.35), 0 3px 4px rgba(56, 34, 10, 0.22);
}

.inv-lead {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  color: var(--ink-soft);
}

.inv-title {
  margin-top: 0.9rem;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 243, 214, 0.25);
}

/* engraved flourish under the title */
.inv-flourish {
  margin-top: 0.9rem;
  color: var(--ink-crimson);
  opacity: 0.85;
  line-height: 0;
}

.inv-flourish svg {
  display: block;
  margin: 0 auto;
  width: min(190px, 52vw);
  height: auto;
}

/* details — set like an engraved invitation */
.inv-rows {
  margin-top: 2.3rem;
  display: grid;
  gap: 1.5rem;
  text-align: center;
  max-width: 380px;
  margin-inline: auto;
}

.inv-row {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

/* small diamond between stanzas */
.inv-row + .inv-row::before {
  content: "";
  width: 5px;
  height: 5px;
  transform: rotate(45deg);
  background: var(--ink-crimson);
  opacity: 0.5;
  margin-bottom: 0.3rem;
}

.inv-row__label {
  font-family: var(--font-label);
  font-weight: 850;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-crimson);
  padding-left: 0.3em; /* optically centre the letter-spacing */
}

.inv-row__value {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.2vw, 1.55rem);
  color: var(--ink);
  line-height: 1.35;
}

.inv-row__sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-faint);
}

.inv-row__link {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.2vw, 1.55rem);
  color: var(--ink);
  line-height: 1.35;
  text-decoration: none;
  border-bottom: 1px dashed rgba(100, 17, 31, 0.45);
  padding-bottom: 1px;
  transition: border-color 0.25s var(--ease);
}

.inv-row__link:hover {
  border-bottom-style: solid;
  border-bottom-color: var(--ink-crimson);
}

/* ---------- the dress-code palette ---------- */
.inv-palette {
  margin-top: 0.9rem;
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.palette__swatches {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.palette__swatch {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  background: var(--c, #000);
  border: 1px solid rgba(58, 39, 22, 0.45);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.18),
    inset 0 -2px 3px rgba(0, 0, 0, 0.22),
    0 2px 4px rgba(43, 31, 20, 0.25);
}

/* hand-stamped, not grid-perfect */
.palette__swatch:nth-child(odd)  { transform: rotate(-2.4deg); }
.palette__swatch:nth-child(even) { transform: rotate(1.8deg); }

.palette__legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.32rem 1rem;
  max-width: 430px;
}

.palette__legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.palette__dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--c, #000);
  border: 1px solid rgba(58, 39, 22, 0.4);
  flex: none;
}

.palette__legend span {
  font-family: var(--font-label);
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- the rites of the night (agenda) ---------- */
.inv-agenda {
  margin-top: 2.3rem;
}

.inv-agenda__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  font-family: var(--font-label);
  font-weight: 850;
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-crimson);
  padding-left: 0.3em; /* optically centre the letter-spacing */
}

.inv-agenda__label::before,
.inv-agenda__label::after {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  transform: rotate(45deg);
  background: var(--ink-crimson);
  opacity: 0.5;
}

.agenda {
  list-style: none;
  margin-top: 1.35rem;
  display: grid;
  gap: 0.68rem;
  max-width: 400px;
  margin-inline: auto;
  text-align: left;
}

/* rows cascade in just after the section's own reveal slot */
.agenda__item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: calc(var(--i, 0) * 140ms + 320ms + var(--ai, 0) * 70ms);
}

.scroll.is-revealed .agenda__item {
  opacity: 1;
  transform: none;
}

.agenda__time {
  flex: none;
  font-family: var(--font-label);
  font-weight: 850;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

/* dotted leader, set on the baseline like an engraved programme */
.agenda__leader {
  flex: 1;
  min-width: 1.1rem;
  border-bottom: 1px dotted rgba(58, 39, 22, 0.4);
}

.agenda__what {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.06rem;
  line-height: 1.32;
  color: var(--ink);
  text-align: right;
  text-transform: lowercase; /* match the invitation's voice */
}

/* interludes — breaks read as quieter asides */
.agenda__item--soft .agenda__what {
  color: var(--ink-faint);
  font-size: 0.95rem;
}

.agenda__item--soft .agenda__time {
  opacity: 0.6;
}

.agenda__item--soft .agenda__leader {
  border-bottom-color: rgba(58, 39, 22, 0.22);
}

/* the big moments — inked in blood */
.agenda__item--key .agenda__time {
  color: var(--ink-crimson);
}

.agenda__item--key .agenda__what {
  color: var(--ink-crimson);
  font-weight: 600;
}

.agenda__item--key .agenda__what::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.45rem;
  transform: rotate(45deg);
  background: var(--ink-crimson);
  opacity: 0.75;
  vertical-align: 0.16em;
}

/* actions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.7rem;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 850;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn--wax {
  background: linear-gradient(180deg, #93202e, #6f1220 60%, #520c17);
  color: #eddcb8;
  border-color: rgba(38, 17, 6, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 235, 200, 0.1), 0 8px 20px -8px rgba(0, 0, 0, 0.6);
  filter: saturate(0.94);
}

.btn--wax:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 30px -8px rgba(92, 14, 27, 0.55);
}

.btn--ink {
  color: var(--ink-crimson);
  border-color: rgba(92, 22, 32, 0.45);
  background: transparent;
}

.btn--ink:hover {
  transform: translateY(-2px);
  border-color: var(--ink-crimson);
  background: rgba(110, 18, 32, 0.06);
}

/* footnote */
.inv-foot {
  margin-top: 2.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid rgba(43, 31, 20, 0.25);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  line-height: 1.9;
}

.inv-foot .sigil {
  font-style: normal;
  font-family: var(--font-label);
  font-weight: 850;
  font-size: 0.7em;
  letter-spacing: 0.16em;
  color: var(--ink-crimson);
}

/* ---------- the wax seal ---------- */
.seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.7rem;
  cursor: pointer;
  background:
    radial-gradient(circle at 34% 28%, #b23342 0%, #992634 30%, #6f1220 58%, #490d16 100%);
  border: 2px solid rgba(26, 3, 7, 0.6);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.65),
    0 0 44px -6px var(--blood-glow),
    inset 0 0 0 7px rgba(36, 5, 10, 0.4),
    inset 0 5px 12px rgba(255, 150, 160, 0.14),
    inset 0 -8px 16px rgba(0, 0, 0, 0.5);
  filter: saturate(0.92);
  animation: sealBreath 3.4s ease-in-out infinite;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.seal:hover {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.7),
    0 0 60px -4px var(--blood-glow),
    inset 0 0 0 7px rgba(40, 6, 12, 0.32),
    inset 0 5px 12px rgba(255, 150, 160, 0.28),
    inset 0 -8px 16px rgba(0, 0, 0, 0.45);
}

@keyframes sealBreath {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.14); }
}

/* paw pressed into the wax */
.seal__paw {
  color: rgba(26, 4, 10, 0.9);
  transform: translateY(1px) rotate(-4deg);
  line-height: 0;
  filter:
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6))
    drop-shadow(0 -1px 1px rgba(255, 150, 160, 0.1));
}

.seal__paw svg {
  width: 64px;
  height: auto;
  display: block;
}

/* aged crack lines across the wax */
.seal::after {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  pointer-events: none;
  background:
    linear-gradient(38deg, transparent 46.5%, rgba(34, 3, 8, 0.38) 47.5%, transparent 49%),
    linear-gradient(-26deg, transparent 60.5%, rgba(34, 3, 8, 0.3) 61.5%, transparent 63%),
    linear-gradient(64deg, transparent 30%, rgba(34, 3, 8, 0.18) 30.8%, transparent 31.8%);
}

.seal.is-cracked {
  animation: sealShake 0.38s linear;
}

@keyframes sealShake {
  0%   { transform: translate(-50%, -50%) rotate(0deg); }
  20%  { transform: translate(-52%, -51%) rotate(-5deg); }
  40%  { transform: translate(-48%, -49%) rotate(5deg); }
  60%  { transform: translate(-51%, -50%) rotate(-3deg); }
  80%  { transform: translate(-49%, -50%) rotate(3deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

.seal.is-broken {
  animation: sealBurst 0.65s var(--ease) forwards;
  pointer-events: none;
}

@keyframes sealBurst {
  40% {
    transform: translate(-50%, -50%) scale(1.22) rotate(6deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.7) rotate(14deg);
    opacity: 0;
  }
}

/* sparks from the broken seal */
.spark {
  position: absolute;
  z-index: 9;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd27a 0%, #d4452f 60%, transparent 75%);
  pointer-events: none;
}

/* hint under the scroll */
.hint {
  margin-top: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-weight: 850;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f3d9a0;
  animation: hintPulse 2.2s ease-in-out infinite;
  transition: opacity 0.5s var(--ease);
}

.hint::before,
.hint::after {
  content: "";
  height: 1px;
  width: 34px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}

.hint::after {
  transform: scaleX(-1);
}

.hint.is-gone {
  opacity: 0;
  animation: none;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ---------- lost soul (bad / missing id) ---------- */
.lost {
  width: min(92vw, 440px);
  transform: rotate(0.5deg);
  background:
    var(--stains),
    linear-gradient(165deg, var(--parch-1) 0%, var(--parch-2) 48%, var(--parch-3) 100%);
  box-shadow:
    inset 0 0 80px rgba(56, 30, 8, 0.55),
    inset 0 0 22px rgba(38, 19, 3, 0.4),
    0 30px 70px -20px rgba(0, 0, 0, 0.85);
  padding: clamp(2.2rem, 6vw, 3rem) clamp(1.5rem, 5vw, 2.6rem);
  text-align: center;
  color: var(--ink);
  animation: scrollArrive 1s var(--ease) both;
}

.lost__icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.8rem;
}

.lost__title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 2.7rem;
  line-height: 1.15;
  color: var(--ink-crimson);
}

.lost__msg {
  margin-top: 0.7rem;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.lost__msg small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.lost__form {
  margin-top: 1.7rem;
  display: grid;
  gap: 0.8rem;
}

.lost__form input {
  width: 100%;
  background: rgba(43, 31, 20, 0.07);
  border: 1.5px solid rgba(92, 22, 32, 0.4);
  border-radius: 4px;
  padding: 0.8rem 1rem;
  font: 600 0.95rem var(--font-display);
  letter-spacing: 0.12em;
  color: var(--ink);
  text-align: center;
}

.lost__form input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
  letter-spacing: 0.04em;
}

.lost__form input:focus {
  outline: none;
  border-color: var(--ink-crimson);
  box-shadow: 0 0 0 3px rgba(110, 18, 32, 0.14);
}

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .rod { left: -9px; right: -9px; height: 26px; }
  .rod::before, .rod::after { width: 15px; height: 15px; }
  .rod::before { left: -6px; }
  .rod::after { right: -6px; }
  .seal { width: 96px; height: 96px; font-size: 2.2rem; }
  .seal__paw svg { width: 50px; }
  .inv-brand .mark { width: 186px; }
  .inv-name { font-size: clamp(3.4rem, 17vw, 4.6rem); }
  .palette__swatch { width: 23px; height: 23px; }
  .agenda { margin-top: 1.15rem; gap: 0.58rem; }
  .agenda__what { font-size: 1rem; }
  .agenda__item--key .agenda__what { font-size: 1rem; }
  .hint { margin-top: 1.8rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ember { display: none; }
}
