/* Keepsake envelope (core/hero/070) — INV-04 Keepsake Table · Luxe W0 (A1980; plan docs/plans/plan_inv04_keepsake_table_master.md).
   Stage 1, still. What the bundle held, laid out on the table, seen from straight above.
   W1.2 (A2016, the owner's remarks on W1.1): the name card stands in the envelope now ("put the card in the envelope"),
   an arched card of the same cotton with a fine double gold line along its arch, pulled most of the way out of the
   envelope's straight mouth, its foot still inside; the open flap lies flat above it, its liner in the couple's colour
   framing the arch. The envelope is the opener's, a little wider (.82, "very skinny looking"): its back is solid paper,
   seamed like the opener's, so the card's foot is hidden, as in a real envelope. The couple's photo lies beside it in a
   carved frame of antique white (a photograph, Kie; neutral, so it suits any couple colour) with a linen mat, the
   frame's own shadow straight down; a torn-edge tag with their line is tucked under the frame. The wax seal that held
   the envelope shut lies on the table where it came off; platinum rings lie on the table beside the frame (W2.4), flowers at the edge.
   Every paper carries the soft relief of handled cotton (the skin's k-paper). The names are the page's only h1. No
   venue here (D-121). Shadows: the skin's --k-sh-* tokens, straight down (12 o'clock); a filter turns with its element
   (AG-T162), so every turned picture sits inside an unturned element that carries its shadow.
   W1.3 (A2027, the owner: the top-left corner "looks blank", "a little bit more accessories, very little"): a sparse
   sprinkle of flowers in the top-left corner over two vintage stamps, a short strand of pearls on the right, and two
   loose petals; the frame casts the skin's frame shadow (the tallest object: the longest crisp shadow).
   W1.4 (A2034, the owner: "get rid of the pearls necklace thing from hero"; picked extras): no pearls; the seal the
   guest broke in the opener lies in two halves; a soft window light falls across the table (the skin's .k-window: it
   only lightens, so no word gets darker). */
.he070 {
  --he070-ew: min(86vw, 380px);
  --he070-eh: calc(var(--he070-ew) / .82);
  --he070-fh: calc(var(--he070-eh) * .62);
  --he070-cw: calc(var(--he070-ew) * .8);
  --he070-ch: calc(var(--he070-cw) * 1.4);
  --he070-tuck: .15;
  /* how far the arch stands above the open flap's tip (the envelope's box grows by it) */
  --he070-rise: max(0px, calc(var(--he070-ch) - var(--he070-eh) * var(--he070-tuck) - var(--he070-fh)));
  --he070-fw: min(74vw, 330px);
  position: relative; z-index: 1; background: var(--k-light-ground); color: var(--k-ink);
  padding: clamp(36px, 7svh, 72px) 0 clamp(28px, 5svh, 56px);
}
@media (min-width: 700px) { .he070 { --he070-ew: min(60vw, 470px, calc((100svh - 60px) / 1.74 * .82)); --he070-fw: min(52vw, 420px); } }
.he070 .he070__lay { position: relative; display: grid; justify-items: center; width: 100%; }

/* ---- the table's edge: flowers (a mirrored spray keeps its light on top) ---- */
.he070 .he070__fl { position: absolute; z-index: 2; width: min(62vw, 420px); right: max(-20vw, -140px); top: -3%; }
.he070 .he070__fl::before { scale: -1 1; }
.he070 .he070__gyp { position: absolute; z-index: 2; width: min(40vw, 220px); left: max(-8vw, -50px); bottom: 3%; }
.he070 .he070__gyp::before { rotate: -12deg; }
@media (max-width: 699.98px) { .he070 .he070__gyp { left: -24vw; } .he070 .he070__fl { right: -30vw; } }
/* W1.3: the top-left corner: the sprinkle (its cluster in the corner, petals trailing in) lies over two stamps; pearls
   on the right by the envelope; one petal on the table at the lower left (the other is by the frame, in .he070__pic).
   W2.4 (A2094, D-193, AG-T334): all lie on top of the paper they overlap (z 2, the envelope is z 1), never under it,
   and nothing lies on the frame or under it: nothing lies over a word */
.he070 .he070__flc { position: absolute; z-index: 2; width: min(48vw, 300px); left: max(-12vw, -70px); top: -3%; }
.he070 .he070__stamps { position: absolute; z-index: 2; width: clamp(64px, 20vw, 110px); left: 2vw; top: 9%; }
.he070 .he070__stamps::before { rotate: -7deg; }
.he070 .he070__pt { position: absolute; z-index: 2; width: 36px; }
.he070 .he070__pt--a { left: -6%; top: -14%; }
.he070 .he070__pt--a::before { rotate: -9deg; }
.he070 .he070__pt--b { left: 5vw; bottom: 15%; }
.he070 .he070__pt--b::before { scale: -1 1; rotate: 6deg; }

/* W1.4: the window light falls across the top of the table, over everything (light falls on the objects too) */
.he070 .he070__sun { z-index: 6; width: 120%; left: -30%; top: -8%; }

/* ---- the envelope: the open flap lies flat above the body; the card stands in the mouth between them ---- */
.he070 .he070__env { position: relative; z-index: 1; width: var(--he070-ew); height: calc(var(--he070-fh) + var(--he070-eh)); margin-top: var(--he070-rise); rotate: -2.5deg; }
.he070 .he070__flapw { position: absolute; left: 0; right: 0; top: 0; height: var(--he070-fh); filter: var(--k-sh-cut); }
.he070 .he070__flap { position: absolute; inset: 0; clip-path: polygon(0 100%, 48% 2%, 52% 2%, 100% 100%);
  background-color: var(--k-card); background-image: var(--k-kt-wr-a), var(--k-kt-card); background-size: cover, 192px 192px;
  background-repeat: no-repeat, repeat; background-blend-mode: hard-light, multiply; }
.he070 .he070__liner { position: absolute; left: 4.6%; right: 4.6%; top: 8%; bottom: 0; clip-path: polygon(0 100%, 48% 2%, 52% 2%, 100% 100%);
  background-color: var(--c-primary); background-image: var(--k-kt-card), radial-gradient(circle at 50% 50%, rgb(var(--c-secondary-rgb) / .55) 0 1.1px, transparent 1.6px);
  background-size: 192px 192px, 14px 14px; background-blend-mode: multiply, normal; }

/* the arched name card: its foot --he070-tuck of the body's height inside the mouth */
.he070 .he070__cardw { position: absolute; z-index: 2; left: 10%; width: var(--he070-cw); bottom: calc(var(--he070-eh) * (1 - var(--he070-tuck))); filter: var(--k-sh-cut); }
.he070 .he070__card { position: relative; display: grid; justify-items: center; align-content: start; gap: clamp(5px, 1svh, 10px);
  height: var(--he070-ch); padding: 25% 11% 0; text-align: center; rotate: 1.2deg;
  border-radius: 50% 50% 1.5px 1.5px / 23% 23% 1.5px 1.5px; }
.he070 .he070__card::before, .he070 .he070__card::after { content: ""; position: absolute; pointer-events: none; border-radius: 50% 50% 0 0 / 23% 23% 0 0; }
.he070 .he070__card::before { inset: 6.5%; border: 1px solid rgb(var(--c-secondary-rgb) / .9); }
.he070 .he070__card::after { inset: 8%; border: .75px solid rgb(var(--c-secondary-rgb) / .5); }
/* W2.2 (A2057, the owner: "The wedding of" was "crossing the borders"): at 18 % down the arch the inner gold line was
   narrower than the words (about 148 px for 168 on a phone, worse on a laptop). The words sit lower now, where the arch
   is wider, a little tighter and sized from the card, so they clear the inner line at every size. The weekday is gone
   from the date (the owner); the space it left takes the move. */
.he070 .he070__kicker { position: relative; font: 400 clamp(.72rem, calc(var(--he070-cw) * .042), .86rem)/1.4 var(--k-font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--k-ink-soft); }
.he070 .he070-names { position: relative; display: grid; justify-items: center; margin: 0; font-weight: 400; color: var(--k-script-ink);
  font: 400 min(14.5vw, 4.8rem, calc(var(--he070-cw) * .74 / (var(--he070-len, 5) * .5)))/1.02 var(--k-font-script); }
.he070 .he070-name { display: block; padding: 0 .2em; }
.he070 .he070-and { display: block; margin: .02em 0 .08em; font: italic 500 clamp(1.05rem, 4.4vw, 1.35rem)/1 var(--k-font-body); letter-spacing: .04em; color: var(--c-secondary-dark); }
.he070 .he070__rule { position: relative; width: min(62%, 200px); margin: 0 auto; }
.he070 .he070__date { position: relative; display: grid; gap: 5px; justify-items: center; }
.he070 .he070__d { font: 400 clamp(1rem, 4.4vw, 1.3rem)/1.2 var(--k-font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--k-ink); }

/* the back, solid paper over the card's foot: the side flaps and the bottom flap meet in the opener's seams; its top
   edge (the mouth) catches the light */
.he070 .he070__bodyw { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: var(--he070-eh); filter: var(--k-sh-thick); }
.he070 .he070__body { position: absolute; inset: 0; box-shadow: var(--k-edge); }
.he070 .he070__seams { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the seal that held it shut, lying where it came off, by the mouth. W1.4 (A2034): broken when the guest tapped it in
   the opener, so it lies in two halves along a jagged crack; the same photo in both, clipped on ::before (a clip on the
   element would cut its own shadow), each half carrying its own straight-down shadow */
.he070 .he070__seal { position: absolute; z-index: 4; width: clamp(56px, 17vw, 76px); left: -10%; bottom: calc(var(--he070-eh) * .62); }
.he070 .he070__seal--a::before { rotate: 12deg; clip-path: polygon(0 0, 54% 0, 49% 18%, 55% 37%, 47% 56%, 53% 74%, 46% 100%, 0 100%); }
.he070 .he070__seal--b { translate: 9% 4%; }
.he070 .he070__seal--b::before { rotate: 22deg; clip-path: polygon(54% 0, 100% 0, 100% 100%, 46% 100%, 53% 74%, 47% 56%, 55% 37%, 49% 18%); }
.he070 .he070__rings--env { position: absolute; z-index: 4; width: clamp(80px, 25vw, 128px); right: -12%; bottom: 4%; }

/* ---- the framed photo: lying across the envelope's lower half on phones and tablets; the frame (a photograph) is
   drawn over the print, which sits in the mat's window (the window's box from the kit's frame.json, 0.6 % tucked
   under the bevel); the mat's edge shades the print's top (12 o'clock) ---- */
.he070 .he070__pic { position: relative; z-index: 2; width: var(--he070-fw); margin-top: calc(var(--he070-eh) * -.5); translate: 7vw 0; }
.he070 .he070__framew { position: relative; z-index: 1; filter: var(--k-sh-frame); }
.he070 .he070__frame { position: relative; margin: 0; aspect-ratio: 840 / 970; rotate: 3deg; }
.he070 .he070__win { position: absolute; inset: 15.68% 18.4% 15.18% 18.92%; overflow: hidden; background: #D9D3C8; }
.he070 .he070__win::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 2.5px 1.2px -1px rgb(30 22 14 / .34), inset 0 1px .5px rgb(30 22 14 / .22); }
.he070 .he070__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--he070-pos, 50% 35%); }
.he070 .he070__frameart { position: absolute; inset: 0; background: var(--k-kt-frame) center / 100% 100% no-repeat; }
/* the couple's line on a torn-edge tag hanging from under the frame's lower left, only its top edge tucked in, turned
   with the frame so the line stays clear of it (a mask cuts its own shadow, so a wrapper carries it) */
.he070 .he070__tagw { position: absolute; z-index: 0; left: -7%; top: calc(100% - 18px); width: 66%; filter: var(--k-sh-cut); }
.he070 .he070__tag { padding: 24px 12px 14px; text-align: center; rotate: 2deg;
  font: 400 clamp(1.15rem, 5.4vw, 1.6rem)/1.1 var(--k-font-script); color: var(--k-script-ink); white-space: nowrap; }
.he070 .he070__rings { position: absolute; z-index: 2; width: clamp(80px, 25vw, 132px); right: -13%; bottom: -4%; }
.he070 .he070__rings::before { rotate: -14deg; }
/* W2.4 (A2094, D-193; the owner: the rings "are sitting on the frame, which basically doesn't make any sense … place it
   next to the frame on a plane surface"): the rings lie on the table beside the frame, never on it. Phones: under the
   frame's lower right (the tag hangs at its lower left), the hero a little taller to hold them; tablets: to the right of
   the frame; computers: to its right, low. The no-photo rings (on the envelope, paper) keep their rule above */
.he070 .he070__pic .he070__rings { width: clamp(72px, 21vw, 132px); right: -1%; bottom: auto; top: calc(100% + 20px); }
@media (max-width: 699.98px) { .he070:has(.he070__pic) { padding-bottom: calc(clamp(28px, 5svh, 56px) + 48px); } }
@media (min-width: 700px) { .he070 .he070__pic .he070__rings { width: clamp(72px, 12vw, 112px); left: calc(100% + 24px); right: auto; top: auto; bottom: 5%; } }

/* ---- computers: the envelope with its card, the framed photo beside it, overlapping its right edge, set lower ---- */
@media (min-width: 1000px) and (min-aspect-ratio: 1/1) {
  .he070 { --he070-eh: min(calc((100svh - 110px) / 1.74), 560px); --he070-ew: calc(var(--he070-eh) * .82); --he070-fw: min(34vw, 520px);
    min-height: 100svh; display: grid; align-items: center; padding: 48px 0; }
  .he070 .he070__lay { width: min(92vw, 1500px); margin: 0 auto; grid-template-columns: auto auto; justify-content: center; align-items: start; }
  .he070 .he070__pic { margin: calc(var(--he070-rise) + var(--he070-fh) * .5) 0 0 calc(var(--he070-fw) * -.1); translate: none; }
  .he070 .he070__pic .he070__rings { width: 128px; left: calc(100% + 28px); bottom: 6%; }
  .he070 .he070__seal { width: 96px; left: -14%; bottom: 10%; }
  .he070 .he070-names { font-size: min(14.5vw, 4.4rem, calc(var(--he070-cw) * .74 / (var(--he070-len, 5) * .5))); }
  .he070 .he070__fl { right: -3vw; top: -6svh; width: min(28vw, 420px); }
  .he070 .he070__gyp { left: 2vw; bottom: -2svh; width: min(17vw, 240px); }
  .he070 .he070__flc { left: -1vw; top: -6svh; width: min(22vw, 340px); }
  .he070 .he070__stamps { width: 130px; left: 8vw; top: 20svh; }
  .he070 .he070__pt { width: 52px; }
  .he070 .he070__pt--b { left: 14vw; bottom: 4svh; }
  .he070 .he070__sun { width: 70vw; left: -6vw; top: -10svh; }
  .he070 .he070__tag { font-size: clamp(1.3rem, 2vw, 1.8rem); }
}

/* ---- stage 2 W2.1 (A2046; plan ~/.claude/plans/witty-leaping-globe.md: the master plan's spread, without the seal
   breaking, which the owner did not pick). As the opener fades, what was in the bundle spreads over the table: the
   envelope with its card and the framed photo start gathered where the bundle lay (the photo on the envelope) and slide
   to where they rest, in the table's plane (never towards the guest, D-017). The small keepsakes are laid down: their
   shadows start lifted (longer, softer, fainter, as if held above the table) and settle one after another. The big
   sprays at the table's edge stay as they are (a filter animates only on small things). CSS on the runtime's
   kjy-opening -> kjy-enter, because the motion core is not loaded yet at the tap; reduced motion and no JS: the still.
   transform here; the card's draw (section.js) moves the inner card, the table's depth (pa070) the keepsakes ---- */
.he070 { --he070-lift: drop-shadow(0 calc(3.2 * var(--k-u)) calc(2.2 * var(--k-u)) rgb(30 22 14 / .26)) drop-shadow(0 calc(11 * var(--k-u)) calc(4 * var(--k-u)) rgb(30 22 14 / .16)); }
html.kjy-opening:not(.kjy-enter):not(.motion-reduce) .he070 .he070__env { transform: translateY(calc(var(--he070-eh) * .1)); }
html.kjy-opening:not(.kjy-enter):not(.motion-reduce) .he070 .he070__pic { transform: translate(-7vw, calc(var(--he070-eh) * -.42)); }
html.kjy-enter .he070 .he070__env { transition: transform 900ms var(--k-ease) 120ms; }
html.kjy-enter .he070 .he070__pic { transition: transform 1000ms var(--k-ease) 220ms; }
html.kjy-opening:not(.kjy-enter):not(.motion-reduce) .he070 :is(.he070__stamps, .he070__pt, .he070__seal, .he070__rings) { filter: var(--he070-lift); }
html.kjy-enter .he070 :is(.he070__stamps, .he070__pt, .he070__seal, .he070__rings) { transition: filter 700ms var(--k-ease) var(--he070-ld, 600ms); }
.he070 .he070__stamps { --he070-ld: 480ms; }
.he070 .he070__pt--b { --he070-ld: 560ms; }
.he070 .he070__seal--a { --he070-ld: 640ms; }
.he070 .he070__seal--b { --he070-ld: 700ms; }
.he070 .he070__pt--a { --he070-ld: 780ms; }
.he070 .he070__rings { --he070-ld: 860ms; }
@media (min-width: 1000px) and (min-aspect-ratio: 1/1) {
  html.kjy-opening:not(.kjy-enter):not(.motion-reduce) .he070 .he070__env { transform: translateX(calc(var(--he070-ew) * .2)); }
  html.kjy-opening:not(.kjy-enter):not(.motion-reduce) .he070 .he070__pic { transform: translate(calc(var(--he070-fw) * -.55), calc(var(--he070-eh) * .04)); }
}
