/* ==========================================================================
   components.css: photo frame, name ribbon, tab tiles, page ribbon, panel
   contents, link pills, order pill, gallery, viewer, states.
   Pink and cocoa lace: cream cloth surfaces, a sewn name label, an embroidered title plate,
   one pale rose dashed stitch line (only inside panels, tiles, the footer
   label and gallery frames), soft shadows. Surfaces read the material layer
   in css/layout.css (--mat-*), so every photographic fabric can arrive alone.
   Colours only from css/tokens.css.
   ========================================================================== */

/* ---------- label-font tracking (only lettering set 3 defines --label-track, to tighten Gaegu) ---------- */
:where(.marquee, .skip-link, .noscript-note, .tagline, .tab-label, .banner-sub, .empty-note, .panel-status,
  .panel-error-text, .retry-button, .fact-label, .more-toggle, .rule-title, .menu-cat-name, .fave-tag,
  .photo-caption, .pager-status, .link-label, .link-state, .order-state, .foot-text, .viewer-caption, .viewer-count) {
  letter-spacing: var(--label-track, normal);
}

/* ---------- "to fill" placeholders: a soft rose band; on taupe ribbons a cream underline, on petal a cocoa one ---------- */
.is-placeholder {
  width: fit-content;
  max-width: 100%;
  color: var(--ph-color, var(--c-rose-800));
  background-color: var(--ph-band, var(--c-ph-band));
  border-radius: 4px;
  text-decoration: underline solid var(--ph-line, var(--c-rose-300)) 2px;
  text-underline-offset: 4px;
  text-decoration-skip-ink: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* the band itself is painted on an inline span inside the text (js/richtext.mjs setText): one stroke per line, so a
   placeholder that wraps gets a band on each line, never a slab. It covers the ink of the small and tall letters and
   the tails (from .82em over the baseline to the bottom of the font's box, .31em under it), not the font's whole
   box, so in a pill, a tag or the order button it stays inside the stitch; accents may rise past it, as on a marker
   stroke. The element keeps its colour and underline. */
.is-placeholder:has(> .ph-band) { background-color: transparent; }
.ph-band {
  background: linear-gradient(var(--ph-band, var(--c-ph-band)), var(--ph-band, var(--c-ph-band))) 0 100% / 100% 1.13em no-repeat;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.banner, .menu-cat-name {
  --ph-color: var(--c-cream);
  --ph-band: transparent;
  --ph-line: var(--c-rose-200);
}
.marquee, .tab.is-active, .order-badge {
  --ph-color: var(--c-cocoa-900);
  --ph-band: transparent;
  --ph-line: var(--c-cocoa);
}

/* ---------- before the page is ready: every word the editor can change stays hidden (visibility, so nothing moves)
   until js/app.mjs has rendered the content and its fonts have loaded and sets html.page-ready; the error state
   (html.page-failed) keeps them hidden too and shows only its own message. The sewn object shows from the first paint:
   card, lace, bands, photo frame, tiles and icons, panels, the empty order button with its rim. The panel's
   "loading…" line is the one word visible meanwhile; scripts off, the noscript note takes its place. ---------- */
html:not(.page-ready) :is(.marquee-viewport, .name-text, .tagline, .tab-label, .banner-title, .banner-sub, .links-title,
  .link-list, .order-label, .order-state, .order-note, .foot-text, #panel > :not(.panel-status)),
html.page-failed :is(.marquee-viewport, .name-text, .tagline, .tab-label, .banner-title, .banner-sub, .links-title,
  .link-list, .order-label, .order-state, .order-note, .foot-text) { visibility: hidden; }
/* still not ready after 8 seconds (a script that never finishes): a quiet line under the loading line, no script */
.page-slow.page-slow { display: none; } /* doubled: beats .panel-status further down */
html:not(.page-ready) .page-slow { display: flex; padding-top: 0; text-align: center; visibility: hidden; animation: page-slow 1ms 8s forwards; }
@keyframes page-slow { to { visibility: visible; } }
/* the content is rendered into the hidden panel a moment before its fonts have loaded: the loading line stays
   meanwhile, over the panel's top, in the look of .panel-status */
html:not(.page-ready) #panel:not(.panel--status)::before {
  content: "loading…";
  position: absolute;
  inset: 0 0 auto;
  padding: 24px 0;
  text-align: center;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  color: var(--c-body);
  pointer-events: none;
}
@media (scripting: none) { #panel > .panel-status, .page-slow { display: none !important; } }

/* ---------- nine-slice pieces (name label, title plate): the photographed piece is a border-image on a
   ::before layer that also carries the soft shadow, so the text above it never gets a shadow.
   --k scales the image's slice pixels to CSS px. ---------- */
.name-ribbon::before,
.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- photo: round photo on a lace frame (drawn ring, or the photographed doily), bow on top ---------- */
:root { --frame-d: calc(var(--photo-d) + 2 * var(--lace-ring)); }
html[data-art~="doily"] { --photo-d: 66px; --frame-d: calc(var(--photo-d) / .62); }
@media (max-width: 359px) { html[data-art~="doily"] { --photo-d: 62px; } }
@media (min-width: 960px) { html[data-art~="doily"] { --photo-d: 100px; } }

.photo-patch {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--frame-d);
  height: var(--frame-d);
}
.photo-patch::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../assets/trim/lace-ring.svg");
  background-size: 100% 100%;
  filter: drop-shadow(0 2px 2px var(--c-cocoa-a22));
  pointer-events: none;
}
html[data-art~="doily"] .photo-patch::before {
  background-image: var(--art-doily);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.photo-media {
  position: relative;
  display: grid;
  width: var(--photo-d);
  height: var(--photo-d);
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--c-blush);
  box-shadow: 0 0 0 2px var(--c-lace), 0 2px 5px 1px var(--c-cocoa-a22);
}
.photo-media > * { grid-area: 1 / 1; }
.photo-media .photo-img { width: 100%; height: 100%; object-fit: cover; }

/* empty photo slot / failed image: blush with one small rose heart */
.photo-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background-color: var(--c-blush);
  background-image: var(--mat-blush);
  background-size: var(--mat-size);
  --sp-fill: var(--c-rose-300);
}
.photo-fallback-glyph { width: 32%; height: 32%; max-width: 64px; max-height: 64px; }

/* ---------- where the embroidery of the two nine-slice pieces really ends, in image px from the outer edge.
   Measured in assets/art/label.webp and assets/art/plaque.webp (scripts: qa/wip/a/edges2.py): on the label, the
   last pink pixel of the woven bands (red minus green over 14, top 25 / bottom 25) and the last dark pixel of the
   cocoa end stitches (luminance under 215, left 27 / right 27); on the plaque, the last pixel of the cream
   scalloped stitch line or its shading (luminance more than 12 off the plain middle; top 27, bottom 24, left 24,
   right 22). Each pair keeps the larger side. The slice areas in css/art.css are wider than this (label 28 / 36,
   plaque 57 / 67): padding measured from the slice would leave dead cloth inside the embroidery.
   Padding = edge x --k + the clearance - what the lettering box can be counted on to hold above the ink (--ink-hold). ---------- */
:root {
  --label-edge-y: 25;
  --label-edge-x: 27;
  --plaque-edge-y: 27;
  --plaque-edge-x: 24;
}

/* ---------- name and tagline on a sewn name label: the photographed label (slot label, nine-slice) or a
   drawn cream label with a pink line along the long edges and cocoa stitches at the short ends.
   A three-column grid: the name (row 1) and the tagline (row 2) in the middle column, the owner's dotted scroll
   in each side column on desktop (.flourish). Script ink keeps 8px from the visible embroidery: padding top
   = edge + 8px - --ink-hold, bottom = edge + 8px (the tagline's line box, line-height 1.4, holds its tails), sides = edge + 8px. ---------- */
.name-ribbon {
  --k: .3;
  --label-air-y: 2px; /* the drawn label's visible edge: its 2px pink lines on the box edge */
  --label-air-x: 9px; /* and its dashed end stitches (inset 7px, 2px wide) */
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  text-align: center;
  max-width: 100%;
  padding: calc(var(--label-air-y) + 8px - var(--ink-hold, 0px)) calc(var(--label-air-x) + 8px) calc(var(--label-air-y) + 8px);
}
html[data-art~="label"] .name-ribbon {
  --label-air-y: calc(var(--label-edge-y) * var(--k) * 1px);
  --label-air-x: calc(var(--label-edge-x) * var(--k) * 1px);
}
.name-ribbon > .name-text { grid-column: 2; grid-row: 1; }
.name-ribbon > .tagline { grid-column: 2; grid-row: 2; }
.flourish { display: none; }
.name-ribbon::before {
  border-radius: 6px;
  background-color: var(--c-cream);
  background-image: var(--mat-cream);
  background-size: var(--mat-size);
  box-shadow: var(--sh-panel);
  border-top: 2px solid var(--c-rose-200);
  border-bottom: 2px solid var(--c-rose-200);
  outline: 2px solid var(--c-cream); /* a cream margin outside the pink lines, as on a woven label */
}
.name-ribbon::after {
  content: "";
  position: absolute;
  inset: 8px 7px;
  border-inline: 2px dashed var(--c-mocha-300);
  pointer-events: none;
}
html[data-art~="label"] .name-ribbon::before {
  border-radius: 0;
  background: none;
  box-shadow: none;
  outline: 0;
  border-style: solid;
  border-color: transparent;
  border-width: calc(var(--art-label-slice-y) * var(--k) * 1px) calc(var(--art-label-slice-x) * var(--k) * 1px);
  border-image-source: var(--art-label);
  border-image-slice: var(--art-label-slice-y) var(--art-label-slice-x) fill;
  border-image-repeat: stretch;
  filter: drop-shadow(0 2px 2px var(--c-cocoa-a22));
}
html[data-art~="label"] .name-ribbon::after { display: none; }
.name-text {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  --letter-size: var(--fs-name);
  font-size: var(--letter-size);
  line-height: var(--display-lh);
  letter-spacing: calc(var(--display-track) * 1em);
  color: var(--c-body);
  overflow-wrap: anywhere;
  /* two lines at most (three under 360px). overflow clips at the padding box, so: the box's top already sits
     --ink-pad above the tallest ink; the side padding keeps the swashes of the first and last letter (and the
     placeholder band's ends); clip-path cuts the bottom --ink-pad under the tails of the last kept line, where the tall
     letters of a hidden next line would otherwise peek in */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-inline: .15em;
  clip-path: inset(0 0 calc((var(--ink-lh, 1.65) / 2 - .516) * 1em - var(--ink-pad, 0px)) 0);
}
.tagline {
  position: relative;
  z-index: 1;
  max-width: 100%;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  line-height: 1.4; /* tails inside the line box; two lines keep 3px between an accent and the tails above */
  color: var(--c-rose-800);
  overflow-wrap: anywhere;
  text-wrap: balance;
}
@media (max-width: 359px) {
  .name-text { -webkit-line-clamp: 3; }
}
/* desktop: the label runs the whole width of the tab row, name and tagline centred, and the owner's dotted scroll
   (assets/trim/flourish.svg) in each side column: the drawing as it is on the left, mirrored on the right.
   js/render-profile.mjs (fitScrolls) decides, before the page shows, whether they fit and at what size:
   - the scroll is drawn at a dot pitch --scroll-p that lands on whole device pixels (2px; on a 1.25 screen 1.6px; on
     1.5 and 2x screens also 1.33px and 1.5px when 2px does not fit), so 100 x 32 pitches, never another scale;
   - each side column is at least --scroll-col wide: the drawing, 14px of air to the name and tagline, 2px to the
     label's padding (which holds its 8px inside the embroidered end, so 10px from the visible edge);
   - the tagline wraps in the middle column (balanced, two lines at most) and the name takes a smaller size down to
     --name-cap's floor (72% of its size, never under the phone size) rather than pushing the scrolls out;
   - when none of that is enough, .has-scrolls stays off: no scrolls, both together, the name at its own size.
   The scroll box stays 72px tall in every case (the drawing centred in it), so the label keeps its height. */
@media (min-width: 960px) {
  .name-ribbon { --k: .36; flex: 1 1 100%; }
  .name-ribbon > .flourish {
    position: relative;
    z-index: 1;
    display: block;
    grid-row: 1 / 3;
    justify-self: stretch;
    height: 72px;
    pointer-events: none;
  }
  .name-ribbon > .flourish--l { grid-column: 1; }
  .name-ribbon > .flourish--r { grid-column: 3; }
  .name-ribbon.has-scrolls {
    grid-template-columns: minmax(var(--scroll-col), 1fr) minmax(0, auto) minmax(var(--scroll-col), 1fr);
  }
  .name-ribbon.has-scrolls > .name-text { font-size: min(var(--letter-size), var(--name-cap)); }
  .name-ribbon.has-scrolls > .flourish::before {
    --w: calc(100px * var(--scroll-p));
    content: "";
    position: absolute;
    /* --fl-dx / --fl-dy: under one device pixel, set by js/render-profile.mjs so the dot grid lands on whole device pixels */
    top: calc((72px - 32px * var(--scroll-p)) / 2 + var(--fl-dy, 0px));
    width: var(--w);
    height: calc(32px * var(--scroll-p));
    background: url("../assets/trim/flourish.svg") 0 0 / var(--w) calc(32px * var(--scroll-p)) no-repeat;
  }
  /* centred in its column when there is room; otherwise 2px from the outer side and 14px from the middle */
  .name-ribbon.has-scrolls > .flourish--l::before { left: calc(clamp(2px, 50% - var(--w) / 2, 100% - 14px - var(--w)) + var(--fl-dx, 0px)); }
  .name-ribbon.has-scrolls > .flourish--r::before { left: calc(clamp(14px, 50% - var(--w) / 2, 100% - 2px - var(--w)) + var(--fl-dx, 0px)); transform: scaleX(-1); }
}

/* ---------- tab tiles: floral cotton, a seam stitched inside, the icon on a cream disc with a stitched ring,
   the label on its own small sewn cream tag, so text never touches the print.
   A tile is at least --tab-h tall and grows with a label that wraps (the row keeps one height: grid stretch).
   Its side padding keeps the tag 3px inside the stitch (inner edge 6px in, 7px on desktop). Each tile is an inline
   size container: the label's size and the tag's side padding follow the tile's width, so a label as wide as
   "gallery" (2.65em with its tracking, 2.75em counted) stays on one line at its full size wherever it fits, with at least 3px of
   tag (3.5px) on either side of the ink; a word that still cannot fit breaks inside the tag (never out of it). ---------- */
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* vertical: the disc's ring (3.5px outside it) 2.5px under the stitch, 6px from the ring to the tag (so even an
     accent's ink keeps 6px from the ring), the tag 2px over the stitch */
  gap: 6px;
  height: auto;
  min-height: var(--tab-h);
  min-width: 0;
  container-type: inline-size;
  padding: 12px 9px 8.5px;
  border-radius: var(--r-tile);
  background-color: var(--c-cream);
  background-image: var(--mat-floral);
  background-size: var(--mat-floral-size);
  color: var(--c-body);
  text-decoration: none;
  box-shadow: var(--sh-tile);
}
.tab::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: var(--stitch) dashed var(--c-stitch);
  border-radius: calc(var(--r-tile) - 4px);
  pointer-events: none;
}
.tab-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tab-dot);
  height: var(--tab-dot);
  border-radius: 50%;
  background-color: var(--c-cream);
  outline: 1.5px dashed var(--c-stitch); /* the disc is not focusable: its outline is free for the stitched ring */
  outline-offset: 2px;
  box-shadow: 0 1px 2px var(--c-cocoa-a12);
  --sp-thread: var(--c-cocoa);
  --sp-fill: var(--c-cocoa);
}
.tab-icon { width: var(--tab-icon); height: var(--tab-icon); }
.tab-label {
  --tag-pad-max: 6px;
  --tag-border: 2px;
  position: relative;
  max-width: 100%;
  /* the tag's side padding: what the tile leaves beside a "gallery"-wide label, 3px to --tag-pad-max */
  /* measured on pixels at 3x (qa/wip/c/tabink.cjs): the painted tails of g, y, p end up to 2px under the line box, the
     outer letters up to 1.5px beyond their advance; 2px over, 5.5px under and at least 4.5px beside keep every ink 3px
     inside the cream tag */
  padding: 2px var(--tab-pad, clamp(4.5px, (100cqi - 2 * var(--tag-border) - 2.75em) / 2, var(--tag-pad-max))) 5.5px;
  border-inline: var(--tag-border) dotted var(--c-rose-300);
  border-radius: 4px;
  background-color: var(--c-lace);
  box-shadow: 0 1px 2px var(--c-cocoa-a22);
  font-family: var(--font-label);
  font-size: var(--tab-fs, clamp(var(--fs-min), (100cqi - 2 * var(--tag-border) - 9px) / 2.75, var(--fs-tab)));
  font-weight: var(--label-bold);
  line-height: var(--label-lh);
  text-align: center;
  overflow-wrap: anywhere; /* last resort only: js/render-profile.mjs fitTabs() sizes every word to fit its line */
  text-wrap: balance;
}
/* measured names (js/render-profile.mjs fitTabs): a name whose longest word does not fit its line at the row's size
   gets its own smaller size (--tab-fs, never under 14px) and the least tag padding (--tab-pad), so it wraps only
   between words; a name that wraps (.tab-label--wrap) keeps 3px between an accent and the tails above */
.tab-label--wrap { line-height: 1.45; }
.tab-probe { position: absolute; visibility: hidden; width: max-content; white-space: nowrap; overflow-wrap: normal; font-weight: 700; } /* bold: the active tab's weight, the widest a name gets */ /* fitTabs' measuring probe, removed at once */
/* a tile that grows with a wrapped label ends on a fractional pixel: 1px more keeps its tag 2px clear of the stitch */
@media (max-width: 959px) { .tab:has(> .tab-label--wrap) { padding-bottom: 9px; } }
/* two by two (phones only, .tabs--pairs, set by fitTabs when some word cannot fit a quarter-width tile at 14px): each
   tile is half the row wide, the disc beside the name, so a whole name fits on one line when it can. The same tile:
   stitch, disc and ring, tag, active look. Vertical: 56px, the ring 3.5px clear of the stitch; horizontal: the ring
   2px inside the stitch (padding 12px), 6px from the disc to the tag so the name's ink keeps 6px from the ring.
   A single word too long even here breaks inside, with a hyphen where the browser can place one. */
@media (max-width: 959px) {
  .tabs.tabs--pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs--pairs .tab { flex-direction: row; min-height: 56px; padding: 9px 9px 9px 12px; gap: 6px; }
  .tabs--pairs .tab:has(> .tab-label--wrap) { padding-bottom: 9px; }
  .tabs--pairs .tab-label { flex: 0 1 auto; min-width: 0; hyphens: auto; -webkit-hyphens: auto; }
}
/* no label: no empty tag; the tile keeps its size and its name for screen readers (aria-label, render-profile.mjs) */
.tab-label:empty { display: none; }
/* active: petal cloth, pressed into the band (2px lower, inner shade instead of the raised shadow) */
.tab.is-active {
  translate: 0 2px;
  background-color: var(--mat-petal-color);
  background-image: var(--mat-petal);
  background-size: var(--mat-petal-size);
  background-blend-mode: var(--mat-petal-blend);
  color: var(--c-cocoa-900);
  box-shadow: inset 0 2px 5px var(--c-cocoa-a35), inset 0 0 0 1px var(--c-cocoa-a12);
}
.tab.is-active .tab-label { font-weight: 700; }
.tab.is-active::before { border-color: var(--c-lace); }
.tab.is-active .tab-dot { outline-color: var(--c-lace); --sp-thread: var(--c-cocoa-900); --sp-fill: var(--c-cocoa-900); }
.tab.is-pressed { translate: 0 2px; box-shadow: var(--sh-tile-pressed); }
.tab.is-active.is-pressed { box-shadow: inset 0 3px 6px var(--c-cocoa-a35), inset 0 0 0 1px var(--c-cocoa-a12); }
@media (max-width: 359px) {
  .tab-label { --tag-border: 1.5px; letter-spacing: calc(var(--label-track, 0em) - .02em); }
}
@media (min-width: 960px) {
  .tab { gap: 7px; padding: 14px 10px 10px; } /* 14px: the ring keeps 2px from the stitch while the hovered disc grows 6% */
  .tab::before { inset: 5px; border-radius: calc(var(--r-tile) - 5px); }
  .tab-label { --tag-pad-max: 11px; }
}

/* ---------- title plate on every tab: the photographed embroidered plaque (slot plaque, nine-slice) or a drawn
   taupe plate with one cream stitched frame. Cream lettering on its plain middle, an embroidered spray (slot
   spray-plate) either side: grid columns that only take the width the title leaves, with the column gap as air
   (12px, 16px desktop, 10px on phones), so a long title shrinks them and finally makes them zero. ---------- */
.banner {
  --k: .26;
  --spray-w: 58px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  column-gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 88px;
  /* the drawn plate's visible edge is its cream stitched frame (inset 6px, 2px wide): the title ink 8px inside it */
  padding: calc(16px - var(--ink-hold, 0px)) 16px 17px;
  text-align: center;
  perspective: 600px;
}
.banner::before {
  border-radius: 16px;
  background-color: var(--mat-ribbon-color);
  background-image: var(--mat-ribbon);
  background-size: var(--mat-size);
  background-blend-mode: multiply;
  box-shadow: var(--sh-panel);
}
.banner::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 0;
  border: 2px dashed color-mix(in srgb, var(--c-cream) 70%, transparent);
  border-radius: 11px;
  pointer-events: none;
}
.banner > .spray { display: none; }
html[data-art~="spray-plate"] .banner > .spray {
  display: block;
  width: min(100%, var(--spray-w));
  aspect-ratio: var(--mat-spray-plate-ar);
  --spray-img: var(--mat-spray-plate);
}
/* a spray is its own size container: squeezed under 32px by a long title it gives way completely, never a speck */
.spray { position: relative; z-index: 1; container-type: inline-size; pointer-events: none; }
.spray::before { content: ""; position: absolute; inset: 0; background: var(--spray-img, none) center / contain no-repeat; }
@container (max-width: 31px) { .spray::before { display: none; } }
.banner > .spray--l { grid-column: 1; grid-row: 1; justify-self: start; }
.banner > .banner-text { grid-column: 2; grid-row: 1; }
.banner > .spray--r { grid-column: 3; grid-row: 1; justify-self: end; transform: scaleX(-1); }
/* padding from the plaque's visible stitch line (--plaque-edge-*): the title ink 8px under the top stitches, the
   subtitle 9px over the bottom ones (8px plus its descent room), the sides at least 16px so a spray never meets
   the scalloped end */
html[data-art~="plaque"] .banner {
  padding:
    calc(var(--plaque-edge-y) * var(--k) * 1px + 8px - var(--ink-hold, 0px))
    max(16px, calc(var(--plaque-edge-x) * var(--k) * 1px + 8px))
    calc(var(--plaque-edge-y) * var(--k) * 1px + 9px);
}
html[data-art~="plaque"] .banner::before {
  border-radius: 0;
  background: none;
  box-shadow: none;
  border-style: solid;
  border-color: transparent;
  border-width: calc(var(--art-plaque-slice-y) * var(--k) * 1px) calc(var(--art-plaque-slice-x) * var(--k) * 1px);
  border-image-source: var(--art-plaque);
  border-image-slice: var(--art-plaque-slice-y) var(--art-plaque-slice-x) fill;
  border-image-repeat: round stretch; /* the embroidered top and bottom edges repeat, the sides and middle stretch */
  filter: drop-shadow(0 2px 3px var(--c-cocoa-a22));
}
html[data-art~="plaque"] .banner::after { display: none; }
.banner-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  transform-origin: 50% 50%;
}
.banner-title {
  max-width: 100%;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  --letter-size: var(--fs-banner);
  font-size: var(--letter-size);
  line-height: var(--display-lh);
  letter-spacing: calc(var(--display-track) * 1em);
  color: var(--c-cream);
  overflow-wrap: anywhere;
}
.banner-sub {
  margin-top: 2px;
  text-wrap: balance;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  line-height: var(--label-lh);
  color: var(--c-cream);
  overflow-wrap: anywhere;
}
@media (min-width: 960px) {
  .banner { --k: .36; --spray-w: 140px; min-height: 110px; column-gap: 16px; }
  /* 1px more over the title: a capital with a hook above (Ỷ) rises 1px past the box at the desktop sizes */
  html[data-art~="plaque"] .banner { padding-top: calc(var(--plaque-edge-y) * var(--k) * 1px + 9px - var(--ink-hold, 0px)); }
}

/* ---------- the one divider: a line of hand stitching (pale stitch colour) with a small knot at each end and one
   embroidered motif sewn on its middle (slot blossoms); without the image three knot dots. The line is two dashed
   runs (6px stitches, 4px apart, as the browser's own 2px dashed border draws them, each run starting at its knot)
   that stop at least --div-open short of the middle: the motif sits in a real opening, nothing is painted over the line. ---------- */
.divider {
  --div-open: 16px; /* half the opening: the three dots (9px + 2px either side) and 5px of air */
  position: relative;
  width: min(70%, 320px);
  height: var(--stitch);
  margin: 26px auto 12px;
  background:
    repeating-linear-gradient(to right, var(--c-stitch) 0 6px, transparent 6px 10px) left top / var(--div-run) 100% no-repeat,
    repeating-linear-gradient(to left, var(--c-stitch) 0 6px, transparent 6px 10px) right top / var(--div-run) 100% no-repeat;
  /* each run ends on a whole stitch at the opening (no stub): its length rounded down to 6px + whole 10px steps */
  --div-run: calc(round(down, 50% - var(--div-open) - 6px, 10px) + 6px);
}
.divider::before {
  content: "";
  position: absolute;
  top: calc(var(--stitch) / 2 - 3px);
  left: -6px;
  right: -6px;
  height: 6px;
  border-inline: 6px solid var(--c-rose-300);
  border-radius: 3px;
  pointer-events: none;
}
.divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(var(--stitch) / 2);
  width: 4px;
  height: 4px;
  translate: -50% -50%;
  border-radius: 50%;
  background-color: var(--c-rose-300);
  box-shadow: -9px 0 0 var(--c-rose-300), 9px 0 0 var(--c-rose-300);
  pointer-events: none;
}
/* the motif is 20px tall; the opening is its width plus 8px either side */
html[data-art~="blossoms"] .divider { --div-open: calc(10px * var(--mat-blossoms-ar) + 8px); }
html[data-art~="blossoms"] .divider::after {
  width: calc(20px * var(--mat-blossoms-ar));
  height: 20px;
  border-radius: 0;
  background: var(--mat-blossoms) center / contain no-repeat;
  box-shadow: none;
}
.divider--links { margin-top: 20px; margin-bottom: 18px; width: min(78%, 240px); } /* its motif as far from the first pill as from the heading's tails */
/* phones: a tighter divider, so the first link pill shows on the first screen (390 x 844, factory content); the top
   margin stays 14px, so the motif (20px tall on the line) keeps 3px from the plate above it */
@media (max-width: 959px) { .divider--links { display: none; } .divider { margin-top: 14px; margin-bottom: 4px; } }
.links-head:has(> .links-title[hidden]) + .divider--links { display: none; }
.mini-heart { flex: none; width: 15px; height: 15px; --sp-fill: var(--c-rose-300); }
/* beside "my links": an embroidered butterfly either side (slot butterfly), both facing outward; empty without it */
.links-head .mini-heart { display: none; }
html[data-art~="butterfly"] .links-head .mini-heart {
  display: block;
  width: 32px;
  height: calc(32px / var(--mat-butterfly-ar));
  background: var(--mat-butterfly) center / contain no-repeat;
  rotate: -8deg;
}
html[data-art~="butterfly"] .links-head .mini-heart:first-child { transform: scaleX(-1); rotate: 8deg; }
.links-head .mini-heart use { display: none; }

/* ---------- panel ---------- */
.panel { position: relative; flex: 1 0 auto; margin-top: 10px; border-radius: 6px; }
.panel:focus { outline: none; }
.panel:focus-visible { outline: var(--focus-w) solid var(--focus-color); outline-offset: 4px; }
/* phones: the panel sits 16px inside its block, whose stitch ends 8px in: offset 2px leaves the ring 3px from the stitch */
@media (max-width: 959px) { .panel:focus-visible { outline-offset: 2px; } }
/* loading and error (js/app.mjs): their own state, the message centred in whatever height the panel has */
.panel--status { display: flex; flex-direction: column; justify-content: center; }
.richtext p + p { margin-top: .55em; }
.richtext { overflow-wrap: anywhere; }
.rt-link {
  color: var(--c-rose-800);
  text-decoration: underline solid var(--c-rose-300) 2px;
  text-underline-offset: 4px;
}
mark.hl {
  background-color: var(--c-hl);
  color: var(--c-body);
  padding: 0 5px;
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.fact-tag mark.hl { background-color: var(--c-cream); }
.empty-note {
  margin-inline: auto;
  padding: 24px 0;
  text-align: center;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  color: var(--c-rose-800);
}
.link-item--empty .empty-note { width: 100%; padding: 12px 0; background-color: var(--c-lace); border: 2px solid var(--c-rose-200); border-radius: var(--r-pill); }
@media (min-width: 960px) {
  .panel { margin-top: 14px; }
}

.panel-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  color: var(--c-body);
}
.panel-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 8px 0;
  padding: 20px 16px;
  text-align: center;
  border-radius: var(--r-tile);
  background-color: var(--c-blush);
  background-image: var(--mat-blush);
  background-size: var(--mat-size);
}
.panel-error-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--c-error);
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
}
.panel-error-icon { width: 24px; height: 24px; flex: none; --sp-thread: var(--c-error); --sp-fill: var(--c-error); }
.retry-button {
  min-height: var(--tap);
  padding: 6px 26px;
  border-radius: var(--r-pill);
  background-color: var(--c-mocha-700);
  color: var(--c-cream);
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  box-shadow: var(--sh-pill-hover);
}
.retry-button:active { translate: 0 2px; box-shadow: var(--sh-pill); }

/* ---------- home ---------- */
.home-bio { color: var(--c-body); }
.home-more { margin-top: 14px; }
.facts { display: grid; gap: 10px; }
.fact-tag {
  --fact-pad-r: 40px;
  position: relative;
  padding: 11px var(--fact-pad-r) 12px 16px;
  border-radius: var(--r-tile);
  background-color: var(--c-blush);
  background-image: var(--mat-blush);
  background-size: var(--mat-size);
}
.fact-tag::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px dashed var(--c-stitch);
  border-radius: calc(var(--r-tile) - 4px);
  pointer-events: none;
}
/* one small motif in the top right corner, cycling so no two neighbours match: blossoms, butterfly, bowknot */
.fact-tag::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 21px;
  height: 21px;
  background: var(--fact-motif, none) center / contain no-repeat;
  rotate: var(--fact-turn, 0deg);
  pointer-events: none;
}
.fact-tag:nth-child(3n + 1) { --fact-motif: var(--mat-blossoms); --fact-turn: -8deg; }
.fact-tag:nth-child(3n + 2) { --fact-motif: var(--mat-butterfly); --fact-turn: 10deg; }
.fact-tag:nth-child(3n) { --fact-motif: var(--mat-bowknot); --fact-turn: -14deg; }
/* the first line of the box (the label, or the text when there is no label) ends 45px from the box's right edge:
   the motif (13px in, 21px wide, up to 2.2px more when turned) plus 8px of air */
.fact-tag > :is(.fact-label, .fact-text:not(.fact-label + *)) { padding-right: calc(45px - var(--fact-pad-r)); }
.fact-label {
  font-family: var(--font-label);
  font-size: var(--fs-h3);
  font-weight: var(--label-bold);
  line-height: var(--label-lh);
  color: var(--c-rose-800);
}
.fact-text { margin-top: 3px; color: var(--c-body); }
.more-toggle {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin-top: 8px;
  padding: 0 22px;
  border: 2px solid var(--c-rose-200);
  border-radius: var(--r-pill);
  background-color: var(--c-lace);
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  color: var(--c-rose-800);
}
@media (max-width: 959px) {
  .panel--home:not(.is-expanded) .home-bio {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  .panel--home:not(.is-expanded) .home-more { display: none; }
}
@media (min-width: 960px) {
  .facts { grid-template-columns: 1fr 1fr; gap: 14px; }
  .fact-tag { --fact-pad-r: 20px; padding: 14px var(--fact-pad-r) 15px 20px; }
  .fact-tag:last-child:nth-child(odd) { grid-column: 1 / -1; } /* an odd last box spans the row: no hole */
  .home-more { margin-top: 18px; }
  .more-toggle { display: none; }
}

/* ---------- round controls: mocha circles with a cream glyph ---------- */
.round-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--round-button);
  height: var(--round-button);
  border-radius: 50%;
  background-color: var(--c-mocha-700);
  color: var(--c-cream);
  box-shadow: var(--sh-pill-hover);
  --sp-fill: var(--c-cream);
  --sp-thread: var(--c-cream);
}
.round-button-glyph { width: 22px; height: 22px; }
button.round-button:active:not([aria-disabled="true"]),
.round-button.is-pressed:not([aria-disabled="true"]) { translate: 0 2px; box-shadow: var(--sh-pill); }
.round-button[aria-disabled="true"] {
  background-color: var(--c-blush);
  box-shadow: none;
  cursor: default;
  --sp-fill: var(--c-mocha-700);
  --sp-thread: var(--c-mocha-700);
}

/* ---------- rules: number in a mocha circle, spacing instead of dividers ---------- */
.rule-list { display: flex; flex-direction: column; gap: 20px; }
.rule {
  display: grid;
  grid-template-columns: var(--rule-num) minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
}
.rule-num {
  display: grid;
  place-items: center;
  width: var(--rule-num);
  height: var(--rule-num);
  border-radius: 50%;
  background-color: var(--c-mocha-700);
  color: var(--c-cream);
  box-shadow: 0 0 0 3px var(--c-blush);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: var(--fs-num);
  line-height: 1;
}
.rule-body { padding-top: 5px; min-width: 0; }
.rule-title {
  font-family: var(--font-label);
  font-size: var(--fs-h3);
  font-weight: var(--label-bold);
  line-height: var(--label-lh);
  color: var(--c-rose-800);
}
.rule-text { margin-top: 3px; }

/* ---------- menu: category on a small rounded taupe tag (the plate's family), name left, price in a blush chip;
   the stitched divider between categories and above the footnote ---------- */
.menu-cat { margin-top: 22px; }
.menu-intro + .menu-cat { margin-top: 20px; }
.menu-cat:first-child { margin-top: 0; }
.panel--menu > .divider { margin-top: 30px; margin-bottom: 26px; }
.panel--menu > .divider + .menu-cat, .panel--menu > .divider + .menu-footnote { margin-top: 0; }
.menu-cat-name {
  position: relative;
  width: fit-content;
  max-width: 100%;
  /* the stitch's inner edge is 4.5px in; Patrick Hand at line-height 1.25 puts accents .1em under the line's top and
     tails .05em under its bottom: 6px and 9px keep both 3px or more inside the stitch */
  padding: 6px 16px 9px;
  border-radius: 9px;
  background-color: var(--mat-ribbon-color);
  background-image: var(--mat-ribbon);
  background-size: var(--mat-size);
  background-blend-mode: multiply;
  box-shadow: 0 1px 2px var(--c-cocoa-a12), 0 3px 6px -3px var(--c-cocoa-a35);
  font-family: var(--font-label);
  font-size: var(--fs-h3);
  font-weight: var(--label-bold);
  line-height: var(--label-lh);
  color: var(--c-cream);
  overflow-wrap: anywhere;
}
.menu-cat-name::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px dashed color-mix(in srgb, var(--c-cream) 65%, transparent);
  border-radius: 7px;
  pointer-events: none;
}
.menu-items { display: flex; flex-direction: column; gap: 15px; margin-top: 14px; }
/* name and description left, the price chip right. The row may wrap: the text column asks for 55% of the row, so a
   price that leaves it less (a long price) moves to its own line under the item and wraps inside its chip there;
   a short price stays beside the name exactly as before */
.menu-item { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 12px; row-gap: 6px; }
.menu-main { flex: 1 1 55%; min-width: 0; }
/* the fave tag sits beside the name or, wrapped, under it with 7px between the name's tails and the tag's edge */
.menu-line { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 7px; }
.item-name {
  min-width: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: calc(var(--fs-h3-raw) * var(--display-scale) - 1px);
  line-height: 1.25;
  color: var(--c-body);
  overflow-wrap: anywhere;
}
/* a long tag wraps inside its pill (whole words, a long word inside itself); the pill's radius stays that of one line */
.fave-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  /* on pixels the tails run up to 2px past the line box: 2px over and 5.5px under keep the ink 3px inside the border */
  padding: 2px 12px 5.5px 8px;
  border: 1.5px solid var(--c-rose-200);
  border-radius: 16px;
  background-color: var(--c-lace);
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  line-height: var(--label-lh);
  color: var(--c-rose-800);
  --sp-fill: var(--c-rose-300);
}
.fave-text { min-width: 0; overflow-wrap: anywhere; }
.fave-heart { width: 13px; height: 13px; flex: none; }
.price {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  /* the painted tails run up to 2px past the line box: 5px under keeps the ink 3px inside the chip */
  padding: 3px 12px 5px;
  border-radius: var(--r-chip);
  background-color: var(--c-blush);
  font-family: var(--font-display);
  font-weight: var(--price-weight);
  font-size: var(--fs-price);
  line-height: 1.35;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--c-body);
}
.item-desc { margin-top: 2px; }
.menu-footnote { margin-top: 24px; font-size: var(--fs-text-small); color: var(--c-body); }

/* ---------- gallery: photos in lace-white frames with a dashed inner line ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.photo-item { min-width: 0; display: flex; }
.photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%; /* cards in a row end level even when one caption takes two lines */
  padding: 10px 10px 0;
  border-radius: calc(var(--r-chip) + 8px);
  background-color: var(--c-lace);
  box-shadow: var(--sh-panel);
  text-align: center;
}
.photo-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: var(--stitch) dashed var(--c-stitch);
  border-radius: calc(var(--r-chip) + 4px);
  pointer-events: none;
}
.photo-frame {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-chip);
  background-color: var(--c-blush);
}
.photo-frame > .photo-img,
.photo-frame > canvas.photo-img { width: 100%; height: 100%; object-fit: cover; }
.photo-frame > .photo-fallback { position: absolute; inset: 0; }
.photo-caption {
  /* up to two lines, then an ellipsis; centred in whatever height the row gives the card */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  margin-block: auto;
  /* vertical spacing as transparent borders: overflow clips at the padding box, so a third line never peeks out */
  padding: 0 6px;
  border-top: 7px solid transparent;
  border-bottom: 10px solid transparent;
  font-family: var(--font-label);
  font-size: var(--fs-small);
  font-weight: var(--label-bold);
  /* 1.4: the tails of the second line stay inside its line box (the clamp cuts at the box), the accents of a hidden
     third line stay under it, and two lines keep 3px between tails and accents */
  line-height: 1.4;
  color: var(--c-body);
  overflow: hidden;
  overflow-wrap: anywhere;
  text-wrap: balance; /* a short centred text: balanced lines */
}
.photo-caption.is-placeholder { width: auto; }
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
}
.pager-status {
  min-width: 4.5em;
  text-align: center;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  color: var(--c-body);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 960px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}

/* ---------- "my links" between two butterflies (the pills and the order button: css/links.css). The panel's top
   padding (css/layout.css) puts the script ink 10px under the stitch frame; the heading's bottom margin is the air
   down to the first pill (on desktop the divider sits there and takes its own margins) ---------- */
.links-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px; /* the heading's box ends 2px under its tails: 10px of air down to the first pill's edge */
}
@media (min-width: 960px) { .links-head { margin-bottom: 10px; } }
.links-head:has(> .links-title[hidden]) { display: none; }
.links-title {
  min-width: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  --letter-size: var(--fs-links-title);
  font-size: var(--letter-size);
  line-height: var(--display-lh);
  letter-spacing: calc(var(--display-track) * 1em);
  color: var(--c-rose-800);
  overflow-wrap: anywhere;
}

/* ---------- footer: text on a cream label with a dashed inner frame ---------- */
/* radius 22px: a one-line label is the same pill as before (the radius is capped at half its height); a label that
   wraps keeps rounded corners instead of growing half-round ends that cut into its text */
.foot-label {
  position: relative;
  z-index: 2;
  max-width: 100%;
  padding: 9px 26px 10px;
  border-radius: 22px;
  background-color: var(--c-cream);
  background-image: var(--mat-cream);
  background-size: var(--mat-size);
  box-shadow: var(--sh-panel);
}
.foot-label::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: var(--stitch) dashed var(--c-stitch);
  border-radius: 18px;
  pointer-events: none;
}
.foot-text {
  position: relative;
  text-align: center;
  text-wrap: balance;
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  line-height: 1.4; /* two lines: accents 3px clear of the tails above */
  color: var(--c-body);
  overflow-wrap: anywhere;
}
@media (min-width: 960px) {
  .foot-label { padding: 10px 36px 11px; }
}

/* ---------- viewer: cream cloth frame, 4px cocoa outline, soft shadow, mocha round buttons.
   Everything stays on the screen at any window size: the close button (pinned over the frame's top right corner)
   keeps 8px from the screen's edges, so the frame keeps --viewer-m from the top and bottom and 14px from the sides
   (60px on desktop); the photo gets what the window leaves after the frame's other parts (--viewer-rest: margins,
   padding, outline, a caption of up to 3 lines, the bar); a longer caption scrolls inside its 3 lines. ---------- */
.viewer {
  --viewer-m: 34px;      /* close button 26px above the frame + 8px */
  --viewer-rest: 266px;  /* 2 x 34 + padding 22 + 12 + outline 8 + caption 14 + 3 x 1.4 x 19 + bar 10 + 52 */
  --media-max: min(64dvh, 100dvh - var(--viewer-rest));
  width: calc(100vw - 28px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  color: var(--c-body);
}
.viewer::backdrop { background-color: var(--c-backdrop); }
.viewer-frame {
  position: relative;
  max-height: calc(100dvh - 2 * var(--viewer-m));
  border: var(--binding) solid var(--c-cocoa);
  border-radius: var(--r-quilt);
  background-color: var(--c-cream);
  background-image: var(--mat-cream);
  background-size: var(--mat-size);
  padding: 22px 12px 12px;
  box-shadow: var(--sh-viewer);
}
.viewer-figure { display: flex; flex-direction: column; align-items: center; }
.viewer-media {
  display: grid;
  place-items: center;
  width: 100%;
  /* Holds the frame open while a photo is still loading, so the viewer never collapses. */
  min-height: min(46dvh, 300px, var(--media-max));
  max-height: var(--media-max);
  touch-action: pan-y;
  user-select: none;
}
.viewer-media > .photo-img {
  max-width: 100%;
  max-height: var(--media-max);
  object-fit: contain;
  border-radius: var(--r-chip);
  box-shadow: 0 0 0 6px var(--c-lace), 0 4px 12px 4px var(--c-cocoa-a22);
}
.viewer-media > .photo-fallback {
  width: min(100%, var(--media-max));
  height: auto;
  aspect-ratio: 1;
  border-radius: var(--r-chip);
}
.viewer-caption {
  margin-top: 14px;
  max-width: 100%;
  max-height: calc(3 * 1.4em);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: var(--font-label);
  font-size: 19px;
  font-weight: var(--label-bold);
  line-height: 1.4;
  color: var(--c-body);
  text-align: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
/* three columns: the counter always on the frame's middle line, with or without the arrows (one photo hides them) */
.viewer-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 10px;
}
.viewer-prev { grid-column: 1; justify-self: start; }
.viewer-count { grid-column: 2; }
.viewer-next { grid-column: 3; justify-self: end; }
.viewer-prev, .viewer-next { width: 52px; height: 52px; }
.viewer-count {
  font-family: var(--font-label);
  font-size: var(--fs-sub);
  font-weight: var(--label-bold);
  color: var(--c-body);
  font-variant-numeric: tabular-nums;
}
.viewer-close {
  position: absolute;
  z-index: 3;
  top: -26px;
  right: -6px;
  width: var(--close-button);
  height: var(--close-button);
  border: 3px solid var(--c-cream);
}
@media (min-width: 960px) {
  .viewer {
    --viewer-m: 38px;     /* close button 30px above the frame + 8px */
    --viewer-rest: 297px; /* 2 x 38 + padding 28 + 20 + outline 8 + caption 14 + 3 x 1.4 x 21 + bar 10 + 52 */
    width: min(860px, 100vw - 120px);
  }
  .viewer-frame { padding: 28px 28px 20px; }
  .viewer-caption { font-size: 21px; }
  .viewer-close { top: -30px; right: -30px; }
}

/* ---------- an embroidered bowknot (slot bowknot) inside the stitched frame at the page panel's bottom left (not on
   home) and the links panel's bottom right, slightly turned; the bouquet (slot corner) over the home panel's corner ---------- */
:root { --knot-w: 28px; --corner-w: 0px; }
html[data-art~="corner"] { --corner-w: 128px; }
.block::after {
  content: "";
  position: absolute;
  left: calc(var(--stitch-inset) + 9px);
  bottom: calc(var(--stitch-inset) + 8px);
  width: var(--knot-w);
  height: calc(var(--knot-w) / var(--mat-bowknot-ar));
  background: var(--mat-bowknot) center / contain no-repeat;
  rotate: -12deg;
  pointer-events: none;
}
.links-block::after { left: auto; right: calc(var(--stitch-inset) + 9px); rotate: 10deg; }
.panel-block:has(> .panel--home)::after {
  inset: auto auto -8px -8px;
  z-index: 2;
  rotate: none;
  width: var(--corner-w);
  height: calc(var(--corner-w) / var(--mat-corner-ar));
  background-image: var(--mat-corner);
  background-size: contain;
  background-position: left bottom;
  filter: drop-shadow(0 2px 3px var(--c-cocoa-a22));
}
/* at 320 to 359 the card body's side padding is only 8px: the bouquet moves 2px in, so it keeps 2px from the card's outline */
@media (max-width: 359px) { .panel-block:has(> .panel--home)::after { left: -6px; } }
/* room for the bouquet, from its real top edge (assets/art/corner.webp, alpha over 40: qa/wip/c/corner-profile.cjs). Over
   every column the panel's content can reach (from 24px right of the bouquet's left edge on, image column 99 and
   up) the roses rise to row 1 of 276, so the whole height counts: --corner-rise .996. The content keeps 4px above it:
   padding = bouquet height x rise - 8px (it hangs 8px under the panel) - the panel's own bottom padding + 4px.
   On phone it shares the row with the right-aligned "read more" (so no extra room while that button shows). */
:root { --corner-rise: .996; --corner-room: calc(var(--corner-w) / var(--mat-corner-ar) * var(--corner-rise) - 8px + 4px); }
@media (max-width: 959px) { .panel-block:has(> .panel--home) { padding-bottom: 16px; } }
.panel--home .more-toggle { display: flex; width: fit-content; margin-left: auto; }
.panel--home:has(> .more-toggle[hidden]) { padding-bottom: max(0px, var(--corner-room) - 16px); }
@media (min-width: 960px) {
  :root { --knot-w: 32px; }
  html[data-art~="corner"] { --corner-w: 204px; }
  .panel--home { padding-bottom: max(0px, var(--corner-room) - 28px); }
}

/* ---------- lettering set 2: Borel for the four big words only, thickened, tall line box; Patrick Hand elsewhere ---------- */
html[data-lettering="2"] :is(.name-text, .banner-title, .links-title, .order-label) {
  -webkit-text-stroke: var(--display-stroke) currentColor;
  paint-order: stroke fill;
}
/* a script text that has to wrap does so in balanced lines (never a short orphan line); a symbol-only word is glued to
   its neighbour by js/richtext.mjs glueSymbols(), so no line holds only symbols */
:is(.name-text, .banner-title, .links-title, .order-label) { text-wrap: balance; }
html[data-lettering="2"] :is(.name-text, .links-title) { color: var(--c-cocoa-900); }
/* Borel's ink does not fit its line box. Measured from the font, stroke included: tall letters rise 1.02em above
   the baseline, tails drop .53em below it, and for a line-height L (in em) the baseline sits L/2 - .014em under the
   top of the line box. So the ink starts L/2 - 1.034em under that top (above it for any L under 2.07) and tails end
   L/2 + .516em under it (L/2 + .016em without a tail letter). One rule for the four script texts: padding-top puts
   the box's top edge --ink-pad above the tallest ink, margin-bottom (--ink-mb) puts its bottom edge --ink-pad under
   the tails (under the baseline when the text has no tail letter: data-tails="no", set by setLetter() in
   js/richtext.mjs; the plate title ignores it and keeps the tail room, so the plate has one height on every tab).
   Every container measures its air from this box: padding = edge + clearance - --ink-hold. --ink-hold is the part
   of --ink-pad a container can count on: measured on the page (canvas metrics at 10x size, baseline rounding), the
   tallest ink lands 1.1 to 2.8px under the box top, never closer. A text that wraps
   keeps its lines apart (one line of ink is 1.55em, the line step 1.65em). The side padding of the name and of
   "my links" holds the swashes of the outer letters and the placeholder band's ends. */
html[data-lettering="2"] { --ink-lh: 1.65; --ink-pad: 2px; --ink-hold: 1px; }
html[data-lettering="2"] :is(.name-text, .banner-title, .links-title, .order-label) {
  --ink-mb: calc((0.516 - var(--ink-lh) / 2) * 1em + var(--ink-pad));
  line-height: var(--ink-lh);
  padding-top: calc((1.034 - var(--ink-lh) / 2) * 1em + var(--ink-pad));
  padding-bottom: 0;
  margin-bottom: var(--ink-mb);
}
html[data-lettering="2"] :is(.name-text, .links-title, .order-label)[data-tails="no"] {
  --ink-mb: calc((0.016 - var(--ink-lh) / 2) * 1em + var(--ink-pad));
}
/* a "to fill" placeholder in script on a light surface: the band is a highlighter stroke over the ink only
   (from the box top to its effective bottom, so --ink-pad beyond the tallest letter and the tails), not the
   whole line box, and no underline through the tails */
html[data-lettering="2"] :is(.name-text, .links-title).is-placeholder {
  background: linear-gradient(var(--ph-band, var(--c-ph-band)), var(--ph-band, var(--c-ph-band))) 0 0 / 100% calc(100% + var(--ink-mb)) no-repeat;
  text-decoration: none;
}
/* the placeholder name is set a little smaller, so "[your name]" (6.6em plus the side padding) stays on one line
   beside the photo down to 320px, with a few px to spare at the narrowest width of each step */
html[data-lettering="2"] .name-text.is-placeholder { --letter-size: calc(var(--fs-name) * .88); }
@media (max-width: 389px) { html[data-lettering="2"] .name-text.is-placeholder { --letter-size: calc(var(--fs-name) * .86); } }
@media (max-width: 359px) { html[data-lettering="2"] .name-text.is-placeholder { --letter-size: calc(var(--fs-name) * .8); } }
html[data-lettering="2"] .links-title { padding-inline: .15em; }

/* a script text of up to 11 characters stays on one line (js/richtext.mjs fitLetter: .is-fit, --fit-em = its width at
   1em): its size is capped so that width, its side padding (--fit-pad, in em) and 6px (the stroke, and canvas metrics
   that run up to 2px short of the painted glyphs at either end) fit the inline
   size of the piece around it (each piece is an inline size container); nothing else about the lettering changes,
   and every clearance is in em or measured from the box, so it holds at the smaller size too */
.name-ribbon, .banner, .links-head, .order-badge { container-type: inline-size; }
.name-text, .links-title { --fit-pad: .3; }
.links-head { --fit-side: 0px; }
html[data-art~="butterfly"] .links-head { --fit-side: 88px; } /* two butterflies, 32px each, and the 12px gaps */
:is(.name-text, .banner-title, .links-title, .order-label).is-fit {
  font-size: min(var(--letter-size), (100cqi - var(--fit-side, 0px) - 6px) / (var(--fit-em) + var(--fit-pad, 0)));
}
/* the subtitle's tallest ink (an apostrophe or an accent, .875em high: Patrick Hand leaves .115em above it at
   line-height 1.25) 4px under the plate title's deepest tails, plus 1.5px because the baseline of the script line
   rounds up to 1.5px lower at some sizes (34px: measured on pixels at 1x, 2x and 3x, 3 to 4.3px; ascenders such as
   l or d land 2.5px lower still). At the desktop size (46px) the tails sit where the box says, so 2px less there:
   measured 4 to 4.5px. */
html[data-lettering="2"] .banner-sub { margin-top: calc(5.5px - var(--ink-pad) - .115em); font-size: calc(var(--fs-sub) + 1px); }
@media (min-width: 960px) { html[data-lettering="2"] .banner-sub { margin-top: calc(3.5px - var(--ink-pad) - .115em); } }
html[data-lettering="2"] :is(.banner-sub, .menu-cat-name, .tab-label, .marquee, .link-label, .fact-label, .rule-title, .foot-text, .tagline, .pager-status, .viewer-caption) {
  -webkit-text-stroke: var(--label-stroke) currentColor;
}
html[data-lettering="2"] .tagline { color: var(--c-rose-800); }
html[data-lettering="2"] :is(.item-name, .price, .rule-num) { font-family: var(--font-label); }
html[data-lettering="2"] .item-name { font-size: var(--fs-h3); line-height: 1.3; -webkit-text-stroke: .4px currentColor; }
html[data-lettering="2"] .price { font-size: 20px; -webkit-text-stroke: .3px currentColor; }
html[data-lettering="2"] .rule-num { font-size: 22px; -webkit-text-stroke: .3px currentColor; }

/* ---------- phone and tablet plate (< 960px): the sprays flank the TITLE only. .banner-text dissolves (display:
   contents): row 1 is spray | title | spray, row 2 the subtitle across the plate, so only the title's width decides
   how much room the sprays get (up to 78px, 10px from the ink, gone under 32px). The flip moves to title and subtitle. */
@media (max-width: 959px) {
  .banner { --spray-w: 78px; column-gap: 10px; grid-template-rows: auto auto; }
  .banner > .banner-text { display: contents; }
  .banner .banner-title { grid-column: 2; grid-row: 1; position: relative; z-index: 1; transform-origin: 50% 50%; }
  .banner .banner-sub { grid-column: 1 / -1; grid-row: 2; position: relative; z-index: 1; justify-self: center; max-width: 100%; transform-origin: 50% 50%; }
  /* centred on the middle of the small letters and lifted a little, so the spray ends at least 8px above the subtitle */
  html[data-art~="spray-plate"] .banner > .spray { align-self: center; margin-bottom: calc(var(--fs-banner) * .12); }
  .banner.banner.is-flipping > .banner-text { animation: none; } /* beats the base rule in css/motion.css, which loads later */
  .banner.is-flipping .banner-title,
  .banner.is-flipping .banner-sub { animation: banner-flip var(--dur-banner) linear; }
}
@media (max-width: 959px) and (prefers-reduced-motion: reduce) {
  .banner.is-flipping .banner-title,
  .banner.is-flipping .banner-sub { animation: none; }
}
