/* Ticket editions are modelled on three real print processes:
   Common  — letterpress on toothy card stock, with a security print pattern.
   Rare    — hot-foil stamping on a metal surface with its own texture.
   Ultra   — holographic security film with its own pattern and motion.
   One light position (--mx, --my) and one tilt (--rx, --ry) drive every
   layer, so the number, the foil and the glare always agree. */

@property --mx { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --my { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --rx { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --ry { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --lift { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --spin { syntax: "<angle>"; inherits: true; initial-value: 0deg; }
@property --flow { syntax: "<percentage>"; inherits: true; initial-value: 0%; }

.edition-paper {
  --edge: #b9ae8f;
  --edge-dark: #7f7660;
  --shadow: #1c231b;
  container-type: inline-size;
  min-width: 0;
  perspective: 1100px;
  /* Two hard 1px shadows give the card stock its thickness. The soft pair
     slides opposite the tilt, as if lit from above. */
  filter:
    drop-shadow(0 .6px 0 var(--edge))
    drop-shadow(0 .9px 0 var(--edge-dark))
    drop-shadow(calc(var(--ry) * -.3px) calc(3px + var(--rx) * -.25px) 3px color-mix(in srgb, var(--shadow) 22%, transparent))
    drop-shadow(calc(var(--ry) * -.9px) calc(11px + var(--rx) * -.7px) 14px color-mix(in srgb, var(--shadow) 16%, transparent));
  transition: --mx .6s cubic-bezier(.2, .8, .2, 1), --my .6s cubic-bezier(.2, .8, .2, 1),
    --rx .6s cubic-bezier(.2, .8, .2, 1), --ry .6s cubic-bezier(.2, .8, .2, 1), --lift .6s ease-out;
}
.edition-paper[data-tilting] { transition-duration: .14s; }
.edition-paper[data-tier="rare"] { --edge: #8f8a7c; --edge-dark: #4a463d; }
.edition-paper[data-tier="ultra"] { --edge: #8d8fb5; --edge-dark: #2b2c4a; --shadow: #10122a; }
.edition-paper:is([data-edition="gold-leaf"], [data-edition="sunlit-citrus"]) { --edge: #b78f45; --edge-dark: #6f5221; }

.edition-ticket {
  --seam: 21%;
  --stock: #f5efdc;
  --print: #1e2b25;
  --stub: #344839;
  --stub-print: #fffdf0;
  --ink: var(--print);
  --ink-hi: var(--print);
  --corner: 12px;
  --notch: 8px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--seam) minmax(0, 1fr);
  min-height: 140px;
  aspect-ratio: 2.48;
  color: var(--print);
  background: var(--stock);
  transform: rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg));
  mask:
    radial-gradient(circle var(--corner) at 0 0, transparent calc(100% - .7px), #000),
    radial-gradient(circle var(--corner) at 100% 0, transparent calc(100% - .7px), #000),
    radial-gradient(circle var(--corner) at 0 100%, transparent calc(100% - .7px), #000),
    radial-gradient(circle var(--corner) at 100% 100%, transparent calc(100% - .7px), #000),
    radial-gradient(circle var(--notch) at var(--seam) 0, transparent calc(100% - .7px), #000),
    radial-gradient(circle var(--notch) at var(--seam) 100%, transparent calc(100% - .7px), #000),
    radial-gradient(ellipse 2.6px 3px at 0 50%, transparent 73%, #000) 0 0 / 100% 9px repeat-y,
    radial-gradient(ellipse 2.6px 3px at 100% 50%, transparent 73%, #000) 0 0 / 100% 9px repeat-y,
    radial-gradient(ellipse 1px 1.7px at var(--seam) 50%, transparent 65%, #000) 0 0 / 100% 6px repeat-y;
  mask-composite: intersect;
}
.edition-ticket::before, .edition-ticket::after, .edition-print, .edition-foil, .edition-glare, .edition-register {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Stub colour. */
.edition-ticket::before {
  content: "";
  z-index: -4;
  background: linear-gradient(to right, var(--stub) var(--seam), transparent var(--seam));
}
/* Surface relief: paper tooth for letterpress, metal or film for the rest. */
.edition-ticket::after {
  content: "";
  z-index: -1;
  background: url("/textures/tooth.svg") 0 0 / 180px;
  mix-blend-mode: soft-light;
  opacity: .85;
}

/* Security print, inked in the stub colour under the type. */
.edition-print {
  z-index: -3;
  inset-inline-start: var(--seam);
  background: var(--stub);
  opacity: .2;
  mask-composite: intersect;
}
.edition-ticket[data-print="rosette"] .edition-print {
  mask: url("/textures/rosette.svg") 94% 50% / auto 118% no-repeat;
}
.edition-ticket[data-print="waves"] .edition-print {
  mask:
    url("/textures/waves.svg") 0 0 / 120px 48px,
    linear-gradient(90deg, transparent, #000 35%, #000 70%, transparent);
  mask-composite: intersect;
  opacity: .34;
}
.edition-ticket[data-print="halftone"] .edition-print {
  mask: url("/textures/halftone.svg") 100% 50% / auto 100% no-repeat;
  opacity: .16;
}
.edition-ticket[data-print="engraving"] .edition-print {
  mask:
    repeating-linear-gradient(-32deg, #000 0 .7px, transparent .7px 3.2px),
    radial-gradient(ellipse 70% 120% at 92% 50%, #000 30%, transparent 75%);
  mask-composite: intersect;
  opacity: .26;
}

/* A broad, soft glare. Paper is matte, foil and film are not. */
.edition-glare {
  z-index: 3;
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), #fffffff0, #ffffff40 22%, transparent 58%);
  mix-blend-mode: soft-light;
  opacity: calc(.18 + var(--lift) * .32);
}
.edition-ticket:is([data-tier="rare"], [data-tier="ultra"]) .edition-glare {
  mix-blend-mode: overlay;
  opacity: calc(.26 + var(--lift) * .36);
}

.edition-register { width: 100%; height: 100%; z-index: 1; overflow: hidden; fill: none; stroke: currentColor; opacity: .5; }
.edition-register path { vector-effect: non-scaling-stroke; stroke-width: 1px; }
.edition-ticket[data-tier="common"] .edition-register { color: var(--stub); }
.edition-ticket[data-tier="rare"] .edition-register { color: var(--ink-hi); opacity: .55; }
.edition-ticket[data-tier="ultra"] .edition-register { color: #f2f6ff; opacity: .8; filter: drop-shadow(0 0 3px #bdf6ff9e); }

.edition-stub {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  margin: 9px 0;
  padding: 6px 4px;
  border-inline-end: 1px dashed currentColor;
  color: var(--stub-print);
  text-align: center;
}
.edition-tier {
  --tier-size: .66rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  /* The ticket keeps its shape, so a long store name stops at the stub's height (about a quarter of the width). */
  max-inline-size: 23cqw;
  overflow: hidden;
  font: 750 var(--tier-size)/1 var(--body-font);
  letter-spacing: .07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.edition-stamp {
  width: clamp(20px, 8cqw, 36px);
  height: auto;
  margin-top: 6px;
  opacity: .83;
}
.edition-ticket[data-received] .edition-stamp { color: #e5ffd4; opacity: 1; }
.edition-main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px clamp(6px, 2cqw, 14px);
  min-width: 0;
  padding: 11px clamp(11px, 4cqw, 25px);
}
.edition-baseline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.edition-baseline > span:first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edition-brand { grid-area: 1 / 1; width: clamp(44px, 15cqw, 80px); aspect-ratio: 1430 / 365; background: currentColor; mask: url('/brand/orderly-wordmark-black.svg') center / contain no-repeat; }
.edition-shop {
  grid-area: 1 / 2;
  justify-self: end;
  display: inline-grid;
  place-items: center;
  width: clamp(25px, 7cqw, 37px);
  aspect-ratio: 1;
  border: 1px solid #263c3266;
  border-radius: 4px;
  color: var(--stub);
  background: #fffef4;
  box-shadow: 0 1px 0 #ffffff80 inset, 0 1px 2px #0000002e;
}
.edition-shop .icon { width: 65%; height: 65%; }
.edition-label, .edition-baseline { font: 650 .68rem/1.2 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; }
.edition-type { grid-area: 2 / 1; min-width: 0; display: grid; align-content: center; }
.edition-main:not(:has(.edition-qr)) .edition-type { grid-column: 1 / -1; }
.edition-title, .edition-number { font: 790 clamp(1.28rem, 7.75cqw, 3.35rem)/.96 var(--display-font); letter-spacing: -.06em; overflow-wrap: anywhere; }
.edition-number { font-size: clamp(1.85rem, 10.5cqw, 4.55rem); font-variant-numeric: tabular-nums; }

/* Letterpress: the type is pressed into the stock, so it catches a light
   lip below and a shadow above. */
.edition-ticket[data-tier="common"] :is(.edition-title, .edition-number) {
  text-shadow: 0 -1px 0 #0000002b, 0 1px 0 #ffffff8c;
}
/* Foil stamping: the number is metal and takes the same light as the sheet. */
.edition-ticket:is([data-tier="rare"], [data-tier="ultra"]) :is(.edition-title, .edition-number) {
  padding-block: .04em;
  color: transparent;
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) calc(var(--mx) - 32%), var(--ink-hi) var(--mx), var(--ink) calc(var(--mx) + 32%), var(--ink) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 1px 0 #00000059) drop-shadow(0 0 1px #00000033);
}
.edition-ticket[data-tier="ultra"] :is(.edition-title, .edition-number) {
  background: linear-gradient(100deg, var(--ink) 0%, var(--ink) calc(var(--mx) - 30%), #ffd7f2 calc(var(--mx) - 10%), #d9fbff var(--mx), #fff1c4 calc(var(--mx) + 10%), var(--ink) calc(var(--mx) + 30%), var(--ink) 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.edition-qr {
  grid-area: 2 / 2;
  position: relative;
  z-index: 2;
  display: block;
  width: clamp(56px, 18cqw, 110px);
  line-height: 0;
  background: #fff;
  box-shadow: 0 0 0 1px #17231d4d, 0 1px 3px #0000002e;
}
.edition-qr img { width: 100%; height: auto; color: #17231d; font-size: .56rem; line-height: 1; }
.edition-baseline { grid-area: 3 / 1 / 4 / 3; font-size: .68rem; }
.edition-rule { min-width: 8px; flex: 1; height: 3px; border-block: 1px solid currentColor; opacity: .45; }

/* ---------- Foil and film ---------- */
.edition-foil { z-index: -2; overflow: hidden; }
.edition-light {
  position: absolute;
  inset: 0;
  background: var(--foil);
  background-size: 260% 260%;
  background-position: var(--mx) var(--my);
  mix-blend-mode: screen;
  opacity: calc(var(--foil-opacity, .5) + var(--lift) * .3);
}
/* Keep the stub as printed card so the foil light stays on the sheet. */
.edition-ticket[data-tier="rare"]::before {
  z-index: -1;
  background: linear-gradient(to right, color-mix(in srgb, var(--stub) 90%, transparent) var(--seam), transparent var(--seam));
}
.edition-ticket[data-tier="rare"]::after {
  background: var(--material, url("/foil-grain.svg") 0 0 / 320px 160px);
  mix-blend-mode: overlay;
  opacity: var(--material-opacity, .7);
}
.edition-ticket[data-tier="ultra"]::before {
  background: linear-gradient(to right, #0b0e20b8 var(--seam), transparent var(--seam));
  z-index: 0;
}
.edition-ticket[data-tier="ultra"]::after {
  background: url("/textures/glitter.svg") 0 0 / 120px;
  mask: radial-gradient(circle at var(--mx) var(--my), #000, transparent 55%);
  mix-blend-mode: normal;
  filter: invert(1);
  opacity: calc(.25 + var(--lift) * .5);
  z-index: 0;
}
.edition-ticket[data-tier="ultra"] .edition-light:nth-child(1) { mix-blend-mode: normal; --foil-opacity: .92; }
.edition-ticket[data-tier="ultra"] .edition-light:nth-child(2) { --foil: var(--foil-pattern); --foil-opacity: .78; background-size: auto; background-position: 0 0; }
.edition-ticket[data-tier="ultra"] .edition-light:nth-child(3) { --foil: var(--foil-sheen); --foil-opacity: .62; mix-blend-mode: overlay; }

/* Common stocks. */
[data-edition="ivory-receipt"]    { --stock: #f4eedb; --stub: #39483a; }
[data-edition="sage-press"]       { --stock: #d6dfc6; --stub: #435a42; }
[data-edition="matcha-milk"]      { --stock: #e0e6a9; --stub: #494e25; }
[data-edition="mint-leaf"]        { --stock: #c3ebd6; --stub: #205746; }
[data-edition="sea-glass"]        { --stock: #c1e7e8; --stub: #265766; }
[data-edition="lagoon"]           { --stock: #87cfc9; --stub: #154e53; }
[data-edition="rain-check"]       { --stock: #c8d9ec; --stub: #334e70; }
[data-edition="blue-hour"]        { --stock: #a3b5e6; --stub: #283965; }
[data-edition="ink-wash"]         { --stock: #c6ced6; --stub: #263747; }
[data-edition="lavender-carbon"]  { --stock: #ddd9ef; --stub: #483f66; }
[data-edition="lilac-ink"]        { --stock: #e4c8e9; --stub: #66436d; }
[data-edition="grape-soda"]       { --stock: #c9afe8; --stub: #503276; }
[data-edition="rosewater"]        { --stock: #efd1d9; --stub: #724452; }
[data-edition="peach-paper"]      { --stock: #f3d1bc; --stub: #824b37; }
[data-edition="tomato-stamp"]     { --stock: #edab9d; --stub: #7e3932; }
[data-edition="apricot-press"]    { --stock: #f3bd83; --stub: #6f4527; }
[data-edition="saffron"]          { --stock: #eac671; --stub: #664b24; }
[data-edition="buttercream"]      { --stock: #f7e6a7; --stub: #62532c; }
[data-edition="toasted-oat"]      { --stock: #e2c6a1; --stub: #694d35; }
[data-edition="cocoa-carbon"]     { --stock: #ceb19e; --stub: #4e342e; }

/* Rare metals. Each has its own surface, ink and moving light. */
.edition-ticket:where([data-tier="rare"]) { --stock: #192a2c; --print: #fffef7; --stub: #122326; }
[data-edition="gold-leaf"] {
  --stock: #d9b06a; --print: #2c210d; --stub: #493722; --ink: #2a1e0c; --ink-hi: #7a5a26;
  --foil: linear-gradient(112deg, transparent 34%, #fff2bf 46%, #f6cf7a 50%, transparent 64%);
  --foil-opacity: .7;
}
[data-edition="silver-rain"] {
  --stock: #1f334d; --stub: #142538; --ink: #dfe9f3; --ink-hi: #ffffff;
  --material: url("/textures/rain.svg") 0 0 / 120px 240px;
  --material-opacity: .42;
  --foil: linear-gradient(140deg, transparent 36%, #7fa9d2 46%, #e3eef6 50%, #7fa9d2 54%, transparent 64%);
}
[data-edition="copper-ember"] {
  --stock: #5e3221; --stub: #37241e; --ink: #ffcfae; --ink-hi: #fff6ec;
  --material: url("/textures/hammered.svg") center / cover;
  --material-opacity: .5;
  --foil: radial-gradient(circle at 50% 50%, #ffc08ad0, #d86c3a70 18%, transparent 36%);
}
[data-edition="jade-vein"] {
  --stock: #1f4a3b; --stub: #143127; --ink: #bcdcc3; --ink-hi: #f4fff6;
  --material: url("/textures/marble.svg") center / cover;
  --material-opacity: .8;
  --foil: linear-gradient(129deg, transparent 38%, #84b98a 46%, #d4ecd7 50%, transparent 63%);
}
[data-edition="rose-chrome"] {
  --stock: #4c2737; --stub: #301d2b; --ink: #ffd3e2; --ink-hi: #fff8fb;
  --material: url("/foil-grain.svg") 0 0 / 640px 320px;
  --material-opacity: .32;
  --foil: linear-gradient(100deg, transparent 30%, #c97a9a 42%, #ffd9e6 50%, #c97a9a 58%, transparent 70%);
  --foil-opacity: .62;
}
[data-edition="ocean-ripple"] {
  --stock: #17505b; --stub: #193139; --ink: #addfe7; --ink-hi: #f2ffff;
  --material: repeating-radial-gradient(circle at var(--mx) 115%, #ffffff00 0 calc(var(--flow) / 10), #ffffff38 calc(var(--flow) / 10 + 1px), #ffffff00 calc(var(--flow) / 10 + 7px), #00000000 calc(var(--flow) / 10 + 10px));
  --material-opacity: .9;
  --foil: radial-gradient(ellipse 30% 40% at 50% 50%, #9dd6dfb0, transparent 70%);
}
[data-edition="violet-smoke"] {
  --stock: #3d2d5e; --stub: #2c203e; --ink: #d3bdf2; --ink-hi: #fdf8ff;
  --material: url("/textures/smoke.svg") var(--flow) 0 / 360px 200px;
  --material-opacity: .9;
  --foil: radial-gradient(ellipse 30% 40% at 50% 50%, #c09ae0b8, #6f488d60 50%, transparent 72%);
}
[data-edition="sunlit-citrus"] {
  --stock: #eaa95e; --print: #331c12; --stub: #61342b; --ink: #3d1f0f; --ink-hi: #94511f;
  --material: repeating-conic-gradient(from var(--spin) at 0% 110%, #fff6 0deg 1.5deg, #fff0 1.5deg 5deg);
  --material-opacity: .6;
  --foil: linear-gradient(68deg, transparent 30%, #fff0b4 47%, #ffd172 55%, transparent 70%);
  --foil-opacity: .7;
}
[data-edition="midnight-ink"] {
  --stock: #172642; --stub: #0f1a2c; --ink: #a8c4f7; --ink-hi: #ffffff;
  --material: url("/textures/glitter.svg") 0 0 / 140px;
  --material-opacity: .9;
  --foil: linear-gradient(82deg, transparent 40%, #355cc6 46%, #a6c8ff 50%, #343e91 54%, transparent 60%);
}
.edition-ticket[data-edition="midnight-ink"]::after {
  /* Stars only glint near the light. */
  filter: invert(1);
  mix-blend-mode: screen;
  mask: radial-gradient(circle at var(--mx) var(--my), #000 0, #0006 30%, transparent 62%);
}
[data-edition="opalescent-linen"] {
  --stock: #c9cfd0; --print: #1c2b2e; --stub: #465454; --ink: #22323a; --ink-hi: #6a7b92;
  --material:
    repeating-linear-gradient(0deg, #0000 0 1px, #0000001c 1px 2px, #0000 2px 3px),
    repeating-linear-gradient(90deg, #0000 0 1px, #ffffff40 1px 2px, #0000 2px 3px);
  --material-opacity: 1;
  --foil: linear-gradient(112deg, transparent 22%, #9fd3c9 34%, #fff6f0 46%, #c3b1e2 56%, #ffd9c4 64%, transparent 78%);
  --foil-opacity: .75;
}

.edition-ticket[data-edition="sunlit-citrus"] .edition-print { display: none; }

/* Ultra holographic film. Layer 1 is the film, layer 2 its pattern and
   layer 3 the sheen. */
.edition-ticket:where([data-tier="ultra"]) { --stock: #1d2240; --print: #fffef7; --ink: #f6f3ff; --stub: #151935; }
[data-edition="prism-proof"] {
  --stock: #151d4a;
  --foil: repeating-linear-gradient(115deg, #b02a6e 0%, #a8701c 7%, #1f8a57 14%, #1a6fa6 21%, #4b36b8 28%, #b02a6e 35%);
  --foil-pattern:
    repeating-linear-gradient(60deg, #ffffff00 0 9px, #ffffffb0 9px 10px),
    repeating-linear-gradient(-60deg, #ffffff00 0 9px, #ffffffb0 9px 10px);
  --foil-sheen: linear-gradient(62deg, transparent 36%, #ffffffb0 50%, transparent 64%);
}
.edition-ticket[data-edition="prism-proof"] .edition-light:nth-child(1) { opacity: calc(.62 + var(--lift) * .3); }
.edition-ticket[data-edition="prism-proof"] .edition-light:nth-child(2) {
  mask: radial-gradient(ellipse 70% 90% at var(--mx) var(--my), #000, transparent 75%);
  opacity: calc(.32 + var(--lift) * .35);
}

[data-edition="afterlight"] {
  --stock: #0d1a3d;
  --foil: linear-gradient(160deg, #0b1239 20%, #1b2a6b 45%, #0f4f63 70%, #0c1638 90%);
  --foil-pattern:
    radial-gradient(ellipse 60% 18% at calc(var(--flow) * 1.6 - 30%) 38%, #4dffb6d0, transparent 70%),
    radial-gradient(ellipse 55% 14% at calc(130% - var(--flow) * 1.4) 62%, #a77bffc0, transparent 70%),
    radial-gradient(ellipse 45% 12% at calc(var(--flow) * 1.2 - 10%) 78%, #3fd2ffa0, transparent 70%);
  --foil-sheen: radial-gradient(ellipse 34% 20% at 50% 50%, #c7f7ffb0, transparent 80%);
  --flow-time: 11s;
}
[data-edition="crystal-fold"] {
  --stock: #233250;
  --foil: conic-gradient(from var(--spin) at var(--mx) var(--my), #2f4f8a 0 12%, #262a5e 12% 21%, #63397e 21% 33%, #163a52 33% 46%, #276b7d 46% 59%, #241c55 59% 71%, #3f5f9a 71% 84%, #2f4f8a 84% 100%);
  --foil-pattern: url("/textures/glitter.svg") 0 0 / 90px;
  --foil-sheen: linear-gradient(125deg, transparent 38%, #e8a3ff90 45%, #f5ddff 49%, #a8e4ff 51%, transparent 60%);
  --spin-time: 30s;
}
.edition-ticket[data-edition="crystal-fold"] .edition-light:nth-child(1) { background-size: 100% 100%; }
.edition-ticket[data-edition="crystal-fold"] .edition-light:nth-child(2) {
  filter: invert(1);
  mask: radial-gradient(circle at var(--mx) var(--my), #000 0, transparent 60%);
  background-position: calc(var(--flow) * .6) calc(var(--flow) * -.4);
}

[data-edition="eclipse-foil"] {
  --stock: #231231;
  --foil: radial-gradient(circle at 62% 50%, #0b0616 0 13%, #2c1647 14%, #7a2c7c 22%, #e48a4a 26%, #3b1f5c 34%, #211538 60%);
  --foil-pattern:
    conic-gradient(from var(--spin) at 62% 50%, #ffb36b00, #ffb36bd0 8%, #ff6fa000 18%, #ffd38ab0 35%, #ffb36b00 46%, #c875ffb0 62%, #ffb36b00 74%, #ffcf8fd0 88%, #ffb36b00);
  --foil-sheen: linear-gradient(116deg, transparent 40%, #ffbe8aa0 50%, transparent 60%);
  --spin-time: 16s;
}
.edition-ticket[data-edition="eclipse-foil"] .edition-light:nth-child(1) { background-size: 100% 100%; background-position: 0 0; }
.edition-ticket[data-edition="eclipse-foil"] .edition-light:nth-child(2) {
  mask: radial-gradient(circle at 62% 50%, transparent 12cqw, #000 13.5cqw, #000 18cqw, transparent 30cqw);
}

[data-edition="spectrum-zero"] {
  --stock: #15163a;
  --foil: linear-gradient(126deg, #141438 25%, #2c1d5a 50%, #122a52 75%);
  --foil-pattern: repeating-linear-gradient(90deg, #ff4f9a00 0 14px, #ff4f9ac0 18px, #ffc04fc0 24px, #4fffc000 30px, #ff4f9a00 64px);
  --foil-sheen: repeating-linear-gradient(90deg, #4f8bff00 0 22px, #4f8bffd0 26px, #b39bff 30px, #4f8bff00 36px, #4f8bff00 92px);
  --flow-time: 9s;
}
.edition-ticket[data-edition="spectrum-zero"] .edition-light:nth-child(1) { background-size: 100% 100%; }
.edition-ticket[data-edition="spectrum-zero"] .edition-light:nth-child(2) { background-position: calc(var(--flow) * 3.2) 0; mask: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.edition-ticket[data-edition="spectrum-zero"] .edition-light:nth-child(3) {
  background-size: auto;
  background-position: calc(var(--flow) * -2.3) 0;
  mix-blend-mode: screen;
  mask: linear-gradient(#000, transparent 45%, transparent 55%, #000);
}

/* ---------- Motion ---------- */
@keyframes edition-sway {
  0%, 100% { --mx: 50%; --my: 50%; --rx: 0; --ry: 0; --lift: .2; }
  25% { --mx: 80%; --my: 36%; --rx: 2.4; --ry: 5; --lift: .55; }
  50% { --mx: 58%; --my: 66%; --rx: -2; --ry: 1.2; --lift: .35; }
  75% { --mx: 20%; --my: 42%; --rx: 1.4; --ry: -5; --lift: .55; }
}
@keyframes edition-spin { to { --spin: 360deg; } }
@keyframes edition-flow { to { --flow: 100%; } }
@media (prefers-reduced-motion: no-preference) {
  .edition-paper[data-foil-motion] {
    animation:
      edition-sway var(--sway-time, 10s) ease-in-out infinite,
      edition-spin var(--spin-time, 24s) linear infinite,
      edition-flow var(--flow-time, 14s) linear infinite;
  }
  /* A hand or a phone tilt takes over from the idle sway. */
  .edition-paper[data-foil-motion]:is([data-tilting], [data-settling]) {
    animation-name: none, edition-spin, edition-flow;
  }
  .edition-paper[data-foil-motion][data-foil-paused] { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .edition-motion-button { display: none; }
  .edition-ticket { transform: none; }
}
@media (forced-colors: active) {
  .edition-ticket :is(.edition-title, .edition-number) { color: CanvasText; background: none; filter: none; }
}
@container (min-width: 420px) {
  .edition-ticket { --corner: 16px; --notch: 11px; }
  .edition-main { padding-block: 17px; }
  .edition-tier { --tier-size: .9rem; }
  .edition-label, .edition-baseline { font-size: .77rem; }
}

/* Long store names: smaller letters, and from 16 letters on, two lines along the stub. */
.edition-tier[data-length="12"] { font-size: min(var(--tier-size), calc(23cqw / 9.6)); }
.edition-tier:is([data-length="16"], [data-length="20"], [data-length="24"], [data-length="28"], [data-length="32"]) {
  max-block-size: 2.3em;
  white-space: normal;
  line-height: 1.1;
  text-overflow: clip;
  text-align: center;
  overflow-wrap: anywhere;
}
.edition-tier[data-length="16"] { font-size: min(var(--tier-size), calc(23cqw / 6.4)); }
.edition-tier[data-length="20"] { font-size: min(var(--tier-size), calc(23cqw / 8)); }
.edition-tier[data-length="24"] { font-size: min(var(--tier-size), calc(23cqw / 9.6)); }
.edition-tier[data-length="28"] { font-size: min(var(--tier-size), calc(23cqw / 11.2)); }
.edition-tier[data-length="32"] { font-size: min(var(--tier-size), calc(23cqw / 12.8)); }
