/* emblem.css — d11, the turning emblem (engine/emblem.js). Loaded only by pages that show one.
   The mount is a square; the poster <img> and the <canvas> lie on top of each other. The poster shows until the
   canvas has drawn a frame (data-state="ready"), and stays for good when the module is off, under reduced motion or
   calm. A skin sizes the mount (--emblem-size) and places it; nothing here colours anything, as the frames carry the
   site's own background (dark sites) or are transparent (light sites). */
[data-wsd="emblem"] {
  position: relative;
  inline-size: var(--emblem-size, min(78vw, 30rem));
  max-inline-size: 100%;
  aspect-ratio: 1;
  margin-inline: auto;
  touch-action: pan-y;                     /* a sideways drag turns it (feature page, Try); vertical still scrolls */
}
.fx[data-mode="try"] [data-wsd="emblem"][data-state="ready"] { cursor: grab; }
.fx[data-mode="try"] [data-wsd="emblem"][data-state="ready"]:active { cursor: grabbing; }
[data-wsd="emblem"] > img,
[data-wsd="emblem"] > canvas {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  display: block;
  /* the frame's edge melts into the page: WebP rounds the dark sites' background by a step, and this way no box
     can show on any backdrop. The emblem itself sits well inside 80% of the frame. */
  -webkit-mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
}
[data-wsd="emblem"] > canvas { opacity: 0; }
[data-wsd="emblem"][data-state="ready"] > canvas { opacity: 1; }
[data-wsd="emblem"][data-state="ready"] > img { visibility: hidden; }

/* the switch, again: engine.css carries it (one line per id), and the couples' homes load engine.css unversioned,
   so a cached copy would not know d11. Repeated here, in a versioned file only d11's pages load. */
:root:not([data-features~="d11"]) [data-wsd-feature~="d11"] { display: none !important; }

/* on a couple's home: the emblem between the cover and the invitation */
.emb-home { display: grid; justify-items: center; padding-block: clamp(.5rem, 2vw, 1.5rem); }
/* a frame carries about 15% of empty studio above and below the emblem: pulled in so the band sits close */
.emb-home-mark { --emblem-size: min(84vw, 28rem); margin-block: calc(-.14 * var(--emblem-size)); }
.bend--right > .emb-home-mark { margin-left: auto; margin-right: 0; }

/* inside the mount: the skin's own words around the emblem (skin tokens are allowed here) */
.emb-page {
  display: grid; justify-items: center; text-align: center; gap: .5rem;
  padding: clamp(1.4rem, 4vw, 2.6rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 6vw, 3.4rem);
}
.emb-page .emb-mark { --emblem-size: min(100%, 26rem); margin-block: .2rem .6rem; }
.emb-study { margin: 0 0 .6rem; font-size: var(--step--1, .8125rem); letter-spacing: .08em; color: var(--muted, currentColor); }
.emb-names { margin: 0; font-family: var(--display, Georgia, serif); font-weight: 400; color: var(--accent, currentColor); font-size: var(--step-3, 2.4rem); line-height: 1.05; text-wrap: balance; }
.emb-names .amp { font-style: italic; }
.emb-page .cover-date, .emb-page .cover-place { margin: 0; }
