@import url('https://fonts.googleapis.com/css2?family=Ruslan+Display&display=swap');

/* ===========================================================================
   Crow Messenger — autonomous flying crows that carry a rolled scroll in
   their feet. Click one and that scroll flies out and unrolls in the center
   of the screen; scroll the page or click the backdrop to dismiss (it
   catches fire from the middle, burns away and goes up in smoke, then a
   fresh crow flight resumes). CSS + GSAP + 2D canvas, no build step.
   ===========================================================================*/

.crow-source { display: none; }

.crow-fly {
  position: absolute;
  top: 0; left: 0;
  width: 72px; height: 55px;
  z-index: 40;
  cursor: pointer;
  pointer-events: auto;
}
.crow-sprite {
  position: relative;
  width: 100%; height: 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 5px 7px rgba(20, 18, 14, 0.3));
}

/* The little rolled scroll gripped in the crow's talons (drawn in crow.js,
   legScrollSVG). The feet sit around x 36–43, y 49–51 of the 72×55 sprite,
   facing right; the grip point (the middle of this box) is centred under
   them. It's a child of the sprite, so it mirrors with it when the crow
   turns. Its tilt is set from crow.js (LEG_SCROLL_TILT) so GSAP can scale
   it without losing the tilt. */
.crow-leg-scroll {
  position: absolute;
  left: 27.5px; top: 44px;
  width: 24px; height: 11px;
  pointer-events: none;
}
.crow-leg-scroll svg {
  display: block; width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(40, 22, 6, 0.4));
}

/* ---- Full-screen dismiss backdrop ---- */
.crow-backdrop {
  position: fixed; inset: 0;
  z-index: 9997;
  background: rgba(20, 18, 14, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.crow-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* ---- The scroll ---- */
.crow-parchment {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* On the outer box so the shadow follows the scroll's real worn (and,
     while burning, burnt-away) shape — the clip-paths are on children. */
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5));
}
.crow-parchment-scrollwrap { position: relative; }

/* The window the sheet is let out through as it unrolls (crow.js animates
   its height); the sheet inside stays full size, so it's revealed, never
   stretched. */
.crow-parchment-reveal {
  position: absolute;
  overflow: hidden;
}
.crow-parchment-paper {
  position: absolute;
  top: 0; left: 0;
  box-sizing: border-box;
  padding: 30px 34px 50px;
  color: #3b2413;
  font-family: 'Alegreya', Georgia, 'Times New Roman', serif;
  /* clip-path (the worn outline) is generated per open in crow.js. */
}
.crow-parchment-texture {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
/* Shade along the edges that are just coming off the rolls. */
.crow-parchment-curl {
  position: absolute; left: 0; right: 0;
  height: 18px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(60, 32, 10, 0) 0%, rgba(60, 32, 10, 0.4) 100%);
}
.crow-parchment-curl--top {
  background: linear-gradient(0deg, rgba(60, 32, 10, 0) 0%, rgba(60, 32, 10, 0.4) 100%);
}

.crow-parchment-content {
  position: relative;
  z-index: 1;
  font-size: 1.02rem;
  line-height: 1.55;
  /* A touch of ink bleed into the old paper. */
  text-shadow: 0 0 0.6px rgba(59, 36, 19, 0.55);
}
.crow-parchment-content :first-child { margin-top: 0; }
.crow-parchment-content :last-child { margin-bottom: 0; }
.crow-parchment-content > p:first-child::first-letter {
  float: left;
  font-family: 'Ruslan Display', 'Alegreya', Georgia, serif;
  font-size: 3em;
  line-height: 0.8;
  margin: 0.08em 0.1em 0 0;
  color: #7b1a10;
  text-shadow: 1px 1px 0 rgba(40, 10, 5, 0.25);
}
.crow-parchment-content a {
  display: inline-block; margin-top: 0.7rem;
  font-style: italic; font-weight: 700; font-size: 0.92rem;
  color: #7b1a10; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.crow-parchment-content a::before { content: "\2766\00a0"; display: inline-block; }

/* Wax seal near the bottom corner, with two red ribbon tails pressed under
   it hanging down over the bottom roll. The group is a zero-size anchor at
   the seal's centre (crow.js places it); it sits on the scroll body, above
   the rolls, rather than on the sheet, so the ribbons can hang past the
   sheet's edge. */
.crow-parchment-sealgroup {
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 0;
  z-index: 5;
}
.crow-parchment-ribbon {
  position: absolute;
  left: -7.5px; top: 0;
  width: 15px;
  /* Satin red: dark folds at the sides, a sheen down the middle, and the
     shade cast by the seal where the ribbon comes out from under it. */
  background:
    linear-gradient(180deg, rgba(40, 0, 0, 0.55) 0, rgba(40, 0, 0, 0) 22px),
    linear-gradient(90deg, #5e080c 0%, #a5151a 20%, #d8443a 44%, #e8685a 52%, #b3191d 70%, #6e0c10 100%);
  /* Swallowtail end, cut in a V. */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 9px), 0 100%);
}
.crow-parchment-seal {
  position: absolute;
  left: -18px; top: -18px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  font-family: 'Ruslan Display', Georgia, serif;
  font-size: 18px;
  color: rgba(70, 8, 6, 0.85);
  text-shadow: 1px 1px 0 rgba(255, 140, 120, 0.35);
  border-radius: 47% 53% 44% 56% / 55% 45% 55% 45%;
  background: radial-gradient(circle at 36% 30%, #d0453a 0%, #9b1c14 45%, #5c0b07 100%);
  box-shadow:
    inset 0 0 0 4px rgba(120, 18, 12, 0.6),
    inset 0 0 0 5px rgba(255, 120, 100, 0.18),
    1px 2px 4px rgba(30, 5, 0, 0.5);
}

/* ---- Rolls: just the rolled-up part of the sheet at each end, nothing
   sticking out past the paper (crow.js sets each roll's height as it
   unrolls). ---- */
.crow-parchment-rod {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: 18px;
  z-index: 4;
}
/* The wound sheet: a cylinder of old paper (crow.js sets its height to the
   roll's current diameter and slides the age-spot layers as it turns). */
.crow-parchment-roll {
  position: absolute;
  left: 18px; right: 18px; top: 50%;
  height: 12px;
  transform: translateY(-50%);
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(50, 25, 6, 0.6) 0%, rgba(255, 244, 210, 0.28) 28%, rgba(255, 244, 210, 0.06) 50%, rgba(50, 25, 6, 0.5) 82%, rgba(30, 14, 3, 0.75) 100%),
    radial-gradient(circle at 30% 40%, rgba(120, 75, 25, 0.28) 0 1.5px, transparent 2.5px) 0 0 / 37px 9px,
    radial-gradient(circle at 70% 60%, rgba(120, 75, 25, 0.2) 0 1px, transparent 2px) 0 0 / 53px 13px,
    #dcc189;
  box-shadow: inset 0 0 0 0.5px rgba(80, 45, 15, 0.5);
}
/* The roll's end faces — the spiral of wound layers, seen at an angle. */
.crow-roll-cap {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(30, 14, 3, 0.4));
}
.crow-roll-cap--left { left: 0; transform: translateX(-50%); }
.crow-roll-cap--right { right: 0; transform: translateX(50%); }

/* ---- The burn: one canvas per burn, sized around the scroll with room
   above for the flames and smoke to rise into. ---- */
.crow-burn-canvas {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .crow-fly, .crow-parchment { transition: none !important; animation: none !important; }
}
