/* adsheet — a contact sheet. Paper and ink, a film-edge strip, frame numbers in edge print,
   and a grease-pencil ring around the frames you pick. Phone first; wider screens only add columns. */

:root {
  color-scheme: light dark;
  --paper: #f1ede4;
  --card: #fbf9f4;
  --ink: #15120f;
  --soft: #5d564c;
  --rule: #cfc7b8;
  --strip: #0f0e0c;
  --strip-ink: #f3c316;
  --go: #f3c316;
  --go-ink: #15120f;
  --pencil: #e0341b;
  --ok: #1d6b3a;
  --bad-bg: #fbe1dc;
  --bad-ink: #8f1d10;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "Cascadia Mono", monospace;
  --gutter: max(16px, env(safe-area-inset-left));
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0e0c;
    --card: #191714;
    --ink: #ece6da;
    --soft: #a59c8d;
    --rule: #3a352d;
    --strip: #000;
    --bad-bg: #3a1712;
    --bad-ink: #ffb1a4;
    --ok: #7fd49c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--body);
  font-stretch: 100%;
  overflow-wrap: anywhere;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- film edge strip ---- */
.strip {
  background: var(--strip);
  color: var(--strip-ink);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.strip a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; letter-spacing: 0.22em; }
.perf {
  height: 10px;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, var(--paper) 8px 20px) 0 2px / 100% 6px no-repeat,
    var(--strip);
}

/* ---- landing ---- */
.hero { padding: 28px 0 8px; }
.kicker { font: 600 11px/1.2 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
h1 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 850;
  font-size: clamp(2.15rem, 9.2vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 10px 0 14px;
  text-wrap: balance;
}
.lede { font-size: 1.08rem; color: var(--soft); max-width: 34rem; }

.slate {
  margin-top: 22px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 16px;
  position: relative;
  box-shadow: 6px 6px 0 var(--ink);
}
.slate label { display: block; font: 600 11px/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
/* The link box holds two things: the link, and at its right end the ad's shape. The shape is for whoever looks for
   it, so it is quiet: no label, no line between the two, soft ink, the same box. */
.field {
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.slate input {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 52px;
  padding: 12px 8px 12px 14px;
  font: 500 16px/1.3 var(--body);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  text-overflow: ellipsis; /* the example link ends in an ellipsis where the box is narrow, not mid-word */
}
.slate input::placeholder { color: var(--soft); opacity: 0.8; }
.slate input:focus-visible { outline: 0; }
.field select {
  flex: none;
  min-height: 48px;
  max-width: 46%;
  /* The arrow is drawn here, not left to the browser: a browser's own arrow hugs the edge and ignores padding,
     most of all on a phone. Two small gradients make the arrow, in the text's own colour, 12px in from the edge. */
  appearance: none;
  -webkit-appearance: none;
  padding: 0 32px 0 10px;
  font: 500 16px/1.2 var(--body);
  color: var(--soft);
  background:
    linear-gradient(45deg, transparent 50%, currentColor 50%) right 17px center / 5px 5px no-repeat,
    linear-gradient(135deg, currentColor 50%, transparent 50%) right 12px center / 5px 5px no-repeat;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.field select:focus-visible { outline: 0; color: var(--ink); }
/* "Make my own" arrives with the link box in the middle of the screen and the rest of the page dimmed. The dim layer is
   inside the hero and the hero is raised above the page, so the layer covers every other section and the box stays lit. */
.spot { position: fixed; inset: 0; z-index: 1; background: var(--spot, rgb(10 10 12 / 0.6)); opacity: 0; transition: opacity 0.3s ease; }
.spot.on { opacity: 1; }
.spotlit .hero { position: relative; z-index: 41; }
.spotlit .slate { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .spot { transition: none; } }
/* The flavour menu: the same box as the link, as wide as its words, under the link and only when there is a choice.
   The line for a linked flavour with no photo is one short sentence in soft ink. */
.flavour { margin-top: 10px; animation: arrive 0.18s ease-out; }
.flavour .field { width: fit-content; max-width: 100%; }
.flavour .field select { max-width: 100%; min-height: 44px; font-size: 16px; }
.slate .note { margin: 10px 2px 0; font-size: 0.9rem; color: var(--soft); animation: arrive 0.18s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .flavour, .slate .note, .slate .nudge { animation: none; } }
/* What is said when the button is pressed with the box empty: a small bubble under the box, pointing up at it, in the
   button's own colours so every look gets its own. */
.slate .nudge { position: relative; width: fit-content; max-width: 100%; margin: 14px 6px 0; padding: 10px 16px; font: 700 0.95rem/1.3 var(--body); color: var(--go-ink); background: var(--go); border: 2px solid var(--ink); border-radius: 6px; animation: arrive 0.18s ease-out; }
.slate .nudge::before { content: ""; position: absolute; left: 22px; top: -8px; width: 12px; height: 12px; background: inherit; border-left: inherit; border-top: inherit; transform: rotate(45deg); }
.field:focus-within, button:focus-visible, a:focus-visible, summary:focus-visible, .pick input:focus-visible ~ .edge {
  outline: 3px solid var(--pencil);
  outline-offset: 2px;
}
.go {
  appearance: none;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  padding: 0 20px;
  font: 800 1.1rem/1 var(--display);
  font-stretch: 112%;
  letter-spacing: 0.01em;
  color: var(--go-ink);
  background: var(--go);
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.go:disabled { opacity: 0.55; cursor: default; }
.go:active:not(:disabled) { transform: translate(2px, 2px); }
.error { margin-top: 10px; padding: 10px 12px; background: var(--bad-bg); color: var(--bad-ink); border-radius: 4px; font-weight: 600; }

.section { padding: 36px 0 0; }
.section h2 {
  font-family: var(--display);
  font-stretch: 114%;
  font-weight: 800;
  font-size: clamp(1.45rem, 5.6vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proof-grid figure { margin: 0; background: var(--strip); padding: 6px 6px 0; }
/* The example pictures carry width and height attributes; without this the height stays 640 px while the width shrinks to its column and the ad is drawn stretched. */
.proof-grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.proof-grid figcaption { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--strip-ink); padding: 7px 2px; }

.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.claims li { padding: 16px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 4px 10px; }
.claims .n { font: 600 12px/1.6 var(--mono); color: var(--pencil); }
.claims h3 { font-size: 1.12rem; font-weight: 750; line-height: 1.25; }
.claims .doubt { grid-column: 2; font-style: italic; color: var(--soft); }
.claims .how { grid-column: 2; }

.rows { border-top: 2px solid var(--ink); }
.rows details { border-bottom: 1px solid var(--rule); }
.rows summary {
  list-style: none;
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 650;
}
.rows summary::-webkit-details-marker { display: none; }
.rows summary::after { content: "+"; font: 400 1.5rem/1 var(--mono); color: var(--soft); }
.rows details[open] summary::after { content: "–"; }
.rows details p { padding: 0 0 16px; color: var(--soft); max-width: 44rem; }

footer { margin-top: 48px; padding: 20px 0 28px; border-top: 1px solid var(--rule); color: var(--soft); font-size: 0.9rem; }
/* Terms, privacy and refunds: small links, each a 44px target, so the page keeps its clean look. */
.legal-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 2px; }
.legal-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--soft); }
/* The three legal pages: one column of plain text at a comfortable reading width. */
.legal { max-width: 42rem; padding: 28px 0 0; }
.legal h1 { font-size: clamp(2rem, 8vw, 3rem); }
.legal h2 { font-size: 1.15rem; font-weight: 700; margin: 30px 0 8px; }
.legal p { line-height: 1.6; }
.legal p + p, .legal ul + p, .legal p + ul { margin-top: 10px; }
.legal ul { margin: 8px 0 0; padding-left: 1.2rem; line-height: 1.6; }
.legal li + li { margin-top: 8px; }
.legal a { text-underline-offset: 2px; }
.legal .lede { margin-bottom: 4px; }
/* A star and a share button at the end of the sentence. Each is a 44px target that takes no more line height than the text. */
.keep {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -12px -2px;
  padding: 0;
  vertical-align: middle;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.keep svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.keep:hover svg { stroke: var(--star, #ff6fb0); }
.keep[aria-pressed="true"] svg { fill: var(--star, #ff6fb0); stroke: var(--star, #ff6fb0); animation: star-in 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes star-in { from { transform: scale(0.65); } to { transform: scale(1); } }
.keep-note { margin-left: 8px; font-size: 0.85rem; }

/* ---- sets saved on this device (the landing page) ---- */
.saved-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.saved-list li { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--rule); }
.saved-list a { flex: 1; min-width: 0; display: block; padding: 12px 0; font-weight: 650; text-decoration: none; }
.saved-list a span { display: block; font-weight: 400; font-size: 0.9rem; color: var(--soft); }
.saved-list button { min-height: 44px; padding: 0 6px; font: inherit; font-size: 0.9rem; color: var(--soft); background: none; border: 0; text-decoration: underline; cursor: pointer; }

/* ---- job page ---- */
.job-head { padding: 22px 0 6px; }
.job-head h1 { font-size: clamp(1.7rem, 7vw, 3rem); margin: 8px 0 8px; }
.job-head .sub { color: var(--soft); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.95rem; }
.steps li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); align-items: baseline; color: var(--soft); }
.steps li::before { content: "○"; font-family: var(--mono); }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "●"; color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 650; }
.steps li.now::before { content: "◐"; color: var(--pencil); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 4px; background: var(--card); border: 1px solid var(--rule); }
.notice.bad { background: var(--bad-bg); color: var(--bad-ink); border-color: transparent; font-weight: 600; }
.notice[hidden] { display: none; }
/* A display rule on a class beats the browser's own [hidden] style, so say it once for everything. */
[hidden] { display: none !important; }

.frames { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px 0 8px; }
.frame { background: var(--strip); padding: 8px 8px 0; min-width: 0; }
.pick { display: block; position: relative; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shot {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: var(--shape, 1 / 1);
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  background: #26231f;
  overflow: hidden;
  cursor: zoom-in;
  appearance: none;
  -webkit-appearance: none;
}
.shot:disabled { cursor: default; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .ring { position: absolute; inset: 3%; width: 94%; height: 94%; pointer-events: none; }
.shot .ring path {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 330;
  stroke-dashoffset: 330;
  transition: stroke-dashoffset 0.32s ease-out;
}
.pick input:checked ~ .shot .ring path { stroke-dashoffset: 0; }
.edge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--strip-ink);
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
}
.edge { cursor: pointer; }
.edge .num { font-size: 15px; letter-spacing: 0.1em; }
.edge .line { color: #e9e2d3; font-family: var(--body); font-size: 0.95rem; font-weight: 600; letter-spacing: 0; }
.edge .state { border: 1.5px solid currentColor; border-radius: 999px; padding: 6px 10px; text-transform: uppercase; white-space: nowrap; }
/* The example set is looked through, not bought from: no price, nothing to choose. */
#job[data-example] .edge .state { display: none; }
#job[data-example] .edge { cursor: default; }
.pick input:checked ~ .edge .state { background: var(--pencil); border-color: var(--pencil); color: #fff; }
.frame.paid .edge .state { background: var(--strip-ink); border-color: var(--strip-ink); color: var(--strip); }
/* A cue that runs across the "+ $20" buttons: the script gives each one this class in turn, so a ripple of pink rings moves down the page. */
.frame .state.cue { animation: add-cue 1.1s ease-out; }
@keyframes add-cue {
  0% { box-shadow: 0 0 0 0 rgb(255 111 176 / 0.85); transform: scale(1); }
  25% { transform: scale(1.1); }
  70%, 100% { box-shadow: 0 0 0 12px rgb(255 111 176 / 0); transform: scale(1); }
}
.frame .under { background: var(--card); margin: 0 -8px; padding: 0 12px; border: 1px solid var(--rule); border-top: 0; }
.frame .capt { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0; font: inherit; font-size: 0.92rem; font-weight: 600; color: inherit; text-align: left; background: transparent; border: 0; cursor: pointer; }
.frame .capt::after { content: "›"; margin-left: auto; font-size: 1.35rem; line-height: 1; }
.frame .capt[hidden] { display: none; }
.frame .get {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0 0 12px;
  font-weight: 800;
  text-decoration: none;
  color: var(--go-ink);
  background: var(--go);
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.frame .get[hidden] { display: none; }
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  margin: 0 0 12px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.copy[hidden] { display: none; }
.share { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.share .sheet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
}
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "▾"; margin-left: 8px; }
.menu .options {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  min-width: 260px;
  display: grid;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.menu .options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.menu .options a + a { border-top: 1px solid var(--rule); }
.menu .options span { font-weight: 400; font-size: 0.88rem; color: var(--soft); }
.share .hint { flex-basis: 100%; margin: 0; color: var(--soft); font-size: 0.92rem; max-width: 44rem; }
.extra-text { white-space: pre-wrap; color: var(--soft); max-width: 44rem; padding: 8px 0 12px; }
/* The extra caption is long, so it is folded: the heading and the first two lines show, and a tap opens the rest. */
.extra-summary { display: block; flex: 1; min-width: 0; padding: 10px 0; }
.section.extra .extra-summary h2 { margin: 0 0 6px; font-size: clamp(1.1rem, 4.4vw, 1.5rem); }
.extra-teaser {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
}
.extra details[open] .extra-teaser { display: none; }
/* What to copy is the caption alone. The guidance above it is set apart (italic, small, and unselectable, so a quick
   drag over the caption cannot pick it up), and the caption sits in its own card so its edges are plain. */
.extra details > .sub { font-size: 0.9rem; font-style: italic; user-select: none; -webkit-user-select: none; }
.extra details .extra-text {
  margin: 0 0 12px;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.extra details[open] .extra-summary h2 { margin-bottom: 0; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.frame.working .shot { display: grid; place-items: center; color: #8f877a; font: 600 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; }
.frame.working .shot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.07) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: develop 1.8s linear infinite;
}
@keyframes develop { from { background-position: 180% 0; } to { background-position: -40% 0; } }
.frame.fresh { animation: arrive 0.45s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--strip);
  color: #f1ede4;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: grid;
  /* On a phone the button sits under the words: beside them, a long label squeezed the words to one letter a line. */
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px 12px;
  border-top: 2px solid var(--strip-ink);
}
.bar[hidden] { display: none; }
.bar .count { display: block; font-weight: 800; font-size: 1.05rem; }
.bar .hint { display: block; font-size: 0.85rem; color: #c9c1b2; }
.bar .go { width: 100%; margin: 0; }
.bar .trust { margin: 0; font-size: 0.78rem; line-height: 1.3; text-align: center; opacity: 0.78; }
.bar .all { background: none; border: 0; color: var(--strip-ink); font: inherit; font-size: 0.85rem; text-decoration: underline; padding: 0; min-height: 44px; cursor: pointer; text-align: left; }
.bar .all[hidden] { display: none; }

/* The main button's poof when every ad goes in the cart: the button squashes and springs, a candyfloss puff and a ring open
   behind it and 18 pieces of confetti fly up and fall. All of it is made by job.js, placed on the button, and cleared away. */
.bar .go.poof { animation: go-poof 0.7s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes go-poof {
  0% { transform: scale(0.86, 1.1); box-shadow: 0 0 0 0 rgb(255 111 176 / 0.8), 0 12px 22px -12px rgb(224 53 138 / 0.9); }
  30% { transform: scale(1.1, 0.92); }
  55% { transform: scale(0.97, 1.04); }
  100% { transform: none; box-shadow: 0 0 0 26px rgb(255 111 176 / 0), 0 12px 22px -12px rgb(224 53 138 / 0.9); }
}
.burst { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst::before { content: ""; position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / 0.95) 0 28%, rgb(255 168 214 / 0.85) 29% 52%, rgb(255 168 214 / 0) 72%); animation: poof-cloud 0.6s ease-out forwards; }
.burst::after { content: ""; position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; border: 4px solid #fff; animation: poof-ring 0.55s ease-out forwards; }
@keyframes poof-cloud { from { transform: scale(0.2); opacity: 1; } to { transform: scale(2.3); opacity: 0; } }
@keyframes poof-ring { from { transform: scale(0.3); opacity: 1; } to { transform: scale(2.8); opacity: 0; } }
.burst i { position: absolute; width: 9px; height: 14px; margin: -7px 0 0 -4.5px; border-radius: 3px; background: var(--c, #ff4f9f); opacity: 0; animation: confetti 1s cubic-bezier(0.15, 0.7, 0.3, 1) forwards; }
.burst i:nth-child(3n) { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; }
.burst i:nth-child(5n) { width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.burst i:nth-child(3n + 2) { animation-delay: 0.04s; }
.burst i:nth-child(3n + 3) { animation-delay: 0.08s; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0) scale(0.4); opacity: 1; }
  60% { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 1.15), calc(var(--dy) + 46px)) rotate(calc(var(--r) * 1.6)) scale(1); opacity: 0; }
}
.burst i:nth-child(1) { --dx: -140px; --dy: -90px; --r: 200deg; --c: #ff4f9f; }
.burst i:nth-child(2) { --dx: -105px; --dy: -150px; --r: -160deg; --c: #3d9bff; }
.burst i:nth-child(3) { --dx: -60px; --dy: -190px; --r: 280deg; --c: #ffc933; }
.burst i:nth-child(4) { --dx: -20px; --dy: -120px; --r: -240deg; --c: #3fd9a8; }
.burst i:nth-child(5) { --dx: 15px; --dy: -205px; --r: 120deg; --c: #a98bff; }
.burst i:nth-child(6) { --dx: 55px; --dy: -170px; --r: -300deg; --c: #ff4f9f; }
.burst i:nth-child(7) { --dx: 95px; --dy: -140px; --r: 180deg; --c: #3d9bff; }
.burst i:nth-child(8) { --dx: 135px; --dy: -85px; --r: -200deg; --c: #ffc933; }
.burst i:nth-child(9) { --dx: -160px; --dy: -30px; --r: 340deg; --c: #3fd9a8; }
.burst i:nth-child(10) { --dx: 160px; --dy: -35px; --r: -320deg; --c: #ff4f9f; }
.burst i:nth-child(11) { --dx: -125px; --dy: -125px; --r: 100deg; --c: #a98bff; }
.burst i:nth-child(12) { --dx: 120px; --dy: -120px; --r: -120deg; --c: #3fd9a8; }
.burst i:nth-child(13) { --dx: -35px; --dy: -90px; --r: 260deg; --c: #3d9bff; }
.burst i:nth-child(14) { --dx: 40px; --dy: -100px; --r: -260deg; --c: #ffc933; }
.burst i:nth-child(15) { --dx: -80px; --dy: -60px; --r: 150deg; --c: #ff4f9f; }
.burst i:nth-child(16) { --dx: 85px; --dy: -55px; --r: -150deg; --c: #a98bff; }
.burst i:nth-child(17) { --dx: -10px; --dy: -165px; --r: 380deg; --c: #ff4f9f; }
.burst i:nth-child(18) { --dx: 0px; --dy: -60px; --r: -380deg; --c: #3d9bff; }

.lost { padding: 48px 0; }

/* ---- what was bought: its own panel, laid out to fit how many ---- */
.bought { padding-bottom: 8px; }
.bought .sub { color: var(--soft); max-width: 44rem; }
.bought .bought-grid { padding-top: 16px; max-width: calc(var(--cols, 99) * 26rem); }
.bought-zip { display: flex; align-items: center; justify-content: center; max-width: 22rem; margin: 8px 0 0; text-decoration: none; }
.rest { padding-bottom: 0; }
.rest h2 { margin-bottom: 0; }
@media (min-width: 560px) { .frames.bought-grid { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); } }
@media (min-width: 960px) { .frames.bought-grid { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); } }
@media (min-width: 1280px) { .frames.bought-grid { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }

/* ---- the closer look: one ad as large as the screen allows ---- */
html.lb-open { overflow: hidden; }
.lightbox {
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--lb-bg, rgb(14 13 12 / 0.97));
  color: #f6f3ec;
  overflow: hidden;
}
.lightbox[open] { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: lb-in 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.lightbox::backdrop { background: var(--lb-bg, rgb(14 13 12 / 0.97)); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: max(6px, env(safe-area-inset-top)) var(--gutter) 4px; }
.lb-title { margin: 0; display: flex; align-items: baseline; gap: 10px; min-width: 0; font-weight: 700; }
.lb-num { flex: none; font: 600 15px/1 var(--mono); letter-spacing: 0.1em; }
.lb-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { flex: none; margin-left: auto; font: 500 13px/1 var(--mono); opacity: 0.72; }
.lb-close, .lb-nav {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
}
.lb-nav { width: 52px; height: 52px; }
.lb-close svg, .lb-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.lb-nav:disabled { opacity: 0.3; cursor: default; }
.lb-stage { position: relative; min-height: 0; touch-action: pinch-zoom pan-y; }
.lb-image { position: absolute; inset: 0 8px; width: calc(100% - 16px); height: 100%; object-fit: contain; }
.lb-foot { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: end; gap: 10px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); }
.lb-prev { grid-column: 1; }
.lb-next { grid-column: 3; }
.lb-mid { grid-column: 2; display: grid; gap: 8px; min-width: 0; }
.lb-action { display: flex; align-items: center; justify-content: center; width: 100%; margin: 0; text-decoration: none; }
/* Checkout from here when another ad is in the cart but this one is not: small, so the pink button stays the one thing to press. */
.lb-cart { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; padding: 0 14px; color: inherit; font: 700 0.95rem/1 var(--sans, inherit); background: transparent; border: 2px solid currentColor; border-radius: 999px; cursor: pointer; }
.lb-cart[hidden] { display: none; }
/* The dot: how many ads are in the cart. */
.go .dot, .lb-cart .dot { display: inline-grid; place-items: center; min-width: 1.55em; height: 1.55em; margin-right: 0.55em; padding: 0 0.4em; font: 800 0.72em/1 var(--sans, inherit); color: #e0358a; background: #fff; border-radius: 999px; }
/* A double tap on the picture adds it: a heart comes up from where the finger landed, and the picture gives a small pop. */
.lb-heart { position: absolute; z-index: 2; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; fill: #e0358a; filter: drop-shadow(0 6px 14px rgb(224 53 138 / 0.55)); animation: lb-heart 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes lb-heart { 0% { transform: scale(0.2) rotate(-12deg); opacity: 0; } 22% { transform: scale(1.15) rotate(6deg); opacity: 1; } 40% { transform: scale(0.95) rotate(0); } 100% { transform: translateY(-42px) scale(1.05); opacity: 0; } }
.lb-image.lb-popped { animation: lb-popped 0.28s ease-out; }
@keyframes lb-popped { 45% { transform: scale(1.025); } }
@media (prefers-reduced-motion: reduce) { .lb-heart { display: none; } .lb-image.lb-popped { animation: none; } }
@media (min-width: 760px) { .lb-foot { grid-template-columns: 52px minmax(0, 26rem) 52px; justify-content: center; } }

/* ---- a caption in a white sheet: read it, copy it, and once it is copied the ad it goes with is offered ---- */
html.cs-open, html.pay-open { overflow: hidden; }
.csheet { width: 100%; max-width: 34rem; margin: auto auto 0; padding: 0; color: #151515; background: #fff; border: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -18px 50px -20px rgb(0 0 0 / 0.5); overflow: hidden; }
.csheet[open] { animation: sheet-up 0.24s cubic-bezier(0.16, 1, 0.3, 1); }
.csheet::backdrop { background: rgb(10 10 12 / 0.55); }
@keyframes sheet-up { from { transform: translateY(26px); opacity: 0; } }
/* A caption is long, so only the words scroll: the title stays above them and the buttons stay below, in reach. */
.cs-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; max-height: 88dvh; padding: 16px var(--gutter) calc(20px + env(safe-area-inset-bottom)); overflow: hidden; }
.cs-actions { display: grid; gap: 10px; }
.cs-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.cs-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin: 0; font-weight: 700; }
.cs-title #cs-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: #151515; background: #f0f0f3; border: 0; border-radius: 50%; cursor: pointer; }
.cs-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.cs-text { min-height: 0; margin: 0; overflow-y: auto; overscroll-behavior: contain; font-size: 1rem; line-height: 1.55; color: #2a2a2e; white-space: pre-wrap; }
.cs-card .go { margin: 0; }
.cs-offer { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 16px; font: inherit; font-weight: 800; text-decoration: none; color: #151515; background: #fff; border: 2px solid #151515; border-radius: 4px; cursor: pointer; animation: arrive 0.22s ease-out; }
.cs-offer[hidden] { display: none; }
.cs-offer:disabled { opacity: 0.55; cursor: default; }
.cs-note { margin: 0; font-size: 0.9rem; color: #5b5b63; }
/* The payment sheet reuses the caption sheet's frame: what is being bought, the exact charge, the email for the receipt. */
.pay-body { display: grid; gap: 12px; align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.pay-total { margin: 0; font-weight: 700; color: #2a2a2e; }
.pay-charge { margin: 0; font-size: 1.55rem; font-weight: 800; line-height: 1.15; }
.pay-field { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; color: #2a2a2e; }
.pay-field input { width: 100%; min-height: 52px; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 500; color: #151515; background: #fff; border: 2px solid #151515; border-radius: 4px; }
.pay-field input:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; }
.pay-fine { margin: 0; font-size: 0.82rem; line-height: 1.45; color: #5b5b63; }
.pay-charge[hidden], .pay-fine[hidden] { display: none; }
#pay-note { font-weight: 600; color: #151515; }
.pop { animation: pop 0.3s ease-out; }
@keyframes pop { 40% { transform: scale(1.07); } }
@media (min-width: 640px) { .csheet { margin: auto; border-radius: 24px; } }
@media (prefers-reduced-motion: reduce) { .csheet[open], .pop, .cs-offer { animation: none; } }

@media (min-width: 560px) {
  .bar { grid-template-columns: minmax(0, 1fr) auto; }
  .bar .go { width: auto; min-width: 14.5rem; } /* wide enough for "Add all 12 · $120", so Checkout takes the same room */
  .bar .trust { display: none; } /* the line is for a phone; a wide bar stays clean */  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slate { padding: 20px; }
}
@media (min-width: 760px) {
  .hero { padding-top: 48px; }
  .slate form, .slate .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
  .slate .go { width: auto; margin-top: 0; min-height: 56px; } /* as tall as the link box, which the menu may extend downwards */
  .claims { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}
@media (min-width: 960px) {
  .frames { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .frames { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .frame.working .shot::before, .frame.fresh, .lightbox[open], .keep[aria-pressed="true"] svg { animation: none; }
  .shot .ring path { transition: none; }
  .go:active:not(:disabled) { transform: none; }
  .bar .go.poof { animation: none; }
  .burst { display: none; }
  .frame .state.cue { animation: none; }
}

/* Words for a screen reader that are not shown. */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- the owner's page (/admin): a square for each set, with what it has earned ---- */
.owner .tally { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.owner .tally div { background: var(--card); border-radius: 18px; padding: 14px 16px; min-width: 0; }
.owner .tally dt { font-size: 0.8rem; font-weight: 700; color: var(--soft); }
.owner .tally dd { margin: 0; }
.owner .tally dd:nth-of-type(1) { font: 400 clamp(1.7rem, 7vw, 2.4rem)/1.1 var(--display); color: var(--ink); }
.owner .tally .sub { font-size: 0.8rem; color: var(--soft); overflow-wrap: anywhere; }
.owner .tally .warn { box-shadow: 0 0 0 3px var(--go); }
.owner .note { margin: 12px 2px 0; font-size: 0.85rem; color: var(--soft); }
.owner .seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 14px; }
.owner .seg a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 700; text-decoration: none; }
.owner .seg a[aria-current="page"] { background: var(--ink); color: var(--card); }
.sets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.set { background: var(--card); border-radius: 20px; padding: 8px 8px 10px; min-width: 0; }
.set.sold { box-shadow: 0 0 0 3px var(--ok); }
.set > a { display: block; color: inherit; text-decoration: none; }
.set .sq { position: relative; display: block; aspect-ratio: 1; border-radius: 13px; overflow: hidden; background: var(--rule); }
.set .sq img { width: 100%; height: 100%; object-fit: cover; }
.set .blank { display: grid; place-items: center; height: 100%; font-weight: 700; color: var(--soft); }
.set .chip { position: absolute; left: 8px; top: 8px; padding: 6px 10px; border-radius: 999px; font: 800 0.8rem/1 var(--body); }
.set .chip.sold { background: var(--ok); color: var(--card); }
.set .chip.wait { background: var(--go); color: var(--go-ink); }
.set .name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font-weight: 700; font-size: 0.92rem; line-height: 1.25; }
.set .meta { margin: 3px 0 0; font-size: 0.75rem; color: var(--soft); overflow-wrap: anywhere; }
@media (min-width: 700px) { .owner .tally { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .sets { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
