/* Box of Invites: the page around the 3D scene (PROJ-455).
   Tokens follow flow's system in two layers (the flow nights set, PROJ-308: project/flow.css):
   primitives hold raw values, roles read primitives, parts read roles only. */
@font-face { font-family: 'Guton'; font-weight: 400; font-display: swap; src: url('fonts/Guton-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Guton'; font-weight: 500; font-display: swap; src: url('fonts/Guton-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Guton'; font-weight: 600; font-display: swap; src: url('fonts/Guton-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Guton'; font-weight: 700; font-display: swap; src: url('fonts/Guton-Bold.woff2') format('woff2'); }

:root {
  /* primitives */
  --flow-background: #060606; --flow-overlay: #111318; --flow-card: #1b1f29; --flow-elevated: #1e2026;
  --flow-ice: #d9f7ff; --flow-cyan: #00c5fc; --flow-cyan-ink: #00141b; --flow-ink: #f5f5f5; --flow-mark: #e6e8ec;
  --flow-green: #3ecf7d; --flow-amber: #ffbe46; --flow-coral: #ff7a6b;
  --flow-ink-a72: rgba(245,245,245,.72); --flow-ink-a56: rgba(245,245,245,.56); --flow-ink-a40: rgba(245,245,245,.40);
  --flow-ink-a24: rgba(245,245,245,.24); --flow-ink-a12: rgba(245,245,245,.12); --flow-ink-a06: rgba(250,250,250,.06);
  --flow-black-a72: rgba(6,6,6,.72); --flow-cyan-a14: rgba(255,255,255,.12); --flow-cyan-a40: rgba(0,197,252,.4);
  --flow-chrome-label: linear-gradient(135deg, #a3a8af 0%, #e7eaee 22%, #959aa1 44%, #d4d8dd 62%, #a7acb2 80%, #f2f3f5 100%);
  /* roles */
  --color-bg-canvas: var(--flow-background); --color-bg-surface: var(--flow-ink-a06); --color-bg-overlay: var(--flow-overlay);
  --color-bg-raised: var(--flow-card); --color-bg-scrim: var(--flow-black-a72);
  --color-bg-action-primary: var(--flow-cyan); --color-fg-on-action-primary: var(--flow-cyan-ink);
  --color-bg-action-secondary: var(--flow-mark); --color-fg-on-action-secondary: var(--flow-background);
  --color-fg-primary: var(--flow-ink); --color-fg-secondary: var(--flow-ink-a72); --color-fg-tertiary: var(--flow-ink-a56);
  --color-fg-brand: var(--flow-ice); --color-fg-accent: var(--flow-cyan); --color-fg-positive: var(--flow-green); --color-fg-warning: var(--flow-amber); --color-fg-negative: var(--flow-coral);
  --color-border-subtle: var(--flow-ink-a12); --color-border-strong: var(--flow-ink-a24); --color-border-control: var(--flow-ink-a40); --color-border-focus: rgba(255,255,255,.85);
  --font-display: 'Guton', ui-sans-serif, system-ui, sans-serif; --font-body: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --shape-control: 14px;
  --flow-cta-bg: oklch(1 0 0); --flow-cta-fg: oklch(0.17 0 0); --flow-cta-bg-hover: oklch(0.93 0 0); --flow-cta-bg-disabled: oklch(0.42 0 0); --flow-cta-fg-disabled: oklch(0.97 0 0);
  --glass-fill: oklch(0.22 0 0 / .55); --glass-border: rgba(255,255,255,.14); --glass-blur: blur(24px) saturate(160%);
  --ease-arrive: cubic-bezier(.16,1,.3,1); --ease-glide: cubic-bezier(.65,0,.35,1); --shape-sheet: 24px; --shape-rounded: 999px;
  --size-touch: 56px;
  --ms-fast: 160ms; --ms-moderate: 240ms; --ms-slow: 320ms; --ms-expressive: 400ms;
  --curve-standard: cubic-bezier(.4,0,.2,1); --curve-decelerate: cubic-bezier(0,0,.2,1); --curve-emphasized: cubic-bezier(.2,0,0,1);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, a, input, label { touch-action: manipulation; }
html { background: var(--color-bg-canvas); }
html, body { margin: 0; height: 100%; color: var(--color-fg-primary); font-family: var(--font-body); overflow: hidden; overscroll-behavior: none; }
body { -webkit-font-smoothing: antialiased; background: var(--color-bg-canvas); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* the top strip */
.top { position: fixed; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 14px) 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; z-index: 5; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--color-fg-secondary); font: 500 13px/1 var(--font-body); }
.brand img.wm { height: 26px; width: auto; display: block; }
.brand .ent-t { font: 700 15px/1 var(--font-display); letter-spacing: .02em; color: var(--color-fg-primary); }
.brand .x { opacity: .5; }
/* the association's logo keeps its own shape: a fixed height, its width follows */
.brand img.ent { height: 18px; width: auto; max-width: 96px; object-fit: contain; display: block; }
/* how many are left: a quiet count, no box around it; the number ticks when one goes */
.live { display: inline-flex; align-items: baseline; gap: 6px; font: 400 13px/1 var(--font-body); color: var(--color-fg-tertiary); font-variant-numeric: tabular-nums; }
.live b { font: 600 17px/1 var(--font-display); color: var(--color-fg-primary); letter-spacing: -.01em; }
.live b.tick { animation: tick 520ms var(--curve-emphasized); }
@keyframes tick { 0% { transform: translateY(-6px); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* text blocks over the scene */
.stage { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 20px calc(var(--safe-b) + 18px); z-index: 4; pointer-events: none; display: flex; flex-direction: column; align-items: stretch; gap: 14px; max-width: 520px; margin: 0 auto; }
.stage > * { pointer-events: auto; }
.stage::before { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(6,6,6,.94) 0%, rgba(6,6,6,.78) 38%, rgba(6,6,6,0) 100%); }
.stage[data-show="sealed"]::before { height: 22vh; }
.hero-copy { position: fixed; top: calc(var(--safe-t) + 70px); left: 0; right: 0; text-align: center; padding: 0 24px; z-index: 4; pointer-events: none; transition: opacity var(--ms-expressive) var(--curve-standard), transform var(--ms-expressive) var(--curve-standard); }
.hero-copy h1 { margin: 0; font: 600 36px/1.06 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.hero-copy h1 em { font-style: normal; background: var(--flow-chrome-label); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { margin: 16px auto 0; max-width: 320px; font: 400 16px/1.5 var(--font-body); color: var(--color-fg-secondary); text-wrap: pretty; }

/* buttons: flow's primary (cyan) and secondary (mark) */
.btn { appearance: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--size-touch); padding: 0 22px; border-radius: var(--shape-rounded); font: 600 16px/1 var(--font-body); letter-spacing: -.005em; cursor: pointer; text-decoration: none; transition: transform var(--ms-fast) var(--curve-standard), opacity var(--ms-fast), background var(--ms-fast); user-select: none; -webkit-user-select: none; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 3px; }
.btn-primary { background: var(--flow-cta-bg); color: var(--flow-cta-fg); box-shadow: 0 14px 40px -12px rgba(255,255,255,.28); }
/* every control answers the pointer: it lifts on hover and sinks on press */
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--flow-cta-bg-hover); transform: translateY(-1px); box-shadow: 0 18px 44px -12px rgba(255,255,255,.34); }
  .btn-ghost:hover { background: oklch(0.32 0 0 / .6); border-color: var(--color-border-strong); transform: translateY(-1px); }
  .chip:hover { color: var(--color-fg-primary); border-color: var(--color-border-strong); transform: translateY(-1px); }
  .link:hover { color: var(--color-fg-primary); text-decoration-color: var(--color-fg-secondary); }
}
.chip, .link { transition: transform var(--ms-fast) var(--curve-standard), color var(--ms-fast), border-color var(--ms-fast), background var(--ms-fast); }
.chip:active, .btn-ghost:active { transform: scale(.96); }
#gl { cursor: grab; }
.btn-primary[disabled] { background: var(--flow-cta-bg-disabled); color: var(--flow-cta-fg-disabled); opacity: 1; }
.btn-secondary { background: var(--color-bg-action-secondary); color: var(--color-fg-on-action-secondary); }
.btn-ghost { background: var(--glass-fill); color: var(--color-fg-primary); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { text-align: center; font: 500 12px/1.3 var(--font-body); color: var(--color-fg-tertiary); }
.skip { position: fixed; right: 16px; top: calc(var(--safe-t) + 56px); z-index: 6; }
.skip .btn { min-height: 36px; padding: 0 14px; font-size: 13px; }

/* the pass caption under the fan */
.caption { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.caption .l { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.caption .nav { width: 44px; min-height: 44px; padding: 0; }
.caption .nav[disabled] { opacity: .3; }
.caption b { font: 600 20px/1.1 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caption small { font: 400 13px/1.2 var(--font-body); color: var(--color-fg-tertiary); }
.count { display: flex; align-items: center; justify-content: center; gap: 10px; }
.count b { font: 600 13px/1 var(--font-body); color: var(--color-fg-secondary); white-space: nowrap; }
.meter { width: 104px; height: 4px; border-radius: 4px; background: var(--flow-ink-a12); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--flow-ice); border-radius: 4px; transition: width var(--ms-expressive) var(--curve-emphasized); }
.row2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.row2 .btn-ghost { width: var(--size-touch); padding: 0; }
.row2.half { grid-template-columns: 1fr 1fr; }
.row2.half .btn-ghost { width: auto; padding: 0 16px; font-size: 15px; }
/* ticket types: one chip each, how many are still in the box */
.types { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 10px; border-radius: var(--shape-rounded); border: 1px solid var(--glass-border); background: var(--glass-fill); color: var(--color-fg-secondary); font: 500 13px/1 var(--font-body); cursor: pointer; backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); transition: background var(--ms-fast), color var(--ms-fast), border-color var(--ms-fast); }
.chip span { color: var(--color-fg-tertiary); }
.chip i { width: 10px; height: 16px; border-radius: 3px; background: #16161a; border: 1px solid var(--flow-ink-a24); }
.chip i.chrome { background: linear-gradient(135deg, #b9bec6, #f3f5f8 30%, #9aa0a8 60%, #f6f7f9); border-color: transparent; }
.chip.on { color: var(--color-fg-primary); border-color: var(--color-border-strong); background: oklch(0.3 0 0 / .6); }
.chip:focus-visible, .link:focus-visible { outline: 2px solid var(--color-border-focus); outline-offset: 3px; }
/* a quiet second action under the main button */
.link { appearance: none; border: 0; background: none; color: var(--color-fg-secondary); font: 500 14px/1.3 var(--font-body); text-decoration: underline; text-decoration-color: var(--flow-ink-a24); text-underline-offset: 4px; padding: 6px 0; cursor: pointer; }
.link[hidden] { display: none; }
.addr input { margin-top: 14px; font-size: 14px; color: var(--color-fg-secondary); }

/* sheets */
/* the scrim softens the box behind a sheet instead of blacking it out */
.scrim { position: fixed; inset: 0; background: rgba(6,6,6,.5); backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); z-index: 20; opacity: 0; pointer-events: none; transition: opacity 360ms var(--curve-standard); }
.scrim.on { opacity: 1; pointer-events: auto; }
/* a sheet is a floating glass card: it rises a little and settles with a soft spring, never a slab sliding up */
.sheet { position: fixed; left: 10px; right: 10px; bottom: calc(var(--kb, 0px) + max(10px, var(--safe-b))); z-index: 21; max-width: 500px; margin: 0 auto;
  background: linear-gradient(180deg, rgba(30,33,40,.92), rgba(17,19,24,.94)); border: 1px solid var(--glass-border); border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.6); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  padding: 10px 20px 20px; max-height: calc(100dvh - var(--kb, 0px) - 24px); overflow: auto;
  opacity: 0; transform: translateY(28px) scale(.96); transform-origin: 50% 100%;
  transition: transform 520ms cubic-bezier(.2,1.1,.3,1), opacity 260ms var(--curve-standard); }
.sheet.on { opacity: 1; transform: none; }
.sheet.on > * { animation: fadeUp 420ms var(--curve-decelerate) both; }
.sheet.on > *:nth-child(2) { animation-delay: 40ms; } .sheet.on > *:nth-child(3) { animation-delay: 80ms; } .sheet.on > *:nth-child(n+4) { animation-delay: 120ms; }
body.kb .sheet { padding-bottom: 16px; }
body.kb .sheet .sub, body.kb .sheet .fine, body.kb .sheet .grab { display: none; }
body.kb .sheet h2 { font-size: 20px; margin-bottom: 4px; }
.sheet:not(.on) { visibility: hidden; transition: transform 300ms var(--curve-standard), opacity 200ms, visibility 0s 300ms; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--flow-ink-a24); margin: 0 auto 14px; }
.sheet h2 { margin: 0; font: 600 24px/1.1 var(--font-display); letter-spacing: -.015em; }
.sheet .sub { margin: 6px 0 0; font: 400 14px/1.45 var(--font-body); color: var(--color-fg-secondary); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font: 500 12px/1 var(--font-body); color: var(--color-fg-tertiary); }
.field input { width: 100%; min-width: 0; height: 50px; border-radius: var(--shape-control); border: 1px solid var(--color-border-control); background: rgba(0,0,0,.25); color: var(--color-fg-primary); font: 400 16px/1 var(--font-body); padding: 0 14px; outline: none; transition: border-color var(--ms-fast); }
.field input:focus { border-color: var(--color-border-focus); box-shadow: 0 0 0 4px var(--flow-cyan-a14); }
.field input.bad { border-color: var(--color-fg-negative); }
.err { font: 500 12px/1.3 var(--font-body); color: var(--color-fg-negative); min-height: 0; }
.fine { margin: 12px 0 0; font: 400 12px/1.45 var(--font-body); color: var(--color-fg-tertiary); text-align: center; }
.fine a { color: var(--color-fg-secondary); }
.actions { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }

/* claimed */
.done { text-align: center; }
.done h2 { margin: 0; font: 700 24px/1.1 var(--font-display); letter-spacing: -.02em; }
.done p { margin: 6px auto 0; max-width: 320px; font: 400 13px/1.4 var(--font-body); color: var(--color-fg-secondary); }
.done .actions { margin-top: 12px; gap: 8px; }
.done .actions .btn { white-space: nowrap; font-size: 15px; }

/* toast */
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 58px); transform: translate(-50%, -20px); opacity: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: var(--shape-rounded); background: rgba(30,32,38,.92); border: 1px solid var(--color-border-subtle); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font: 500 13px/1.2 var(--font-body); color: var(--color-fg-primary); box-shadow: 0 12px 40px rgba(0,0,0,.5); transition: all 500ms var(--ease-arrive); white-space: nowrap; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast .av { width: 26px; height: 26px; border-radius: 50%; background: #f5f5f5; color: #0b0b0d; display: grid; place-items: center; font: 600 11px/1 var(--font-body); }

/* the states as screens */
[data-show] { display: none !important; }
body[data-screen="sealed"] [data-show~="sealed"], body[data-screen="opening"] [data-show~="opening"], body[data-screen="open"] [data-show~="open"],
body[data-screen="empty"] [data-show~="empty"], body[data-screen="named"] [data-show~="named"] { display: flex !important; }
body[data-screen="sealed"] .hero-copy[data-show~="sealed"], body[data-screen="empty"] .hero-copy[data-show~="empty"] { display: block !important; }
.fade-in { animation: fadeUp var(--ms-expressive) var(--curve-decelerate) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.passlist { list-style: none; margin: 0; padding: 0; }

@media (min-width: 1100px) {
  .hero-copy { top: 96px; } .hero-copy h1 { font-size: 50px; } .hero-copy p { max-width: 400px; margin-top: 20px; font-size: 17px; }
  .stage { bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* the social preview layout (rendered to og.png, 1200 x 630) */
body.og .top, body.og .skip { display: none !important; }
body.og .ogtext { position: fixed; left: 72px; top: 0; bottom: 0; width: 560px; display: flex; flex-direction: column; justify-content: center; gap: 18px; z-index: 5; }
body.og .ogtext h1 { margin: 0; font: 600 68px/1.0 var(--font-display); letter-spacing: -.025em; }
body.og .ogtext h1 em { font-style: normal; background: var(--flow-chrome-label); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.og .ogtext p { margin: 0; font: 400 24px/1.4 var(--font-body); color: var(--color-fg-secondary); }
body.og .ogtext .wm { height: 34px; width: auto; align-self: flex-start; margin-bottom: 8px; }

/* ---------- laptop, wide screens and phones held sideways: words and actions in a column, the object beside them.
   The same query is WIDE in app.js (where the scene shifts the box aside). ---------- */
@media (min-width: 1100px) and (min-aspect-ratio: 1/1), (min-width: 640px) and (max-height: 520px) and (orientation: landscape) {
  .hero-copy { left: max(56px, 7vw); right: auto; width: min(520px, 38vw); top: 50%; transform: translateY(-62%); text-align: left; padding: 0; }
  .hero-copy h1 { font-size: clamp(40px, 3.6vw, 60px); }
  .hero-copy p { margin-left: 0; max-width: 420px; font-size: 18px; margin-top: 22px; }
  .stage { left: auto; right: max(48px, 6vw); top: 50%; bottom: auto; transform: translateY(-50%); width: 400px; max-width: none; margin: 0;
    padding: 28px; border-radius: 28px; background: var(--glass-fill); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 24px 70px rgba(0,0,0,.55);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
  .stage::before { display: none; }
  .stage[data-show~="sealed"], .stage[data-show~="empty"], .stage[data-show~="closed"] { left: max(56px, 7vw); right: auto; top: auto; bottom: 18vh; transform: none; width: min(420px, 38vw);
    padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .stage[data-show~="sealed"] .hint, .stage[data-show~="empty"] .hint { text-align: left; }
  .done { text-align: left; } .done p { margin-left: 0; }
  .done h2 { font-size: 28px; }
  /* a held pass: the panel that sends you to pay is the moment, so it is the biggest thing on the right */
  .stage.done { width: min(500px, 36vw); padding: 40px; border-radius: 32px; }
  .stage.done h2 { font-size: clamp(32px, 2.7vw, 42px); line-height: 1.05; }
  .stage.done p { max-width: none; margin-top: 14px; font-size: 16px; line-height: 1.5; }
  .stage.done .actions { margin-top: 28px; gap: 10px; }
  .stage.done .actions .btn { min-height: 58px; font-size: 16px; }
  .caption b { font-size: 22px; }
  /* the open box's panel: room between its rows, so it reads calm and premium, not packed */
  .stage[data-show~="open"] { width: min(500px, 36vw); padding: 40px 40px 36px; gap: 28px; border-radius: 32px; }
  .stage[data-show~="open"] .tally { justify-content: flex-start; gap: 22px; padding-bottom: 24px; border-bottom: 1px solid var(--glass-border); font-size: 14px; }
  .stage[data-show~="open"] .tally b { font-size: 16px; margin-right: 4px; }
  .stage[data-show~="open"] .types { justify-content: flex-start; gap: 10px; }
  .stage[data-show~="open"] .chip { min-height: 42px; padding: 0 18px 0 14px; font-size: 14px; gap: 10px; }
  .stage[data-show~="open"] .caption { gap: 16px; padding: 4px 0; }
  .stage[data-show~="open"] .caption .l { gap: 8px; }
  .stage[data-show~="open"] .caption b { font-size: 26px; }
  .stage[data-show~="open"] .caption small { font-size: 14px; }
  .stage[data-show~="open"] .caption .nav { width: 52px; min-height: 52px; }
  .stage[data-show~="open"] #mainBtn { min-height: 60px; font-size: 16px; }
  .meter { width: 120px; }
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 480px; max-height: 88vh; border-radius: 24px; border: 1px solid var(--color-border-subtle);
    transform: translate(-50%, -46%) scale(.98); opacity: 0; pointer-events: none; transition: transform 460ms var(--ease-arrive), opacity 240ms var(--curve-standard); padding: 22px 24px 24px; }
  .sheet.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .sheet .grab { display: none; }
  .skip { top: 28px; right: 28px; }
}
@media (min-width: 1100px) and (min-aspect-ratio: 1/1), (min-width: 640px) and (max-height: 520px) and (orientation: landscape) {
  .skip { top: 76px; }
  .count { justify-content: space-between; }
  .meter { width: 150px; }
}

/* a phone held sideways: little height, so everything tighter */
@media (min-width: 640px) and (max-height: 520px) and (orientation: landscape) {
  .top { padding-top: calc(var(--safe-t) + 10px); }
  .hero-copy { top: 54%; } .hero-copy h1 { font-size: 30px; } .hero-copy p { font-size: 14px; margin-top: 8px; } .hero-copy .from { display: none; }
  .stage { width: 340px; padding: 16px 18px; gap: 10px; right: max(16px, env(safe-area-inset-right)); }
  .stage[data-show~="sealed"], .stage[data-show~="empty"], .stage[data-show~="closed"] { bottom: 14px; }
  .caption b { font-size: 18px; } .stage .hint { display: none; }
  .done h2 { font-size: 20px; } .done p { font-size: 12px; }
  .sheet { max-height: 94vh; padding: 16px 20px 18px; } .sheet .sub { display: none; }
}


/* when a browser cannot copy: the message itself, selected, above everything */
.manual { position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 16px); z-index: 40; max-width: 500px; margin: 0 auto; min-height: 120px; padding: 14px; border-radius: 18px; border: 1px solid var(--color-border-strong); background: #15171c; color: var(--color-fg-primary); font: 400 14px/1.45 var(--font-body); resize: none; }
.manual[hidden] { display: none; }

/* top right: the count, and "?" for why this box and how it works */
.top-r { display: flex; align-items: center; gap: 14px; }
.btn.info { width: 34px; min-height: 34px; height: 34px; padding: 0; font: 600 15px/1 var(--font-body); color: var(--color-fg-secondary); }
.btn.info:hover { color: var(--color-fg-primary); }
.info-sheet .note { margin: 12px 0 0; font: 400 16px/1.5 var(--font-body); color: var(--color-fg-primary); }
.info-sheet .signed { margin: 8px 0 0; font: 500 14px/1.3 var(--font-display); color: var(--color-fg-secondary); }
.how { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: how; display: grid; gap: 12px; }
/* each step: its number, then one block of words (a b and its text together, never split across the grid) */
.how li { counter-increment: how; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 12px; font: 400 14px/1.5 var(--font-body); color: var(--color-fg-secondary); }
.how li > span { padding-top: 3px; }
.how li::before { content: counter(how); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--flow-ink-a12); color: var(--color-fg-primary); font: 600 13px/1 var(--font-body); }
.how b { color: var(--color-fg-primary); font-weight: 600; }
.info-sheet h3 { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--color-border-subtle); font: 600 15px/1.2 var(--font-display); color: var(--color-fg-primary); }
.info-sheet .about { margin: 8px 0 0; font: 400 14px/1.5 var(--font-body); color: var(--color-fg-secondary); }
.info-sheet .how { margin-top: 12px; }
/* a phone: '14 left' instead of the full line */
@media (max-width: 400px) { .live span { display: none; } .live b:not(:empty)::after { content: ' left'; font: 400 13px/1 var(--font-body); color: var(--color-fg-tertiary); } }

/* the "?" sheet: one rhythm, 24px between sections, the button set apart */
.info-sheet { padding: 12px 24px 24px; }
.info-sheet h2 { margin-top: 4px; }
.info-sheet .note { margin-top: 14px; }
.info-sheet .signed { margin-top: 10px; }
.info-sheet h3 { margin-top: 24px; padding-top: 22px; }
.info-sheet .about { margin-top: 10px; }
.info-sheet .how { margin-top: 14px; gap: 14px; }
.info-sheet .actions { margin-top: 28px; }

/* the tally: claimed, opened, sent, in the box; claimed glows once someone has their ticket */
.tally { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font: 400 13px/1 var(--font-body); color: var(--color-fg-tertiary); font-variant-numeric: tabular-nums; }
.tally b { font: 600 14px/1 var(--font-display); color: var(--color-fg-primary); margin-right: 2px; }
.tally .hot b { color: var(--color-fg-positive); }
@media (min-width: 1100px) and (min-aspect-ratio: 1/1) { .tally { justify-content: flex-start; } }

/* tooltips: anything with data-tip explains itself on hover or keyboard focus (fine pointers; phones read the words) */
[data-tip] { position: relative; }
@media (hover: hover) and (pointer: fine) {
  [data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 4px); width: max-content; max-width: 240px;
    padding: 8px 11px; border-radius: 10px; background: rgba(20,22,27,.96); border: 1px solid var(--color-border-strong); color: var(--color-fg-primary);
    font: 500 12px/1.35 var(--font-body); letter-spacing: 0; text-align: center; white-space: normal; pointer-events: none; opacity: 0; z-index: 60;
    box-shadow: 0 10px 30px rgba(0,0,0,.45); transition: opacity 160ms var(--curve-standard), transform 160ms var(--curve-standard); }
  [data-tip-pos="below"]::after { bottom: auto; top: calc(100% + 10px); transform: translate(-50%, -4px); left: auto; right: 0; transform-origin: top right; }
  [data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 250ms; }
  [data-tip-pos="below"]:hover::after, [data-tip-pos="below"]:focus-visible::after { transform: none; }
  .live { cursor: help; }
}
.guide { margin: 0; text-align: center; font: 400 13px/1.4 var(--font-body); color: var(--color-fg-tertiary); }
.guide[hidden] { display: none; }
.tally span { cursor: default; }

/* the "?" sheet and the name sheet on anything wider than a phone: a centred card that always fits the screen */
@media (min-width: 600px) {
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: min(480px, calc(100vw - 48px)); margin: 0; max-height: calc(100dvh - 48px);
    transform: translate(-50%, -46%) scale(.97); transform-origin: 50% 50%; }
  .sheet.on { transform: translate(-50%, -50%); }
  .sheet .grab { display: none; }
}
@media (max-height: 760px) {
  .info-sheet .note { font-size: 15px; line-height: 1.45; }
  .info-sheet h3 { margin-top: 18px; padding-top: 16px; }
  .info-sheet .how { gap: 10px; }
  .info-sheet .actions { margin-top: 20px; }
}

/* sheets: one rhythm everywhere (title, line, field, button, fine print) */
.sheet h2 { line-height: 1.15; }
.sheet .sub { margin-top: 8px; line-height: 1.5; }
.sheet .fields { margin-top: 20px; }
.sheet .field label { margin-bottom: 2px; }
.sheet .actions { margin-top: 18px; }
.sheet .fine { margin-top: 14px; }
@media (min-width: 600px) { .sheet { padding: 28px 28px 24px; } }

/* a round or square logo (a badge) needs more height than a wide wordmark to read */
.brand img.ent.round { height: 36px; max-width: 44px; }

.btn.info { position: relative; }

/* "Continue to payment": a slow chrome light crosses it and a soft glow breathes, so the eye finds it without a
   flashing badge. Still for reduced motion. */
.cta-live { position: relative; overflow: hidden; isolation: isolate; animation: cta-glow 3.2s var(--curve-standard, ease-in-out) infinite; }
.cta-live::after { content: ''; position: absolute; inset: -2px; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 32%, rgba(162,165,170,.0) 40%, rgba(162,165,170,.42) 50%, rgba(255,255,255,.0) 60%, transparent 68%);
  transform: translateX(-120%); animation: cta-sheen 3.2s cubic-bezier(.45,0,.2,1) infinite; }
@keyframes cta-sheen { 0% { transform: translateX(-120%); } 48%, 100% { transform: translateX(120%); } }
@keyframes cta-glow {
  0%, 100% { box-shadow: 0 14px 40px -12px rgba(255,255,255,.28), 0 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: 0 18px 60px -10px rgba(255,255,255,.5), 0 0 0 6px rgba(255,255,255,.07); }
}
@media (prefers-reduced-motion: reduce) { .cta-live, .cta-live::after { animation: none; } }

/* paying inside the box: Stripe's own fields, framed like the rest of the sheet */
.pay-sheet { max-height: 92vh; overflow-y: auto; }
.pay-express { margin-top: 18px; }
.pay-express[hidden] { display: none; }
.pay-element { margin-top: 16px; min-height: 120px; }
.pay-wait { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px; color: var(--color-fg-tertiary); font: 400 14px/1.4 var(--font-body); }
.pay-email { margin-top: 16px; }
.sheet .fine[hidden] { display: none; }
.pay-form[hidden], .pay-more[hidden] { display: none; }
.pay-express { min-height: 54px; }
.pay-more { appearance: none; display: block; width: 100%; margin-top: 14px; padding: 10px 0; border: 0; background: none; color: var(--color-fg-secondary); font: 500 14px/1.3 var(--font-body); text-align: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.25); }
.pay-more:hover { color: var(--color-fg-primary); }

/* phones first (99% of members): at phone width every row stays on one line. The type chips scroll sideways if they
   must, the title and the price line shrink and cut with "…" before they could touch the arrows. */
@media (max-width: 440px) {
  .stage { gap: 12px; padding-left: 16px; padding-right: 16px; }
  .tally { gap: 12px; font-size: 12.5px; }
  .tally b { font-size: 13.5px; }
  .types { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
  .types::-webkit-scrollbar { display: none; }
  .types .chip:first-child { margin-left: auto; } .types .chip:last-child { margin-right: auto; }
  .chip { flex: none; min-height: 34px; padding: 0 12px 0 9px; font-size: 12.5px; gap: 7px; }
  .caption { gap: 8px; }
  .caption .nav { width: 40px; min-height: 40px; }
  .caption b { font-size: clamp(15px, 4.9vw, 19px); }
  .caption small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

/* Cookie choice (public/box/analytics.js): a small card over the header, never over the title or the box buttons */
.consent { position: fixed; z-index: 40; left: 12px; right: 12px; top: calc(var(--safe-t, 0px) + 6px); max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 16px; background: rgba(22,22,24,.92); border: 1px solid rgba(255,255,255,.1); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: var(--color-fg-secondary); font: 400 12.5px/1.35 var(--font-body); opacity: 0; transform: translateY(-6px); transition: opacity .25s ease, transform .25s ease; }
.consent.on { opacity: 1; transform: none; }
.consent p { margin: 0; flex: 1; min-width: 0; }
.consent a { color: var(--color-fg-primary); text-underline-offset: 2px; }
.consent-go { display: flex; gap: 6px; flex: none; }
.consent button { appearance: none; border: 0; border-radius: 999px; min-height: 34px; padding: 0 12px; font: 500 12.5px/1 var(--font-body); cursor: pointer; white-space: nowrap; }
.consent-no { background: rgba(255,255,255,.08); color: var(--color-fg-primary); }
.consent-yes { background: #f5f5f7; color: #0b0b0c; }
@media (max-width: 340px) { .consent { flex-wrap: wrap; } .consent-go { width: 100%; } .consent button { flex: 1; } }
.pay-wait[hidden] { display: none; }
