/* "Îngerașul cu plicul" (Components/Heroes/AngelHero.razor, layouts/angel.js), over envelope.css: the angel that brings
   the sealed envelope and lets it go, and the small angel over the open letter. Its colours from the palette (--paper,
   --gold, --line, --ink) and a skin and curls of its own; it only ever moves up and down (and its wings), never sideways. */
.angel-hero{--angel-skin:#f6d9c6;--angel-skin-line:#e7bea6;--angel-hair:#e8c27f;--angel-hair-line:#d4a95f;--angel-cheek:#f1a69c;
  --angel-wing:color-mix(in srgb,#fff 82%,var(--paper));--angel-wing-line:color-mix(in srgb,var(--gold) 45%,var(--paper));
  --angel-gown:var(--paper);--angel-gown-line:color-mix(in srgb,var(--gold) 70%,var(--paper))}

/* — the drawing — */
.angel-figure{display:block;overflow:visible}
.angel-wing{fill:var(--angel-wing);stroke:var(--angel-wing-line);stroke-width:2;stroke-linejoin:round}
.angel-wing-line{fill:none;stroke:var(--angel-wing-line);stroke-width:1.4;stroke-linecap:round;opacity:.8}
.angel-gown{fill:var(--angel-gown);stroke:var(--angel-gown-line);stroke-width:2}
.angel-collar{fill:none;stroke:var(--angel-gown-line);stroke-width:2;stroke-linecap:round}
.angel-sleeve{fill:var(--angel-gown);stroke:var(--angel-gown-line);stroke-width:2;stroke-linejoin:round}
.angel-skin{fill:var(--angel-skin);stroke:var(--angel-skin-line);stroke-width:1.6}
.angel-hair circle{fill:var(--angel-hair);stroke:var(--angel-hair-line);stroke-width:1.2}
.angel-halo{fill:none;stroke:var(--gold);stroke-width:4;filter:drop-shadow(0 0 4px color-mix(in srgb,var(--gold) 60%,transparent))}
.angel-cheek{fill:var(--angel-cheek);opacity:.55}
.angel-face{fill:none;stroke:#8a6656;stroke-width:2.2;stroke-linecap:round}

/* — sealed: the angel over the envelope, holding its top edge (y 172 of the drawing's 240) between body and hands — */
.envelope-closed .angel-figure{position:absolute;left:23%;width:54%;top:-56.1%;pointer-events:none}
.envelope-closed .angel-body{z-index:0}
.envelope-closed .envelope-shape{z-index:1}
.envelope-closed .angel-hands{z-index:4}
html[data-sealed] .angel-hero{padding-top:min(42vw,270px)}
html[data-sealed] .angel-hero .envelope-closed{cursor:pointer}
/* It comes down from above, then floats; its wings beat softly. */
html[data-sealed=closed] .angel-hero .envelope-closed{animation:angel-arrives 1.8s cubic-bezier(.2,.7,.25,1) both,angel-floats 3.4s 1.8s ease-in-out infinite alternate}
.angel-wing{transform-box:view-box}
.angel-wing-left{transform-origin:106px 116px}
.angel-wing-right{transform-origin:134px 116px}
html[data-sealed=closed] .angel-hero .angel-wing-left{animation:angel-wing-left 1.3s ease-in-out infinite alternate}
html[data-sealed=closed] .angel-hero .angel-wing-right{animation:angel-wing-right 1.3s ease-in-out infinite alternate}
/* Touched: it lets the envelope go and rises away while the seal breaks. */
html[data-sealed=opening] .angel-hero .angel-figure{animation:angel-leaves .8s ease-in forwards}
@keyframes angel-arrives{from{transform:translateY(-60vh);opacity:0}45%{opacity:1}to{transform:none;opacity:1}}
@keyframes angel-floats{from{transform:none}to{transform:translateY(-9px)}}
@keyframes angel-wing-left{from{transform:rotate(4deg)}to{transform:rotate(-7deg)}}
@keyframes angel-wing-right{from{transform:rotate(-4deg)}to{transform:rotate(7deg)}}
@keyframes angel-leaves{to{transform:translateY(-90px);opacity:0}}
.angel-hero .envelope-hint{top:calc(100% + 26px)}

/* — open: the small angel over the names — */
.letter-angel{position:relative;z-index:1;width:clamp(96px,16vw,132px);margin:88px auto -34px}
.envelope-hero.just-opened .letter-angel{animation:angel-settles 1.1s .25s cubic-bezier(.2,.8,.2,1) both}
@keyframes angel-settles{from{transform:translateY(-24px);opacity:0}to{transform:none;opacity:1}}

@media (max-width:700px){
  html[data-sealed] .angel-hero{padding-top:min(46vw,210px)}
  .letter-angel{margin:62px auto -24px}
}
@media (prefers-reduced-motion:reduce){
  .angel-hero *,.angel-hero{animation:none!important}
}
@media print{
  .letter-angel{margin-top:6mm;width:28mm}
}
