/* Letter opened flat (core/hero/230), INV-25 The Folded Letter · Luxe stage 1 (A3008, D-497): the letter that the opener held
   shut now lies open in three panels with two creases. Phone and tablet: the names fill the top panel; the couple's photo is
   printed across the other two, so the lower crease runs through it; the date under it. Laptop: the letter lies open sideways,
   photo | names | photo, two upright creases. Never the venue (D-121). */
.he230 { height: max(100svh, 640px); display: grid; grid-template-rows: 33.333% 1fr auto; text-align: center; color: var(--k-ink); }
.he230 .he230__words { grid-row: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(18px, env(safe-area-inset-top)) var(--k-gutter) 1.4svh; }
.he230 .he230__kick { font-size: clamp(.72rem, .55rem + .8vw, 1rem); letter-spacing: .2em; max-width: 24em; text-wrap: balance; }
.he230-names { --he230-fs: calc(min(calc(84vw / (var(--he230-len) * .62)), 12.6svh) * var(--k-fl-z)); position: relative; display: flex; flex-direction: column;
  margin-top: clamp(6px, 1.2svh, 14px); font-size: var(--he230-fs); font-weight: 300; }
.he230-names .he230-name { overflow-wrap: anywhere; }
.he230-names .he230-and { position: absolute; left: 50%; top: 50%; translate: -50% -52%; rotate: -5deg; font-size: .56em; }
.he230 .he230__rule, .he230 .he230__date--lp { display: none; }
.he230 .he230__ph { grid-row: 2; margin: 1.6svh 20px 0; min-height: 0; }
.he230 .he230__img { object-position: var(--he230-pos, 50% 50%); }
.he230 .he230__ph--b { display: none; }
.he230 .he230__date--ph { grid-row: 3; padding: 2.6svh var(--k-gutter) max(3.4svh, env(safe-area-inset-bottom)); }
/* three panels, two creases, each panel's own light */
.he230 .he230__t { inset: auto 0; height: 33.334%; }
.he230 .he230__t--1 { top: 0; } .he230 .he230__t--2 { top: 33.333%; } .he230 .he230__t--3 { top: 66.666%; }
.he230 .he230__c--1 { top: calc(33.333% - 28px); } .he230 .he230__c--2 { top: calc(66.666% - 28px); }
.he230--nophoto { grid-template-rows: 1fr auto; } .he230--nophoto .he230__words { grid-row: 1; }

@media (min-width: 980px) and (orientation: landscape) {
  .he230 { height: max(100svh, 620px); grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; }
  .he230 .he230__words { grid-column: 2; grid-row: 1; padding: 6svh 2.4vw; }
  .he230 .he230__kick { font-size: .82rem; }
  .he230-names { --he230-fs: calc(min(calc(30vw / (var(--he230-len) * .56)), 20svh) * var(--k-fl-z)); margin-top: 2.4svh; }
  .he230 .he230__rule { display: block; width: 46%; margin-top: 3.4svh; }
  .he230 .he230__date--lp { display: block; margin-top: 2.2svh; font-size: .82rem; letter-spacing: .2em; }
  .he230 .he230__date--ph { display: none; }
  .he230 .he230__ph { grid-column: 1; grid-row: 1; margin: 34px 34px; }
  .he230 .he230__ph--b { display: block; grid-column: 3; }
  .he230 .he230__ph:only-of-type { grid-column: 1; }
  .he230 .he230__t { inset: 0 auto; width: 33.334%; height: auto; background: linear-gradient(90deg, rgb(70 52 34 / .06), rgb(70 52 34 / .012) 60%, rgb(255 255 255 / .05)); }
  .he230 .he230__t--1 { top: 0; left: 0; } .he230 .he230__t--2 { top: 0; left: 33.333%; background: linear-gradient(270deg, rgb(70 52 34 / .055), rgb(70 52 34 / .012) 60%, rgb(255 255 255 / .05)); }
  .he230 .he230__t--3 { top: 0; left: 66.666%; }
  .he230 .he230__c { top: 0; bottom: 0; width: 60px; height: auto; right: auto; margin-left: -30px;
    background: linear-gradient(90deg, rgb(255 255 255 / 0) 0, rgb(255 255 255 / .16) 30%, rgb(255 255 255 / .6) 48.5%, rgb(64 46 30 / .28) 50.5%, rgb(64 46 30 / .11) 56%, rgb(64 46 30 / 0) 100%); }
  .he230 .he230__c--1 { left: 33.333%; } .he230 .he230__c--2 { left: 66.666%; }
}

/* Stage 2 (A3016, plan W2): the letter lies open under the lifting flap, its two creases still deep from the fold and its panels still
   tilted; they settle flat as the words arrive. On CSS from kjy-enter, so nothing waits for a script; a return visit (kjy-instant) or Reduce
   Motion shows the still hero. W3 (A3023): the letter unfolds onto the hero, so the photo prints from 1.15 s (reveal_at_ms), as the middle
   panel shows between the unfolding panels, the date next; the
   words rise once the flap has left the top panel; the script "and" is written (INV-02's clip); the rule draws out. Done by about 3.3 s from
   the tap (feedback-reveal-about-5s; W2 r2: no bare paper between the flap and the words). Nothing shows twice: the opener holds no copy of the hero's parts. */
html.js:not(.motion-reduce):not(.kjy-enter) .he230 :is(.he230__kick, .he230-name, .he230__date, .he230__ph) { opacity: 0; }
html.js:not(.motion-reduce):not(.kjy-enter) .he230 :is(.he230__kick, .he230-name, .he230__date--lp) { transform: translateY(14px); }
html.js:not(.motion-reduce):not(.kjy-enter) .he230-and { clip-path: inset(-60% 120% -60% -20%); }
html.js:not(.motion-reduce):not(.kjy-enter) .he230__rule { transform: scaleX(0); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 { --he230-at: var(--kjy-reveal-at, 1150ms); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__ph { transition: opacity 1.4s cubic-bezier(.3, 0, .2, 1) var(--he230-at); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 :is(.he230__kick, .he230-name, .he230__date) { --he230-d: calc(var(--he230-at) + 400ms);
  transition: opacity .9s ease var(--he230-d), transform 1.1s var(--k-ease) var(--he230-d); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230-name { --he230-d: calc(var(--he230-at) + 460ms); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230-name ~ .he230-name { --he230-d: calc(var(--he230-at) + 520ms); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__date--ph { --he230-d: calc(var(--he230-at) + 450ms); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__date--lp { --he230-d: calc(var(--he230-at) + 900ms); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230-and { clip-path: inset(-60% -20% -60% -20%); transition: clip-path 1.4s cubic-bezier(.45, .05, .35, 1) calc(var(--he230-at) + 700ms); animation: he230-dry 1.9s ease-in calc(var(--he230-at) + 700ms) both; } /* W3: wet ink, then dry */
@keyframes he230-dry { from, 40% { color: var(--k-fl-wet); text-shadow: 0 -.5px 0 rgb(255 255 255 / .8), 0 0 .5px var(--k-fl-wet), 0 .8px 1.1px rgb(90 20 10 / .3); } }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__rule { transition: transform 1.2s var(--k-ease) calc(var(--he230-at) + 650ms); }
/* the creases and the panels' light: a deep copy on each fades away, the lower fold first (the flap's edge leaves it first) */
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 :is(.he230__c, .he230__t)::after { content: ""; position: absolute; inset: 0; background: inherit;
  pointer-events: none; opacity: 0; animation: he230-crease 1.7s var(--k-ease) var(--he230-s, calc(var(--he230-at) + 100ms)) backwards; }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__t::after { animation-name: he230-tilt; }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 :is(.he230__c--1, .he230__t--1) { --he230-s: calc(var(--he230-at) + 400ms); }
html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__t--2 { --he230-s: calc(var(--he230-at) + 200ms); }
/* laptop: the photos sit under the unfolding side panels, so they print once the panels have gone (W3 r2: no sliver of photo at the edge) */
@media (min-width: 980px) and (orientation: landscape) { html.kjy-enter:not(.kjy-instant):not(.motion-reduce) .he230 .he230__ph { transition-delay: calc(var(--he230-at) + 450ms); } }
@keyframes he230-crease { from { opacity: .6; } to { opacity: 0; } }
@keyframes he230-tilt { from { opacity: .5; } to { opacity: 0; } }
