/* Wesley Girls' High School · 2005 Year Group · Pinktober frame
   UI build: layout and styling only. */

:root {
  color-scheme: light;

  /* Colour: pink is taken from the pledge lettering outline (#B91F64);
     green is the 2005 / crest green. Use pink for actions, green only for identity. */
  --ink: #2A1320;
  --muted: #6B5560;
  --pink: #B91F64;
  --pink-press: #8E1149;
  --pink-tint: #FBEAF1;
  --pink-wash: #FDF4F8;
  --line: #EBDDE3;
  --line-strong: #CDB8C2;
  --seg: #F6EEF2;
  --placeholder: #E8DBE1;
  --green: #0E6B3B;
  --surface: #FFFFFF;
  --page: #F6EEF2;

  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 16px;
  --shadow-stage: 0 1px 2px rgba(42, 19, 32, 0.08), 0 8px 24px rgba(42, 19, 32, 0.10);

  --gutter: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Height of everything that is not the photo stage, per screen. */
  --app-h: 100vh;
  --editor-chrome: 280px;
  --save-chrome: 340px;
}

@supports (height: 100dvh) {
  :root { --app-h: 100dvh; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; }

a { color: var(--pink); }

button { font: inherit; color: inherit; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- App shell ---------- */

.app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: var(--app-h);
  margin: 0 auto;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: var(--app-h);
}
.screen[hidden] { display: none; }

.screen__body {
  flex: 1 0 auto;
  padding: 0 var(--gutter);
}

/* On tablets and desktop the phone-sized column sits on a soft page. */
@media (min-width: 640px) {
  :root { --app-h: calc(100vh - 48px); }
  @supports (height: 100dvh) {
    :root { --app-h: calc(100dvh - 48px); }
  }
  body { background: var(--page); padding: 24px 0; }
  .app {
    border-radius: 28px;
    box-shadow: 0 2px 6px rgba(42, 19, 32, 0.06), 0 24px 60px rgba(42, 19, 32, 0.12);
    overflow: clip;
  }
  .actionbar { border-radius: 0 0 28px 28px; }
}

/* ---------- Shared bits ---------- */

.section-label {
  display: block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--pink-tint);
  color: var(--pink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { flex: 0 0 auto; }

.btn--primary { background: var(--pink); color: #FFFFFF; }
.btn--primary:hover { background: var(--pink-press); }

.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line); font-size: 15px; }
.btn--secondary:hover { border-color: var(--line-strong); }

.btn--grow { flex: 1 1 auto; }
.actionbar--row .btn--secondary { flex: 0 0 auto; padding: 0 14px; white-space: nowrap; }
.btn__meta { font-weight: 500; color: var(--muted); }

.icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { background: var(--seg); }
.icon-btn--outlined { border: 1.5px solid var(--line); background: var(--surface); }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--pink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.text-btn--ink { color: var(--ink); font-size: 15px; font-weight: 600; }
.text-btn:hover { background: var(--seg); }

/* ---------- Headers ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px var(--gutter) 10px;
}
.brand__crest { width: 40px; height: 44px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; gap: 1px; }
.brand__school { font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em; }
.brand__group { font-size: 12.5px; font-weight: 600; color: var(--green); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  min-height: 60px;
}
.topbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.topbar__spacer { width: 44px; height: 44px; }
.topbar__spacer--wide { width: 64px; }

/* ---------- Screen 1 · Choose ---------- */

.intro { padding: 6px 0 0; }
.intro__title {
  margin: 10px 0 6px;
  font-size: 26px;
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.01em;
  outline: none;
}
.intro__lede { margin: 0; font-size: 15px; color: var(--muted); }

.pledges {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 22px 0 24px;
}

.pledge-card {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 9px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.pledge-card:hover { border-color: var(--line-strong); }
.pledge-card:focus-within { outline: 3px solid var(--pink); outline-offset: 2px; }
.pledge-card:has(input:focus:not(:focus-visible)) { outline: none; }

.pledge-card__thumb {
  width: 64px;
  height: 114px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--placeholder);
}
.pledge-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pledge-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pink);
}
.pledge-card__copy { font-size: 14.5px; line-height: 1.38; }
.pledge-card__copy strong { font-weight: 700; }

.pledge-card__check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}

.pledge-card.is-selected { border-color: var(--pink); background: var(--pink-wash); }
.pledge-card.is-selected .pledge-card__check { background: var(--pink); border-color: var(--pink); color: #FFFFFF; }

/* ---------- Action bar ---------- */

.actionbar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px var(--gutter) calc(16px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid #F1E6EB;
}
.actionbar--row { flex-direction: row; }
.actionbar .btn:not(.btn--secondary) { width: 100%; }
.actionbar--row .btn--primary { width: auto; }

.privacy {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.consent-details { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.consent-details summary { cursor: pointer; color: var(--pink); padding: 8px 0; }
.consent-details__body { max-height: 30vh; overflow-y: auto; }
.consent-details__body p { margin: 0 0 8px; }

/* ---------- Photo stage (shared by editor + result) ---------- */

.stage {
  position: relative;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--placeholder);
  box-shadow: var(--shadow-stage);
  isolation: isolate;
}

.stage--editor {
  height: min(calc(var(--app-h) - var(--editor-chrome)), calc((min(100vw, 440px) - 2 * var(--gutter)) * 16 / 9));
  min-height: 360px;
  max-height: 680px;
}

.stage--live { touch-action: none; cursor: grab; }

.stage--result {
  height: min(calc(var(--app-h) - var(--save-chrome)), 520px);
  min-height: 300px;
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(42, 19, 32, 0.08), 0 10px 28px rgba(42, 19, 32, 0.16);
}

.stage__photo,
.stage__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage__photo { object-fit: cover; z-index: 0; }
.stage__frame { object-fit: fill; z-index: 1; pointer-events: none; }

.stage__placeholder {
  position: absolute;
  left: 50%;
  top: 17%;
  width: 46%;
  height: auto;
  transform: translateX(-50%);
  color: var(--line-strong);
}

.stage__add {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(42, 19, 32, 0.18);
}
.stage__add svg { color: var(--pink); }
.stage__add:hover { background: var(--pink-wash); }

.stage__hint {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(30, 12, 22, 0.72);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.stage__hint-short { display: none; }

/* ---------- Editor controls ---------- */

.screen__body--editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
  padding-bottom: 12px;
}

.zoom { display: flex; align-items: center; gap: 8px; }
.zoom__range {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  margin: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

.segmented__track {
  display: grid;
  grid-template-columns: repeat(var(--pledge-count, 3), minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--seg);
}
.segmented__opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.segmented__opt:focus-within { outline: 3px solid var(--pink); outline-offset: 1px; }
.segmented__opt:has(input:focus:not(:focus-visible)) { outline: none; }
.segmented__opt.is-selected {
  background: var(--surface);
  color: var(--pink);
  box-shadow: 0 1px 3px rgba(42, 19, 32, 0.14);
}

/* ---------- Screen 4 · Save ---------- */

.screen__body--save {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 8px;
}

.save-actions { display: flex; flex-direction: column; gap: 10px; }
.save-actions .btn { width: 100%; }

.save-help {
  margin: 2px 4px 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.save-help strong { color: var(--ink); }

.more {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 12px 0 calc(14px + var(--safe-bottom));
  color: var(--line-strong);
}
.more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.more a:hover { background: var(--seg); }

/* ---------- Toast (UI-build notice for unwired buttons) ---------- */

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(104px + var(--safe-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(42, 19, 32, 0.24);
}

/* ---------- Small phones ---------- */

@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .intro__title { font-size: 23px; }
  .segmented__opt { font-size: 12.5px; }
  .btn__meta { display: none; }
}

/* Narrow stages (small phones, short screens): shorter hint so it clears the crest. */
@media (max-width: 374px), (max-height: 700px) {
  .stage__hint { font-size: 12px; padding: 6px 10px; left: 10px; top: 10px; }
  .stage__hint-long { display: none; }
  .stage__hint-short { display: inline; }
}

@media (max-width: 374px) {
  .actionbar--row { gap: 8px; }
  .actionbar--row .btn--secondary svg { display: none; }
  .actionbar--row .btn { padding: 0 12px; }
}

@media (max-height: 700px) {
  :root { --editor-chrome: 268px; --save-chrome: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Phase 1 editor and actual exported image. */
[hidden] { display: none !important; }
button.stage__add { border: 0; font-family: inherit; cursor: pointer; }
#photo-canvas, #export-image { display: block; width: 100%; height: 100%; }
#photo-canvas { position: absolute; inset: 0; }
#export-image { object-fit: contain; -webkit-touch-callout: default; }
.photo-error, .small-photo { margin: 0; padding: 10px; border-radius: 10px; background: var(--pink-tint); color: var(--ink); font-size: 13px; }
.small-photo { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.preview-note { font-size: 12px; color: var(--muted); margin: -14px 0 12px; }
.btn:disabled { opacity: .65; cursor: wait; }
.pledge-total { min-height: 1.45em; margin: 8px 0 0; font-size: 13px; color: var(--muted); visibility: hidden; }
.pledge-count { display: block; min-height: 1.4em; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; visibility: hidden; }
.has-stats .pledge-total, .has-stats .pledge-count { visibility: visible; }

/* =====================================================================
   FIT TO SCREEN: every screen fits the visible phone height, no page scroll.
   The app is exactly one viewport tall. Each screen is a column: header,
   flexible middle, footer. The photo stage takes whatever height is left
   and keeps 9:16 using container query units. Very short viewports (phone
   turned sideways) fall back to normal page scrolling instead of clipping.
   ===================================================================== */

html, body { height: 100%; }
body { overflow: hidden; overscroll-behavior: none; }

.app { height: var(--app-h); min-height: 0; overflow: hidden; }

.screen {
  height: 100%;
  min-height: 0;
}

.screen__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.actionbar {
  position: static;
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 10px;
  padding-bottom: calc(12px + var(--safe-bottom));
}

/* ---------- Screen 1 · Choose ---------- */

.brand { padding-top: clamp(8px, 1.6vh, 14px); padding-bottom: clamp(4px, 1vh, 10px); }
.intro { flex: 0 0 auto; padding-top: 0; }
.intro__title { font-size: clamp(21px, 3.2vh, 26px); margin: clamp(4px, 1vh, 10px) 0 clamp(2px, 0.6vh, 6px); }
.pledge-total { min-height: 0; margin-top: 4px; }
.pledge-total:empty { display: none; }

.pledges {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;            /* safety net only; sized not to need it */
  margin: clamp(10px, 2vh, 22px) 0 clamp(8px, 1.4vh, 16px);
  gap: clamp(6px, 1.1vh, 10px);
  --thumb-h: clamp(54px, 10.5vh, 114px);
}
.pledges .section-label { margin-bottom: clamp(4px, 0.8vh, 10px); }
.pledge-card { flex: 0 0 auto; grid-template-columns: calc(var(--thumb-h) * 9 / 16) minmax(0, 1fr) 24px; }
.pledge-card__thumb { width: calc(var(--thumb-h) * 9 / 16); height: var(--thumb-h); }
.pledge-card__copy { font-size: clamp(13px, 1.9vh, 14.5px); line-height: 1.32; }

.preview-note { margin: 0 0 6px; }

/* Consent: the sentence itself opens the details, which float above the footer. */
.consent-details { position: relative; }
.consent-details > summary {
  display: block;
  list-style: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}
.consent-details > summary::-webkit-details-marker { display: none; }
.consent-details__more { color: var(--pink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.consent-details[open] .consent-details__more { text-decoration: none; }
.consent-details__body {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: min(50vh, 340px);
  overflow-y: auto;
  padding: 14px 16px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(42, 19, 32, 0.18);
}

/* ---------- Photo stage: fill the leftover height at 9:16 ---------- */

.stage-fit {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}
.stage--editor,
.stage--result {
  width: auto;
  height: min(100cqh, 100cqw * 16 / 9);
  min-height: 0;
  max-height: none;
  margin: 0;
}

/* Browsers without container query units: previous height estimate. */
@supports not (height: 1cqh) {
  .stage--editor { height: min(calc(var(--app-h) - var(--editor-chrome)), calc((min(100vw, 440px) - 2 * var(--gutter)) * 16 / 9)); }
  .stage--result { height: min(calc(var(--app-h) - var(--save-chrome)), 520px); }
}

.screen__body--editor { gap: clamp(8px, 1.4vh, 12px); padding-bottom: clamp(6px, 1.2vh, 12px); }
.screen__body--editor .segmented .section-label { margin-bottom: 6px; }
.screen__body--save { gap: clamp(10px, 2vh, 20px); padding-bottom: 4px; }
.save-actions { flex: 0 0 auto; gap: clamp(6px, 1.1vh, 10px); }
.save-help { margin: 0; font-size: 12.5px; line-height: 1.4; }
.more { flex: 0 0 auto; padding: 4px 0 calc(8px + var(--safe-bottom)); }

/* ---------- Height tiers ---------- */

@media (max-height: 760px) {
  .eyebrow { display: none; }
  .intro__lede { font-size: 14px; }
  .btn { min-height: 48px; }
}

@media (max-height: 640px) {
  .intro__lede { display: none; }
  .pledges .section-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pledge-card { padding: 6px 10px 6px 6px; gap: 10px; }
  .pledge-card__label { font-size: 10.5px; }
  .screen__body--editor .segmented .section-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .segmented__opt { min-height: 42px; }
  .zoom .icon-btn { width: 42px; height: 42px; }
  .zoom__range { height: 42px; }
  .topbar { min-height: 52px; padding-top: 4px; padding-bottom: 4px; }
  .btn { min-height: 46px; }
  .more a { min-height: 40px; }
}

@media (max-height: 580px) {
  .pledge-card__label { display: none; }
  .pledge-card__copy { font-size: 13px; line-height: 1.28; }
}

/* Phone sideways or tiny window: let the page scroll rather than clip. */
@media (max-height: 459px) {
  body { overflow: auto; }
  .app { height: auto; min-height: var(--app-h); overflow: visible; }
  .screen { height: auto; min-height: var(--app-h); }
  .pledges { overflow: visible; }
  .stage-fit { flex: 0 0 auto; container-type: normal; }
  .stage--editor, .stage--result { height: 360px; }
}

/* Counter sits inline after the card label and takes no space until it has a value. */
.pledge-count { display: inline; min-height: 0; margin-left: 6px; }
.pledge-count:empty { display: none; }

/* "Tap to add a photo" scales with the frame so it never overflows a small stage. */
.stage { container-type: inline-size; }
.stage__add {
  max-width: 92%;
  gap: 6px;
  min-height: 44px;
  padding: 0 clamp(10px, 6cqw, 20px);
  font-size: clamp(12.5px, 7cqw, 15px);
}
@container (max-width: 200px) {
  .stage__add svg { display: none; }
}

/* One-line consent + terms pop-up (replaces the long consent sentence and Details). */
.terms-line {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}
.terms-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.terms {
  width: min(360px, calc(100vw - 32px));
  max-height: min(80vh, 560px);
  padding: 20px 20px 16px;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(42, 19, 32, 0.28);
  overflow: auto;
}
.terms::backdrop { background: rgba(30, 12, 22, 0.55); }
.terms__title { margin: 0 0 10px; font-size: 18px; font-weight: 800; }
.terms__body { font-size: 14px; line-height: 1.45; }
.terms__body p { margin: 0 0 10px; }
.terms form { margin: 14px 0 0; }
.terms__close { width: 100%; }

/* No eyebrow labels: section headings stay for screen readers only. */
.pledges > .section-label,
.screen__body--editor .segmented > .section-label {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Card title is just the pledge name; the count is a quiet badge on its own line. */
.pledge-card__label { letter-spacing: 0.04em; }
.pledge-card__count {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--seg);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.pledge-card__count[hidden] { display: none; }
.pledge-card.is-selected .pledge-card__count { background: #FFFFFF; }
.pledge-card__count svg { flex: 0 0 auto; }

/* Softer "terms" link: muted pink, light underline (still 4.5:1 on white). */
.terms-link {
  color: #A9547A;
  font-weight: 600;
  text-decoration-color: rgba(185, 31, 100, 0.35);
}

/* =====================================================================
   FIRST-VISIT INTRO (js/intro.js). Active only while <html> has .intro-loading.
   ===================================================================== */
#choose { position: relative; }
@keyframes intro-sk-pulse { from { opacity: 1; } to { opacity: .45; } }

/* Skeleton: crest stays real; everything else becomes pulsing placeholder bars. */
.intro-loading #choose :is(.brand__text span, .intro__title, .intro__lede, .pledge-total,
                           .pledge-card__label, .pledge-card__copy, .pledge-card__count, .terms-line) {
  color: transparent !important;
  background: linear-gradient(to bottom, transparent 16%, #EFE4E9 16% 84%, transparent 84%) 0 0 / 100% 1.35em repeat-y;
  background-size: 100% 1lh;
  border-radius: 6px;
  animation: intro-sk-pulse .7s ease-in-out infinite alternate;
}
.intro-loading #choose :is(.pledge-card__copy strong, .terms-link, .pledge-card__count svg) { visibility: hidden; }
.intro-loading #choose .pledge-card__count { background: #EFE4E9; }
.intro-loading #choose .pledge-card,
.intro-loading #choose .pledge-card.is-selected { border-color: var(--line); background: var(--surface); }
.intro-loading #choose .pledge-card__thumb {
  object-position: -9999px 0;
  background: #EFE4E9;
  animation: intro-sk-pulse .7s ease-in-out infinite alternate;
}
.intro-loading #choose .pledge-card__check,
.intro-loading #choose .pledge-card.is-selected .pledge-card__check { border-color: #EFE4E9; background: #EFE4E9; color: transparent; }
.intro-loading #choose .btn--primary {
  background: #EFE4E9;
  color: transparent;
  animation: intro-sk-pulse .7s ease-in-out infinite alternate;
}

/* Page fades in as the skeleton lifts. */
@keyframes intro-reveal { from { opacity: .35; } to { opacity: 1; } }
.intro-revealing #choose :is(.brand__text, .screen__body, .actionbar) { animation: intro-reveal .28s ease-out both; }

/* The stack of dropped prints. Taps pass through (and skip the intro). */
.intro-drop {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.intro-drop__shot {
  position: absolute;
  left: 50%;
  top: 44%;
  height: auto;
  aspect-ratio: 9 / 16;
  border: 4px solid #FFFFFF;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(42, 19, 32, .18), 0 14px 30px rgba(42, 19, 32, .30);
  opacity: 0;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .intro-drop { display: none; }
}
