/* The greeting card (PLAN.md §8.8, §9 WP1): .gcard with --page / --preview / --thumb / --stage and .gcard__*.
   WP1 owns this file. The card is a size container, so every measure below is relative to the card itself (cqi =
   1% of its width, cqh = 1% of its height): the same markup scales from a 200 px thumb to a 4K stage.
     page    4:5 portrait card, max 560 px, grows taller rather than clipping a long message
     thumb   4:5 miniature, message clamped to 3 lines, no seat
     preview 16:9 miniature of the stage (opaque, with overlays), for the booking live preview. Its type has px floors, so
             it stays readable on a phone, and it grows taller than 16:9 when the floors need more room
     stage   fills its parent (give the parent a definite size, e.g. position:absolute; inset:0). Transparent and
             without overlays: on /live the theme background, overlays and fx canvas live in the layers behind it.
   Data hooks (GreetingCard.tsx / card.ts): data-font, data-headline, data-milestone, data-sealed on the article;
   --len on the name; data-len="s|m|l" on the message; --card-rotate and --t-hl from theme.background.card.
   Per-theme polish lives in themes.css. */

.gcard {
  --name-k: 132cqi;               /* name size = min(--name-max, --name-k / --len) */
  --name-max: 19cqi;
  --name-min: 10px;               /* a floor only for degenerate cases: the formula below already fits 24 graphemes */
  --edge-top: 11cqi;              /* breathing room above and below the content */
  --edge-bottom: 13cqi;
  --mx: 8cqi;                     /* side margin of every text row (6cqw on the preview and the stage) */
  --ou: 1cqi;                     /* overlay unit (themes.css): 1 % of the card's shorter side; portrait cards: the width */
  --font-msg: var(--font-ui);
  --font-sign: var(--font-name);
  --sign-style: italic;
  position: relative;
  isolation: isolate;
  container: gcard / inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-inline-size: 0;
  color: var(--t-text);
  font-family: var(--font-ui);
  text-align: center;
  -webkit-font-smoothing: antialiased;
}
.gcard::before, .gcard::after { content: ""; display: block; flex: none; }
.gcard::before { order: -10; block-size: var(--edge-top); }
.gcard::after { order: 10; block-size: var(--edge-bottom); }
:where(.gcard > p, .gcard > h2) { margin-block: 0; margin-inline: var(--mx); max-inline-size: calc(100% - 2 * var(--mx)); }

.gcard[data-font="instrument-serif"] { --name-k: 172cqi; --name-max: 25cqi; }
.gcard[data-font="caveat"] { --name-k: 196cqi; --name-max: 24cqi; }
.gcard[data-font="chakra-petch"] { --name-k: 118cqi; --name-max: 16.5cqi; }
.gcard[data-font="instrument-sans"] { --name-k: 140cqi; }
/* the genre faces (round 3): --name-k is about 75cqi over the face's average advance per letter, measured in Chromium on
   twelve names (in capitals for the faces their themes set in capitals); --name-max is the cap a short name reaches */
.gcard[data-font="cinzel"] { --name-k: 107cqi; --name-max: 17cqi; }
.gcard[data-font="anton"] { --name-k: 161cqi; --name-max: 24cqi; }
.gcard[data-font="bangers"] { --name-k: 184cqi; --name-max: 26cqi; }
.gcard[data-font="orbitron"] { --name-k: 97cqi; --name-max: 15cqi; }
.gcard[data-font="audiowide"] { --name-k: 98cqi; --name-max: 15cqi; }
.gcard[data-font="press-start"] { --name-k: 75cqi; --name-max: 12cqi; }
.gcard[data-font="rye"] { --name-k: 103cqi; --name-max: 19cqi; }   /* both Rye themes set it in capitals: mean capital advance .729 em (120 was the lowercase figure) */
.gcard[data-font="shrikhand"] { --name-k: 117cqi; --name-max: 19cqi; }
.gcard[data-font="limelight"] { --name-k: 119cqi; --name-max: 19cqi; }
.gcard[data-font="syncopate"] { --name-k: 85cqi; --name-max: 13cqi; }
.gcard[data-font="vt323"] { --name-k: 188cqi; --name-max: 28cqi; }
.gcard[data-font="pixelify"] { --name-k: 129cqi; --name-max: 20cqi; }
.gcard[data-font="silkscreen"] { --name-k: 89cqi; --name-max: 14cqi; }
.gcard[data-font="pirata"] { --name-k: 186cqi; --name-max: 26cqi; }
.gcard[data-font="unifraktur"] { --name-k: 147cqi; --name-max: 23cqi; }
.gcard[data-font="michroma"] { --name-k: 77cqi; --name-max: 12cqi; }
.gcard[data-font="playfair"] { --name-k: 136cqi; --name-max: 22cqi; }
.gcard[data-font="dela-gothic"] { --name-k: 84cqi; --name-max: 14cqi; }
.gcard[data-font="quicksand"] { --name-k: 132cqi; --name-max: 20cqi; }
.gcard[data-font="unbounded"] { --name-k: 86cqi; --name-max: 13cqi; }
.gcard[data-font="bungee"] { --name-k: 107cqi; --name-max: 17cqi; }
.gcard[data-font="plex-mono"] { --name-k: 125cqi; --name-max: 18cqi; }
.gcard[data-font="jua"] { --name-k: 128cqi; --name-max: 22cqi; }               /* measured in capitals (Comeback Stage) */
.gcard[data-font="black-han-sans"] { --name-k: 109cqi; --name-max: 18cqi; }
.gcard[data-font="mochiy"] { --name-k: 110cqi; --name-max: 18cqi; }
.gcard[data-font="m-plus-rounded"] { --name-k: 130cqi; --name-max: 20cqi; }

/* the music themes' faces (r7), measured the same way (capitals for Sedgwick and Metal Mania, whose themes set them in capitals) */
.gcard[data-font="new-rocker"] { --name-k: 145cqi; --name-max: 24cqi; }
.gcard[data-font="sedgwick"] { --name-k: 131cqi; --name-max: 20cqi; }
.gcard[data-font="metal-mania"] { --name-k: 145cqi; --name-max: 27cqi; }
.gcard[data-font="permanent-marker"] { --name-k: 127cqi; --name-max: 19cqi; }
.gcard[data-font="special-elite"] { --name-k: 122cqi; --name-max: 18cqi; }
.gcard[data-font="grenze-gotisch"] { --name-k: 164cqi; --name-max: 28cqi; }
.gcard[data-font="rubik-bubbles"] { --name-k: 117cqi; --name-max: 18cqi; }

/* the cinematic themes' faces (r12): --name-k is 0.96 x 75cqi over the face's mean advance per letter of 60 names (the factor the
   r7 faces were calibrated at), measured in Chromium at the catalog weight; Oxanium's theme sets it in capitals, so it is measured in capitals */
.gcard[data-font="lilita-one"] { --name-k: 140cqi; --name-max: 22cqi; }
.gcard[data-font="cinzel-decorative"] { --name-k: 102cqi; --name-max: 16cqi; }
.gcard[data-font="oxanium"] { --name-k: 109cqi; --name-max: 17cqi; }
.gcard[data-font="tilt-neon"] { --name-k: 137cqi; --name-max: 21cqi; }
/* r13, Last Rodeo: set in capitals, so measured in capitals */
.gcard[data-font="sancreek"] { --name-k: 127cqi; --name-max: 20cqi; }
/* r13, Golden Goal: Teko, set in capitals, so measured in capitals */
.gcard[data-font="teko"] { --name-k: 158cqi; --name-max: 24cqi; }
.gcard[data-font="racing-sans-one"] { --name-k: 131cqi; --name-max: 20cqi; }
/* r13, Hero Rising and Wanderlust: Bebas Neue, set in capitals by both (one rule: the same face, case and numbers) */
.gcard[data-font="bebas-neue"] { --name-k: 186cqi; --name-max: 29cqi; }
.gcard[data-font="im-fell-english"] { --name-k: 100cqi; --name-max: 16cqi; }
/* r13, Grand Slam: Graduate, set in capitals, so measured in capitals */
.gcard[data-font="graduate"] { --name-k: 108cqi; --name-max: 17cqi; }
/* r13, Strawberry Social */
.gcard[data-font="fraunces"] { --name-k: 115cqi; --name-max: 18cqi; }
/* r13, Fur Ball: Baloo 2 ExtraBold in mixed case */
.gcard[data-font="baloo-2"] { --name-k: 134cqi; --name-max: 21cqi; }
/* r13, Thunder Lizards: Luckiest Guy in capitals */
.gcard[data-font="luckiest-guy"] { --name-k: 124cqi; --name-max: 19cqi; }
/* r13, Once Upon: Almendra Regular in mixed case */
.gcard[data-font="almendra"] { --name-k: 144cqi; --name-max: 22cqi; }
/* r13, Sugar Kingdom: Titan One Regular in mixed case */
.gcard[data-font="titan-one"] { --name-k: 113cqi; --name-max: 18cqi; }
/* r13, The Season: Bodoni Moda Bold in capitals */
.gcard[data-font="bodoni-moda"] { --name-k: 99cqi; --name-max: 15cqi; }
.gcard[data-font="alfa-slab-one"] { --name-k: 92cqi; --name-max: 14cqi; }
/* r13, Pearl Lagoon: Berkshire Swash Regular in mixed case */
.gcard[data-font="berkshire-swash"] { --name-k: 137cqi; --name-max: 21cqi; }
.gcard[data-font="kavoon"] { --name-k: 123cqi; --name-max: 19cqi; }
.gcard[data-font="yeseva-one"] { --name-k: 120cqi; --name-max: 19cqi; }
/* r13, Fairy Glade: Great Vibes in mixed case */
.gcard[data-font="great-vibes"] { --name-k: 161cqi; --name-max: 25cqi; }
/* r13, Please Rewind: Monoton in capitals */
.gcard[data-font="monoton"] { --name-k: 91cqi; --name-max: 14cqi; }
.gcard[data-font="medievalsharp"] { --name-k: 134cqi; --name-max: 21cqi; }
.gcard[data-font="poiret-one"] { --name-k: 144cqi; --name-max: 22cqi; }
/* r13, Campfire: Gochi Hand in capitals */
.gcard[data-font="gochi-hand"] { --name-k: 132cqi; --name-max: 20cqi; }
/* r13, Big Dig: Saira Stencil One in capitals */
.gcard[data-font="saira-stencil-one"] { --name-k: 111cqi; --name-max: 17cqi; }
/* r13, Creature Feature: Creepster in capitals (the face has no lowercase) */
.gcard[data-font="creepster"] { --name-k: 160cqi; --name-max: 25cqi; }
/* r13, Bollywood Nights: Rozha One in capitals */
.gcard[data-font="rozha-one"] { --name-k: 121cqi; --name-max: 19cqi; }
/* r13, Midnight Circus: Fascinate Inline in mixed case (a fat 1920s display face with an inline stripe) */
.gcard[data-font="fascinate-inline"] { --name-k: 117cqi; --name-max: 18cqi; }
.gcard[data-font="mountains-of-christmas"] { --name-k: 163cqi; --name-max: 25cqi; }
/* r13, Ronin: Reggae One in capitals */
.gcard[data-font="reggae-one"] { --name-k: 100cqi; --name-max: 16cqi; }
/* r13, Starlit Spell: Cormorant Garamond Bold in capitals (a face used by two themes: Serenity sets it in SemiBold and mixed case, and its own sheet sets its --name-k and --name-max, 152cqi and 8.6cqi) */
.gcard[data-font="cormorant-garamond"] { --name-k: 111cqi; --name-max: 17cqi; }
/* r13, Thousand Nights: El Messiri 700 in capitals */
.gcard[data-font="el-messiri"] { --name-k: 114cqi; --name-max: 18cqi; }
/* r13, Jukebox Diner: Pacifico Regular in mixed case */
.gcard[data-font="pacifico"] { --name-k: 136cqi; --name-max: 21cqi; }
/* r13, Back Nine: Libre Baskerville Bold in capitals (a face used by two themes: Book Nook sets it in mixed case, and its own sheet sets its --name-k and --name-max, 111cqi and 17cqi) */
.gcard[data-font="libre-baskerville"] { --name-k: 88cqi; --name-max: 14cqi; }

/* ── Layers ───────────────────────────────────────────────────────────────────────────────────────── */
.gcard__overlays {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

/* ── Type ─────────────────────────────────────────────────────────────────────────────────────────── */
.gcard__eyebrow {
  margin-block-end: 2.6cqi;
  padding-inline-start: .24em;           /* balances the trailing letter-spacing */
  color: var(--t-eyebrow, var(--t-cta));
  font: 700 clamp(11px, 2.85cqi, 17px)/1.25 var(--font-display);
  letter-spacing: .24em;
  text-transform: uppercase;
  text-wrap: balance;
}
.gcard__eyebrow:empty { display: none; }

.gcard__name {
  --pad-top: .06em;
  --pad-bottom: .12em;
  padding-block: var(--pad-top) var(--pad-bottom);
  color: var(--t-text);
  font-family: var(--t-font-name);
  font-weight: var(--t-name-weight);
  font-style: var(--t-name-style);
  font-stretch: var(--t-name-stretch);
  font-size: clamp(var(--name-min), min(var(--name-max), calc(var(--name-k) / max(var(--len, 6), 3))), 240px);
  line-height: .98;
  letter-spacing: -.015em;
  text-wrap: balance;
  /* A name never breaks inside a word (base.css would break it anywhere): the size formula is an estimate, and a word
     that comes out a little wide overhangs into the 8 % margins (fit.ts then shrinks it) instead of reading "Grandm/a". */
  overflow-wrap: normal;
  word-break: normal;
  /* theme.background.card.highlighter: a marker swipe behind each line (transparent when the theme has none) */
  background-image: repeating-linear-gradient(to bottom, transparent 0 .5em, var(--t-hl, transparent) .5em .9em, transparent .9em 1em);
  background-clip: content-box;
  background-origin: content-box;
}
.gcard[style*="--t-hl"] .gcard__name { line-height: 1; padding-inline: .12em; }

.gcard__milestone {
  margin-block-start: 3.4cqi;
  padding: .52em 1.1em .5em;
  border: 1px solid color-mix(in srgb, var(--t-a1) 55%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--t-a1) 15%, transparent);
  color: var(--t-text);
  font: 650 clamp(11.5px, 2.65cqi, 15px)/1.15 var(--font-ui);
  letter-spacing: .02em;
}
.gcard[data-milestone] .gcard__milestone::before { content: "★ "; color: var(--t-a1); }

.gcard__kicker {
  order: -1;
  margin-block-end: 3cqi;
  color: var(--t-a3);
  font: 700 clamp(11px, 2.7cqi, 16px)/1.1 var(--font-display);
  letter-spacing: .3em;
  text-transform: uppercase;
}

.gcard__message {
  margin-block-start: 4.8cqi;
  color: var(--t-msg, var(--t-text));
  font-family: var(--font-msg);
  font-weight: 450;
  white-space: pre-line;
  text-wrap: pretty;
  max-inline-size: min(100% - 16cqi, 34em);
}
.gcard__message { font-size: clamp(14.5px, 3.3cqi, 18.5px); line-height: 1.46; }
.gcard__message[data-len="s"] { font-size: clamp(18px, 5.6cqi, 31px); line-height: 1.24; font-weight: 500; letter-spacing: -.005em; }
.gcard__message[data-len="m"] { font-size: clamp(16px, 4.15cqi, 23px); line-height: 1.36; }

.gcard__sender {
  margin-block-start: 4.6cqi;
  color: var(--t-muted);
  font-family: var(--font-sign);
  font-style: var(--sign-style);
  font-weight: 400;
  font-size: clamp(16px, 4.4cqi, 25px);
  line-height: 1.15;
}
.gcard__sender > [data-f] { color: var(--t-text); }
.gcard[data-sealed] .gcard__sender { margin-block-start: 6cqi; }

.gcard__emoji {
  position: absolute;
  z-index: 1;
  inset-inline-end: 5.5cqi;
  inset-block-end: 4.6cqi;
  font-size: clamp(26px, 9.5cqi, 54px);
  line-height: 1;
  rotate: 9deg;
  filter: drop-shadow(0 .07em .08em rgb(0 0 0 / .3));
  user-select: none;
}
.gcard__emoji:empty { display: none; }

.gcard__seat {
  position: absolute;
  z-index: 1;
  inset-block-end: 5cqi;
  inset-inline-start: 5cqi;
  padding: .6em .85em .55em;
  border: 1.5px dashed color-mix(in srgb, var(--t-text) 42%, transparent);
  border-radius: .55em;
  background: color-mix(in srgb, var(--t-bg) 82%, transparent);
  color: var(--t-muted);
  font: 700 clamp(9.5px, 2.3cqi, 12.5px)/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ── page: 4:5, max 560 px ───────────────────────────────────────────────────────────────────────── */
.gcard--page {
  inline-size: 100%;
  max-inline-size: 560px;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
  border-radius: var(--radius-l);
  rotate: var(--card-rotate, 0deg);
  outline: 1px solid color-mix(in srgb, var(--t-text) 10%, transparent);
  outline-offset: -1px;
  box-shadow:
    0 2px 4px rgb(0 0 0 / .16),
    0 26px 60px -20px rgb(0 0 0 / .58),
    0 60px 120px -50px color-mix(in srgb, var(--t-a1) 34%, transparent);
}
.gcard--page[style*="--card-rotate"], .gcard--thumb[style*="--card-rotate"] { scale: .985; }

/* ── thumb: proportional miniature ───────────────────────────────────────────────────────────────── */
.gcard--thumb {
  --name-min: 0px;
  --edge-top: 10cqi;
  --edge-bottom: 12cqi;
  inline-size: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: clamp(10px, 7cqi, 22px);
  rotate: var(--card-rotate, 0deg);
  outline: 1px solid color-mix(in srgb, var(--t-text) 10%, transparent);
  outline-offset: -1px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .2), 0 14px 30px -14px rgb(0 0 0 / .6);
}
.gcard--thumb .gcard__eyebrow { font-size: 3.8cqi; }
.gcard--thumb .gcard__milestone { font-size: 3.6cqi; }
.gcard--thumb .gcard__kicker { font-size: 3.6cqi; }
.gcard--thumb .gcard__message {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 4.6cqi !important;
  line-height: 1.32;
}
/* A thumb is a proportional miniature, but a card of 120 px and more (the landing hero's sample, a "my greetings" row)
   is something people read: the message never drops below 10 px there. Smaller than that it stays a thumbnail. */
@container gcard (min-width: 120px) {
  .gcard--thumb .gcard__message { font-size: max(10px, 4.6cqi) !important; }
}
.gcard--thumb .gcard__sender { font-size: 5.2cqi; }
.gcard--thumb .gcard__emoji { font-size: 11cqi; }
.gcard--thumb .gcard__seat { display: none; }

/* ── preview and stage: the Grand Display composition ───────────────────────────────────────────────── */
/* --hu is 1 % of the composition's height, so one set of rules serves both:
   - the stage is a size container and fills a parent of known height (--hu is 1cqh);
   - the preview is always 16:9, so its height is 9/16 of its width (--hu is .5625cqw), and it is an inline-size container
     only. People proofread on it, mostly on phones, so every text role has a px floor (--fl-*: on a 358 px phone the
     faithful miniature would set the message at 6 px). When the floors need more room than 16:9 gives, the card grows
     taller instead of clipping: an aspect-ratio box takes its content height as a minimum, and overflow: clip (unlike
     hidden) keeps that. A parent that fixes the preview's height defeats it (docs/wp-notes/WP1.md). */
.gcard--stage { --hu: 1cqh; --ou: 1cqmin; container: gcard / size; }
/* The preview's overlays keep the sizes of the 16:9 miniature (the shorter side is the height, 9/16 of the width) even
   when the card grows taller. cqmin cannot do that here: without a block-size container it falls back to the viewport. */
.gcard--preview { --hu: .5625cqw; --ou: .5625cqi; }
.gcard--preview, .gcard--stage {
  --name-min: 0px;
  --edge-top: calc(5 * var(--hu));
  --edge-bottom: calc(6 * var(--hu));
  --mx: 6cqw;
  justify-content: safe center;
}
:is(.gcard--preview, .gcard--stage) > * { flex-shrink: 0; }
/* the name: 6–20 % of the height on one line (§9 WP3 says 6–22 vh), smaller when the message is long */
:is(.gcard--preview, .gcard--stage) .gcard__name {
  font-size: min(var(--name-max-stage, max(var(--fl-name-s, 0px), calc(20 * var(--hu)))), calc(var(--name-k) / max(var(--len, 6), 3)));
}
:is(.gcard--preview, .gcard--stage):has(.gcard__message[data-len="m"]) { --name-max-stage: max(var(--fl-name-m, 0px), calc(16 * var(--hu))); }
:is(.gcard--preview, .gcard--stage):has(.gcard__message[data-len="l"]) { --name-max-stage: max(var(--fl-name-l, 0px), calc(12.5 * var(--hu))); }
:is(.gcard--preview, .gcard--stage) .gcard__eyebrow { margin-block-end: calc(2 * var(--hu)); font-size: max(var(--fl-eyebrow, 0px), min(calc(2.7 * var(--hu)), 4cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__kicker { margin-block-end: calc(2.4 * var(--hu)); font-size: max(var(--fl-eyebrow, 0px), min(calc(2.6 * var(--hu)), 3.8cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__milestone { margin-block-start: calc(2.4 * var(--hu)); font-size: max(var(--fl-milestone, 0px), min(calc(2.3 * var(--hu)), 3.6cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__message { margin-block-start: calc(3.2 * var(--hu)); max-inline-size: min(100% - 12cqw, 38ch); }
:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="l"] { max-inline-size: min(100% - 12cqw, 50ch); }
:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="s"] { font-size: max(var(--fl-msg-s, 0px), min(calc(5.2 * var(--hu)), 7.4cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="m"] { font-size: max(var(--fl-msg-m, 0px), min(calc(3.8 * var(--hu)), 5.6cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="l"],
:is(.gcard--preview, .gcard--stage) .gcard__message:not([data-len]) { font-size: max(var(--fl-msg-l, 0px), min(calc(2.9 * var(--hu)), 4.4cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__sender { margin-block-start: calc(3 * var(--hu)); font-size: max(var(--fl-sender, 0px), min(calc(3.8 * var(--hu)), 5.4cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__emoji {
  position: static;
  order: 5;
  margin-block-start: calc(1.6 * var(--hu));
  font-size: max(var(--fl-emoji, 0px), min(calc(6 * var(--hu)), 10cqw));
  rotate: 0deg;
}
:is(.gcard--preview, .gcard--stage):has(.gcard__message[data-len="l"]) .gcard__emoji { font-size: max(var(--fl-emoji, 0px), min(calc(4.5 * var(--hu)), 8cqw)); }
:is(.gcard--preview, .gcard--stage) .gcard__seat { inset-block-end: calc(3 * var(--hu)); inset-inline-start: 2.4cqw; font-size: max(var(--fl-seat, 0px), min(calc(1.8 * var(--hu)), 2.6cqw)); }
[data-theme="sketchbook"]:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="s"] { font-size: max(var(--fl-msg-s, 0px), min(calc(7.4 * var(--hu)), 10cqw)); }
[data-theme="sketchbook"]:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="m"] { font-size: max(var(--fl-msg-m, 0px), min(calc(5.8 * var(--hu)), 8cqw)); }
[data-theme="sketchbook"]:is(.gcard--preview, .gcard--stage) .gcard__message[data-len="l"] { font-size: max(var(--fl-msg-l, 0px), min(calc(4.5 * var(--hu)), 6.4cqw)); }
[data-theme="sketchbook"]:is(.gcard--preview, .gcard--stage) .gcard__milestone { font-size: max(var(--fl-milestone, 0px), min(calc(3.6 * var(--hu)), 5.2cqw)); }
[data-theme="sketchbook"]:is(.gcard--preview, .gcard--stage) .gcard__eyebrow,
[data-theme="sketchbook"]:is(.gcard--preview, .gcard--stage) .gcard__sender { font-size: max(var(--fl-eyebrow, 0px), min(calc(4.4 * var(--hu)), 6.4cqw)); }
[data-theme="neon-arcade"]:is(.gcard--preview, .gcard--stage) .gcard__sender { font-size: max(var(--fl-sender, 0px), min(calc(2.6 * var(--hu)), 3.8cqw)); }

.gcard--preview {
  /* legibility floors (px): the faithful 16:9 sizes win above them, so a wide preview is the stage in miniature */
  --fl-eyebrow: 10px;
  --fl-milestone: 10.5px;
  --fl-sender: 12px;
  --fl-emoji: 20px;
  --fl-seat: 9px;
  --fl-msg-s: 16px;
  --fl-msg-m: 13px;
  --fl-msg-l: 12px;
  --fl-name-s: 36px;              /* the cap of the name's size, by message length; a long name is still bounded by its width */
  --fl-name-m: 34px;
  --fl-name-l: 30px;
  --edge-top: max(14px, calc(5 * var(--hu)));
  --edge-bottom: max(16px, calc(6 * var(--hu)));
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;               /* browsers without overflow: clip: the card clips instead of growing */
  overflow: clip;
  border-radius: var(--radius-m);
  outline: 1px solid color-mix(in srgb, var(--t-text) 10%, transparent);
  outline-offset: -1px;
  box-shadow: 0 2px 4px rgb(0 0 0 / .16), 0 26px 60px -24px rgb(0 0 0 / .6);
}
/* Caveat is a small-x-height hand: the same px reads smaller, so its floors are higher */
.gcard--preview[data-theme="sketchbook"] {
  --fl-eyebrow: 14px;
  --fl-milestone: 13px;
  --fl-sender: 15px;
  --fl-msg-s: 22px;
  --fl-msg-m: 17px;
  --fl-msg-l: 15px;
}

.gcard--stage {
  inline-size: 100%;
  block-size: 100%;
  min-block-size: 20rem;
  background: none;
}
.gcard--stage .gcard__overlays { display: none; }
.gcard--stage[data-scheme="dark"] :is(.gcard__message, .gcard__sender, .gcard__eyebrow) { text-shadow: 0 1px 2px rgb(0 0 0 / .45), 0 0 1.2em rgb(0 0 0 / .35); }
.gcard--stage[data-scheme="light"] :is(.gcard__message, .gcard__sender, .gcard__eyebrow) { text-shadow: 0 0 .8em color-mix(in srgb, var(--t-bg) 85%, transparent); }

/* ── Forced colors: drop decoration, keep the text ───────────────────────────────────────────────── */
@media (forced-colors: active) {
  .gcard { border: 1px solid CanvasText; }
  .gcard__overlays { display: none; }
  /* a filter would draw the name's forced Canvas box as a glowing rectangle */
  .gcard__name { background: none; filter: none; text-shadow: none; }
  .gcard__emoji { filter: none; }
}
